mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-12 07:52:38 +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);
|
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;
|
goto err;
|
||||||
}
|
}
|
||||||
if (PyObject_AsReadBuffer(fastinsharesitems[i], &(incshares[i]), &sz))
|
if (PyObject_AsReadBuffer(fastinsharesitems[i], (const void**)&(incshares[i]), &sz))
|
||||||
goto err;
|
goto err;
|
||||||
if (oldsz != 0 && oldsz != sz) {
|
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);
|
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);
|
pystrs_produced[check_share_index] = PyString_FromStringAndSize(NULL, sz);
|
||||||
if (pystrs_produced[check_share_index] == NULL)
|
if (pystrs_produced[check_share_index] == NULL)
|
||||||
goto err;
|
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)
|
if (check_shares_produced[check_share_index] == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
check_share_index++;
|
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);
|
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;
|
goto err;
|
||||||
}
|
}
|
||||||
if (PyObject_AsReadBuffer(fastsharesitems[i], &(cshares[i]), &sz))
|
if (PyObject_AsReadBuffer(fastsharesitems[i], (const void**)&(cshares[i]), &sz))
|
||||||
goto err;
|
goto err;
|
||||||
if (oldsz != 0 && oldsz != sz) {
|
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);
|
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];
|
unsigned char c = cshareids[i];
|
||||||
|
|
||||||
SWAP (cshareids[i], cshareids[c], int);
|
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*);
|
SWAP (fastsharesitems[i], fastsharesitems[c], PyObject*);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -461,7 +461,7 @@ Decoder_decode(Decoder *self, PyObject *args) {
|
|||||||
recoveredpystrs[i] = PyString_FromStringAndSize(NULL, sz);
|
recoveredpystrs[i] = PyString_FromStringAndSize(NULL, sz);
|
||||||
if (recoveredpystrs[i] == NULL)
|
if (recoveredpystrs[i] == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
recoveredcstrs[i] = PyString_AsString(recoveredpystrs[i]);
|
recoveredcstrs[i] = (gf*)PyString_AsString(recoveredpystrs[i]);
|
||||||
if (recoveredcstrs[i] == NULL)
|
if (recoveredcstrs[i] == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ static gf gf_mul_table[256][256];
|
|||||||
* multiplication of two numbers can be resolved without calling modnn
|
* multiplication of two numbers can be resolved without calling modnn
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
init_mul_table () {
|
_init_mul_table(void) {
|
||||||
int i, j;
|
int i, j;
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
for (j = 0; j < 256; j++)
|
for (j = 0; j < 256; j++)
|
||||||
@ -504,8 +504,8 @@ invert_vdm (gf * src, int k) {
|
|||||||
static int fec_initialized = 0;
|
static int fec_initialized = 0;
|
||||||
static void
|
static void
|
||||||
init_fec (void) {
|
init_fec (void) {
|
||||||
generate_gf ();
|
generate_gf();
|
||||||
init_mul_table ();
|
_init_mul_table();
|
||||||
fec_initialized = 1;
|
fec_initialized = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ undef_macros=[]
|
|||||||
if DEBUGMODE:
|
if DEBUGMODE:
|
||||||
extra_compile_args.append("-O0")
|
extra_compile_args.append("-O0")
|
||||||
extra_compile_args.append("-g")
|
extra_compile_args.append("-g")
|
||||||
|
extra_compile_args.append("-Wall")
|
||||||
extra_link_args.append("-g")
|
extra_link_args.append("-g")
|
||||||
undef_macros.append('NDEBUG')
|
undef_macros.append('NDEBUG')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user