[libdvdcss-devel] src: mark tables static and constant.

Diego Elio Pettenò git at videolan.org
Thu Feb 14 21:13:51 CET 2013


libdvdcss | branch: master | Diego Elio Pettenò <flameeyes at flameeyes.eu> | Thu Feb 14 11:29:08 2013 -0800| [b9def08ea38f7509a039a362f20a996914c1545b] | committer: Diego Elio Pettenò

src: mark tables static and constant.

> http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=b9def08ea38f7509a039a362f20a996914c1545b
---

 src/css.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/css.c b/src/css.c
index 1da502e..935b7b2 100644
--- a/src/css.c
+++ b/src/css.c
@@ -763,13 +763,13 @@ static void CryptKey( int i_key_type, int i_variant,
                       uint8_t const *p_challenge, uint8_t *p_key )
 {
     /* Permutation table for challenge */
-    uint8_t pp_perm_challenge[3][10] =
+    static const uint8_t pp_perm_challenge[3][10] =
             { { 1, 3, 0, 7, 5, 2, 9, 6, 4, 8 },
               { 6, 1, 9, 3, 8, 5, 7, 4, 0, 2 },
               { 4, 0, 3, 5, 7, 2, 8, 6, 1, 9 } };
 
     /* Permutation table for variant table for key2 and buskey */
-    uint8_t pp_perm_variant[2][32] =
+    static const uint8_t pp_perm_variant[2][32] =
             { { 0x0a, 0x08, 0x0e, 0x0c, 0x0b, 0x09, 0x0f, 0x0d,
                 0x1a, 0x18, 0x1e, 0x1c, 0x1b, 0x19, 0x1f, 0x1d,
                 0x02, 0x00, 0x06, 0x04, 0x03, 0x01, 0x07, 0x05,
@@ -779,14 +779,14 @@ static void CryptKey( int i_key_type, int i_variant,
                 0x13, 0x1b, 0x17, 0x1f, 0x03, 0x0b, 0x07, 0x0f,
                 0x11, 0x19, 0x15, 0x1d, 0x01, 0x09, 0x05, 0x0d } };
 
-    uint8_t p_variants[32] =
+    static const uint8_t p_variants[32] =
             {   0xB7, 0x74, 0x85, 0xD0, 0xCC, 0xDB, 0xCA, 0x73,
                 0x03, 0xFE, 0x31, 0x03, 0x52, 0xE0, 0xB7, 0x42,
                 0x63, 0x16, 0xF2, 0x2A, 0x79, 0x52, 0xFF, 0x1B,
                 0x7A, 0x11, 0xCA, 0x1A, 0x9B, 0x40, 0xAD, 0x01 };
 
     /* The "secret" key */
-    uint8_t p_secret[5] = { 0x55, 0xD6, 0xC4, 0xC5, 0x28 };
+    static const uint8_t p_secret[5] = { 0x55, 0xD6, 0xC4, 0xC5, 0x28 };
 
     uint8_t p_bits[30], p_scratch[10], p_tmp1[5], p_tmp2[5];
     uint8_t i_lfsr0_o;  /* 1 bit used */



More information about the libdvdcss-devel mailing list