Fixed a problem with using spamsum on 64 bit machines; pushed out as 1.0.3 release

This commit is contained in:
freakboy3742 2009-05-18 04:56:11 +00:00
parent 83377100b7
commit 436cbc2ff1
4 changed files with 6 additions and 6 deletions

2
README
View file

@ -40,7 +40,7 @@ Usage
# Import spamsum and set up some strings
>>> import spamsum
>>> s1 = "I am the very model of a modern Major-General, I've information animal and vegegtable and mineral"
>>> s1 = "I am the very model of a modern Major-General, I've information animal and vegetable and mineral"
>>> s2 = "I am the very model of a modern Brigadier, I've information animal and vegetable and something else"
>>> s3 = "Huh? Gilbert and Who?"

View file

@ -12,7 +12,7 @@
#include <stdlib.h>
int edit_distn(char *from, int from_len, char *to, int to_len);
char *spamsum(const unsigned char *in, size_t length, unsigned int flags, unsigned int bsize);
char *spamsum(const unsigned char *in, unsigned int length, unsigned int flags, unsigned int bsize);
unsigned int spamsum_match(const char *str1, const char *str2);
PyObject *py_edit_distance(PyObject *self, PyObject *args)
@ -41,7 +41,7 @@ PyObject *py_spamsum(PyObject *self, PyObject *args)
char *sum;
unsigned char *in;
size_t length;
unsigned int length;
unsigned int flags, bsize;
flags = 0;

View file

@ -1,7 +1,7 @@
from distutils.core import setup, Extension
setup(name = "pyspamsum",
version = "1.0.2",
version = "1.0.3",
author = "Russell Keith-Magee",
author_email = "russell@keith-magee.com",
url = 'http://code.google.com/p/pyspamsum/',

View file

@ -104,7 +104,7 @@ static inline u32 sum_hash(uchar c, u32 h)
take a message of length 'length' and return a string representing a hash of that message,
prefixed by the selected blocksize
*/
char *spamsum(const uchar *in, size_t length, u32 flags, u32 bsize)
char *spamsum(const uchar *in, u32 length, u32 flags, u32 bsize)
{
const char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
char *ret, *p;
@ -489,7 +489,7 @@ static char *spamsum_stdin(u32 flags, u32 block_size)
{
uchar buf[10*1024];
uchar *msg;
size_t length = 0;
u32 length = 0;
int n;
char *sum;