fedora 24
obsolete weakness #278

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.

 		return -1;
	}
	// no nstripables yet
	if (!session->nroutes()) {
		return -1;
	}

	OSCSurface *s = get_surface (addr);

	// revert any expand to select
	 s->expand = 0;
	 s->expand_enable = false;
	_strip_select (ControlProtocol::first_selected_stripable(), addr);

	// undo all listeners for this url
	StripableList stripables;
	session->get_stripables (stripables);
	for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) {

		boost::shared_ptr<Stripable> stp = *it;
		if (stp) {
			end_listen (stp, addr);
		}
		// slow devices need time to clear buffers
		usleep ((uint32_t) 10);
	}

	s->strips = get_sorted_stripables(s->strip_types, s->cue);
	s->nstrips = s->strips.size();

	uint32_t b_size;
	if (!s->bank_size) {
		// no banking - bank includes all stripables
		b_size = s->nstrips;
	} else {
		b_size = s->bank_size;
	}

	// 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]) { 

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.