comparison common.h @ 2288:3d4a1f8e6a27 libavcodec

* fixing a few of gcc 'clean-code' warnings
author kabi
date Wed, 06 Oct 2004 08:50:46 +0000
parents cd1a71898311
children 15cfba1b97b5
comparison
equal deleted inserted replaced
2287:679642dc54cf 2288:3d4a1f8e6a27
389 #define UNALIGNED_STORES_ARE_BAD 389 #define UNALIGNED_STORES_ARE_BAD
390 #endif 390 #endif
391 391
392 /* used to avoid missaligned exceptions on some archs (alpha, ...) */ 392 /* used to avoid missaligned exceptions on some archs (alpha, ...) */
393 #ifdef ARCH_X86 393 #ifdef ARCH_X86
394 # define unaligned32(a) (*(uint32_t*)(a)) 394 # define unaligned32(a) (*(const uint32_t*)(a))
395 #else 395 #else
396 # ifdef __GNUC__ 396 # ifdef __GNUC__
397 static inline uint32_t unaligned32(const void *v) { 397 static inline uint32_t unaligned32(const void *v) {
398 struct Unaligned { 398 struct Unaligned {
399 uint32_t i; 399 uint32_t i;
618 618
619 # define CLOSE_READER(name, gb)\ 619 # define CLOSE_READER(name, gb)\
620 (gb)->index= name##_index;\ 620 (gb)->index= name##_index;\
621 621
622 # define UPDATE_CACHE(name, gb)\ 622 # define UPDATE_CACHE(name, gb)\
623 name##_cache= unaligned32_be( ((uint8_t *)(gb)->buffer)+(name##_index>>3) ) << (name##_index&0x07);\ 623 name##_cache= unaligned32_be( ((const uint8_t *)(gb)->buffer)+(name##_index>>3) ) << (name##_index&0x07);\
624 624
625 # define SKIP_CACHE(name, gb, num)\ 625 # define SKIP_CACHE(name, gb, num)\
626 name##_cache <<= (num);\ 626 name##_cache <<= (num);\
627 627
628 // FIXME name? 628 // FIXME name?
1251 (c)=(d);\ 1251 (c)=(d);\
1252 } 1252 }
1253 #endif 1253 #endif
1254 1254
1255 #ifdef ARCH_X86 1255 #ifdef ARCH_X86
1256 static inline long long rdtsc() 1256 static inline long long rdtsc(void)
1257 { 1257 {
1258 long long l; 1258 long long l;
1259 asm volatile( "rdtsc\n\t" 1259 asm volatile( "rdtsc\n\t"
1260 : "=A" (l) 1260 : "=A" (l)
1261 ); 1261 );