]> git.sesse.net Git - vlc/commitdiff
Avoid ?: GCC-ism
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 17 May 2009 08:16:03 +0000 (11:16 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 17 May 2009 08:18:03 +0000 (11:18 +0300)
20 files changed:
modules/access/dvb/linux_dvb.c
modules/access/ftp.c
modules/access/http.c
modules/access/v4l2.c
modules/access/vcd/cdrom.c
modules/access_output/udp.c
modules/codec/subtitles/subsdec.c
modules/demux/ts.c
modules/services_discovery/sap.c
modules/stream_out/transcode.c
modules/video_filter/postproc.c
modules/video_output/msw/direct3d.c
src/misc/filter_chain.c
src/misc/variables.c
src/modules/modules.c
src/network/httpd.c
src/network/io.c
src/network/tcp.c
src/network/udp.c
src/video_output/video_output.c

index 2654fd1604103f580fe97954e77c604c705584eb..acab3d8868838bfb01a48de7ca2c8588f66ccf14 100644 (file)
@@ -414,7 +414,8 @@ static int ScanParametersDvbC( access_t *p_access, scan_parameter_t *p_scan )
     /* */
     p_scan->frequency.i_min = p_frontend->info.frequency_min;
     p_scan->frequency.i_max = p_frontend->info.frequency_max;
-    p_scan->frequency.i_step = p_frontend->info.frequency_stepsize ?: 166667;
+    p_scan->frequency.i_step = p_frontend->info.frequency_stepsize
+        ? p_frontend->info.frequency_stepsize : 166667;
     p_scan->frequency.i_count = (p_scan->frequency.i_max-p_scan->frequency.i_min)/p_scan->frequency.i_step;
 
     /* */
@@ -436,7 +437,8 @@ static int ScanParametersDvbT( access_t *p_access, scan_parameter_t *p_scan )
     /* */
     p_scan->frequency.i_min = p_frontend->info.frequency_min;
     p_scan->frequency.i_max = p_frontend->info.frequency_max;
-    p_scan->frequency.i_step = p_frontend->info.frequency_stepsize ?: 166667;
+    p_scan->frequency.i_step = p_frontend->info.frequency_stepsize
+        ? p_frontend->info.frequency_stepsize : 166667;
     p_scan->frequency.i_count = (p_scan->frequency.i_max-p_scan->frequency.i_min)/p_scan->frequency.i_step;
 
     /* */
index c6ac6df16325a3fd8449651f204219d8dcb63193..b3dc2c911bb1a7aa9a1438c121d03c7ac9641a84 100644 (file)
@@ -334,12 +334,14 @@ static int InOpen( vlc_object_t *p_this )
         goto exit_error;
 
     /* get size */
-    if( ftp_SendCommand( p_this, p_sys, "SIZE %s", p_sys->url.psz_path ? : "" ) < 0 ||
-        ftp_ReadCommand( p_this, p_sys, NULL, &psz_arg ) != 2 )
+    if( ftp_SendCommand( p_this, p_sys, "SIZE %s", p_sys->url.psz_path
+                                               ? p_sys->url.psz_path : "" ) < 0
+     || ftp_ReadCommand( p_this, p_sys, NULL, &psz_arg ) != 2 )
     {
         msg_Dbg( p_access, "cannot get file size" );
         msg_Dbg( p_access, "will try to get directory contents" );
-        if( ftp_SendCommand( p_this, p_sys, "CWD %s", p_sys->url.psz_path ?: "" ) < 0 ||
+        if( ftp_SendCommand( p_this, p_sys, "CWD %s", p_sys->url.psz_path
+                             ? p_sys->url.psz_path : "" ) < 0 ||
         ftp_ReadCommand( p_this, p_sys, NULL, &psz_arg ) != 2 )
         {
             msg_Err( p_access, "file or directory doesn't exist" );
@@ -799,8 +801,8 @@ static int ftp_StartStream( vlc_object_t *p_access, access_sys_t *p_sys,
         /* "1xx" message */
         if( ftp_SendCommand( p_access, p_sys, "%s %s",
                              p_sys->out ? "STOR" : "RETR",
-                             p_sys->url.psz_path ?: "" ) < 0 ||
-            ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) > 2 )
+                           p_sys->url.psz_path ? p_sys->url.psz_path : "" ) < 0
+         || ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) > 2 )
         {
             msg_Err( p_access, "cannot retrieve file" );
             return VLC_EGENERIC;
index f94d7cd81ec66683dc8bb2bbbae8ebdba50e6bc8..16544e1c3e2eda47dde3019c655b051ae3b24006 100644 (file)
@@ -248,7 +248,7 @@ static int OpenWithCookies( vlc_object_t *p_this, vlc_array_t *cookies )
     char         *psz, *p;
     /* Only forward an store cookies if the corresponding option is activated */
     bool   b_forward_cookies = var_CreateGetBool( p_access, "http-forward-cookies" );
-    vlc_array_t * saved_cookies = b_forward_cookies ? (cookies ?: vlc_array_new()) : NULL;
+    vlc_array_t * saved_cookies = b_forward_cookies ? (cookies ? cookies : vlc_array_new()) : NULL;
 
     /* Set up p_access */
     STANDARD_READ_ACCESS_INIT;
@@ -1735,8 +1735,8 @@ static char *AuthDigest( access_t *p_access, vlc_url_t *p_url,
                          http_auth_t *p_auth, const char *psz_method )
 {
     (void)p_access;
-    const char *psz_username = p_url->psz_username ?: "";
-    const char *psz_password = p_url->psz_password ?: "";
+    const char *psz_username = p_url->psz_username ? p_url->psz_username : "";
+    const char *psz_password = p_url->psz_password ? p_url->psz_password : "";
 
     char *psz_HA1 = NULL;
     char *psz_HA2 = NULL;
@@ -1843,8 +1843,8 @@ static void AuthReply( access_t *p_access, const char *psz_prefix,
     access_sys_t *p_sys = p_access->p_sys;
     v_socket_t     *pvs = p_sys->p_vs;
 
-    const char *psz_username = p_url->psz_username ?: "";
-    const char *psz_password = p_url->psz_password ?: "";
+    const char *psz_username = p_url->psz_username ? p_url->psz_username : "";
+    const char *psz_password = p_url->psz_password ? p_url->psz_password : "";
 
     if( p_auth->psz_nonce )
     {
@@ -1892,20 +1892,20 @@ static void AuthReply( access_t *p_access, const char *psz_prefix,
                     psz_username,
                     p_auth->psz_realm,
                     p_auth->psz_nonce,
-                    p_url->psz_path ?: "/",
+                    p_url->psz_path ? p_url->psz_path : "/",
                     psz_response,
                     /* Optional parameters */
                     p_auth->psz_algorithm ? "algorithm=\"" : "",
-                    p_auth->psz_algorithm ?: "",
+                    p_auth->psz_algorithm ? p_auth->psz_algorithm : "",
                     p_auth->psz_algorithm ? "\", " : "",
                     p_auth->psz_cnonce ? "cnonce=\"" : "",
-                    p_auth->psz_cnonce ?: "",
+                    p_auth->psz_cnonce ? p_auth->psz_cnonce : "",
                     p_auth->psz_cnonce ? "\", " : "",
                     p_auth->psz_opaque ? "opaque=\"" : "",
-                    p_auth->psz_opaque ?: "",
+                    p_auth->psz_opaque ? p_auth->psz_opaque : "",
                     p_auth->psz_opaque ? "\", " : "",
                     p_auth->psz_qop ? "qop=\"" : "",
-                    p_auth->psz_qop ?: "",
+                    p_auth->psz_qop ? p_auth->psz_qop : "",
                     p_auth->psz_qop ? "\", " : "",
                     p_auth->i_nonce ? "nc=\"" : "uglyhack=\"", /* Will be parsed as an unhandled extension */
                     p_auth->i_nonce,
index 0e9b5b6a9b379e0da8db00101be7d0bd107bd368..c52fa87f4f55351960176c3fe16c03a660122d26 100644 (file)
@@ -2958,7 +2958,8 @@ static int ControlReset( vlc_object_t *p_obj, demux_sys_t *p_sys, int i_fd )
                     if( controls[i].i_cid == queryctrl.id ) break;
                 name2var( queryctrl.name );
                 Control( p_obj, p_sys, i_fd,
-                         controls[i].psz_name ? : (const char *)queryctrl.name,
+                         controls[i].psz_name ? controls[i].psz_name
+                          : (const char *)queryctrl.name,
                          queryctrl.id, queryctrl.default_value );
             }
             queryctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
@@ -2988,7 +2989,8 @@ static int ControlReset( vlc_object_t *p_obj, demux_sys_t *p_sys, int i_fd )
                         if( controls[i].i_cid == queryctrl.id ) break;
                     name2var( queryctrl.name );
                     Control( p_obj, p_sys, i_fd,
-                             controls[i].psz_name ? : (const char *)queryctrl.name,
+                             controls[i].psz_name ? controls[i].psz_name
+                              : (const char *)queryctrl.name,
                              queryctrl.id, queryctrl.default_value );
                 }
             }
index 22b29de37c0b6f184760d62059983de19badf99c..a8d0f4dfeae097fdcb0f7c610cfe7c821c2c010d 100644 (file)
@@ -1362,13 +1362,16 @@ static int CdTextParse( vlc_meta_t ***ppp_tracks, int *pi_tracks,
                 }
                 break;
             case 0x01: /* Performer */
-                vlc_meta_SetArtist( p_track, psz_value ?: psz_default );
+                vlc_meta_SetArtist( p_track,
+                                    psz_value ? psz_value : psz_default );
                 break;
             case 0x05: /* Messages */
-                vlc_meta_SetDescription( p_track, psz_value ?: psz_default );
+                vlc_meta_SetDescription( p_track,
+                                         psz_value ? psz_value : psz_default );
                 break;
             case 0x07: /* Genre */
-                vlc_meta_SetGenre( p_track, psz_value ?: psz_default );
+                vlc_meta_SetGenre( p_track,
+                                   psz_value ? psz_value : psz_default );
                 break;
             /* FIXME unsupported:
              * 0x02: songwriter
index d9782ca4236c2b7d9d137520bea6c2a757d24606..dae64f1e477c6adf1f2a42e85680276a67252dc7 100644 (file)
@@ -175,7 +175,7 @@ static int Open( vlc_object_t *p_this )
     if (psz_parser[0] == '[')
         psz_parser = strchr (psz_parser, ']');
 
-    psz_parser = strchr (psz_parser ?: psz_dst_addr, ':');
+    psz_parser = strchr (psz_parser ? psz_parser : psz_dst_addr, ':');
     if (psz_parser != NULL)
     {
         *psz_parser++ = '\0';
index 5bd43a51eb09ca4f8a98f83d43ffc36a7e93c86c..aa5ca570d66a0dcc1690dd4ec60ba2f80e658ce8 100644 (file)
@@ -269,7 +269,8 @@ static int OpenDecoder( vlc_object_t *p_this )
     {
         psz_charset = strdup (p_dec->fmt_in.subs.psz_encoding);
         msg_Dbg (p_dec, "trying demuxer-specified character encoding: %s",
-                 p_dec->fmt_in.subs.psz_encoding ?: "not specified");
+                 p_dec->fmt_in.subs.psz_encoding ?
+                 p_dec->fmt_in.subs.psz_encoding : "not specified");
     }
 
     /* Second, try configured encoding */
@@ -277,7 +278,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     {
         psz_charset = var_CreateGetNonEmptyString (p_dec, "subsdec-encoding");
         msg_Dbg (p_dec, "trying configured character encoding: %s",
-                 psz_charset ?: "not specified");
+                 psz_charset ? psz_charset : "not specified");
     }
 
     /* Third, try "local" encoding with optional UTF-8 autodetection */
@@ -285,7 +286,7 @@ static int OpenDecoder( vlc_object_t *p_this )
     {
         psz_charset = strdup (GetFallbackEncoding ());
         msg_Dbg (p_dec, "trying default character encoding: %s",
-                 psz_charset ?: "not specified");
+                 psz_charset ? psz_charset : "not specified");
 
         if (var_CreateGetBool (p_dec, "subsdec-autodetect-utf8"))
         {
index 5493c47ef807cc5273564304f20bf608ab66cf60..b80031b68a845ba780f01a18b70ee466c353d7b5 100644 (file)
@@ -3217,7 +3217,8 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_pid_t *pid,
             ts_teletext_page_t *p_dst = &p_page[i_page++];
 
             p_dst->i_type = p_src->i_teletext_type;
-            p_dst->i_magazine = p_src->i_teletext_magazine_number ? : 8;
+            p_dst->i_magazine = p_src->i_teletext_magazine_number
+                ? p_src->i_teletext_magazine_number : 8;
             p_dst->i_page = p_src->i_teletext_page_number;
             memcpy( p_dst->p_iso639, p_src->i_iso6392_language_code, 3 );
         }
@@ -3250,7 +3251,8 @@ static void PMTSetupEsTeletext( demux_t *p_demux, ts_pid_t *pid,
                 break;
             }
             /* FIXME check if it is the right split */
-            p_dst->i_magazine = (p_src->i_composition_page_id >> 8) ? : 8;
+            p_dst->i_magazine = (p_src->i_composition_page_id >> 8)
+                ? (p_src->i_composition_page_id >> 8) : 8;
             p_dst->i_page = p_src->i_composition_page_id & 0xff;
             memcpy( p_dst->p_iso639, p_src->i_iso6392_language_code, 3 );
         }
index a43a89233c831728ae51086894f228ab3199eba4..2e1d070fccd11a3f05ecef278a7672ae2b642dc7 100644 (file)
@@ -918,9 +918,11 @@ static const char *FindAttribute (const sdp_t *sdp, unsigned media,
                                   const char *name)
 {
     /* Look for media attribute, and fallback to session */
-    return GetAttribute (sdp->mediav[media].pp_attributes,
-                         sdp->mediav[media].i_attributes, name)
-        ?: GetAttribute (sdp->pp_attributes, sdp->i_attributes, name);
+    const char *attr = GetAttribute (sdp->mediav[media].pp_attributes,
+                                     sdp->mediav[media].i_attributes, name);
+    if (attr == NULL)
+        attr = GetAttribute (sdp->pp_attributes, sdp->i_attributes, name);
+    return attr;
 }
 
 
index bc66396838b4d51f3f931cc3e356fc40f47e24e0..b4bf89136ab1126212cc4a0286783aac5d89a22c 100644 (file)
@@ -1492,11 +1492,15 @@ static int transcode_video_new( sout_stream_t *p_stream, sout_stream_id_t *id )
     /* The dimensions will be set properly later on.
      * Just put sensible values so we can test an encoder is available. */
     id->p_encoder->fmt_in.video.i_width =
-        id->p_encoder->fmt_out.video.i_width ?:
-        id->p_decoder->fmt_in.video.i_width ?: 16;
+        id->p_encoder->fmt_out.video.i_width
+          ? id->p_encoder->fmt_out.video.i_width
+          : id->p_decoder->fmt_in.video.i_width
+            ? id->p_decoder->fmt_in.video.i_width : 16;
     id->p_encoder->fmt_in.video.i_height =
-        id->p_encoder->fmt_out.video.i_height ?:
-        id->p_decoder->fmt_in.video.i_height ?: 16;
+        id->p_encoder->fmt_out.video.i_height
+          ? id->p_encoder->fmt_out.video.i_height
+          : id->p_decoder->fmt_in.video.i_height
+            ? id->p_decoder->fmt_in.video.i_height : 16;
     id->p_encoder->fmt_in.video.i_frame_rate = ENC_FRAMERATE;
     id->p_encoder->fmt_in.video.i_frame_rate_base = ENC_FRAMERATE_BASE;
 
index db9e56d0e54f645d63d8207be8b73c6ab15f0510..427e973798413dcc63c76cfaa1ebc42354297e92 100644 (file)
@@ -197,7 +197,8 @@ static int OpenPostproc( vlc_object_t *p_this )
     var_AddCallback( p_filter, FILTER_PREFIX "name", PPNameCallback, NULL );
     if( val_orig.i_int )
     {
-        p_sys->pp_mode = pp_get_mode_by_name_and_quality( val.psz_string?:
+        p_sys->pp_mode = pp_get_mode_by_name_and_quality( val.psz_string ?
+                                                          val.psz_string :
                                                           "default",
                                                           val_orig.i_int );
 
@@ -328,7 +329,8 @@ static void PPChangeMode( filter_t *p_filter, const char *psz_name,
     vlc_mutex_lock( &p_sys->lock );
     if( i_quality > 0 )
     {
-        pp_mode_t *pp_mode = pp_get_mode_by_name_and_quality( psz_name?:
+        pp_mode_t *pp_mode = pp_get_mode_by_name_and_quality( psz_name ?
+                                                              psz_name :
                                                               "default",
                                                               i_quality );
         if( pp_mode )
index dcb73107bca90fae92ccb8f68b848d847169beb4..6435154de92ad388439666af3a9666aa4794bc28 100644 (file)
@@ -1031,7 +1031,8 @@ static int Direct3DVoutCreatePictures( vout_thread_t *p_vout, size_t i_num_pics
     HRESULT hr;
     size_t c;
     // if vout is already running, use current chroma, otherwise choose from upstream
-    int i_chroma = p_vout->output.i_chroma ? : p_vout->render.i_chroma;
+    int i_chroma = p_vout->output.i_chroma ? p_vout->output.i_chroma
+                                           : p_vout->render.i_chroma;
 
     I_OUTPUTPICTURES = 0;
 
index 7061c929f20018c68a2cfffe20711c263fd692ae..c2b14f9f3183f3873e7d6dccc762305401cf2875 100644 (file)
@@ -344,7 +344,7 @@ static filter_t *filter_chain_AppendFilterInternal( filter_chain_t *p_chain,
     vlc_array_append( &p_chain->filters, p_filter );
 
     msg_Dbg( p_chain->p_this, "Filter '%s' (%p) appended to chain",
-             psz_name?:p_filter->psz_object_name, p_filter );
+             psz_name ? psz_name : p_filter->psz_object_name, p_filter );
 
     return p_filter;
 
index 80caffffe734f6131b4981ff9659aedcfae6a64c..1242431c222e59920bb2bc463dac9af9297ed504 100644 (file)
@@ -68,7 +68,10 @@ static int CmpAddress( vlc_value_t v, vlc_value_t w ) { return v.p_address == w.
  * Local duplication functions, and local deallocation functions
  *****************************************************************************/
 static void DupDummy( vlc_value_t *p_val ) { (void)p_val; /* unused */ }
-static void DupString( vlc_value_t *p_val ) { p_val->psz_string = strdup( p_val->psz_string ?: ""); }
+static void DupString( vlc_value_t *p_val )
+{
+    p_val->psz_string = strdup( p_val->psz_string ? p_val->psz_string :  "" );
+}
 
 static void DupList( vlc_value_t *p_val )
 {
@@ -1407,8 +1410,9 @@ static int InheritValue( vlc_object_t *p_this, const char *psz_name,
             p_var->ops->pf_dup( p_val );
 
             /*msg_Dbg( p_this, "Inherited value for var %s from object %s",
-                     psz_name ? : "(null)",
-                     p_this->psz_object_name ? : "(Unknown)" );*/
+                     psz_name ? psz_name : "(null)",
+                     p_this->psz_object_name
+                         ? p_this->psz_object_name : "(Unknown)" );*/
             return VLC_SUCCESS;
         }
         else if ( p_this->p_parent ) /* We are still not there */
index e21323488aa00b4fecd3c7105843510e1b601497..7c1290823bf5e9abcd2b5074ed440b613f942cc8 100644 (file)
@@ -292,7 +292,7 @@ const char *module_get_name( const module_t *m, bool long_name )
     if( long_name && ( m->psz_longname != NULL) )
         return m->psz_longname;
 
-    return m->psz_shortname ?: m->psz_object_name;
+    return m->psz_shortname ? m->psz_shortname : m->psz_object_name;
 }
 
 /**
index 48e18a9432c4e4012398a9fda49496008b5b76f0..7bfc071f04a2e7ad0bdd0a3fb1e7a1a81b03e65d 100644 (file)
@@ -366,7 +366,7 @@ static size_t httpd_HtmlError (char **body, int code, const char *url)
         "<a href=\"http://www.videolan.org\">VideoLAN</a>\n"
         "</body>\n"
         "</html>\n", errname, code, errname,
-        (url ? " (" : ""), (url ?: ""), (url ? ")" : ""));
+        (url ? " (" : ""), (url ? url : ""), (url ? ")" : ""));
 
     if (res == -1)
     {
index 6b62d902ff6eac1affbdd316685202651d07ce6c..313e0e8a9494ce83aa46d4ca5ba638d060e0832c 100644 (file)
@@ -219,8 +219,8 @@ int *net_Listen (vlc_object_t *p_this, const char *psz_host,
             net_Close (fd);
 #if !defined(WIN32) && !defined(UNDER_CE)
             fd = rootwrap_bind (ptr->ai_family, socktype,
-                                protocol ?: ptr->ai_protocol, ptr->ai_addr,
-                                ptr->ai_addrlen);
+                                protocol ? protocol : ptr->ai_protocol,
+                                ptr->ai_addr, ptr->ai_addrlen);
             if (fd != -1)
             {
                 msg_Dbg (p_this, "got socket %d from rootwrap", fd);
index b509b66b339057641f5f39aff1a19fcbb20439c0..0fabdd0afab905728d421f5905e4c07657242b84 100644 (file)
@@ -153,8 +153,9 @@ int __net_Connect( vlc_object_t *p_this, const char *psz_host, int i_port,
 
     for( ptr = res; ptr != NULL; ptr = ptr->ai_next )
     {
-        int fd = net_Socket( p_this, ptr->ai_family, type ?: ptr->ai_socktype,
-                             proto ?: ptr->ai_protocol );
+        int fd = net_Socket( p_this, ptr->ai_family,
+                             type ? type : ptr->ai_socktype,
+                             proto ? proto : ptr->ai_protocol );
         if( fd == -1 )
         {
             msg_Dbg( p_this, "socket error: %m" );
index f063e2ffbbfd5a39b395117e87216ed9b0c24d15..f3e60981ab1f2d4e39babb83fd9e4ca1bc55d5bd 100644 (file)
@@ -151,7 +151,8 @@ static int net_ListenSingle (vlc_object_t *obj, const char *host, int port,
     if (host && !*host)
         host = NULL;
 
-    msg_Dbg (obj, "net: opening %s datagram port %d", host ?: "any", port);
+    msg_Dbg (obj, "net: opening %s datagram port %d",
+             host ? host : "any", port);
 
     int val = vlc_getaddrinfo (obj, host, port, &hints, &res);
     if (val)
@@ -166,7 +167,7 @@ static int net_ListenSingle (vlc_object_t *obj, const char *host, int port,
     for (const struct addrinfo *ptr = res; ptr != NULL; ptr = ptr->ai_next)
     {
         int fd = net_Socket (obj, ptr->ai_family, ptr->ai_socktype,
-                             protocol ?: ptr->ai_protocol);
+                             protocol ? protocol : ptr->ai_protocol);
         if (fd == -1)
         {
             msg_Dbg (obj, "socket error: %m");
@@ -662,7 +663,7 @@ int __net_ConnectDgram( vlc_object_t *p_this, const char *psz_host, int i_port,
     {
         char *str;
         int fd = net_Socket (p_this, ptr->ai_family, ptr->ai_socktype,
-                             proto ?: ptr->ai_protocol);
+                             proto ? proto : ptr->ai_protocol);
         if (fd == -1)
             continue;
 
@@ -773,7 +774,7 @@ int __net_OpenDgram( vlc_object_t *obj, const char *psz_bind, int i_bind,
     for (struct addrinfo *ptr = loc; ptr != NULL; ptr = ptr->ai_next)
     {
         int fd = net_Socket (obj, ptr->ai_family, ptr->ai_socktype,
-                             protocol ?: ptr->ai_protocol);
+                             protocol ? protocol : ptr->ai_protocol);
         if (fd == -1)
             continue; // usually, address family not supported
 
index 5308c6a77f2d3ac597a815ea21b4ff5ac125e7c0..3c932f69856ca7315c1a3db263b412f0b4a616e0 100644 (file)
@@ -1927,7 +1927,8 @@ static int DeinterlaceCallback( vlc_object_t *p_this, char const *psz_cmd,
     const deinterlace_mode_t *p_mode;
     for( p_mode = &p_deinterlace_mode[0]; p_mode->psz_mode; p_mode++ )
     {
-        if( !strcmp( p_mode->psz_mode, newval.psz_string ?: "" ) )
+        if( !strcmp( p_mode->psz_mode,
+                     newval.psz_string ? newval.psz_string : "" ) )
             break;
     }
     if( !p_mode->psz_mode )
@@ -2023,7 +2024,7 @@ static void DeinterlaceEnable( vout_thread_t *p_vout )
         else if( DeinterlaceIsPresent( p_vout, false ) )
             psz_mode = var_CreateGetNonEmptyString( p_vout, "sout-deinterlace-mode" );
     }
-    var_SetString( p_vout, "deinterlace", psz_mode ?: "" );
+    var_SetString( p_vout, "deinterlace", psz_mode ? psz_mode : "" );
     free( psz_mode );
 }