[FFmpeg-devel] [PATCH] Fix warnings in decode_significance_x86 and decode_significance_8x8_x86 (in h264_i386.h)

Eli Friedman eli.friedman
Sun Jun 27 22:21:27 CEST 2010


Patch attached; adds extra casts so gcc doesn't warn about truncating
pointers.  Someone else should double-check that this is the intent,
though; truncating pointers is an unusual operation, although it looks
like it's okay in this case.

-Eli
-------------- next part --------------
Index: libavcodec/x86/h264_i386.h
===================================================================
--- libavcodec/x86/h264_i386.h	(revision 23832)
+++ libavcodec/x86/h264_i386.h	(working copy)
@@ -38,8 +38,8 @@
                                    uint8_t *significant_coeff_ctx_base,
                                    int *index){
     void *end= significant_coeff_ctx_base + max_coeff - 1;
-    int minusstart= -(int)significant_coeff_ctx_base;
-    int minusindex= 4-(int)index;
+    int minusstart= -(int)(x86_reg)significant_coeff_ctx_base;
+    int minusindex= 4-(int)(x86_reg)index;
     int coeff_count;
     __asm__ volatile(
         "movl "RANGE    "(%3), %%esi            \n\t"
@@ -91,7 +91,7 @@
 static int decode_significance_8x8_x86(CABACContext *c,
                                        uint8_t *significant_coeff_ctx_base,
                                        int *index, const uint8_t *sig_off){
-    int minusindex= 4-(int)index;
+    int minusindex= 4-(int)(x86_reg)index;
     int coeff_count;
     x86_reg last=0;
     __asm__ volatile(



More information about the ffmpeg-devel mailing list