add abort() to non-reached code

This cleans up a lot of false-positives in static analysis
and also helps compilers to optimize code paths in general.
(tagging the fatal stingstream operator as ‘noreturn’ is
far less trivial)
This commit is contained in:
Robin Gareus 2014-11-14 10:47:43 +01:00
parent 5d5d9cb9e2
commit 6b3a8915f3
48 changed files with 121 additions and 125 deletions

View File

@ -346,7 +346,7 @@ AddRouteDialog::mode ()
} else {
fatal << string_compose (X_("programming error: unknown track mode in add route dialog combo = %1"), str)
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
/* keep gcc happy */
return ARDOUR::Normal;

View File

@ -113,7 +113,7 @@ AudioStreamView::create_region_view (boost::shared_ptr<Region> r, bool wait_for_
break;
default:
fatal << string_compose (_("programming error: %1"), "illegal track mode in ::create_region_view()") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}

View File

@ -2631,7 +2631,7 @@ Editor::timecode_snap_to_internal (framepos_t& start, int32_t direction, bool /*
break;
default:
fatal << "Editor::smpte_snap_to_internal() called with non-timecode snap type!" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
}

View File

@ -1081,7 +1081,7 @@ Editor::snap_type_action (SnapType type)
break;
default:
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap-to type", (int) type) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
act = ActionManager::get_action (X_("Snap"), action);
@ -1477,7 +1477,7 @@ Editor::snap_mode_action (SnapMode mode)
break;
default:
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible snap mode type", (int) mode) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
act = ActionManager::get_action (X_("Editor"), action);
@ -1541,7 +1541,7 @@ Editor::edit_point_action (EditPoint ep)
break;
default:
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible edit point type", (int) ep) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
act = ActionManager::get_action (X_("Editor"), action);
@ -1599,7 +1599,7 @@ Editor::zoom_focus_action (ZoomFocus focus)
break;
default:
fatal << string_compose (_("programming error: %1: %2"), "Editor: impossible focus type", (int) focus) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
act = ActionManager::get_action (X_("Zoom"), action);

View File

@ -314,14 +314,14 @@ Editor::do_import (vector<string> paths, ImportDisposition disposition, ImportMo
continue;
case 0:
fatal << "Updating existing sources should be disabled!" << endmsg;
/* NOTREACHED*/
abort(); /* NOTREACHED*/
break;
case 1:
replace = false;
break;
default:
fatal << "Illegal return " << check << " from check_whether_and_how_to_import()!" << endmsg;
/* NOTREACHED*/
abort(); /* NOTREACHED*/
}
/* have to reset this for every file we handle */

View File

@ -90,7 +90,7 @@ Editor::export_range ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;

View File

@ -704,7 +704,7 @@ Editor::remove_marker (ArdourCanvas::Item& item, GdkEvent*)
if ((marker = static_cast<Marker*> (item.get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if (entered_marker == marker) {
@ -791,7 +791,7 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
Marker * marker;
if ((marker = reinterpret_cast<Marker *> (item->get_data("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
bool is_start;
@ -976,7 +976,7 @@ Editor::marker_menu_hide ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;
@ -994,7 +994,7 @@ Editor::marker_menu_select_using_range ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;
@ -1012,7 +1012,7 @@ Editor::marker_menu_select_all_selectables_using_range ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;
@ -1031,7 +1031,7 @@ Editor::marker_menu_separate_regions_using_location ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;
@ -1050,7 +1050,7 @@ Editor::marker_menu_play_from ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;
@ -1080,7 +1080,7 @@ Editor::marker_menu_set_playhead ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;
@ -1111,7 +1111,7 @@ Editor::marker_menu_range_to_next ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;
@ -1141,7 +1141,7 @@ Editor::marker_menu_set_from_playhead ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;
@ -1169,7 +1169,7 @@ Editor::marker_menu_set_from_selection (bool /*force_regions*/)
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;
@ -1200,7 +1200,7 @@ Editor::marker_menu_play_range ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;
@ -1225,7 +1225,7 @@ Editor::marker_menu_loop_range ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* l;
@ -1276,7 +1276,7 @@ Editor::dynamic_cast_marker_object (void* p, MeterMarker** m, TempoMarker** t) c
Marker* marker = reinterpret_cast<Marker*> (p);
if (!marker) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
*m = dynamic_cast<MeterMarker*> (marker);
@ -1320,7 +1320,7 @@ Editor::toggle_marker_menu_lock ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* loc;
@ -1346,7 +1346,7 @@ Editor::marker_menu_rename ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
@ -1540,7 +1540,7 @@ Editor::toggle_marker_menu_glue ()
if ((marker = reinterpret_cast<Marker *> (marker_menu_item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* loc;

View File

@ -1332,12 +1332,12 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
if ((marker = reinterpret_cast<Marker *> (item->get_data ("marker"))) == 0) {
fatal << _("programming error: tempo marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if ((tempo_marker = dynamic_cast<TempoMarker*> (marker)) == 0) {
fatal << _("programming error: marker for tempo is not a tempo marker!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
edit_tempo_marker (*tempo_marker);
@ -1350,12 +1350,12 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
if ((marker = reinterpret_cast<Marker *> (item->get_data ("marker"))) == 0) {
fatal << _("programming error: tempo marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if ((meter_marker = dynamic_cast<MeterMarker*> (marker)) == 0) {
fatal << _("programming error: marker for meter is not a meter marker!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
edit_meter_marker (*meter_marker);
break;
@ -1999,7 +1999,7 @@ Editor::can_remove_control_point (ArdourCanvas::Item* item)
if ((control_point = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"))) == 0) {
fatal << _("programming error: control point canvas item has no control point object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
AutomationLine& line = control_point->line ();
@ -2024,7 +2024,7 @@ Editor::remove_control_point (ArdourCanvas::Item* item)
if ((control_point = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"))) == 0) {
fatal << _("programming error: control point canvas item has no control point object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
control_point->line().remove_point (*control_point);
@ -2037,7 +2037,7 @@ Editor::edit_control_point (ArdourCanvas::Item* item)
if (p == 0) {
fatal << _("programming error: control point canvas item has no control point object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
ControlPointDialog d (p);
@ -2242,7 +2242,7 @@ Editor::hide_marker (ArdourCanvas::Item* item, GdkEvent* /*event*/)
if ((marker = static_cast<Marker *> (item->get_data ("marker"))) == 0) {
fatal << _("programming error: marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
Location* location = find_location_from_marker (marker, is_start);

View File

@ -646,7 +646,7 @@ Editor::build_region_boundary_cache ()
break;
default:
fatal << string_compose (_("build_region_boundary_cache called with snap_type = %1"), _snap_type) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return;
}

View File

@ -1560,7 +1560,7 @@ EditorRegions::sort_type_action (Editing::RegionListSortType t) const
break;
default:
fatal << string_compose (_("programming error: %1: %2"), "EditorRegions: impossible sort type", (int) t) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
RefPtr<Action> act = ActionManager::get_action (X_("RegionList"), action);

View File

@ -271,12 +271,12 @@ Editor::remove_tempo_marker (ArdourCanvas::Item* item)
if ((marker = reinterpret_cast<Marker *> (item->get_data ("marker"))) == 0) {
fatal << _("programming error: tempo marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if ((tempo_marker = dynamic_cast<TempoMarker*> (marker)) == 0) {
fatal << _("programming error: marker for tempo is not a tempo marker!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if (tempo_marker->tempo().movable()) {
@ -375,12 +375,12 @@ Editor::remove_meter_marker (ArdourCanvas::Item* item)
if ((marker = reinterpret_cast<Marker *> (item->get_data ("marker"))) == 0) {
fatal << _("programming error: meter marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if ((meter_marker = dynamic_cast<MeterMarker*> (marker)) == 0) {
fatal << _("programming error: marker for meter is not a meter marker!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if (meter_marker->meter().movable()) {

View File

@ -610,7 +610,7 @@ next_meter_point (MeterPoint mp)
break;
}
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return MeterInput;
}

View File

@ -148,7 +148,7 @@ LatencyGUI::change_latency_from_button (int dir)
} else {
fatal << string_compose (_("programming error: %1 (%2)"), X_("illegal string in latency GUI units combo"), unitstr)
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if (dir > 0) {

View File

@ -1139,7 +1139,7 @@ PortMatrix::get_association (PortMatrixNode node) const
}
/* NOTREACHED */
abort(); /* NOTREACHED */
return PortMatrixNode::NOT_ASSOCIATED;
}

View File

@ -273,7 +273,7 @@ RhythmFerret::get_note_onset_function ()
fatal << string_compose (_("programming error: %1 (%2)"), X_("illegal note onset function string"), txt)
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return -1;
}

View File

@ -207,7 +207,7 @@ RouteGroupDialog::do_run ()
msg.run ();
}
/* NOTREACHED */
abort(); /* NOTREACHED */
return false;
}

View File

@ -2015,7 +2015,7 @@ RouteTimeAxisView::add_processor_automation_curve (boost::shared_ptr<Processor>
<< string_compose (X_("processor automation curve for %1:%2/%3/%4 not registered with track!"),
processor->name(), what.type(), (int) what.channel(), what.id() )
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return;
}
@ -2481,7 +2481,7 @@ RouteTimeAxisView::add_underlay (StreamView* v, bool /*update_xml*/)
if (find(_underlay_streams.begin(), _underlay_streams.end(), v) == _underlay_streams.end()) {
if (find(other._underlay_mirrors.begin(), other._underlay_mirrors.end(), this) != other._underlay_mirrors.end()) {
fatal << _("programming error: underlay reference pointer pairs are inconsistent!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
_underlay_streams.push_back(v);
@ -2518,7 +2518,7 @@ RouteTimeAxisView::remove_underlay (StreamView* v)
if (gm == other._underlay_mirrors.end()) {
fatal << _("programming error: underlay reference pointer pairs are inconsistent!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
v->foreach_regionview(sigc::mem_fun(*this, &RouteTimeAxisView::remove_ghost));

View File

@ -1002,7 +1002,7 @@ Selection::toggle (list<Selectable*> const & selectables)
fatal << _("programming error: ")
<< X_("unknown selectable type passed to Selection::toggle()")
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
}
@ -1056,7 +1056,7 @@ Selection::add (list<Selectable*> const & selectables)
fatal << _("programming error: ")
<< X_("unknown selectable type passed to Selection::add()")
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
}

View File

@ -113,7 +113,7 @@ importmode2string (ImportMode mode)
case ImportAsTapeTrack:
return _("as new tape tracks");
}
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return _("as new tracks");
}
@ -1891,7 +1891,7 @@ SoundFileOmega::get_channel_disposition () const
if (x == disposition_map.end()) {
fatal << string_compose (_("programming error: %1 (%2)"), "unknown string for import disposition", str) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
return x->second;

View File

@ -431,7 +431,7 @@ StreamView::update_rec_box ()
default:
fatal << string_compose (_("programming error: %1"), "illegal track mode") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return;
}
@ -575,7 +575,7 @@ StreamView::child_height () const
return height / (_layers * 2 + 1);
}
/* NOTREACHED */
abort(); /* NOTREACHED */
return height;
}

View File

@ -1312,7 +1312,7 @@ TimeAxisView::preset_height (Height h)
return button_height + extra_height;
}
/* NOTREACHED */
abort(); /* NOTREACHED */
return 0;
}

View File

@ -38,7 +38,7 @@ TimeSelection::operator[] (uint32_t which)
}
}
fatal << string_compose (_("programming error: request for non-existent audio range (%1)!"), which) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return *(new AudioRange(0,0,0)); /* keep the compiler happy; never called */
}

View File

@ -708,7 +708,7 @@ ARDOUR_UI_UTILS::get_icon_path (const char* cname, string icon_set, bool is_imag
if (!find_file (def, name, data_file_path)) {
fatal << string_compose (_("cannot find icon image for %1 using %2"), name, spath.to_string()) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
}

View File

@ -267,8 +267,7 @@ namespace ARDOUR {
return seconds != 0;
}
/* NOTREACHED */
assert (false);
abort(); /* NOTREACHED */
return false;
}
};

View File

@ -169,7 +169,7 @@ framecnt_t
AudioPlaylistSource::write_unlocked (Sample *, framecnt_t)
{
fatal << string_compose (_("programming error: %1"), "AudioPlaylistSource::write() called - should be impossible") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return 0;
}

View File

@ -591,7 +591,7 @@ Bundle::type_channel_to_overall (DataType t, uint32_t c) const
++o;
}
/* NOTREACHED */
abort(); /* NOTREACHED */
return -1;
}

View File

@ -202,7 +202,7 @@ Butler::dequeue_request (Request::Type& r)
return false;
} else {
fatal << _("Error reading from butler request pipe") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
#else
r = (Request::Type) m_request_state.get();
@ -242,7 +242,7 @@ Butler::thread_work ()
case Request::Quit:
return 0;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
break;
default:

View File

@ -38,7 +38,7 @@ get_mhz()
if ((f = fopen("/proc/cpuinfo", "r")) == 0) {
fatal << _("CycleTimer::get_mhz(): can't open /proc/cpuinfo") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return 0.0f;
}
@ -50,7 +50,7 @@ get_mhz()
if (fgets (buf, sizeof(buf), f) == 0) {
fatal << _("CycleTimer::get_mhz(): cannot locate cpu MHz in /proc/cpuinfo") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return 0.0f;
}
@ -73,7 +73,7 @@ get_mhz()
}
fatal << _("cannot locate cpu MHz in /proc/cpuinfo") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return 0.0f;
}

View File

@ -148,7 +148,7 @@ Delivery::can_support_io_configuration (const ChanCount& in, ChanCount& out)
}
} else {
fatal << "programming error: this should never be reached" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
@ -169,7 +169,7 @@ Delivery::can_support_io_configuration (const ChanCount& in, ChanCount& out)
}
} else {
fatal << "programming error: this should never be reached" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
} else {
@ -210,7 +210,7 @@ Delivery::configure_io (ChanCount in, ChanCount out)
if (_input->n_ports() != in) {
if (_input->n_ports() != ChanCount::ZERO) {
fatal << _name << " programming error: configure_io called with " << in << " and " << out << " with " << _input->n_ports() << " input ports" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
} else {
/* I/O not yet configured */
}

View File

@ -195,11 +195,11 @@ MidiModel::NoteDiffCommand::change (const NotePtr note, Property prop,
case StartTime:
fatal << "MidiModel::DiffCommand::change() with integer argument called for start time" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
break;
case Length:
fatal << "MidiModel::DiffCommand::change() with integer argument called for length" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
break;
}
@ -627,7 +627,7 @@ MidiModel::NoteDiffCommand::unmarshal_change (XMLNode *xml_change)
change.property = (Property) string_2_enum (prop->value(), change.property);
} else {
fatal << "!!!" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if ((prop = xml_change->property ("id")) == 0) {
@ -648,7 +648,7 @@ MidiModel::NoteDiffCommand::unmarshal_change (XMLNode *xml_change)
}
} else {
fatal << "!!!" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if ((prop = xml_change->property ("new")) != 0) {
@ -662,7 +662,7 @@ MidiModel::NoteDiffCommand::unmarshal_change (XMLNode *xml_change)
}
} else {
fatal << "!!!" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
/* we must point at the instance of the note that is actually in the model.
@ -899,7 +899,7 @@ MidiModel::SysExDiffCommand::unmarshal_change (XMLNode *xml_change)
change.property = (Property) string_2_enum (prop->value(), change.property);
} else {
fatal << "!!!" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if ((prop = xml_change->property ("id")) == 0) {
@ -914,7 +914,7 @@ MidiModel::SysExDiffCommand::unmarshal_change (XMLNode *xml_change)
old_str >> change.old_time;
} else {
fatal << "!!!" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if ((prop = xml_change->property ("new")) != 0) {
@ -922,7 +922,7 @@ MidiModel::SysExDiffCommand::unmarshal_change (XMLNode *xml_change)
new_str >> change.new_time;
} else {
fatal << "!!!" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
/* we must point at the instance of the sysex that is actually in the model.
@ -1728,7 +1728,7 @@ MidiModel::resolve_overlaps_unlocked (const NotePtr note, void* arg)
return -1; /* do not add the new note */
break;
default:
/*NOTREACHED*/
abort(); /*NOTREACHED*/
/* stupid gcc */
break;
}
@ -1764,7 +1764,7 @@ MidiModel::resolve_overlaps_unlocked (const NotePtr note, void* arg)
note_length = min (note_length, (*i)->end_time() - note->time());
break;
default:
/*NOTREACHED*/
abort(); /*NOTREACHED*/
/* stupid gcc */
break;
}
@ -1783,7 +1783,7 @@ MidiModel::resolve_overlaps_unlocked (const NotePtr note, void* arg)
/* cannot add in this case */
return -1;
default:
/*NOTREACHED*/
abort(); /*NOTREACHED*/
/* stupid gcc */
break;
}
@ -1801,14 +1801,14 @@ MidiModel::resolve_overlaps_unlocked (const NotePtr note, void* arg)
to_be_deleted.insert (*i);
break;
default:
/*NOTREACHED*/
abort(); /*NOTREACHED*/
/* stupid gcc */
break;
}
break;
default:
/*NOTREACHED*/
abort(); /*NOTREACHED*/
/* stupid gcc */
break;
}

View File

@ -142,7 +142,7 @@ MidiPlaylistSource::write_unlocked (MidiRingBuffer<framepos_t>&,
framecnt_t)
{
fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::write_unlocked() called - should be impossible") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return 0;
}
@ -150,14 +150,14 @@ void
MidiPlaylistSource::append_event_unlocked_beats(const Evoral::Event<Evoral::MusicalTime>& /*ev*/)
{
fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::append_event_unlocked_beats() called - should be impossible") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
void
MidiPlaylistSource::append_event_unlocked_frames(const Evoral::Event<framepos_t>& /* ev */, framepos_t /*source_start*/)
{
fatal << string_compose (_("programming error: %1"), "MidiPlaylistSource::append_event_unlocked_frames() called - should be impossible") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
void

View File

@ -120,7 +120,7 @@ PannerShell::configure_io (ChanCount in, ChanCount out)
PannerInfo* pi = PannerManager::instance().select_panner (in, out, _user_selected_panner_uri);
if (!pi) {
fatal << _("No panner found: check that panners are being discovered correctly during startup.") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
DEBUG_TRACE (DEBUG::Panning, string_compose (_("select panner: %1\n"), pi->descriptor.name.c_str()));

View File

@ -600,7 +600,7 @@ PluginInsert::default_parameter_value (const Evoral::Parameter& param)
if (_plugins.empty()) {
fatal << _("programming error: ") << X_("PluginInsert::default_parameter_value() called with no plugin")
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
return _plugins[0]->default_value (param.id());
@ -646,7 +646,7 @@ PluginInsert::plugin_factory (boost::shared_ptr<Plugin> other)
fatal << string_compose (_("programming error: %1"),
X_("unknown plugin type in PluginInsert::plugin_factory"))
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return boost::shared_ptr<Plugin> ((Plugin*) 0);
}

View File

@ -66,7 +66,7 @@ RegionFactory::create (boost::shared_ptr<const Region> region, bool announce)
} else {
fatal << _("programming error: RegionFactory::create() called with unknown Region type")
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if (ret) {
@ -108,7 +108,7 @@ RegionFactory::create (boost::shared_ptr<Region> region, const PropertyList& pli
} else {
fatal << _("programming error: RegionFactory::create() called with unknown Region type")
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return boost::shared_ptr<Region>();
}
@ -149,7 +149,7 @@ RegionFactory::create (boost::shared_ptr<Region> region, frameoffset_t offset, c
} else {
fatal << _("programming error: RegionFactory::create() called with unknown Region type")
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return boost::shared_ptr<Region>();
}
@ -191,7 +191,7 @@ RegionFactory::create (boost::shared_ptr<Region> region, const SourceList& srcs,
} else {
fatal << _("programming error: RegionFactory::create() called with unknown Region type")
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
if (ret) {

View File

@ -65,7 +65,7 @@ Send::name_and_id_new_send (Session& s, Role r, uint32_t& bitslot, bool ignore_b
return string_compose (_("send %1"), (bitslot = s.next_send_id ()) + 1);
default:
fatal << string_compose (_("programming error: send created using role %1"), enum_2_string (r)) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return string();
}

View File

@ -2380,7 +2380,7 @@ Session::new_route_from_template (uint32_t how_many, const std::string& template
/* generate a new name by adding a number to the end of the template name */
if (!find_route_name (route_name.c_str(), ++number, name, sizeof(name), true)) {
fatal << _("Session: UINT_MAX routes? impossible!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
}
@ -4041,7 +4041,7 @@ Session::available_capture_duration ()
fatal << string_compose (_("programming error: %1"),
X_("illegal native file data format"))
<< endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
double scale = 4096.0 / sample_bytes_on_disk;

View File

@ -1169,7 +1169,7 @@ Session::process_event (SessionEvent* ev)
default:
fatal << string_compose(_("Programming error: illegal event type in process_event (%1)"), ev->type) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
break;
};

View File

@ -152,7 +152,7 @@ SndFileSource::SndFileSource (Session& s, const string& path, const string& orig
default:
fatal << string_compose (_("programming error: %1"), X_("unsupported audio header format requested")) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
break;
}
@ -459,7 +459,7 @@ SndFileSource::nondestructive_write_unlocked (Sample *data, framecnt_t cnt)
if (_info.channels != 1) {
fatal << string_compose (_("programming error: %1 %2"), X_("SndFileSource::write called on non-mono file"), _path) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return 0;
}

View File

@ -677,7 +677,7 @@ TempoMap::first_meter () const
}
fatal << _("programming error: no tempo section in tempo map!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return *m;
}
@ -693,7 +693,7 @@ TempoMap::first_tempo () const
}
fatal << _("programming error: no tempo section in tempo map!") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return *t;
}
@ -807,7 +807,7 @@ TempoMap::recompute_map (bool reassign_tempo_bbt, framepos_t end)
rmeter = ms;
} else {
fatal << _("programming error: unhandled MetricSection type") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
}
}
@ -1489,8 +1489,7 @@ TempoMap::round_to_type (framepos_t frame, int dir, BBTPointType type)
break;
}
/* NOTREACHED */
assert (false);
abort(); /* NOTREACHED */
return 0;
}
@ -1532,6 +1531,7 @@ TempoMap::tempo_section_at (framepos_t frame) const
if (prev == 0) {
fatal << endmsg;
abort(); /*NOTREACHED*/
}
return *prev;
@ -1785,7 +1785,7 @@ TempoMap::insert_time (framepos_t where, framecnt_t amount)
// cerr << "NEW METER, frame = " << (*i)->frame() << " start = " << (*i)->start() <<endl;
} else {
fatal << _("programming error: unhandled MetricSection type") << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
prev = (*i);

View File

@ -951,7 +951,7 @@ Track::monitoring_state () const
}
}
/* NOTREACHED */
abort(); /* NOTREACHED */
return MonitoringSilence;
}

View File

@ -429,7 +429,7 @@ ARDOUR::string_to_edit_mode (string str)
return Lock;
}
fatal << string_compose (_("programming error: unknown edit mode string \"%1\""), str) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return Slide;
}
@ -468,7 +468,7 @@ ARDOUR::string_to_sync_source (string str)
}
fatal << string_compose (_("programming error: unknown sync source string \"%1\""), str) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return Engine;
}
@ -577,7 +577,7 @@ ARDOUR::string_to_auto_state (std::string str)
}
fatal << string_compose (_("programming error: %1 %2"), "illegal AutoState string: ", str) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return Touch;
}
@ -601,7 +601,7 @@ ARDOUR::auto_state_to_string (AutoState as)
}
fatal << string_compose (_("programming error: %1 %2"), "illegal AutoState type: ", as) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return "";
}
@ -615,7 +615,7 @@ ARDOUR::string_to_auto_style (std::string str)
}
fatal << string_compose (_("programming error: %1 %2"), "illegal AutoStyle string: ", str) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return Trim;
}
@ -634,7 +634,7 @@ ARDOUR::auto_style_to_string (AutoStyle as)
}
fatal << string_compose (_("programming error: %1 %2"), "illegal AutoStyle type: ", as) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return "";
}
@ -669,7 +669,7 @@ ARDOUR::native_header_format_extension (HeaderFormat hf, const DataType& type)
}
fatal << string_compose (_("programming error: unknown native header format: %1"), hf);
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return ".wav";
}

View File

@ -147,8 +147,7 @@ public:
case 2:
return _program_change;
default:
abort ();
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return _program_change;
}
}

View File

@ -1199,7 +1199,7 @@ ControlList::unlocked_eval (double x) const
return multipoint_eval (x);
}
/*NOTREACHED*/ /* stupid gcc */
abort(); /*NOTREACHED*/ /* stupid gcc */
return _default_value;
}

View File

@ -1346,8 +1346,7 @@ Sequence<Time>::get_notes_by_pitch (Notes& n, NoteOperator op, uint8_t val, int
default:
//fatal << string_compose (_("programming error: %1 %2", X_("get_notes_by_pitch() called with illegal operator"), op)) << endmsg;
abort ();
/* NOTREACHED*/
abort(); /* NOTREACHED*/
}
}
}
@ -1392,8 +1391,7 @@ Sequence<Time>::get_notes_by_velocity (Notes& n, NoteOperator op, uint8_t val, i
break;
default:
// fatal << string_compose (_("programming error: %1 %2", X_("get_notes_by_velocity() called with illegal operator"), op)) << endmsg;
abort ();
/* NOTREACHED*/
abort(); /* NOTREACHED*/
}
}

View File

@ -490,7 +490,7 @@ ActionManager::set_toggleaction_state (string n, bool s)
if (last_slash == 0) {
fatal << string_compose ("programmer error: %1 %2", "illegal toggle action name", name) << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return;
}

View File

@ -81,7 +81,7 @@ UI::UI (string namestr, int *argc, char ***argv)
theGtkUI = this;
} else {
fatal << "duplicate UI requested" << endmsg;
/* NOTREACHED */
abort(); /* NOTREACHED */
}
/* the GUI event loop runs in the main thread of the app,

View File

@ -285,7 +285,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
break;
default:
/*NOTREACHED*/
abort(); /*NOTREACHED*/
break;
}

View File

@ -70,7 +70,7 @@ Pool::alloc ()
if (free_list.read (&ptr, 1) < 1) {
fatal << "CRITICAL: " << _name << " POOL OUT OF MEMORY - RECOMPILE WITH LARGER SIZE!!" << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
return 0;
} else {
return ptr;
@ -184,7 +184,7 @@ PerThreadPool::per_thread_pool ()
CrossThreadPool* p = _key.get();
if (!p) {
fatal << "programming error: no per-thread pool \"" << _name << "\" for thread " << pthread_name() << endmsg;
/*NOTREACHED*/
abort(); /*NOTREACHED*/
}
return p;
}