gcc -Wcast-qual clean-up.
authorAndy Polyakov <appro@openssl.org>
Sat, 29 May 2004 19:11:29 +0000 (19:11 +0000)
committerAndy Polyakov <appro@openssl.org>
Sat, 29 May 2004 19:11:29 +0000 (19:11 +0000)
crypto/sha/sha512.c

index 22d916849755099c0dba1365338f883895178ae3..0549e6fd6686dc52f4e255d67cba6c6d710d283d 100644 (file)
@@ -144,7 +144,8 @@ int SHA512_Final (unsigned char *md,SHA512_CTX *c)
 int SHA512_Update (SHA512_CTX *c, const void *_data, size_t len)
        {
        SHA_LONG64      l;
 int SHA512_Update (SHA512_CTX *c, const void *_data, size_t len)
        {
        SHA_LONG64      l;
-       unsigned char  *p=c->u.p,*data=(unsigned char *)_data;
+       unsigned char  *p=c->u.p;
+       const unsigned char *data=(const unsigned char *)_data;
 
        if (len==0) return  1;
 
 
        if (len==0) return  1;
 
@@ -268,7 +269,7 @@ static const SHA_LONG64 K512[80] = {
 #ifndef PEDANTIC
 # if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #  if defined(__x86_64) || defined(__x86_64__)
 #ifndef PEDANTIC
 # if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 #  if defined(__x86_64) || defined(__x86_64__)
-#   define PULL64(x) ({ SHA_LONG64 ret=*((SHA_LONG64 *)(&(x)));        \
+#   define PULL64(x) ({ SHA_LONG64 ret=*((const SHA_LONG64 *)(&(x)));  \
                                asm ("bswapq    %0"             \
                                : "=r"(ret)                     \
                                : "0"(ret)); ret;               })
                                asm ("bswapq    %0"             \
                                : "=r"(ret)                     \
                                : "0"(ret)); ret;               })
@@ -277,7 +278,7 @@ static const SHA_LONG64 K512[80] = {
 #endif
 
 #ifndef PULL64
 #endif
 
 #ifndef PULL64
-#define B(x,j)    (((SHA_LONG64)(*(((unsigned char *)(&x))+j)))<<((7-j)*8))
+#define B(x,j)    (((SHA_LONG64)(*(((const unsigned char *)(&x))+j)))<<((7-j)*8))
 #define PULL64(x) (B(x,0)|B(x,1)|B(x,2)|B(x,3)|B(x,4)|B(x,5)|B(x,6)|B(x,7))
 #endif
 
 #define PULL64(x) (B(x,0)|B(x,1)|B(x,2)|B(x,3)|B(x,4)|B(x,5)|B(x,6)|B(x,7))
 #endif