for( ptr = psz_url; *ptr; ptr++ )
{
- char c = *ptr;
+ unsigned char c = *ptr;
if( c == '%' )
{
- if( !isxdigit( ptr[1] ) || !isxdigit( ptr[2] ) )
+ if( !isxdigit( (unsigned char)ptr[1] )
+ || !isxdigit( (unsigned char)ptr[2] ) )
return 1; /* not encoded */
ptr += 2;
}
HANDLE( MEDIA_NEXT_TRACK );
default:
- i_vk = toupper( i_key & ~KEY_MODIFIER );
+ i_vk = toupper( (uint8_t)(i_key & ~KEY_MODIFIER) );
break;
}
if( !i_vk ) continue;
if( encoding_type == 1 )
{
- if( isxdigit( **input ) == 0 )
+ if( isxdigit( (unsigned char)**input ) == 0 )
return -1;
- if( isdigit( **input ) == 0 )
- *output = (toupper( **input ) - 7) * 16;
+ if( isdigit( (unsigned char)**input ) == 0 )
+ *output = (toupper( (unsigned char)**input ) - 7) * 16;
else
*output = **input * 16;
(*input)++;
- if( isxdigit( **input ) == 0 )
+ if( isxdigit( (unsigned char)**input ) == 0 )
return -1;
- if( isdigit( **input ) == 0 )
- *output |= toupper( **input ) - 0x37;
+ if( isdigit( (unsigned char)**input ) == 0 )
+ *output |= toupper( (unsigned char)**input ) - 0x37;
else
*output |= **input - 0x30;
s = SkipBlanks(s, i_strlen);
val = 0;
- while( (s < end) && isdigit(*s) )
+ while( (s < end) && isdigit((unsigned char)*s) )
{
int newval = val*10 + (*s - '0');
if( newval < val )
s = SkipBlanks(s, end-s);
result = result * 60;
val = 0;
- while( (s < end) && isdigit(*s) )
+ while( (s < end) && isdigit((unsigned char)*s) )
{
int newval = val*10 + (*s - '0');
if( newval < val )
s = SkipBlanks(s, end-s);
result = result * 60;
val = 0;
- while( (s < end) && isdigit(*s) )
+ while( (s < end) && isdigit((unsigned char)*s) )
{
int newval = val*10 + (*s - '0');
if( newval < val )
goto uri;
#if defined( WIN32 ) || defined( __OS2__ )
/* Drive letter (this assumes URL scheme are not a single character) */
- if( isalpha(psz_mrl[0]) && psz_mrl[1] == ':' )
+ if( isalpha((unsigned char)psz_mrl[0]) && psz_mrl[1] == ':' )
goto uri;
#endif
if( strstr( psz_mrl, "://" ) )
s = SkipBlanks(s, i_strlen);
val = 0;
- while( (s < end) && isdigit(*s) )
+ while( (s < end) && isdigit((unsigned char)*s) )
{
int newval = val*10 + (*s - '0');
if( newval < val )
s = SkipBlanks(s, end-s);
result = result * 60;
val = 0;
- while( (s < end) && isdigit(*s) )
+ while( (s < end) && isdigit((unsigned char)*s) )
{
int newval = val*10 + (*s - '0');
if( newval < val )
s = SkipBlanks(s, end-s);
result = result * 60;
val = 0;
- while( (s < end) && isdigit(*s) )
+ while( (s < end) && isdigit((unsigned char)*s) )
{
int newval = val*10 + (*s - '0');
if( newval < val )
strcpy( psz_text, s );
- switch( toupper( psz_text[1] ) )
+ switch( toupper( (unsigned char)psz_text[1] ) )
{
case 'S':
- shift = isalpha( psz_text[2] ) ? 6 : 2 ;
+ shift = isalpha( (unsigned char)psz_text[2] ) ? 6 : 2 ;
if( sscanf( &psz_text[shift], "%d", &h ) )
{
break;
case 'T':
- shift = isalpha( psz_text[2] ) ? 8 : 2 ;
+ shift = isalpha( (unsigned char)psz_text[2] ) ? 8 : 2 ;
sscanf( &psz_text[shift], "%d", &p_sys->jss.i_time_resolution );
break;
while( *psz_text == ' ' || *psz_text == '\t' ) psz_text++;
/* Parse the directives */
- if( isalpha( *psz_text ) || *psz_text == '[' )
+ if( isalpha( (unsigned char)*psz_text ) || *psz_text == '[' )
{
while( *psz_text != ' ' )
{ psz_text++ ;};
psz_text2++;
break;
}
- if( ( toupper(*(psz_text + 1 ) ) == 'C' ) ||
- ( toupper(*(psz_text + 1 ) ) == 'F' ) )
+ if( ( toupper((unsigned char)*(psz_text + 1 ) ) == 'C' ) ||
+ ( toupper((unsigned char)*(psz_text + 1 ) ) == 'F' ) )
{
psz_text++; psz_text++;
break;
// Convert to lower case because of some buggy winamp2 skins
for( size_t i = 0; i < name.size(); i++ )
{
- name[i] = tolower( name[i] );
+ name[i] = tolower( (unsigned char)name[i] );
}
// Register the value in the var manager
// use the wrong case...
if( isWsz )
for( size_t i = 0; i < strlen( filenameInZip ); i++ )
- filenameInZip[i] = tolower( filenameInZip[i] );
+ filenameInZip[i] = tolower( (unsigned char)filenameInZip[i] );
// Allocate the buffer
void *pBuffer = malloc( ZIP_BUFFER_SIZE );
string shortname = name.substr( 0, name.size() - 4 );
for( string::size_type i = 0; i < shortname.size(); i++ )
shortname[i] = ( i == 0 ) ?
- toupper( shortname[i] ) :
- tolower( shortname[i] );
+ toupper( (unsigned char)shortname[i] ) :
+ tolower( (unsigned char)shortname[i] );
m_skinsMap[shortname] = path;
msg_Dbg( getIntf(), "found skin %s", path.c_str() );
if( !key )
{
// This appears to be a "normal" (ascii) key
- key = tolower( MapVirtualKey( wParam, 2 ) );
+ key = tolower( (unsigned char)MapVirtualKey( wParam, 2 ) );
}
if( key )
if ( strncmp( p_sys->psz_language, psz_language, 3 ) )
msg_Dbg( p_stream, "changing language to %s", psz_language );
- strncpy( p_sys->psz_language, psz_language, 3 );
+ strncpy( p_sys->psz_language, (const char *)psz_language, 3 );
}
/*****************************************************************************
sdp_AddAttribute( &psz_sdp, "setup", "passive" );
if( p_sys->proto == IPPROTO_DCCP )
sdp_AddAttribute( &psz_sdp, "dccp-service-code",
- "SC:RTP%c", toupper( mime_major[0] ) );
+ "SC:RTP%c",
+ toupper( (unsigned char)mime_major[0] ) );
}
}
out:
{
char *p_char = p_buffer->p_begin;
- while( isspace( p_char[0] ) || p_char[0] == '\0' )
+ while( isspace( (unsigned char)p_char[0] ) || p_char[0] == '\0' )
{
if( p_char <= (p_buffer->p_begin + p_buffer->i_length) )
p_char++;
{
char *psz_temp = *psz_command;
- while( isspace( *psz_temp ) )
+ while( isspace( (unsigned char)*psz_temp ) )
{
++psz_temp;
}
{
/* Parse: 0 128 128 RGBA 9404459 */
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_width ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_height ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isascii( *psz_command ) )
+ if( isascii( (unsigned char)*psz_command ) )
{
if( parse_char( &psz_command, &psz_end, 4, (char*)&p_params->fourcc )
== VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_shmid ) == VLC_EGENERIC )
return VLC_EGENERIC;
{
VLC_UNUSED(psz_end);
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
return VLC_EGENERIC;
{
VLC_UNUSED(psz_end);
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_alpha ) == VLC_EGENERIC )
return VLC_EGENERIC;
{
VLC_UNUSED(psz_end);
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_x ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_y ) == VLC_EGENERIC )
return VLC_EGENERIC;
{
VLC_UNUSED(psz_end);
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->fontstyle.i_font_alpha ) == VLC_EGENERIC )
return VLC_EGENERIC;
VLC_UNUSED(psz_end);
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &r ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &g ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &b ) == VLC_EGENERIC )
return VLC_EGENERIC;
{
VLC_UNUSED(psz_end);
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->fontstyle.i_font_size ) == VLC_EGENERIC )
return VLC_EGENERIC;
{
VLC_UNUSED(psz_end);
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
if( parse_digit( &psz_command, &p_params->i_id ) == VLC_EGENERIC )
return VLC_EGENERIC;
}
skip_space( &psz_command );
- if( isdigit( *psz_command ) )
+ if( isdigit( (unsigned char)*psz_command ) )
{
int32_t i_vis = 0;
if( parse_digit( &psz_command, &i_vis ) == VLC_EGENERIC )
if( !i_key )
{
/* This appears to be a "normal" (ascii) key */
- i_key = tolower( MapVirtualKey( msg.wParam, 2 ) );
+ i_key = tolower( (unsigned char)MapVirtualKey( msg.wParam, 2 ) );
}
if( i_key )
/* Check we are really dealing with a title/chapter section */
psz_check = psz + 1;
if( !*psz_check ) return;
- if( isdigit(*psz_check) )
+ if( isdigit((unsigned char)*psz_check) )
if(!next(&psz_check)) return;
if( *psz_check != ':' && *psz_check != '-' && *psz_check ) return;
if( *psz_check == ':' && ++psz_check )
{
- if( isdigit(*psz_check) )
+ if( isdigit((unsigned char)*psz_check) )
if(!next(&psz_check)) return;
}
if( *psz_check != '-' && *psz_check ) return;
if( *psz_check == '-' && ++psz_check )
{
- if( isdigit(*psz_check) )
+ if( isdigit((unsigned char)*psz_check) )
if(!next(&psz_check)) return;
}
if( *psz_check != ':' && *psz_check ) return;
if( *psz_check == ':' && ++psz_check )
{
- if( isdigit(*psz_check) )
+ if( isdigit((unsigned char)*psz_check) )
if(!next(&psz_check)) return;
}
if( *psz_check ) return;
static void strcpy_trim( char *d, const char *s )
{
+ unsigned char c;
+
/* skip leading whitespace */
- while( *s && !isalnum(*s) )
+ while( ((c = *s) != '\0') && !isalnum(c) )
{
s++;
}
for(;;)
{
/* copy word */
- while( *s && isalnum(*s) )
+ while( ((c = *s) != '\0') && isalnum(c) )
{
- *d = tolower(*s);
+ *d = tolower(c);
s++; d++;
}
if( *s == 0 ) break;
/* trim excess whitespace */
- while( *s && !isalnum(*s) )
+ while( ((c = *s) != '\0') && !isalnum(c) )
{
s++;
}
static void strcpy_strip_ext( char *d, const char *s )
{
+ unsigned char c;
+
const char *tmp = strrchr(s, '.');
if( !tmp )
{
}
else
strlcpy(d, s, tmp - s + 1 );
- while( *d )
+ while( (c = *d) != '\0' )
{
- *d = tolower(*d);
+ *d = tolower(c);
d++;
}
}
static int whiteonly( const char *s )
{
- while( *s )
+ unsigned char c;
+
+ while( (c = *s) != '\0' )
{
- if( isalnum( *s ) )
+ if( isalnum( c ) )
return 0;
s++;
}
psz_mux = p_cfg->vod.psz_mux;
es_format_t es, *p_es = &es;
- union { char text[5]; uint32_t value; } fourcc;
+ union {
+ char text[5];
+ unsigned char utext[5];
+ uint32_t value;
+ } fourcc;
sprintf( fourcc.text, "%4.4s", psz_mux );
- fourcc.text[0] = tolower(fourcc.text[0]);
- fourcc.text[1] = tolower(fourcc.text[1]);
- fourcc.text[2] = tolower(fourcc.text[2]);
- fourcc.text[3] = tolower(fourcc.text[3]);
+ for( int i = 0; i < 4; i++ )
+ fourcc.utext[i] = tolower(fourcc.utext[i]);
item.i_es = 1;
item.es = &p_es;
*/
static const char *FindCommandEnd( const char *psz_sent )
{
- char c, quote = 0;
+ unsigned char c, quote = 0;
while( (c = *psz_sent) != '\0' )
{
*/
static int Unescape( char *out, const char *in )
{
- char c, quote = 0;
+ unsigned char c, quote = 0;
bool param = false;
while( (c = *in++) != '\0' )
{
const char *psz_temp;
- if(isspace (*psz_command))
+ if(isspace ((unsigned char)*psz_command))
{
psz_command++;
continue;
psz_ip = line;
/* skips blanks - cannot overflow given '\0' is not space */
- while( isspace( *psz_ip ) )
+ while( isspace( (unsigned char)*psz_ip ) )
psz_ip++;
if( *psz_ip == '\0' ) /* empty/blank line */
}
/* look for first space, CR, LF, etc. or comment character */
- for( ptr = psz_ip; ( *ptr!='#' ) && !isspace( *ptr ) && *ptr; ++ptr );
+ for( ptr = psz_ip; ( *ptr!='#' ) && !isspace( (unsigned char)*ptr ) && *ptr; ++ptr );
*ptr = '\0';
char *buf;
#if defined( WIN32 ) || defined( __OS2__ )
/* Drive letter */
- if (isalpha (path[0]) && (path[1] == ':'))
+ if (isalpha ((unsigned char)path[0]) && (path[1] == ':'))
{
if (asprintf (&buf, "%s:///%c:", scheme ? scheme : "file",
path[0]) == -1)