Skip to contentSkip to conversation

audio: Simplify audio_bug() removing old code

PATCH In review Philippe Mathieu-Daudé 3 participants 3 messages Dec 10, 2020 – Dec 15, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 audio: Simplify audio_bug() removing old code

This code (introduced in commit 1d14ffa97ea, Oct 2005) is likely unused since years. Time to remove it. If the condition is true, simply call abort().

---
 audio/audio.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
audio/audio.c +1 -18
index 46578e4a583..b71ab8912c5 100644
@@ -104,9 +104,6 @@ const struct mixeng_volume nominal_volume = {
 
 static bool legacy_config = true;
 
-#ifdef AUDIO_IS_FLAWLESS_AND_NO_CHECKS_ARE_REQURIED
-#error No its not
-#else
 int audio_bug (const char *funcname, int cond)
 {
     if (cond) {
@@ -119,25 +116,11 @@ int audio_bug (const char *funcname, int cond)
             AUD_log (NULL, "I am sorry\n");
         }
         AUD_log (NULL, "Context:\n");
-
-#if defined AUDIO_BREAKPOINT_ON_BUG
-#  if defined HOST_I386
-#    if defined __GNUC__
-        __asm__ ("int3");
-#    elif defined _MSC_VER
-        _asm _emit 0xcc;
-#    else
-        abort ();
-#    endif
-#  else
-        abort ();
-#  endif
-#endif
+        abort();
     }
 
     return cond;
 }
-#endif
 
 static inline int audio_bits_to_index (int bits)
 {
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Philippe Mathieu-Daudé

This code (introduced in commit 1d14ffa97ea, Oct 2005) is likely unused since years. Time to remove it. If the condition is true, simply call abort().

It is going to conflict with the patch from "[PATCH v2 00/13] Remove GCC < 4.8 checks". I'll drop it if yours goes first.

Quoted 48 lines
---
 audio/audio.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
audio/audio.c +1 -19
index 46578e4a583..b71ab8912c5 100644
@@ -104,9 +104,6 @@ const struct mixeng_volume nominal_volume = {
 
 static bool legacy_config = true;
 
-#ifdef AUDIO_IS_FLAWLESS_AND_NO_CHECKS_ARE_REQURIED
-#error No its not
-#else
 int audio_bug (const char *funcname, int cond)
 {
     if (cond) {
@@ -119,25 +116,11 @@ int audio_bug (const char *funcname, int cond)
             AUD_log (NULL, "I am sorry\n");
         }
         AUD_log (NULL, "Context:\n");
-
-#if defined AUDIO_BREAKPOINT_ON_BUG
-#  if defined HOST_I386
-#    if defined __GNUC__
-        __asm__ ("int3");
-#    elif defined _MSC_VER
-        _asm _emit 0xcc;
-#    else
-        abort ();
-#    endif
-#  else
-        abort ();
-#  endif
-#endif
+        abort();
     }
 
     return cond;
 }
-#endif
 
 static inline int audio_bits_to_index (int bits)
 {
--

2.26.2