alpine 3.6
obsolete weakness #271

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

umix/src/umix-1.0.2/src/umix.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.6 obsolete weakness.

 		chan_set_lr(100, 100);
		usleep(200000);

		printf("Setting balance to right\n");
		chan_set_lr(0, 100);
		usleep(200000);

		printf("Setting balance to left\n");
		chan_set_lr(100, 0);
		usleep(200000);

		printf("Setting balance back to center\n");
		chan_set_lr(100, 100);

		printf("Decreasing volume with 2\n");
		chan_inc_vol(-2);
		err_msg("left=%d right=%d", chan_get_lr(CHAN_LEFT),
			chan_get_lr(CHAN_RIGHT));
		usleep(200000);

		printf("Increasing volume with 2\n");
		chan_inc_vol(2);
		err_msg("left=%d right=%d", chan_get_lr(CHAN_LEFT),
			chan_get_lr(CHAN_RIGHT));
		usleep(200000);

		printf("Restoring old values: vol=%3f bal=%3f\n", 
			orig_vol.volume, orig_vol.balance);
		chan_set_vb(orig_vol);

		for (i=mixer_get_num_chan()-1; i>=0; i--)
		{
			chan_set_curr(i);
			if (chan_is_record())
			{
				printf("Setting channel #%d as recsrc\n", i);
				chan_set_rec(CHAN_RECSRC);
				if (chan_is_recsrc())
				{
					printf("Channel #%d (%s) is recsrc\n",
						i, chan_get_name());
				}
				else
					printf("Setting recsrc failed!\n");

				break;
			}
		}
	}
 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.