[FFmpeg-devel] [PATCH 2/3] Stop warnings on the table generation code.

Diego Elio 'Flameeyes' Pettenò flameeyes
Sat Jun 26 01:48:44 CEST 2010


---
 libavutil/aes_tablegen.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavutil/aes_tablegen.h b/libavutil/aes_tablegen.h
index d3bb567..647766b 100644
--- a/libavutil/aes_tablegen.h
+++ b/libavutil/aes_tablegen.h
@@ -42,7 +42,7 @@ static uint8_t inv_sbox[256];
 static uint32_t enc_multbl[AES_TABLE_COUNT][256];
 static uint32_t dec_multbl[AES_TABLE_COUNT][256];
 
-static void init_multbl2(uint8_t tbl[1024], const int c[4], const uint8_t *log8, const uint8_t *alog8, const uint8_t *sbox){
+static void init_multbl2(uint8_t *tbl, const int c[4], const uint8_t *log8, const uint8_t *alog8, const uint8_t *sbox){
     int i, j;
     for(i=0; i<1024; i++){
         int x= sbox[i>>2];
@@ -60,7 +60,7 @@ static void ff_aes_init_tables() {
     uint8_t  log8[256];
     uint8_t alog8[512];
 
-    if(!enc_multbl[0][sizeof(enc_multbl)/sizeof(enc_multbl[0][0])-1]){
+    if(!enc_multbl[AES_TABLE_COUNT-1][255]){
         j=1;
         for(i=0; i<255; i++){
             alog8[i]=
@@ -76,8 +76,8 @@ static void ff_aes_init_tables() {
             inv_sbox[j]= i;
             sbox    [i]= j;
         }
-        init_multbl2(dec_multbl[0], (const int[4]){0xe, 0x9, 0xd, 0xb}, log8, alog8, inv_sbox);
-        init_multbl2(enc_multbl[0], (const int[4]){0x2, 0x1, 0x1, 0x3}, log8, alog8, sbox);
+        init_multbl2((uint8_t*)dec_multbl[0], (const int[4]){0xe, 0x9, 0xd, 0xb}, log8, alog8, inv_sbox);
+        init_multbl2((uint8_t*)enc_multbl[0], (const int[4]){0x2, 0x1, 0x1, 0x3}, log8, alog8, sbox);
     }
 }
 
-- 
1.7.1




More information about the ffmpeg-devel mailing list