]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
crypto: fix compiler warnings in the .c files
authorBrian Warner <warner@lothar.com>
Thu, 16 Aug 2007 00:48:52 +0000 (17:48 -0700)
committerBrian Warner <warner@lothar.com>
Thu, 16 Aug 2007 00:48:52 +0000 (17:48 -0700)
src/allmydata/Crypto/SHA256.c
src/allmydata/Crypto/block_template.c
src/allmydata/Crypto/hash_template.c

index 6bd9df2b475c2963c693966f4d6d26a12de50afb..2e61f35003defbdd38ae66f24853d88df96be5db 100644 (file)
@@ -194,7 +194,7 @@ hash_digest (const hash_state *self)
 \r
        hash_copy((hash_state*)self,&temp);\r
        sha_done(&temp,digest);\r
-       return PyString_FromStringAndSize(digest, 32);\r
+       return PyString_FromStringAndSize((char *)digest, 32);\r
 }\r
 \r
 #include "hash_template.c"\r
index 3c9f4e9f4a3c01973cb936fe2f230f3e067d4605..50a656d8052ca3750712810804dcec119b253625 100644 (file)
@@ -410,7 +410,7 @@ ALG_Encrypt(ALGobject *self, PyObject *args)
                free(buffer);
                return NULL;
        }
-       result=PyString_FromStringAndSize(buffer, len);
+       result=PyString_FromStringAndSize((char *)buffer, len);
        free(buffer);
        return(result);
 }
@@ -572,7 +572,7 @@ ALG_Decrypt(ALGobject *self, PyObject *args)
                free(buffer);
                return NULL;
        }
-       result=PyString_FromStringAndSize(buffer, len);
+       result=PyString_FromStringAndSize((char *)buffer, len);
        free(buffer);
        return(result);
 }
@@ -674,7 +674,7 @@ ALGgetattr(PyObject *s, char *name)
   ALGobject *self = (ALGobject*)s;
   if (strcmp(name, "IV") == 0) 
     {
-      return(PyString_FromStringAndSize(self->IV, BLOCK_SIZE));
+       return(PyString_FromStringAndSize((char *)(self->IV), BLOCK_SIZE));
     }
   if (strcmp(name, "mode") == 0)
      {
index 2325b0fb32499b93cf47bc0f23958d6cd70dff4d..c3433988dd723231e0eca847f72bc68a170dec50 100644 (file)
@@ -105,11 +105,11 @@ ALG_hexdigest(ALGobject *self, PyObject *args)
        /* Get the raw (binary) digest value */
        value = (PyObject *)hash_digest(&(self->st));
        size = PyString_Size(value);
-       raw_digest = PyString_AsString(value);
+       raw_digest = (unsigned char *)PyString_AsString(value);
 
        /* Create a new string */
        retval = PyString_FromStringAndSize(NULL, size * 2 );
-       hex_digest = PyString_AsString(retval);
+       hex_digest = (unsigned char *)PyString_AsString(retval);
 
        /* Make hex version of the digest */
        for(i=j=0; i<size; i++)