]> git.sesse.net Git - vlc/commitdiff
Mark unreachable code on GCC even if NDEBUG
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 17 Feb 2015 21:10:16 +0000 (23:10 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 18 Feb 2015 15:52:52 +0000 (17:52 +0200)
This might suppress some warnings (and very slightly reduce code size)
when assertions are disabled. Not that I particularly like to create
VLC-specific macros.

66 files changed:
include/vlc_common.h
lib/event.c
modules/access/bluray.c
modules/access/dtv/en50221.c
modules/access/file.c
modules/access/http.c
modules/access/live555.cpp
modules/access/mms/mmstu.c
modules/access/v4l2/controls.c
modules/access/v4l2/demux.c
modules/audio_filter/channel_mixer/remap.c
modules/audio_output/amem.c
modules/audio_output/audiotrack.c
modules/audio_output/pulse.c
modules/codec/cc.c
modules/codec/lpcm.c
modules/control/dbus/dbus.c
modules/control/motion.c
modules/control/motionlib.c
modules/control/rc.c
modules/gui/macosx/SPMediaKeyTap.m
modules/gui/macosx_dialog_provider/dialogProvider.m
modules/gui/qt4/components/playlist/playlist_item.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/dialogs/sout.cpp
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/qt4.cpp
modules/hw/vdpau/chroma.c
modules/services_discovery/podcast.c
modules/services_discovery/sap.c
modules/stream_out/rtp.c
modules/stream_out/rtpfmt.c
modules/video_filter/deinterlace/algo_phosphor.c
modules/video_filter/mirror.c
modules/video_filter/posterize.c
modules/video_output/caopengllayer.m
modules/video_output/gl.c
modules/video_output/ios2.m
modules/video_output/macosx.m
modules/video_output/msw/common.c
modules/video_output/msw/wingdi.c
modules/video_output/wayland/shell_surface.c
modules/video_output/xcb/glx.c
modules/video_output/xcb/xvideo.c
modules/video_splitter/wall.c
modules/visualization/glspectrum.c
modules/visualization/visual/visual.c
modules/visualization/visual/window.c
src/android/thread.c
src/audio_output/common.c
src/darwin/dirs.c
src/darwin/thread.c
src/input/es_out.c
src/input/es_out_timeshift.c
src/input/stream.c
src/misc/events.c
src/misc/variables.c
src/missing.c
src/network/httpd.c
src/posix/thread.c
src/posix/timer.c
src/stream_output/sap.c
src/text/strings.c
src/text/unicode.c
src/video_output/display.c
src/win32/dirs.c

index b82dedaae2d5e9fbc29a83b5c886be7b7f6cabc1..14909321148ce7d2c9e9090a820c8bb40f544403 100644 (file)
 
 /* Branch prediction */
 #ifdef __GNUC__
-#   define likely(p)   __builtin_expect(!!(p), 1)
-#   define unlikely(p) __builtin_expect(!!(p), 0)
+# define likely(p)     __builtin_expect(!!(p), 1)
+# define unlikely(p)   __builtin_expect(!!(p), 0)
+# define unreachable() __builtin_unreachable()
 #else
-#   define likely(p)   (!!(p))
-#   define unlikely(p) (!!(p))
+# define likely(p)     (!!(p))
+# define unlikely(p)   (!!(p))
+# define unreachable() ((void)0)
 #endif
 
+#define vlc_assert_unreachable() (assert(!"unreachable"), unreachable())
+
 /* Linkage */
 #ifdef __cplusplus
 # define VLC_EXTERN extern "C"
index 7cc17bfa5fded4d33ed725e6797d97e2182f5db0..2ed7c5ba88a6ef03dd599a5e7f62bfb470b4caf3 100644 (file)
@@ -373,7 +373,7 @@ int event_attach( libvlc_event_manager_t * p_event_manager,
     free(listener);
     fprintf( stderr, "This object event manager doesn't know about '%s' events",
              libvlc_event_type_name(event_type) );
-    assert(0);
+    vlc_assert_unreachable();
     return -1;
 }
 
index 4a46407379932da8574427237afae096fd31c3c3..0d2a5edff09efc82fa67554ea296694a141a4123 100644 (file)
@@ -773,7 +773,7 @@ static int onMouseEvent(vlc_object_t *p_vout, const char *psz_var, vlc_value_t o
         bd_mouse_select(p_sys->bluray, now, val.coords.x, val.coords.y);
         bd_user_input(p_sys->bluray, now, BD_VK_MOUSE_ACTIVATE);
     } else {
-        assert(0);
+        vlc_assert_unreachable();
     }
     return VLC_SUCCESS;
 }
index 81a3a75f785457e841a063919af88f3a3cf4197f..2cf79df9692f116cb2f127699c1944ad1144d1a4 100644 (file)
@@ -2108,7 +2108,7 @@ void en50221_Poll( cam_t * p_cam )
     case CA_CI:
         return;
     default:
-        assert( 0 );
+        vlc_assert_unreachable();
     }
 
     for ( unsigned i_slot = 0; i_slot < p_cam->i_nb_slots; i_slot++ )
index 1b5d435078a0e3f052ba1c4fe89ede54fe7619ad..fbe6fa6216c94ba7c65bba516d76cfe6e985aaf7 100644 (file)
@@ -366,7 +366,7 @@ static ssize_t StreamRead (access_t *p_access, uint8_t *p_buffer, size_t i_len)
 
 static int NoSeek (access_t *p_access, uint64_t i_pos)
 {
-    /* assert(0); ?? */
+    /* vlc_assert_unreachable(); ?? */
     (void) p_access; (void) i_pos;
     return VLC_EGENERIC;
 }
index ee5a8759bbccdbb0b921560fb7a6532046e7547c..31328abd3c88a76997afa979b79db408f0a476a6 100644 (file)
@@ -429,7 +429,7 @@ connect:
             break;
 
         default:
-            assert(0);
+            vlc_assert_unreachable();
     }
 
     if( p_sys->i_code == 401 )
index a6f65c915856daa9a029913556d82c1b78b92754..ececbaf88c9db9193c6ee89a8fa6259fe9d5330c 100644 (file)
@@ -2107,7 +2107,7 @@ static void* TimeoutPrevention( void *p_data )
 
         msleep (((int64_t)p_timeout->p_sys->i_timeout - 2) * CLOCK_FREQ);
     }
-    assert(0); /* dead code */
+    vlc_assert_unreachable(); /* dead code */
 }
 
 /*****************************************************************************
index 6091fbd274de57918fd53b1221963764f8e5c0dc..4c0a8c21240dcfa8955ba1b2544f905129ed79bd 100644 (file)
@@ -1573,7 +1573,7 @@ static void *KeepAliveThread( void *p_data )
 
         msleep( 10 * CLOCK_FREQ );
     }
-    assert(0);
+    vlc_assert_unreachable();
 }
 
 static void KeepAliveStart( access_t *p_access )
index 1d2b104183ca30d8638380f9dc49683f510a7e37..def74035085819dcfc0fe485e92931bf0aa98c8d 100644 (file)
@@ -172,7 +172,7 @@ static int ControlSetCallback (vlc_object_t *obj, const char *var,
             ret = ControlSetStr (ctrl, cur.psz_string);
             break;
         default:
-            assert (0);
+            vlc_assert_unreachable ();
     }
 
     if (ret)
index db8bfecc637693c6fbe11fa4aae7b3405740fbcf..833f6a62c249137b4a415f8614cf2254af44fc01 100644 (file)
@@ -631,7 +631,7 @@ static void *MmapThread (void *data)
 #endif
     }
 
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 static void *ReadThread (void *data)
@@ -693,7 +693,7 @@ static void *ReadThread (void *data)
             GrabVBI (demux, sys->vbi);
 #endif
     }
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 static int DemuxControl( demux_t *demux, int query, va_list args )
index 77aeb094de97b05770eefbb7e0b334a40526e3b2..3a77e02e3224c7da1c220997ddbe6e9d19a06758 100644 (file)
@@ -159,8 +159,7 @@ static inline uint32_t CanonicaliseChannels( uint32_t i_physical_channels )
         if( (i_physical_channels & ~valid_channels[i]) == 0 )
             return valid_channels[i];
 
-    assert( false );
-    return 0;
+    vlc_assert_unreachable();
 }
 
 /*****************************************************************************
index 906954ced5fcbd5adbf500cffe86d94257d39c21..9e9ece62e9ca8ac6b1322b61bb7d94166528d811 100644 (file)
@@ -224,7 +224,7 @@ static int Start (audio_output_t *aout, audio_sample_format_t *fmt)
             fmt->i_physical_channels = AOUT_CHANS_7_1;
             break;
         default:
-            assert(0);
+            vlc_assert_unreachable();
     }
 
     fmt->i_format = VLC_CODEC_S16N;
index 4fb708e8e6c5199e58747cdbe5694dd8590bae1a..1d47c0c7dc972759e5dd0d258e0c9b5baa7c4915 100644 (file)
@@ -611,8 +611,7 @@ JNIThread( void *data )
                                        &p_sys->p_cmd->out.time_get.i_delay );
                 break;
             default:
-                assert( false );
-                break;
+                vlc_assert_unreachable();
         }
         if( b_error )
             p_sys->b_thread_run = false;
index 6ec2eec47ffebb427edbe5266c0b5fc70fe46ef6..5947ceb2c38d11360e48f7b2832974f29ed4a643 100644 (file)
@@ -430,7 +430,7 @@ static void context_cb(pa_context *ctx, pa_subscription_event_type_t type,
             break;
 
         default: /* unsubscribed facility?! */
-            assert(0);
+            vlc_assert_unreachable();
     }
 }
 
index 678f9b902977ada8c942d665da9b950e9fa91e8d..91e35eeb65a1cf2dfbf71b1d170a54218121a4e2 100644 (file)
@@ -479,7 +479,7 @@ static int Eia608GetWritingScreenIndex( eia608_t *h )
         return h->i_screen;
     default:
         /* It cannot happen, else it is a bug */
-        assert( 0 );
+        vlc_assert_unreachable();
         return 0;
     }
 }
index a1f78251af4566251638e3b5ae3178e324771b85..c317e6f9547e7162fb69893189d113c7e5d5e977 100644 (file)
@@ -273,7 +273,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_packetizer )
             p_dec->fmt_out.i_codec = VLC_CODEC_WIDI_LPCM;
             break;
         default:
-            assert(0);
+            vlc_assert_unreachable();
         case LPCM_BD:
             p_dec->fmt_out.i_codec = VLC_CODEC_BD_LPCM;
             break;
@@ -451,7 +451,7 @@ static block_t *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
             AobExtract( p_aout_buffer, p_block, i_bits, p_aob_group );
             break;
         default:
-            assert(0);
+            vlc_assert_unreachable();
         case LPCM_BD:
             BdExtract( p_aout_buffer, p_block, i_frame_length, i_channels, i_channels_padding, i_bits );
             break;
@@ -575,7 +575,7 @@ static block_t *EncodeFrames( encoder_t *p_enc, block_t *p_aout_buf )
         i_freq_code = 3;
         break;
     default:
-        assert(0);
+        vlc_assert_unreachable();
     }
 
     int i_bytes_consumed = 0;
index 43feeb5a4d08d13f6c7b764c8715e1c309ac5c96..2570ff191447cfd6e1cc0d4e0cff466f8883d86f 100644 (file)
@@ -630,7 +630,7 @@ static void ProcessEvents( intf_thread_t *p_intf,
             break;
         }
         default:
-            assert(0);
+            vlc_assert_unreachable();
         }
         free( p_events[i] );
     }
@@ -1015,7 +1015,7 @@ static int AllCallback( vlc_object_t *p_this, const char *psz_var,
     else if( !strcmp( "can-pause", psz_var ) )
         info.signal = SIGNAL_CAN_PAUSE;
     else
-        assert(0);
+        vlc_assert_unreachable();
 
     if( info.signal == SIGNAL_NONE )
         return VLC_SUCCESS;
index 80196ad59e619186f3904a59099749e85642483a..c2774203bdcece3a789a803553170136e152ad57 100644 (file)
@@ -188,7 +188,7 @@ static void *RunIntf( void *data )
 
         vlc_restorecancel( canc );
     }
-    assert(0);
+    vlc_assert_unreachable();
 }
 #undef LOW_THRESHOLD
 #undef HIGH_THRESHOLD
index fd13f6fc340212fff0f0377698f12d8d6e993d9d..5638bb5f1599057cbd095156d2c8186ba0ceea02 100644 (file)
@@ -194,7 +194,7 @@ static int GetOrientation( motion_sensors_t *motion )
             return 0;
 #endif
     default:
-        assert( 0 );
+        vlc_assert_unreachable();
     }
 }
 
index c3eb726e2d0d0d1b9b694e11d46ae74daf249319..ca2b4a19b2a37c848860ef680fc34a4c087df09d 100644 (file)
@@ -1540,7 +1540,7 @@ static int VideoConfig( vlc_object_t *p_this, char const *psz_cmd,
     }
     else
         /* This case can't happen */
-        assert( 0 );
+        vlc_assert_unreachable();
 
     if( newval.psz_string && *newval.psz_string )
     {
index 3917731c12ebe8ab4d0fb858b692d8bca10d6f45..9be81c7db992916e6b431f9c05cfbd7ddf3db004 100644 (file)
@@ -220,7 +220,7 @@ static CGEventRef tapEventCallback2(CGEventTapProxy proxy, CGEventType type, CGE
     }
     @catch (NSException * e) {
         NSLog(@"Strange CGEventType: %d: %@", type, e);
-        assert(0);
+        vlc_assert_unreachable();
         return event;
     }
 
index 2e78a72f82f42c4c1de129e9d26fc89987044945..db97a9b6451dca73c397208b300521242eccf192 100644 (file)
@@ -389,7 +389,7 @@ bool checkProgressPanel (void *priv)
             ret = 3;
             break;
         default:
-            assert(0);
+            vlc_assert_unreachable();
             ret = 0;
             break;
     }
@@ -666,7 +666,7 @@ static NSView *createControlFromWidget(extension_widget_t *widget, id self)
             return spinner;
         }
         default:
-            assert(0);
+            vlc_assert_unreachable();
             return nil;
     }
 
index 1a130aa83a9af60a0cec7a19f2b78f79d24d0b56..b105810d0850c887774fcdcdaf17aad7c1bb680b 100644 (file)
@@ -94,7 +94,7 @@ int PLItem::id( int type )
         return i_playlist_id;
     default:
     case MLMEDIA_ID:
-        assert( 0 );
+        vlc_assert_unreachable();
         return -1;
     }
 }
index eb99f1bef3e210bf7d8b46de7014478132afc623..fa4a2ba2212ddc184e8f874315193fe89db276ba 100644 (file)
@@ -787,7 +787,7 @@ void StandardPLPanel::cycleViews()
 #endif
         showView( ICON_VIEW );
     else
-        assert( 0 );
+        vlc_assert_unreachable();
 }
 
 void StandardPLPanel::activate( const QModelIndex &index )
index 596379ced1516042ba8b90ea7b8e99f664d1eb9f..8f58dc278cd80cc028e4f81dbdcfb3810c06f07d 100644 (file)
@@ -149,7 +149,7 @@ void SoutDialog::addDest( )
             caption = "Icecast";
             break;
         default:
-            assert(0);
+            vlc_assert_unreachable();
             return;
     }
 
index 62184e7c58f248c25b4805a82c15fb97fc176aeb..c7f4de70f6ee75691668570f693792ddd8c49e73 100644 (file)
@@ -301,7 +301,7 @@ void InputManager::customEvent( QEvent *event )
         break;
     default:
         msg_Warn( p_intf, "This shouldn't happen: %i", i_type );
-        assert(0);
+        vlc_assert_unreachable();
     }
 }
 
index b6aef43ceb33ef9d34ea7634a0687a9b051b7998..1122579b41c979333dc04e7622cacfd13ee3447f 100644 (file)
@@ -693,7 +693,7 @@ static int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
             p_wnd->handle.nsobject = (void *)wid;
             break;
         default:
-            assert(0);
+            vlc_assert_unreachable();
     }
 
     p_wnd->control = WindowControl;
index a4df8e639590cc5dd1f59fa70b3dbaf91cb3ea31..7a394f52d86fd4468a23e23aec2a13e2e48947bc 100644 (file)
@@ -381,7 +381,7 @@ static picture_t *VideoImport(filter_t *filter, picture_t *src)
             fmt.i_chroma = VLC_CODEC_VDPAU_VIDEO_444;
             break;
         default:
-            assert(0);
+            vlc_assert_unreachable();
     }
 
     picture_t *dst = picture_NewFromFormat(&fmt);
@@ -433,7 +433,7 @@ static picture_t *VideoRender(filter_t *filter, picture_t *src)
              case VDP_CHROMA_TYPE_420: fmt.i_chroma = VLC_CODEC_NV12; break;
              case VDP_CHROMA_TYPE_422: fmt.i_chroma = VLC_CODEC_UYVY; break;
              case VDP_CHROMA_TYPE_444: fmt.i_chroma = VLC_CODEC_NV24; break;
-             default: assert(0);
+             default: vlc_assert_unreachable();
         }
 
         picture_t *pic = picture_NewFromFormat(&fmt);
index 7e25ca0eaf56b089ac5595e5708507e9da353767..58089ac0e13ba468d8707d06bee8ca17c73b7d6f 100644 (file)
@@ -248,7 +248,7 @@ static void *Run( void *data )
         vlc_restorecancel (canc);
     }
     vlc_cleanup_pop();
-    assert(0); /* dead code */
+    vlc_assert_unreachable(); /* dead code */
 }
 
 static int UrlsChange( vlc_object_t *p_this, char const *psz_var,
index 88882151f2a5d2cbabcb846941ac3fbaedb33748..abdf9575bd9ac166907d5f9bd2e2b3a279646315 100644 (file)
@@ -603,7 +603,7 @@ static void *Run( void *data )
         else if( timeout < 200 )
             timeout = 200; /* Don't wakeup too fast. */
     }
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 /**********************************************************************
index 24839a92be065d5bbe4a0db24da3dfa148132043..949a1616c5f139177cf88126b404f3fe11f936fb 100644 (file)
@@ -1499,7 +1499,7 @@ static void *rtp_listen_thread( void *data )
         vlc_restorecancel( canc );
     }
 
-    assert( 0 );
+    vlc_assert_unreachable();
 }
 
 
index 1ac9e8dfca666b10d182b08c6d4c81fee8c6b0c7..6f0dbb540120466c0b262a632581ce0fd643ad0e 100644 (file)
@@ -486,7 +486,7 @@ int rtp_get_fmt( vlc_object_t *obj, es_format_t *p_fmt, const char *mux,
                         c1 = c2 = 4;
                         break;
                     default:
-                        assert(0);
+                        vlc_assert_unreachable();
                 }
 
                 if( asprintf( &rtp_fmt->fmtp,
@@ -1550,7 +1550,7 @@ static int rtp_packetize_rawvideo( sout_stream_id_sys_t *id, block_t *in, vlc_fo
             i_xdec = i_ydec = 2;
             break;
         default:
-            assert(0);
+            vlc_assert_unreachable();
     }
 
     static const int RTP_HEADER_LEN = 12;
@@ -1653,7 +1653,7 @@ static int rtp_packetize_rawvideo( sout_stream_id_sys_t *id, block_t *in, vlc_fo
                 p_outdata += i_length;
                 p_data += i_length;
             }
-            else assert(0);
+            else vlc_assert_unreachable();
         }
 
         /* rtp common header */
index 30f5e4bbc17b684dbc05dd7b67394e6646369d06..2f4d0917a91ea1ada13fff6ce138feafe439269f 100644 (file)
@@ -336,7 +336,7 @@ int RenderPhosphor( filter_t *p_filter,
             break;
         default:
             /* The above are the only possibilities, if there are no bugs. */
-            assert(0);
+            vlc_assert_unreachable();
             break;
         }
     }
index 748e23c02179775cdacdd5d5985b67911384b771..8ec9cf5c3e5869c0d879b92a4ae3a3182084972f 100644 (file)
@@ -241,7 +241,7 @@ static void VerticalMirror( picture_t *p_pic, picture_t *p_outpic, int i_plane,
             RV32VerticalMirror( p_pic, p_outpic, i_plane, b_left_to_right );
             break;
         default:
-            assert( false );
+            vlc_assert_unreachable();
     }
 }
 
index 4f80ff2a53336271b7e6a64f1a744023eb89a6d0..298b3182a5d02e9d99564061bc59b5fd71f6c722 100644 (file)
@@ -192,7 +192,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
             PackedYUVPosterize( p_pic, p_outpic, level );
             break;
         default:
-            assert( false );
+            vlc_assert_unreachable();
     }
 
     return CopyInfoAndRelease( p_outpic, p_pic );
@@ -316,7 +316,7 @@ static void PackedYUVPosterize( picture_t *p_pic, picture_t *p_outpic, int i_lev
                     u = *p_in++;
                     break;
                 default:
-                    assert( false );
+                    vlc_assert_unreachable();
             }
             /* do posterization */
             YuvPosterization( &posterized_y1, &posterized_y2, &posterized_u,
@@ -349,7 +349,7 @@ static void PackedYUVPosterize( picture_t *p_pic, picture_t *p_outpic, int i_lev
                     *p_out++ = posterized_u;
                     break;
                 default:
-                    assert( false );
+                    vlc_assert_unreachable();
             }
         }
         p_in += p_pic->p[0].i_pitch - p_pic->p[0].i_visible_pitch;
index 462bfd92830756eefe8383dfd5ff36fcab2ed132..6e80ec91fbb510584820d786e122c298b8fef2d9 100644 (file)
@@ -330,7 +330,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         }
 
         case VOUT_DISPLAY_RESET_PICTURES:
-            assert (0);
+            vlc_assert_unreachable ();
         default:
             msg_Err (vd, "Unhandled request %d", query);
         case VOUT_DISPLAY_CHANGE_FULLSCREEN:
index 392ffa183544c6dc277c5dd9a449f23558560968..082aa7837bd5a11d6586a67ff2974833fb2bd5c6 100644 (file)
@@ -217,7 +217,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         break;
 #ifndef NDEBUG
       case VOUT_DISPLAY_RESET_PICTURES: // not needed
-        assert(0);
+        vlc_assert_unreachable();
 #endif
 
       case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
index c7b9e5bf179a1002a1df8737b686388b90a33f52..eca2e084829a806c503fb0bac2a241ac698703c0 100644 (file)
@@ -315,7 +315,7 @@ static int Control(vout_display_t *vd, int query, va_list ap)
         }
 
         case VOUT_DISPLAY_RESET_PICTURES:
-            assert (0);
+            vlc_assert_unreachable ();
         default:
             msg_Err(vd, "Unknown request %d", query);
         case VOUT_DISPLAY_CHANGE_FULLSCREEN:
index fe42ff90bee3f1de1728194c42e790d69e09606b..09541f9159d4f710817f9bc8c8fb4ef4a997837b 100644 (file)
@@ -376,7 +376,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         }
 
         case VOUT_DISPLAY_RESET_PICTURES:
-            assert (0);
+            vlc_assert_unreachable ();
         default:
             msg_Err (vd, "Unknown request in Mac OS X vout display");
             return VLC_EGENERIC;
index 75c8a76a2977e12d701bd8e9d8cbc3a630272c47..1ebe08c362794a38904e082684a8e8104824eae0 100644 (file)
@@ -619,7 +619,7 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
         EventThreadMouseHide(sys->event);
         return VLC_SUCCESS;
     case VOUT_DISPLAY_RESET_PICTURES:
-        assert(0);
+        vlc_assert_unreachable();
     default:
         return VLC_EGENERIC;
     }
index 4f6c63906328de6d3e04665977657f7d4027eb19..ea4b237e2f0016fd366cf6c8d81a7a22865d762d 100644 (file)
@@ -173,7 +173,7 @@ static int Control(vout_display_t *vd, int query, va_list args)
 {
     switch (query) {
     case VOUT_DISPLAY_RESET_PICTURES:
-        assert(0);
+        vlc_assert_unreachable();
         return VLC_EGENERIC;
     default:
         return CommonControl(vd, query, args);
index 013f1b8e080259adb6f461779d10856255525057..4ebdcff720be94a9a3e641dcaeb10edb72f96fd0 100644 (file)
@@ -87,7 +87,7 @@ static void *Thread(void *data)
         wl_display_read_events(display);
         wl_display_dispatch_pending(display);
     }
-    assert(0);
+    vlc_assert_unreachable();
     vlc_cleanup_pop();
     //vlc_restorecancel(canc);
     //return NULL;
index bb5c789f4e5b6f639bf54cd8ca8ceebdc91bc9c1..0d3dbb6c37d638ee99e421e49910f22b099301dc 100644 (file)
@@ -248,7 +248,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         return VLC_SUCCESS;
 
     case VOUT_DISPLAY_RESET_PICTURES:
-        assert (0);
+        vlc_assert_unreachable ();
     default:
         msg_Err (vd, "Unknown request in XCB vout display");
         return VLC_EGENERIC;
index 1a05c08c379a34b24e98affe37218b39ca39536f..e9100fbf1e2a8d95cbcfe948c6918f2feb7c6137 100644 (file)
@@ -769,7 +769,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
         xcb_flush (p_sys->conn);
         return VLC_SUCCESS;
     case VOUT_DISPLAY_RESET_PICTURES:
-        assert(0);
+        vlc_assert_unreachable();
     default:
         msg_Err (vd, "Unknown request in XCB vout display");
         return VLC_EGENERIC;
index 9a9829ac881fc96927893a5d8d0cb60607b1f198..3810c17c30f43fd46fd7820a9d1ab8c40f63cdf8 100644 (file)
@@ -446,7 +446,7 @@ static int Mouse( video_splitter_t *p_splitter, vlc_mouse_t *p_mouse,
             }
         }
     }
-    assert(0);
+    vlc_assert_unreachable();
     return VLC_EGENERIC;
 }
 
index 6086353b710159272526670ccd3d470e42540858..8efdb8f4cd57617e7646b88b6de7f5a6898a52ed 100644 (file)
@@ -493,5 +493,5 @@ release:
         vlc_restorecancel(canc);
     }
 
-    assert(0);
+    vlc_assert_unreachable();
 }
index 628fd7038564d293cff5edecc6b33050d6fb5744..5ce328d0ddbfa708a0852f442b70215f53c70cd5 100644 (file)
@@ -381,7 +381,7 @@ static void *Thread( void *data )
         block_Release( DoRealWork( p_filter, block ) );
         vlc_restorecancel( canc );
     }
-    assert(0);
+    vlc_assert_unreachable();
 }
 
 static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
index e08794d34780926e2ebada679f4a0fa76e5b41bd..49861238ca8dc7b0ab47dd410649caf7a06e4fe5 100644 (file)
@@ -184,7 +184,7 @@ bool window_init( int i_buffer_size, window_param * p_param,
     }
     default:
         /* We should not reach here */
-        assert(0);
+        vlc_assert_unreachable();
         break;
     }
 
index dbf2ece9cb43be229949a8471cb4f234b8d7edce..d365d1012e3e5b786b979fae3e7e4012202f40e0 100644 (file)
@@ -303,7 +303,7 @@ int vlc_cond_timedwait (vlc_cond_t *condvar, vlc_mutex_t *p_mutex,
              cb = pthread_cond_timedwait_monotonic_np;
              break;
          default:
-             assert (0);
+             vlc_assert_unreachable ();
     }
 
     int val = cb (&condvar->cond, p_mutex, &ts);
index c57d9864c46021618cc1de2ebcdee66e1c6a0d9d..9c05ac50e23ab7d2f3eadef14291367f811de593 100644 (file)
@@ -373,7 +373,7 @@ do { \
         case VLC_CODEC_FL32: INTERLEAVE_TYPE(float);    break;
         case VLC_CODEC_S32N: INTERLEAVE_TYPE(int32_t);  break;
         case VLC_CODEC_FL64: INTERLEAVE_TYPE(double);   break;
-        default:             assert(0);
+        default:             vlc_assert_unreachable();
     }
 #undef INTERLEAVE_TYPE
 }
@@ -409,7 +409,7 @@ do { \
         case VLC_CODEC_FL32: DEINTERLEAVE_TYPE(float);    break;
         case VLC_CODEC_S32N: DEINTERLEAVE_TYPE(int32_t);  break;
         case VLC_CODEC_FL64: DEINTERLEAVE_TYPE(double);   break;
-        default:             assert(0);
+        default:             vlc_assert_unreachable();
     }
 #undef DEINTERLEAVE_TYPE
 }
index 381729cb2b364ceab15d8cf8676154c47c487add..9c34cc59f36a9193c592234029c6b0a2920e3e9f 100644 (file)
@@ -132,7 +132,7 @@ static char *getAppDependentDir(vlc_userdir_t type)
             psz_path = "%s/Library/Caches/%s";
             break;
         default:
-            assert(0);
+            vlc_assert_unreachable();
             break;
     }
 
index cd1d694f667bdc320e40942dc28d553b3caabf1f..8b1c29d763d47e3d61f2e3796b31305d5acc03b9 100644 (file)
@@ -730,7 +730,7 @@ void vlc_testcancel (void)
 void vlc_control_cancel (int cmd, ...)
 {
     (void) cmd;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 /* Precision monotonic clock.
index 33e226ac1f113cc6e28638d974d7bbcdd3cb24da..3ea91f0a89233ff46d5cb7e32c96e83e38b5cf7e 100644 (file)
@@ -2490,7 +2490,7 @@ static int EsOutControlLocked( es_out_t *out, int i_query, va_list args )
         case ES_OUT_RESTART_ES_BY_ID:     i_new_query = ES_OUT_RESTART_ES; break;
         case ES_OUT_SET_ES_DEFAULT_BY_ID: i_new_query = ES_OUT_SET_ES_DEFAULT; break;
         default:
-          assert(0);
+          vlc_assert_unreachable();
         }
         /* TODO if the lock is made non recursive it should be changed */
         int i_ret = es_out_Control( out, i_new_query, p_es );
index c12d73ad496dd7e8313fa4c7809ace09a64c02c2..511ba7370100efefd595c5e698ef6b916be12085 100644 (file)
@@ -583,7 +583,7 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args )
     case ES_OUT_GET_ES_OBJECTS_BY_ID:
     case ES_OUT_SET_DELAY:
     case ES_OUT_SET_RECORD_STATE:
-        assert(0);
+        vlc_assert_unreachable();
         return VLC_EGENERIC;
 
     /* Pass-through control */
@@ -700,7 +700,7 @@ static int ControlLocked( es_out_t *p_out, int i_query, va_list args )
 
     default:
         msg_Err( p_sys->p_input, "Unknown es_out_Control query !" );
-        assert(0);
+        vlc_assert_unreachable();
         return VLC_EGENERIC;
     }
 }
@@ -1041,7 +1041,7 @@ static void *TsRun( void *p_data )
             CmdExecuteDel( p_ts->p_out, &cmd );
             break;
         default:
-            assert(0);
+            vlc_assert_unreachable();
             break;
         }
         vlc_restorecancel( canc );
@@ -1222,7 +1222,7 @@ static void CmdClean( ts_cmd_t *p_cmd )
     case C_DEL:
         break;
     default:
-        assert(0);
+        vlc_assert_unreachable();
         break;
     }
 }
@@ -1437,7 +1437,7 @@ static int CmdInitControl( ts_cmd_t *p_cmd, int i_query, va_list args, bool b_co
     }
 
     default:
-        assert(0);
+        vlc_assert_unreachable();
         return VLC_EGENERIC;
     }
 
@@ -1506,7 +1506,7 @@ static int CmdExecuteControl( es_out_t *p_out, ts_cmd_t *p_cmd )
                                                p_cmd->u.control.u.jitter.i_cr_average );
 
     default:
-        assert(0);
+        vlc_assert_unreachable();
         return VLC_EGENERIC;
     }
 }
index a5e3c22e81a8cbb8cd05f9c29833685388069362..55ec2c8dea6a3a3a0e33454ad0fd99ef826c65de 100644 (file)
@@ -633,7 +633,7 @@ static int AStreamControl( stream_t *s, int i_query, va_list args )
             case STREAM_METHOD_STREAM:
                 return AStreamSeekStream( s, offset );
             default:
-                assert(0);
+                vlc_assert_unreachable();
                 return VLC_EGENERIC;
             }
         }
index fb2a04df3accfd0cdac885211dce36c37aa5fdb3..81f901edc5cb13e07a78c8c69e8d8f4cab5a88bc 100644 (file)
@@ -270,7 +270,7 @@ int vlc_event_attach( vlc_event_manager_t * p_em,
         }
     FOREACH_END()
     /* Unknown event = BUG */
-    assert( 0 );
+    vlc_assert_unreachable();
 }
 
 /**
@@ -311,5 +311,5 @@ void vlc_event_detach( vlc_event_manager_t *p_em,
         }
     FOREACH_END()
 
-    assert( 0 );
+    vlc_assert_unreachable();
 }
index 04b3750f90b6739290ae45114ccd04deb1f44875..3a89b4156b90b7c0474b826ec349824a042cce4d 100644 (file)
@@ -255,7 +255,7 @@ int var_Create( vlc_object_t *p_this, const char *psz_name, int i_type )
             p_var->ops = &void_ops;
             break;
         default:
-            assert (0);
+            vlc_assert_unreachable ();
     }
 
     if( (i_type & VLC_VAR_DOINHERIT)
@@ -904,7 +904,7 @@ static int DelCallback( vlc_object_t *p_this, const char *psz_name,
         if( b_found_similar )
             fprintf( stderr, "Calling var_DelCallback for '%s' with the same "
                              "function but not the same data.", psz_name );
-        assert( 0 );
+        vlc_assert_unreachable();
 #endif
         vlc_mutex_unlock( &p_priv->var_lock );
         return VLC_EGENERIC;
@@ -1275,7 +1275,7 @@ int var_Inherit( vlc_object_t *p_this, const char *psz_name, int i_type,
             p_val->b_bool = config_GetInt( p_this, psz_name );
             break;
         default:
-            assert(0);
+            vlc_assert_unreachable();
         case VLC_VAR_ADDRESS:
             return VLC_ENOOBJ;
     }
index 1041ac00d5c554a86b133ae4a3446af778957ad0..f1807520829509dd1ac18b1fb905bb028e3a65aa 100644 (file)
 char *httpd_ClientIP (const httpd_client_t *cl, char *psz_ip, int *port)
 {
     (void) cl; (void) psz_ip; (void) port;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 httpd_file_sys_t *httpd_FileDelete (httpd_file_t *file)
 {
     (void) file;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 httpd_file_t *httpd_FileNew (httpd_host_t *host,
@@ -62,13 +62,13 @@ httpd_file_t *httpd_FileNew (httpd_host_t *host,
     (void) url; (void) content_type;
     (void) login; (void) password;
     (void) cb; (void) data;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 httpd_handler_sys_t *httpd_HandlerDelete (httpd_handler_t *handler)
 {
     (void) handler;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 httpd_handler_t *httpd_HandlerNew (httpd_host_t *host, const char *url,
@@ -79,13 +79,13 @@ httpd_handler_t *httpd_HandlerNew (httpd_host_t *host, const char *url,
     (void) host; (void) url;
     (void) login; (void) password;
     (void) cb; (void) data;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 void httpd_HostDelete (httpd_host_t *h)
 {
     (void) h;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 httpd_host_t *vlc_http_HostNew (vlc_object_t *obj)
@@ -109,44 +109,44 @@ httpd_host_t *vlc_rtsp_HostNew (vlc_object_t *obj)
 void httpd_MsgAdd (httpd_message_t *m, const char *name, const char *fmt, ...)
 {
     (void) m; (void) name; (void) fmt;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 const char *httpd_MsgGet (const httpd_message_t *m, const char *name)
 {
     (void) m; (void) name;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 void httpd_RedirectDelete (httpd_redirect_t *r)
 {
     (void) r;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 httpd_redirect_t *httpd_RedirectNew (httpd_host_t *host,
                                      const char *dst, const char *src)
 {
     (void) host; (void) dst; (void) src;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 char *httpd_ServerIP (const httpd_client_t *client, char *ip, int *port)
 {
     (void) client; (void) ip; (void) port;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 void httpd_StreamDelete (httpd_stream_t *stream)
 {
     (void) stream;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 int httpd_StreamHeader (httpd_stream_t *stream, uint8_t *data, int count)
 {
     (void) stream; (void) data; (void) count;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 httpd_stream_t *httpd_StreamNew (httpd_host_t *host,
@@ -155,13 +155,13 @@ httpd_stream_t *httpd_StreamNew (httpd_host_t *host,
 {
     (void) host; (void) url; (void) content_type;
     (void) login; (void) password;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 int httpd_StreamSend (httpd_stream_t *stream, const block_t *p_block)
 {
     (void) stream; (void) p_block;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 int httpd_StreamSetHTTPHeaders (httpd_stream_t * stream,
@@ -169,27 +169,27 @@ int httpd_StreamSetHTTPHeaders (httpd_stream_t * stream,
                                 size_t i_headers)
 {
     (void) stream; (void) headers; (void) i_headers;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 int httpd_UrlCatch (httpd_url_t *url, int request, httpd_callback_t cb,
                     httpd_callback_sys_t *data)
 {
     (void) url; (void) request; (void) cb; (void) data;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 void httpd_UrlDelete (httpd_url_t *url)
 {
     (void) url;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 httpd_url_t *httpd_UrlNew (httpd_host_t *host, const char *url,
                            const char *login, const char *password)
 {
     (void) host; (void) url; (void) login; (void) password;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 #endif /* !ENABLE_HTTPD */
 
@@ -217,13 +217,13 @@ char *sdp_AddAttribute (char **sdp, const char *name, const char *fmt, ...)
 int sout_AccessOutControl (sout_access_out_t *out, int query, ...)
 {
     VLC_UNUSED (out); VLC_UNUSED (query);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 void sout_AccessOutDelete (sout_access_out_t *out)
 {
     VLC_UNUSED (out);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 #undef sout_AccessOutNew
@@ -238,19 +238,19 @@ sout_access_out_t *sout_AccessOutNew (vlc_object_t *obj,
 ssize_t sout_AccessOutRead (sout_access_out_t *out, block_t *block)
 {
     VLC_UNUSED (out); VLC_UNUSED (block);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 int sout_AccessOutSeek (sout_access_out_t *out, off_t offset)
 {
     VLC_UNUSED (out); VLC_UNUSED (offset);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 ssize_t sout_AccessOutWrite (sout_access_out_t *out, block_t *block)
 {
     VLC_UNUSED (out); VLC_UNUSED (block);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 #undef sout_AnnounceRegisterSDP
@@ -267,7 +267,7 @@ session_descriptor_t *sout_AnnounceRegisterSDP (vlc_object_t *obj,
 void sout_AnnounceUnRegister (vlc_object_t *obj, session_descriptor_t *d)
 {
     VLC_UNUSED (obj); VLC_UNUSED (d);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 #undef sout_EncoderCreate
@@ -280,44 +280,44 @@ encoder_t *sout_EncoderCreate( vlc_object_t *p_this )
 sout_input_t *sout_MuxAddStream (sout_mux_t *mux, es_format_t *fmt)
 {
     VLC_UNUSED (mux); VLC_UNUSED (fmt);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 void sout_MuxDelete (sout_mux_t *mux)
 {
     VLC_UNUSED (mux);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 void sout_MuxDeleteStream (sout_mux_t *mux, sout_input_t *input)
 {
     VLC_UNUSED (mux); VLC_UNUSED (input);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 int sout_MuxGetStream (sout_mux_t *p_mux, unsigned int i_blocks, mtime_t *pi_dts)
 {
     VLC_UNUSED (p_mux); VLC_UNUSED (i_blocks); VLC_UNUSED (pi_dts);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 sout_mux_t *sout_MuxNew (sout_instance_t *instance, const char *mux,
                          sout_access_out_t *out)
 {
     VLC_UNUSED (instance); VLC_UNUSED (mux); VLC_UNUSED (out);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 int sout_MuxSendBuffer (sout_mux_t *mux, sout_input_t *input, block_t *block)
 {
     VLC_UNUSED (mux); VLC_UNUSED (input); VLC_UNUSED (block);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 void sout_StreamChainDelete (sout_stream_t *p_first, sout_stream_t *p_last)
 {
     VLC_UNUSED (p_first); VLC_UNUSED (p_last);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 sout_stream_t *sout_StreamChainNew (sout_instance_t *p_sout, char *psz_chain,
@@ -326,7 +326,7 @@ sout_stream_t *sout_StreamChainNew (sout_instance_t *p_sout, char *psz_chain,
 {
     VLC_UNUSED (p_sout); VLC_UNUSED (psz_chain); VLC_UNUSED (p_next);
     VLC_UNUSED (pp_last);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 char *vlc_sdp_Start (vlc_object_t *obj, const char *cfg,
@@ -346,13 +346,13 @@ int vlm_Control (vlm_t *vlm, int query, ...)
 {
     VLC_UNUSED (query);
     VLC_UNUSED (vlm);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 void vlm_Delete (vlm_t *vlm)
 {
     VLC_UNUSED (vlm);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 int vlm_ExecuteCommand (vlm_t *vlm, const char *cmd, vlm_message_t **pm)
@@ -360,20 +360,20 @@ int vlm_ExecuteCommand (vlm_t *vlm, const char *cmd, vlm_message_t **pm)
     VLC_UNUSED (vlm);
     VLC_UNUSED (cmd);
     VLC_UNUSED (pm);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 vlm_message_t *vlm_MessageAdd (vlm_message_t *a, vlm_message_t *b)
 {
     VLC_UNUSED (a);
     VLC_UNUSED (b);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 void vlm_MessageDelete (vlm_message_t *m)
 {
     VLC_UNUSED (m);
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 vlm_message_t *vlm_MessageSimpleNew (const char *a)
index a643c70552d7b2e2b854492d9eefa0081b0de081..94dec90b7e7b5e50ef2f95e72655671731168511 100644 (file)
@@ -1560,7 +1560,7 @@ static void httpd_ClientRecv(httpd_client_t *cl)
                             break;
                         }
                         default:
-                            assert(0);
+                            vlc_assert_unreachable();
                     }
                     i_len = 0; /* drop */
                 }
index 07fa71eb3e4926d52212f19ecc7ec60a310daf5e..06728ceb4b421da0b6c892b96d00cb534b1e96da 100644 (file)
@@ -829,7 +829,7 @@ void vlc_testcancel (void)
 void vlc_control_cancel (int cmd, ...)
 {
     (void) cmd;
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 /**
index 71ca080bb5e99eaeaa82148e86cab5762b066a92..a237679c7cb447452ea0bacea8bb3398e0fba81b 100644 (file)
@@ -95,7 +95,7 @@ static void *vlc_timer_thread (void *data)
     }
 
     vlc_cleanup_pop ();
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 /**
index 0a7874835026eb3e76da156eb14fe71260fea686..23d05286b0f8016c0ffc78d12a5ef7097b23c8c1 100644 (file)
@@ -160,7 +160,7 @@ static void *RunThread (void *self)
     }
 
     vlc_cleanup_pop ();
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 #undef sout_AnnounceRegisterSDP
@@ -310,7 +310,7 @@ sout_AnnounceRegisterSDP (vlc_object_t *obj, const char *sdp,
             length += 4;
             break;
         default:
-            assert (0);
+            vlc_assert_unreachable ();
     }
 
     /* XXX: Check for dupes */
index 5063e78dad72f69222a432ace1f8844cc829afda..33f30d4e961d216afa896aed2983d80c7a0671c3 100644 (file)
@@ -499,7 +499,7 @@ char *str_format_time( const char *tformat )
         }
         free (str);
     }
-    assert (0);
+    vlc_assert_unreachable ();
 }
 
 static void write_duration(FILE *stream, int64_t duration)
index 25215d7ffc0934d12a20c935ca2ee9dcaa74b4f9..feac99980e6fbc9d863d0dd34cca2f553e60c65a 100644 (file)
@@ -155,7 +155,7 @@ size_t vlc_towc (const char *str, uint32_t *restrict pwc)
             break;
 
         default:
-            assert (0);
+            vlc_assert_unreachable ();
     }
 
     /* Unrolled continuation bytes decoding */
index 4c1b1333cf02d5cac33bcb39754d5f5a0cb14cef..3e3a3d5c7a599fcc30c04f0b73a9d3c86e81d388 100644 (file)
@@ -544,7 +544,7 @@ static void VoutDisplayEventMouse(vout_display_t *vd, int event, va_list args)
         m.b_double_click = true;
         break;
     default:
-        assert(0);
+        vlc_assert_unreachable();
     }
 
     if (is_ignored) {
index 0ec1087340f747e7e51cb019d679b83fa1b5f4ee..fbb48b60a16e070de3afbdd99dfe3e9f02ec7a61 100644 (file)
@@ -122,5 +122,5 @@ char *config_GetUserDir (vlc_userdir_t type)
         case VLC_VIDEOS_DIR:
             return config_GetShellDir (CSIDL_MYVIDEO);
     }
-    assert (0);
+    vlc_assert_unreachable ();
 }