You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
all: add const-correctness to qsort comparators
This adds const-correctness when needed for the comparators. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
This commit is contained in:
@@ -206,7 +206,7 @@ end:
|
|||||||
|
|
||||||
static int compare_ocl_device_desc(const void *a, const void *b)
|
static int compare_ocl_device_desc(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
return ((OpenCLDeviceBenchmark*)a)->runtime - ((OpenCLDeviceBenchmark*)b)->runtime;
|
return ((const OpenCLDeviceBenchmark*)a)->runtime - ((const OpenCLDeviceBenchmark*)b)->runtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
int opt_opencl_bench(void *optctx, const char *opt, const char *arg)
|
int opt_opencl_bench(void *optctx, const char *opt, const char *arg)
|
||||||
|
@@ -138,8 +138,8 @@ static void setup_array(uint8_t *out[SWR_CH_MAX], uint8_t *in, enum AVSampleForm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cmp(const int *a, const int *b){
|
static int cmp(const void *a, const void *b){
|
||||||
return *a - *b;
|
return *(const int *)a - *(const int *)b;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void audiogen(void *data, enum AVSampleFormat sample_fmt,
|
static void audiogen(void *data, enum AVSampleFormat sample_fmt,
|
||||||
@@ -271,7 +271,7 @@ int main(int argc, char **argv){
|
|||||||
r = (seed * (uint64_t)(max_tests - test)) >>32;
|
r = (seed * (uint64_t)(max_tests - test)) >>32;
|
||||||
FFSWAP(int, remaining_tests[r], remaining_tests[max_tests - test - 1]);
|
FFSWAP(int, remaining_tests[r], remaining_tests[max_tests - test - 1]);
|
||||||
}
|
}
|
||||||
qsort(remaining_tests + max_tests - num_tests, num_tests, sizeof(remaining_tests[0]), (void*)cmp);
|
qsort(remaining_tests + max_tests - num_tests, num_tests, sizeof(remaining_tests[0]), cmp);
|
||||||
in_sample_rate=16000;
|
in_sample_rate=16000;
|
||||||
for(test=0; test<num_tests; test++){
|
for(test=0; test<num_tests; test++){
|
||||||
char in_layout_string[256];
|
char in_layout_string[256];
|
||||||
|
Reference in New Issue
Block a user