From 6b3a8915f3c50f7220121fcb9202ec20144389c4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 14 Nov 2014 10:47:43 +0100 Subject: add abort() to non-reached code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- libs/ardour/cycle_timer.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libs/ardour/cycle_timer.cc') diff --git a/libs/ardour/cycle_timer.cc b/libs/ardour/cycle_timer.cc index bb4f3181e0..84dafd00cc 100644 --- a/libs/ardour/cycle_timer.cc +++ b/libs/ardour/cycle_timer.cc @@ -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; } -- cgit v1.2.3