~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_groupcompress_pyx.pyx

Merge Martin gz's tweaks for signed vs unsigned, but tweak them a bit further.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
    int get_hash_offset(delta_index *index, int pos, unsigned int *hash_offset)
75
75
    int get_entry_summary(delta_index *index, int pos,
76
76
                          unsigned int *global_offset, unsigned int *hash_val)
77
 
    unsigned int rabin_hash (char *data)
 
77
    unsigned int rabin_hash (unsigned char *data)
78
78
 
79
79
 
80
80
cdef void *safe_malloc(size_t count) except NULL:
124
124
    if len(content) < 16:
125
125
        raise ValueError('content must be at least 16 bytes long')
126
126
    # Try to cast it to an int, if it can fit
127
 
    return int(rabin_hash(PyString_AS_STRING(content)))
 
127
    return int(rabin_hash(<unsigned char*>(PyString_AS_STRING(content))))
128
128
 
129
129
 
130
130
cdef class DeltaIndex: