fedora 24
obsolete weakness #277

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.

 		// needs change to only clear those for this address on all ports
		clear_devices();
	}
	OSCSurface *s = get_surface(get_address (msg));
	// restart all observers
	set_surface (s->bank_size, (uint32_t) s->strip_types.to_ulong(), (uint32_t) s->feedback.to_ulong(), \
		(uint32_t) s->gainmode, (uint32_t) s->send_page_size, (uint32_t) s->plug_page_size, msg);
	return 0;
}

void
OSC::clear_devices ()
{
	for (RouteObservers::iterator x = route_observers.begin(); x != route_observers.end();) {

		OSCRouteObserver* rc;

		if ((rc = dynamic_cast<OSCRouteObserver*>(*x)) != 0) {
			delete *x;
			x = route_observers.erase (x);
		} else {
			++x;
		}
		// slow devices need time to clear buffers
		usleep ((uint32_t) 10);
	}
	// Should maybe do global_observers too
	for (GlobalObservers::iterator x = global_observers.begin(); x != global_observers.end();) {

		OSCGlobalObserver* gc;

		if ((gc = dynamic_cast<OSCGlobalObserver*>(*x)) != 0) {
			delete *x;
			x = global_observers.erase (x);
		} else {
			++x;
		}
	}
	// delete select observers
	for (uint32_t it = 0; it < _surface.size(); ++it) {
		OSCSurface* sur = &_surface[it];
		OSCSelectObserver* so;
		if ((so = dynamic_cast<OSCSelectObserver*>(sur->sel_obs)) != 0) {
			delete so;
		}
	}
	// delete cue observers
	for (CueObservers::iterator x = cue_observers.begin(); x != cue_observers.end();) {
		OSCCueObserver* co;
		if ((co = dynamic_cast<OSCCueObserver*>(*x)) != 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.