alpine 3.6
obsolete weakness #268

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.

 	{
		printf("Mixer #%d information\n", mixer_get_curr());
		printf("numchan = %d\n", mixer_get_num_chan());
		printf("name    = %s\n", mixer_get_name());
		printf("path    = %s\n", mixer_get_path());
		printf("driver  = %s\n", mixer_get_driver());

		printf("num name       label      lt  rt   s r a m\n");
		for (i=0; i<mixer_get_num_chan(); i++)
		{
			chan_set_curr(i);
			printf("%3d %-10s %-10s ", chan_get_curr(), 
				chan_get_name(), chan_get_label());
			printf("%3d %3d  %d %d %d %d\n", 
				chan_get_lr(CHAN_LEFT), chan_get_lr(CHAN_RIGHT),
				chan_is_stereo(), chan_is_recsrc(), 
				chan_is_record(), chan_is_mute());
		}

		chan_set_curr(1);
		orig_vol = chan_get_vb();

		printf("Setting the channel %s to 100\n", chan_get_name());
		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",  

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.