diff --git a/common/base.c b/common/base.c index 5b35a2e3384dcc4686e2cb1d59d4f3a20505b257..c12232736bdbf2146e9ef36f5219fbd224a566ab 100644 --- a/common/base.c +++ b/common/base.c @@ -207,7 +207,7 @@ typedef struct { void *ptr[]; } strdup_buffer; -#define BUFFER_OFFSET offsetof(strdup_buffer, ptr) +#define BUFFER_OFFSET (int)offsetof(strdup_buffer, ptr) #define BUFFER_DEFAULT_SIZE 16 char *x264_param_strdup( x264_param_t *param, const char *src ) @@ -922,7 +922,7 @@ REALIGN_STACK int x264_param_parse( x264_param_t *p, const char *name, const cha if( 0 ); OPT("asm") { - p->cpu = isdigit(value[0]) ? atoi(value) : + p->cpu = isdigit(value[0]) ? (uint32_t)atoi(value) : !strcasecmp(value, "auto") || atobool(value) ? x264_cpu_detect() : 0; if( b_error ) { diff --git a/tools/checkasm.c b/tools/checkasm.c index c8c1cf75188a1cf8dbb9dfab177262bee4f77b23..1e84ecb720d3e661efa88c690f2d0e4ce335628a 100644 --- a/tools/checkasm.c +++ b/tools/checkasm.c @@ -2383,7 +2383,7 @@ static int check_quant( uint32_t cpu_ref, uint32_t cpu_new ) { \ int nnz = 0; \ int max = rand() & (size-1); \ - memset( dct1, 0, size*sizeof(dctcoef) ); \ + memset( dct1, 0, 64*sizeof(dctcoef) ); \ for( int idx = ac; idx < max; idx++ ) \ nnz |= dct1[idx] = !(rand()&3) + (!(rand()&15))*rand(); \ if( !nnz ) \ @@ -2417,7 +2417,7 @@ static int check_quant( uint32_t cpu_ref, uint32_t cpu_new ) x264_run_level_t runlevel_c, runlevel_a; \ int nnz = 0; \ int max = rand() & (size-1); \ - memset( dct1, 0, size*sizeof(dctcoef) ); \ + memset( dct1, 0, 64*sizeof(dctcoef) ); \ memcpy( &runlevel_a, buf1+i, sizeof(x264_run_level_t) ); \ memcpy( &runlevel_c, buf1+i, sizeof(x264_run_level_t) ); \ for( int idx = ac; idx < max; idx++ ) \