From d6daf2b914a658ecc57346a7348f5f8400b003d2 Mon Sep 17 00:00:00 2001 From: Fiona Glaser Date: Sun, 10 Apr 2011 04:39:51 -0700 Subject: [PATCH] Cosmetics: fix some signedness issues found by -Wsign-compare --- common/common.c | 2 +- common/cpu.h | 2 +- encoder/me.c | 3 +-- filters/filters.c | 2 +- filters/filters.h | 2 +- input/y4m.c | 2 +- x264.c | 4 ++-- x264cli.h | 4 ++-- 8 files changed, 10 insertions(+), 11 deletions(-) diff --git a/common/common.c b/common/common.c index 69941de0..e6d605a8 100644 --- a/common/common.c +++ b/common/common.c @@ -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 ) diff --git a/common/cpu.h b/common/cpu.h index 5438f920..64085662 100644 --- a/common/cpu.h +++ b/common/cpu.h @@ -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[]; diff --git a/encoder/me.c b/encoder/me.c index d18b1404..a4de7ddf 100644 --- a/encoder/me.c +++ b/encoder/me.c @@ -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; diff --git a/filters/filters.c b/filters/filters.c index 4998f8f9..5dd32dce 100644 --- a/filters/filters.c +++ b/filters/filters.c @@ -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; diff --git a/filters/filters.h b/filters/filters.h index f34a32f4..9f15e203 100644 --- a/filters/filters.h +++ b/filters/filters.h @@ -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[] ); diff --git a/input/y4m.c b/input/y4m.c index 4967fe88..cec34252 100644 --- a/input/y4m.c +++ b/input/y4m.c @@ -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 2ab7f960..32eaa0e2 100644 --- 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 ); diff --git a/x264cli.h b/x264cli.h index 50a9be39..29e961cd 100644 --- 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; } -- 2.40.0