diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-05 13:25:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-05 13:34:45 +0100 |
commit | 99efd596267248ba5eae1b0e540d880368a402c3 (patch) | |
tree | 1ab9b0250d1350ffaae7d5f2bf98ba78e21d0cf4 /libavutil | |
parent | 1fa2bdc90a4a5309a3bf83ff9ae37f59e5f329fa (diff) | |
parent | cb45553f577f8e0ebfe05d3287e1b6fa5859b967 (diff) | |
download | ffmpeg-99efd596267248ba5eae1b0e540d880368a402c3.tar.gz |
Merge commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967'
* commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967':
Remove pointless #undefs of previously forbidden functions.
fate: Add dependencies for bmp, cdxl, dfa, mp3
Conflicts:
doc/examples/muxing.c
libavfilter/filtfmts.c
libavutil/des.c
libavutil/eval.c
libavutil/log.c
libavutil/parseutils.c
tests/fate/mp3.mak
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/avstring.c | 1 | ||||
-rw-r--r-- | libavutil/base64.c | 2 | ||||
-rw-r--r-- | libavutil/blowfish.c | 2 | ||||
-rw-r--r-- | libavutil/cpu.c | 1 | ||||
-rw-r--r-- | libavutil/crc.c | 1 | ||||
-rw-r--r-- | libavutil/des.c | 5 | ||||
-rw-r--r-- | libavutil/eval.c | 3 | ||||
-rw-r--r-- | libavutil/fifo.c | 2 | ||||
-rw-r--r-- | libavutil/internal.h | 32 | ||||
-rw-r--r-- | libavutil/log.c | 2 | ||||
-rw-r--r-- | libavutil/md5.c | 1 | ||||
-rw-r--r-- | libavutil/mem.c | 5 | ||||
-rw-r--r-- | libavutil/opt.c | 2 | ||||
-rw-r--r-- | libavutil/parseutils.c | 8 | ||||
-rw-r--r-- | libavutil/sha.c | 1 | ||||
-rw-r--r-- | libavutil/xtea.c | 2 |
16 files changed, 2 insertions, 68 deletions
diff --git a/libavutil/avstring.c b/libavutil/avstring.c index 802d0f85e7..f03df67441 100644 --- a/libavutil/avstring.c +++ b/libavutil/avstring.c @@ -214,7 +214,6 @@ int av_strncasecmp(const char *a, const char *b, size_t n) #ifdef TEST #include "common.h" -#undef printf int main(void) { diff --git a/libavutil/base64.c b/libavutil/base64.c index d907805c7f..98b9c94d8a 100644 --- a/libavutil/base64.c +++ b/libavutil/base64.c @@ -175,8 +175,6 @@ char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size) #ifdef TEST // LCOV_EXCL_START -#undef printf - #define MAX_DATA_SIZE 1024 #define MAX_ENCODED_SIZE 2048 diff --git a/libavutil/blowfish.c b/libavutil/blowfish.c index cdc2952dea..5ad74c10fd 100644 --- a/libavutil/blowfish.c +++ b/libavutil/blowfish.c @@ -420,7 +420,6 @@ void av_blowfish_crypt(AVBlowfish *ctx, uint8_t *dst, const uint8_t *src, #ifdef TEST #include <stdio.h> -#undef printf #define NUM_VARIABLE_KEY_TESTS 34 @@ -523,7 +522,6 @@ static const uint8_t ciphertext2[16] = { #define IV "blowfish" -#undef exit static void test_blowfish(AVBlowfish *ctx, uint8_t *dst, const uint8_t *src, const uint8_t *ref, int len, uint8_t *iv, int dir, const char *test) diff --git a/libavutil/cpu.c b/libavutil/cpu.c index e14b413725..a1d1547033 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -175,7 +175,6 @@ int av_parse_cpu_caps(unsigned *flags, const char *s) } #ifdef TEST -#undef printf #include <stdio.h> static const struct { diff --git a/libavutil/crc.c b/libavutil/crc.c index bba8cb10a5..aeb9e466ab 100644 --- a/libavutil/crc.c +++ b/libavutil/crc.c @@ -113,7 +113,6 @@ uint32_t av_crc(const AVCRC *ctx, uint32_t crc, } #ifdef TEST -#undef printf int main(void) { uint8_t buf[1999]; diff --git a/libavutil/des.c b/libavutil/des.c index 32ac26f69c..a7a5074203 100644 --- a/libavutil/des.c +++ b/libavutil/des.c @@ -337,10 +337,6 @@ void av_des_mac(AVDES *d, uint8_t *dst, const uint8_t *src, int count) { } #ifdef TEST -// LCOV_EXCL_START -#undef printf -#undef rand -#undef srand #include <stdlib.h> #include <stdio.h> #include "libavutil/time.h" @@ -442,5 +438,4 @@ int main(void) { #endif return 0; } -// LCOV_EXCL_STOP #endif diff --git a/libavutil/eval.c b/libavutil/eval.c index 0d6bd15529..4a27742729 100644 --- a/libavutil/eval.c +++ b/libavutil/eval.c @@ -660,8 +660,6 @@ int av_expr_parse_and_eval(double *d, const char *s, } #ifdef TEST -// LCOV_EXCL_START -#undef printf #include <string.h> static const double const_values[] = { @@ -797,5 +795,4 @@ int main(int argc, char **argv) return 0; } -// LCOV_EXCL_STOP #endif diff --git a/libavutil/fifo.c b/libavutil/fifo.c index 47328c4585..bafa9e9f98 100644 --- a/libavutil/fifo.c +++ b/libavutil/fifo.c @@ -149,8 +149,6 @@ void av_fifo_drain(AVFifoBuffer *f, int size) #ifdef TEST -#undef printf - int main(void) { /* create a FIFO buffer */ diff --git a/libavutil/internal.h b/libavutil/internal.h index cc977f64da..4400c5c439 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -58,38 +58,6 @@ # define INT_BIT (CHAR_BIT * sizeof(int)) #endif -/* avoid usage of dangerous/inappropriate system functions */ -#undef malloc -#define malloc please_use_av_malloc -#undef free -#define free please_use_av_free -#undef realloc -#define realloc please_use_av_realloc -#undef rand -#define rand rand_is_forbidden_due_to_state_trashing_use_av_lfg_get -#undef srand -#define srand srand_is_forbidden_due_to_state_trashing_use_av_lfg_init -#undef random -#define random random_is_forbidden_due_to_state_trashing_use_av_lfg_get -#undef sprintf -#define sprintf sprintf_is_forbidden_due_to_security_issues_use_snprintf -#undef strcat -#define strcat strcat_is_forbidden_due_to_security_issues_use_av_strlcat -#undef exit -#define exit exit_is_forbidden -#undef printf -#define printf please_use_av_log_instead_of_printf -#undef fprintf -#define fprintf please_use_av_log_instead_of_fprintf -#undef puts -#define puts please_use_av_log_instead_of_puts -#undef perror -#define perror please_use_av_log_instead_of_perror -#undef strcasecmp -#define strcasecmp please_use_av_strcasecmp -#undef strncasecmp -#define strncasecmp please_use_av_strncasecmp - #define FF_ALLOC_OR_GOTO(ctx, p, size, label)\ {\ p = av_malloc(size);\ diff --git a/libavutil/log.c b/libavutil/log.c index 57b3d5d087..700e89fa97 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -99,7 +99,6 @@ static const uint32_t color[16 + AV_CLASS_CATEGORY_NB] = { #endif static int use_color = -1; -#undef fprintf static void colored_fputs(int level, const char *str) { if (use_color < 0) { @@ -220,7 +219,6 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) is_atty = isatty(2) ? 1 : -1; #endif -#undef fprintf if (print_prefix && (flags & AV_LOG_SKIP_REPEATED) && !strcmp(line, prev)){ count++; if (is_atty == 1) diff --git a/libavutil/md5.c b/libavutil/md5.c index d0d0d27f07..f8f08f130b 100644 --- a/libavutil/md5.c +++ b/libavutil/md5.c @@ -180,7 +180,6 @@ void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len) } #ifdef TEST -#undef printf #include <stdio.h> static void print_md5(uint8_t *md5) diff --git a/libavutil/mem.c b/libavutil/mem.c index d73cddefd0..4253740a10 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -40,11 +40,6 @@ #include "intreadwrite.h" #include "mem.h" -/* here we can use OS-dependent allocation functions */ -#undef free -#undef malloc -#undef realloc - #ifdef MALLOC_PREFIX #define malloc AV_JOIN(MALLOC_PREFIX, malloc) diff --git a/libavutil/opt.c b/libavutil/opt.c index 0ff45c8116..e81da47dbf 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1163,8 +1163,6 @@ void *av_opt_ptr(const AVClass *class, void *obj, const char *name) #ifdef TEST -#undef printf - typedef struct TestContext { const AVClass *class; diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c index f188e815fa..ca40569e6a 100644 --- a/libavutil/parseutils.c +++ b/libavutil/parseutils.c @@ -31,8 +31,6 @@ #include "random_seed.h" #include "parseutils.h" -#undef time - #ifdef TEST #define av_get_random_seed av_get_random_seed_deterministic @@ -676,15 +674,13 @@ int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info #ifdef TEST -static uint32_t random = MKTAG('L','A','V','U'); +static uint32_t randomv = MKTAG('L','A','V','U'); static uint32_t av_get_random_seed_deterministic(void) { - return random = random * 1664525 + 1013904223; + return randomv = randomv * 1664525 + 1013904223; } -#undef printf - int main(void) { printf("Testing av_parse_video_rate()\n"); diff --git a/libavutil/sha.c b/libavutil/sha.c index 8d5ca458f9..9f630fcc87 100644 --- a/libavutil/sha.c +++ b/libavutil/sha.c @@ -332,7 +332,6 @@ void av_sha_final(AVSHA* ctx, uint8_t *digest) #ifdef TEST #include <stdio.h> -#undef printf int main(void) { diff --git a/libavutil/xtea.c b/libavutil/xtea.c index 28780fb551..d4eede70f0 100644 --- a/libavutil/xtea.c +++ b/libavutil/xtea.c @@ -183,7 +183,6 @@ void av_xtea_crypt(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, int count, #ifdef TEST #include <stdio.h> -#undef printf #define XTEA_NUM_TESTS 6 @@ -220,7 +219,6 @@ static const uint8_t xtea_test_ct[XTEA_NUM_TESTS][8] = { { 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41 } }; -#undef exit static void test_xtea(AVXTEA *ctx, uint8_t *dst, const uint8_t *src, const uint8_t *ref, int len, uint8_t *iv, int dir, const char *test) |