]> git.sesse.net Git - x264/commitdiff
Cosmetics: fix some signedness issues found by -Wsign-compare
authorFiona Glaser <fiona@x264.com>
Sun, 10 Apr 2011 11:39:51 +0000 (04:39 -0700)
committerFiona Glaser <fiona@x264.com>
Tue, 12 Apr 2011 08:37:26 +0000 (01:37 -0700)
common/common.c
common/cpu.h
encoder/me.c
filters/filters.c
filters/filters.h
input/y4m.c
x264.c
x264cli.h

index 69941de0300bb6f158f9335e52d84c55aa7e01f8..e6d605a8edda947a65a96f7322bfbab36ffcbb59 100644 (file)
@@ -1160,7 +1160,7 @@ REDUCE_FRACTION( x264_reduce_fraction64, uint64_t )
 char *x264_slurp_file( const char *filename )
 {
     int b_error = 0;
-    int i_size;
+    size_t i_size;
     char *buf;
     FILE *fh = fopen( filename, "rb" );
     if( !fh )
index 5438f920ae29238582e98ab5be63381e275afb62..640856628b728a5b008686fcfac54e2cac8083d3 100644 (file)
@@ -56,7 +56,7 @@ int x264_stack_align( void (*func)(), ... );
 typedef struct
 {
     const char name[16];
-    int flags;
+    uint32_t flags;
 } x264_cpu_name_t;
 extern const x264_cpu_name_t x264_cpu_names[];
 
index d18b1404e3feb4b688e036d0f4584014077aba73..a4de7ddfd8a6f86667acb4a3fd91bd8a0804f1b2 100644 (file)
@@ -1135,8 +1135,7 @@ void x264_me_refine_qpel_rd( x264_t *h, x264_me_t *m, int i_lambda2, int i4, int
     int bmx = m->mv[0];
     int bmy = m->mv[1];
     int omx, omy, pmx, pmy;
-    unsigned bsatd;
-    int satd;
+    int satd, bsatd;
     int dir = -2;
     int i8 = i4>>2;
     uint16_t amvd;
index 4998f8f9f8de073a7e54227622a4938b5429789e..5dd32dcea8a4ff00b1a7703b649c2f0e100acf59 100644 (file)
@@ -27,7 +27,7 @@
 #include "filters.h"
 #define RETURN_IF_ERROR( cond, ... ) RETURN_IF_ERR( cond, "options", NULL, __VA_ARGS__ )
 
-char **x264_split_string( char *string, char *sep, uint32_t limit )
+char **x264_split_string( char *string, char *sep, int limit )
 {
     if( !string )
         return NULL;
index f34a32f40b99e3691a556aa41fb23bba68d1f599..9f15e203899a31753f66158b2f19a4143a944ac2 100644 (file)
@@ -30,7 +30,7 @@
 #include "x264cli.h"
 #include "filters/video/video.h"
 
-char **x264_split_string( char *string, char *sep, uint32_t limit );
+char **x264_split_string( char *string, char *sep, int limit );
 void   x264_free_string_array( char **array );
 
 char **x264_split_options( const char *opt_str, const char *options[] );
index 4967fe88b8212591ee4665a4b7ff929a5e7dedfb..cec34252555472b66e49fdaa7bad279fe5887b41 100644 (file)
@@ -201,7 +201,7 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c
 
 static int read_frame_internal( cli_pic_t *pic, y4m_hnd_t *h )
 {
-    int slen = strlen( Y4M_FRAME_MAGIC );
+    size_t slen = strlen( Y4M_FRAME_MAGIC );
     int i = 0;
     char header[16];
 
diff --git a/x264.c b/x264.c
index 2ab7f96099a8845040f00d440869c6c330ac867a..32eaa0e286662a340070634f68b98817dada4879 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -328,11 +328,11 @@ static void print_csp_names( int longhelp )
     printf( "\n" );
     printf( "                              - valid csps for `lavf' demuxer:\n" );
     printf( INDENT );
-    int line_len = strlen( INDENT );
+    size_t line_len = strlen( INDENT );
     for( enum PixelFormat i = PIX_FMT_NONE+1; i < PIX_FMT_NB; i++ )
     {
         const char *pfname = av_pix_fmt_descriptors[i].name;
-        int name_len = strlen( pfname );
+        size_t name_len = strlen( pfname );
         if( line_len + name_len > (80 - strlen( ", " )) )
         {
             printf( "\n" INDENT );
index 50a9be39d2e58705998743cfe9735755976b51fa..29e961cd1fc1da1c5c08534e645475ad26dbf0bd 100644 (file)
--- a/x264cli.h
+++ b/x264cli.h
@@ -34,7 +34,7 @@
 
 typedef void *hnd_t;
 
-static inline int64_t gcd( int64_t a, int64_t b )
+static inline uint64_t gcd( uint64_t a, uint64_t b )
 {
     while( 1 )
     {
@@ -46,7 +46,7 @@ static inline int64_t gcd( int64_t a, int64_t b )
     }
 }
 
-static inline int64_t lcm( int64_t a, int64_t b )
+static inline uint64_t lcm( uint64_t a, uint64_t b )
 {
     return ( a / gcd( a, b ) ) * b;
 }