]> git.sesse.net Git - vlc/commitdiff
Cast or convert <ctype.h> functions it parameters to unsigned char
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 29 Aug 2011 16:10:00 +0000 (19:10 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 29 Aug 2011 16:20:15 +0000 (19:20 +0300)
22 files changed:
include/vlc_url.h
modules/control/globalhotkeys/win32.c
modules/demux/nsc.c
modules/demux/playlist/asx.c
modules/demux/playlist/playlist.c
modules/demux/playlist/ram.c
modules/demux/subtitle.c
modules/gui/skins2/src/ini_file.cpp
modules/gui/skins2/src/theme_loader.cpp
modules/gui/skins2/src/theme_repository.cpp
modules/gui/skins2/win32/win32_loop.cpp
modules/stream_out/langfromtelx.c
modules/stream_out/rtp.c
modules/video_filter/dynamicoverlay/dynamicoverlay_buffer.c
modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
modules/video_output/msw/events.c
src/input/input.c
src/input/subtitles.c
src/input/vlm.c
src/input/vlmshell.c
src/network/acl.c
src/text/strings.c

index 4884ff8b3778336e36a40e58e128efb3efd70dc1..e1d698b65a31863030f2cff71787098adb53270d 100644 (file)
@@ -204,11 +204,12 @@ static inline int vlc_UrlIsNotEncoded( const char *psz_url )
 
     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;
         }
index a5f4a8683e96368a1392c9590c6b2c5e89cf2db0..055b32a6ecb438d2ac178a24427eeddfc610fddb 100644 (file)
@@ -244,7 +244,7 @@ static void *Thread( void *p_data )
             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;
index da1f9f6bf7cdc79a1b90494f219a3be0fd7f23ab..c7b4ed6049a2bd37918080bb88a0e67764e8908f 100644 (file)
@@ -77,21 +77,21 @@ static int load_byte( unsigned char encoding_type,
 
     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;
 
index eb1539a2e8ceb36f8373578ac3bf3af257a4fef3..03bac21fe73d80ffda0798ca0664c565484336c6 100644 (file)
@@ -125,7 +125,7 @@ static int ParseTime(char *s, size_t i_strlen)
     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 )
@@ -145,7 +145,7 @@ static int ParseTime(char *s, size_t i_strlen)
         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 )
@@ -165,7 +165,7 @@ static int ParseTime(char *s, size_t i_strlen)
             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 )
index 408a76a5c16976e597766a67a6b6b2eb833991c7..00b44a38787b2dbd2e349423af9287fc8cb2d5b0 100644 (file)
@@ -198,7 +198,7 @@ char *ProcessMRL( const char *psz_mrl, const char *psz_prefix )
         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, "://" ) )
index 78ad7784a61bd4d5ec047fb0a643fcfaa8ab097d..0ed37722f72ac03b189db8e4c0df9bb759f92c95 100644 (file)
@@ -138,7 +138,7 @@ static int ParseTime( const char *s, size_t i_strlen)
     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 )
@@ -158,7 +158,7 @@ static int ParseTime( const char *s, size_t i_strlen)
         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 )
@@ -178,7 +178,7 @@ static int ParseTime( const char *s, size_t i_strlen)
             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 )
index 7fcd8d6c537a305dc53d5e9935c1213c5e987d71..6c2f9afea548feb8c52c62b00a7688be9ddaccf2 100644 (file)
@@ -1626,10 +1626,10 @@ static int ParseJSS( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
 
             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 ) )
                  {
@@ -1666,7 +1666,7 @@ static int ParseJSS( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
                  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;
@@ -1710,7 +1710,7 @@ static int ParseJSS( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
     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++ ;};
@@ -1767,8 +1767,8 @@ static int ParseJSS( demux_t *p_demux, subtitle_t *p_subtitle, int i_idx )
                 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;
index 58478d2e4c1cc2cc22163061dca150c90bdd96cc..7142da5a3e32c43d2c3896d81974f10199d3436e 100644 (file)
@@ -71,7 +71,7 @@ void IniFile::parseFile()
                 // 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
index b6553fe5bdfdb1a5211cfa60cc16fe9f153dd095..546b15c46117566963bf7cefdded8e54c0933c85 100644 (file)
@@ -191,7 +191,7 @@ bool ThemeLoader::extractFileInZip( unzFile file, const string &rootDir,
     // 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 );
index 27951485ab6bce73d7ebbdc89994360274d46f42..68e7daeada555964e069d1c7013aca1df4112c1b 100644 (file)
@@ -168,8 +168,8 @@ void ThemeRepository::parseDirectory( const string &rDir_locale )
             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() );
index 5af8a8943f630851d1d65dcbdbba866f715ae9f9..fdd9a0dc05ea2bc6f45d8e662618c3d505d858f2 100644 (file)
@@ -262,7 +262,7 @@ LRESULT CALLBACK Win32Loop::processEvent( HWND hwnd, UINT msg,
             if( !key )
             {
                 // This appears to be a "normal" (ascii) key
-                key = tolower( MapVirtualKey( wParam, 2 ) );
+                key = tolower( (unsigned char)MapVirtualKey( wParam, 2 ) );
             }
 
             if( key )
index bc5871d917335230737c5919718d22fa09c973d0..8156cea05278b7c97c74f3b6f973b37559a592cf 100644 (file)
@@ -190,7 +190,7 @@ static void SetLanguage( sout_stream_t *p_stream, char *psz_language )
     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 );
 }
 
 /*****************************************************************************
index 047834fa7adc8704d826a06991f4c7ab2d24ca66..a016ce94a53eb47d27286c79e79b37706edb7387 100644 (file)
@@ -887,7 +887,8 @@ char *SDPGenerate( sout_stream_t *p_stream, const char *rtsp_url )
                 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:
index 3893bc067aab66b88a6166c8cbec82e47a193a5b..45f63740f1d06907a5e5c2a31850aff7e79d83ff 100644 (file)
@@ -60,7 +60,7 @@ char *BufferGetToken( buffer_t *p_buffer )
 {
     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++;
index a7d3b477ab139f637655ea5c1de48e7235c73aa8..73254720070ef3a8db9e5f65e28dd97e15fa5ed4 100644 (file)
@@ -78,7 +78,7 @@ static int skip_space( char **psz_command )
 {
     char *psz_temp = *psz_command;
 
-    while( isspace( *psz_temp ) )
+    while( isspace( (unsigned char)*psz_temp ) )
     {
         ++psz_temp;
     }
@@ -120,32 +120,32 @@ static int parser_DataSharedMem( char *psz_command,
 {
     /* 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;
@@ -158,7 +158,7 @@ static int parser_Id( char *psz_command, char *psz_end,
 {
     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;
@@ -180,13 +180,13 @@ static int parser_SetAlpha( char *psz_command, char *psz_end,
 {
     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;
@@ -199,19 +199,19 @@ static int parser_SetPosition( char *psz_command, char *psz_end,
 {
     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;
@@ -224,13 +224,13 @@ static int parser_SetTextAlpha( char *psz_command, char *psz_end,
 {
     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;
@@ -245,25 +245,25 @@ static int parser_SetTextColor( char *psz_command, char *psz_end,
     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;
@@ -277,13 +277,13 @@ static int parser_SetTextSize( char *psz_command, char *psz_end,
 {
     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;
@@ -296,13 +296,13 @@ static int parser_SetVisibility( char *psz_command, char *psz_end,
 {
     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 )
index c62d7c7a8990b355e5121e989b37b1d6c9f53902..35aa0cb6445257e97898173740013bc85c0a2171 100644 (file)
@@ -367,7 +367,7 @@ static void *EventThread( void *p_this )
             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 )
index 7927480f9224c3a5228ea54a2a5a60d4c087087c..5839e37f12850cf687d26ede7954cd9047a93a2a 100644 (file)
@@ -3115,24 +3115,24 @@ static void MRLSections( input_thread_t *p_input, char *psz_source,
     /* 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;
index 4a65687b24cbb15c51f246c393fc1e733d6080a6..ce1c7513e71fc9911582aad84b4be9ba87c65625 100644 (file)
@@ -66,22 +66,24 @@ static const char const sub_exts[][6] = {
 
 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++;
         }
@@ -93,6 +95,8 @@ static void strcpy_trim( char *d, const char *s )
 
 static void strcpy_strip_ext( char *d, const char *s )
 {
+    unsigned char c;
+
     const char *tmp = strrchr(s, '.');
     if( !tmp )
     {
@@ -101,9 +105,9 @@ static void strcpy_strip_ext( char *d, const char *s )
     }
     else
         strlcpy(d, s, tmp - s + 1 );
-    while( *d )
+    while( (c = *d) != '\0' )
     {
-        *d = tolower(*d);
+        *d = tolower(c);
         d++;
     }
 }
@@ -119,9 +123,11 @@ static void strcpy_get_ext( char *d, const char *s )
 
 static int whiteonly( const char *s )
 {
-    while( *s )
+    unsigned char c;
+
+    while( (c = *s) != '\0' )
     {
-        if( isalnum( *s ) )
+        if( isalnum( c ) )
             return 0;
         s++;
     }
index e66b4ba34869d57d2c8d40bbacb85ad1fd6634b8..013575c3831a937b9a65d59b07b9c81e299f5a63 100644 (file)
@@ -695,13 +695,15 @@ static int vlm_OnMediaUpdate( vlm_t *p_vlm, vlm_media_sys_t *p_media )
                     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;
index 1273b1bab5bc4b7c7b89826957d84dfe7df0f7ad..07b911304745926e3791211f0929c88ba9088c05 100644 (file)
@@ -80,7 +80,7 @@ static const char quotes[] = "\"'";
  */
 static const char *FindCommandEnd( const char *psz_sent )
 {
-    char c, quote = 0;
+    unsigned char c, quote = 0;
 
     while( (c = *psz_sent) != '\0' )
     {
@@ -127,7 +127,7 @@ static const char *FindCommandEnd( const char *psz_sent )
  */
 static int Unescape( char *out, const char *in )
 {
-    char c, quote = 0;
+    unsigned char c, quote = 0;
     bool param = false;
 
     while( (c = *in++) != '\0' )
@@ -856,7 +856,7 @@ int ExecuteCommand( vlm_t *p_vlm, const char *psz_command,
     {
         const char *psz_temp;
 
-        if(isspace (*psz_command))
+        if(isspace ((unsigned char)*psz_command))
         {
             psz_command++;
             continue;
index 9d15a7eb2ad28a77146ab9e5458dd7c5375f93e3..5f594a585c4dd4264cbf518d589a3de3692b7ce8 100644 (file)
@@ -322,7 +322,7 @@ int ACL_LoadFile( vlc_acl_t *p_acl, const char *psz_path )
         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 */
@@ -351,7 +351,7 @@ int ACL_LoadFile( vlc_acl_t *p_acl, const char *psz_path )
         }
 
         /* 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';
 
index 0b5d828bc1ea362a1886c74bdc9af11e4090d1c7..4b967914ba81e595782f05e17cfdc9c699e0b97b 100644 (file)
@@ -1079,7 +1079,7 @@ char *make_URI (const char *path, const char *scheme)
     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)