fedora 24
obsolete weakness #279

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:

Ardour-5.10.0/libs/surfaces/osc/osc.cc

Context:

The highlighted line of code below is the trigger point of this particular Fedora 24 obsolete weakness.

 	}

	// Do limits checking
	if (bank_start < 1) bank_start = 1;
	if (b_size >= s->nstrips)  {
		bank_start = 1;
	} else if (bank_start > ((s->nstrips - b_size) + 1)) {
		// top bank is always filled if there are enough strips for at least one bank
		bank_start = (uint32_t)((s->nstrips - b_size) + 1);
	}
	//save bank after bank limit checks
	s->bank = bank_start;

	if (s->feedback[0] || s->feedback[1]) {

		for (uint32_t n = bank_start; n < (min ((b_size + bank_start), s->nstrips + 1)); ++n) {
			if (n <= s->strips.size()) {
				boost::shared_ptr<Stripable> stp = s->strips[n - 1];

				if (stp) {
					listen_to_route(stp, addr);
				}
			}
			// slow devices need time to clear buffers
			usleep ((uint32_t) 10);
		}
	}
	// light bankup or bankdown buttons if it is possible to bank in that direction
	if (s->feedback[4] && !s->no_clear) {
		lo_message reply;
		reply = lo_message_new ();
		if ((s->bank > (s->nstrips - s->bank_size)) || (s->nstrips < s->bank_size)) {
			lo_message_add_int32 (reply, 0);
		} else {
			lo_message_add_int32 (reply, 1);
		}
		lo_send_message (addr, "/bank_up", reply);
		lo_message_free (reply);
		reply = lo_message_new ();
		if (s->bank > 1) {
			lo_message_add_int32 (reply, 1);
		} else {
			lo_message_add_int32 (reply, 0);
		}
		lo_send_message (addr, "/bank_down", reply);
		lo_message_free (reply);
	}
	bank_dirty = false;
	tick = true;
	return 0; 

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.