Change all uses of restrict to use av_restrict instead.

Defining restrict results - for some compilers - in changing other
uses of the restrict keyword also, e.g. __declspec(restrict) gets
changed to __declspec(__restrict) on MSVC. This causes compilation
failures. Therefore, using a private namespace macro instead is
more reliable and robust.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Ronald S. Bultje 2012-06-15 15:52:05 -07:00 committed by Michael Niedermayer
parent 5c14b282d1
commit 17fad33f81
7 changed files with 10 additions and 10 deletions

2
configure vendored
View File

@ -3797,7 +3797,7 @@ cat > $TMPH <<EOF
#define AVCONV_DATADIR "$(eval c_escape $datadir)" #define AVCONV_DATADIR "$(eval c_escape $datadir)"
#define CC_TYPE "$cc_type" #define CC_TYPE "$cc_type"
#define CC_VERSION $cc_version #define CC_VERSION $cc_version
#define restrict $_restrict #define av_restrict $_restrict
#define EXTERN_PREFIX "${extern_prefix}" #define EXTERN_PREFIX "${extern_prefix}"
#define EXTERN_ASM ${extern_prefix} #define EXTERN_ASM ${extern_prefix}
#define SLIBSUF "$SLIBSUF" #define SLIBSUF "$SLIBSUF"

View File

@ -2517,7 +2517,7 @@ static void vector_fmac_scalar_c(float *dst, const float *src, float mul,
dst[i] += src[i] * mul; dst[i] += src[i] * mul;
} }
static void butterflies_float_c(float *restrict v1, float *restrict v2, static void butterflies_float_c(float *av_restrict v1, float *av_restrict v2,
int len) int len)
{ {
int i; int i;

View File

@ -444,7 +444,7 @@ typedef struct DSPContext {
* @param v2 second input vector, difference output, 16-byte aligned * @param v2 second input vector, difference output, 16-byte aligned
* @param len length of vectors, multiple of 4 * @param len length of vectors, multiple of 4
*/ */
void (*butterflies_float)(float *restrict v1, float *restrict v2, int len); void (*butterflies_float)(float *av_restrict v1, float *av_restrict v2, int len);
/** /**
* Calculate the sum and difference of two vectors of floats and interleave * Calculate the sum and difference of two vectors of floats and interleave

View File

@ -210,7 +210,7 @@ static int h263_decode_gob_header(MpegEncContext *s)
* @param end pointer to the end of the buffer * @param end pointer to the end of the buffer
* @return pointer to the next resync_marker, or end if none was found * @return pointer to the next resync_marker, or end if none was found
*/ */
const uint8_t *ff_h263_find_resync_marker(const uint8_t *restrict p, const uint8_t * restrict end) const uint8_t *ff_h263_find_resync_marker(const uint8_t *av_restrict p, const uint8_t *av_restrict end)
{ {
assert(p < end); assert(p < end);

View File

@ -140,9 +140,9 @@ const enum PixelFormat ff_hwaccel_pixfmt_list_420[] = {
PIX_FMT_NONE PIX_FMT_NONE
}; };
const uint8_t *avpriv_mpv_find_start_code(const uint8_t *restrict p, const uint8_t *avpriv_mpv_find_start_code(const uint8_t *av_restrict p,
const uint8_t *end, const uint8_t *end,
uint32_t * restrict state) uint32_t *av_restrict state)
{ {
int i; int i;

View File

@ -86,7 +86,7 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size);
void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size); void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size);
void ff_rtp_send_vp8(AVFormatContext *s1, const uint8_t *buff, int size); void ff_rtp_send_vp8(AVFormatContext *s1, const uint8_t *buff, int size);
const uint8_t *ff_h263_find_resync_marker_reverse(const uint8_t *restrict start, const uint8_t *ff_h263_find_resync_marker_reverse(const uint8_t *av_restrict start,
const uint8_t *restrict end); const uint8_t *av_restrict end);
#endif /* AVFORMAT_RTPENC_H */ #endif /* AVFORMAT_RTPENC_H */

View File

@ -23,8 +23,8 @@
#include "avformat.h" #include "avformat.h"
#include "rtpenc.h" #include "rtpenc.h"
const uint8_t *ff_h263_find_resync_marker_reverse(const uint8_t *restrict start, const uint8_t *ff_h263_find_resync_marker_reverse(const uint8_t *av_restrict start,
const uint8_t *restrict end) const uint8_t *av_restrict end)
{ {
const uint8_t *p = end - 1; const uint8_t *p = end - 1;
start += 1; /* Make sure we never return the original start. */ start += 1; /* Make sure we never return the original start. */