comparison common.h @ 400:b0aed401a756 libavcodec

better av_freep()
author glantau
date Mon, 20 May 2002 16:23:27 +0000
parents 48e08d9871da
children 053b3a7a1760
comparison
equal deleted inserted replaced
399:64247fd53524 400:b0aed401a756
54 #ifndef __MINGW32__ 54 #ifndef __MINGW32__
55 #define INT64_C(c) (c ## i64) 55 #define INT64_C(c) (c ## i64)
56 #define UINT64_C(c) (c ## i64) 56 #define UINT64_C(c) (c ## i64)
57 57
58 #define inline __inline 58 #define inline __inline
59
60 /*
61 Disable warning messages:
62 warning C4244: '=' : conversion from 'double' to 'float', possible loss of data
63 warning C4305: 'argument' : truncation from 'const double' to 'float'
64 */
65 #pragma warning( disable : 4244 )
66 #pragma warning( disable : 4305 )
67 59
68 #else 60 #else
69 #define INT64_C(c) (c ## LL) 61 #define INT64_C(c) (c ## LL)
70 #define UINT64_C(c) (c ## ULL) 62 #define UINT64_C(c) (c ## ULL)
71 #endif /* __MINGW32__ */ 63 #endif /* __MINGW32__ */
899 891
900 /* memory */ 892 /* memory */
901 void *av_malloc(int size); 893 void *av_malloc(int size);
902 void *av_mallocz(int size); 894 void *av_mallocz(int size);
903 void av_free(void *ptr); 895 void av_free(void *ptr);
904 #define av_freep(p) do { av_free(*p); *p = NULL; } while (0) 896 void __av_freep(void **ptr);
897 #define av_freep(p) __av_freep((void **)(p))
905 898
906 /* math */ 899 /* math */
907 int ff_gcd(int a, int b); 900 int ff_gcd(int a, int b);
908 901
909 #define CLAMP_TO_8BIT(d) ((d > 0xff) ? 0xff : (d < 0) ? 0 : d) 902 #define CLAMP_TO_8BIT(d) ((d > 0xff) ? 0xff : (d < 0) ? 0 : d)