/* */
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;
/* */
/* */
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;
/* */
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" );
/* "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;
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;
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;
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 )
{
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,
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;
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 );
}
}
}
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
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';
{
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 */
{
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 */
{
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"))
{
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 );
}
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 );
}
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;
}
/* 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;
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 );
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 )
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;
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;
* 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 )
{
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 */
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;
}
/**
"<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)
{
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);
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" );
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)
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");
{
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;
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
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 )
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 );
}