mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 07:06:41 +00:00
pyfec: silence compiler warnings, add -Wall to debugmode compilation
This commit is contained in:
parent
22e9e2eb0b
commit
4a9cd3d977
@ -182,7 +182,7 @@ Encoder_encode(Encoder *self, PyObject *args) {
|
||||
py_raise_fec_error("Precondition violation: %u'th item is required to offer the single-segment read character buffer protocol, but it does not.\n", i);
|
||||
goto err;
|
||||
}
|
||||
if (PyObject_AsReadBuffer(fastinsharesitems[i], &(incshares[i]), &sz))
|
||||
if (PyObject_AsReadBuffer(fastinsharesitems[i], (const void**)&(incshares[i]), &sz))
|
||||
goto err;
|
||||
if (oldsz != 0 && oldsz != sz) {
|
||||
py_raise_fec_error("Precondition violation: Input shares are required to be all the same length. oldsz: %Zu, sz: %Zu\n", oldsz, sz);
|
||||
@ -199,7 +199,7 @@ Encoder_encode(Encoder *self, PyObject *args) {
|
||||
pystrs_produced[check_share_index] = PyString_FromStringAndSize(NULL, sz);
|
||||
if (pystrs_produced[check_share_index] == NULL)
|
||||
goto err;
|
||||
check_shares_produced[check_share_index] = PyString_AsString(pystrs_produced[check_share_index]);
|
||||
check_shares_produced[check_share_index] = (gf*)PyString_AsString(pystrs_produced[check_share_index]);
|
||||
if (check_shares_produced[check_share_index] == NULL)
|
||||
goto err;
|
||||
check_share_index++;
|
||||
@ -433,7 +433,7 @@ Decoder_decode(Decoder *self, PyObject *args) {
|
||||
py_raise_fec_error("Precondition violation: %u'th item is required to offer the single-segment read character buffer protocol, but it does not.\n", i);
|
||||
goto err;
|
||||
}
|
||||
if (PyObject_AsReadBuffer(fastsharesitems[i], &(cshares[i]), &sz))
|
||||
if (PyObject_AsReadBuffer(fastsharesitems[i], (const void**)&(cshares[i]), &sz))
|
||||
goto err;
|
||||
if (oldsz != 0 && oldsz != sz) {
|
||||
py_raise_fec_error("Precondition violation: Input shares are required to be all the same length. oldsz: %Zu, sz: %Zu\n", oldsz, sz);
|
||||
@ -451,7 +451,7 @@ Decoder_decode(Decoder *self, PyObject *args) {
|
||||
unsigned char c = cshareids[i];
|
||||
|
||||
SWAP (cshareids[i], cshareids[c], int);
|
||||
SWAP (cshares[i], cshares[c], gf*);
|
||||
SWAP (cshares[i], cshares[c], const gf*);
|
||||
SWAP (fastsharesitems[i], fastsharesitems[c], PyObject*);
|
||||
}
|
||||
}
|
||||
@ -461,7 +461,7 @@ Decoder_decode(Decoder *self, PyObject *args) {
|
||||
recoveredpystrs[i] = PyString_FromStringAndSize(NULL, sz);
|
||||
if (recoveredpystrs[i] == NULL)
|
||||
goto err;
|
||||
recoveredcstrs[i] = PyString_AsString(recoveredpystrs[i]);
|
||||
recoveredcstrs[i] = (gf*)PyString_AsString(recoveredpystrs[i]);
|
||||
if (recoveredcstrs[i] == NULL)
|
||||
goto err;
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ static gf gf_mul_table[256][256];
|
||||
* multiplication of two numbers can be resolved without calling modnn
|
||||
*/
|
||||
static void
|
||||
init_mul_table () {
|
||||
_init_mul_table(void) {
|
||||
int i, j;
|
||||
for (i = 0; i < 256; i++)
|
||||
for (j = 0; j < 256; j++)
|
||||
@ -504,8 +504,8 @@ invert_vdm (gf * src, int k) {
|
||||
static int fec_initialized = 0;
|
||||
static void
|
||||
init_fec (void) {
|
||||
generate_gf ();
|
||||
init_mul_table ();
|
||||
generate_gf();
|
||||
_init_mul_table();
|
||||
fec_initialized = 1;
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,7 @@ undef_macros=[]
|
||||
if DEBUGMODE:
|
||||
extra_compile_args.append("-O0")
|
||||
extra_compile_args.append("-g")
|
||||
extra_compile_args.append("-Wall")
|
||||
extra_link_args.append("-g")
|
||||
undef_macros.append('NDEBUG')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user