]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: fix warning on little endian
authorStephen Hemminger <shemminger@vyatta.com>
Wed, 9 Dec 2009 11:13:27 +0000 (14:13 +0300)
committerDenis Ovsienko <infrastation@yandex.ru>
Wed, 9 Dec 2009 11:13:27 +0000 (14:13 +0300)
* md5.c
  * md5_calc(): If building on little endian then X
    will be 'const uint32_t' which causes compiler
    warning in code that never gets used. Just move
    the endif to make sure code is not checked.

lib/md5.c

index f1bd06686ea34dc8ed311d06ef45f47a0a97d99e..894de648b3de056660d122c66421c0730680c260 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -232,7 +232,7 @@ static void md5_calc(const uint8_t *b64, md5_ctxt * ctxt)
        const uint32_t *X = (const uint32_t *)b64;
 #elif (BYTE_ORDER == BIG_ENDIAN)
        uint32_t X[16];
-#endif
+
        if (BYTE_ORDER == BIG_ENDIAN)
          {
            /* 4 byte words */
@@ -255,6 +255,7 @@ static void md5_calc(const uint8_t *b64, md5_ctxt * ctxt)
            y[56] = b64[59]; y[57] = b64[58]; y[58] = b64[57]; y[59] = b64[56];
            y[60] = b64[63]; y[61] = b64[62]; y[62] = b64[61]; y[63] = b64[60];
          }
+#endif
 
        ROUND1(A, B, C, D,  0, Sa,  1); ROUND1(D, A, B, C,  1, Sb,  2);
        ROUND1(C, D, A, B,  2, Sc,  3); ROUND1(B, C, D, A,  3, Sd,  4);