Fix various minor errors in passing arguments to
PyArg_ParseTuple.
diff --git a/Modules/audioop.c b/Modules/audioop.c
index 8f5d30c..ce00975 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -472,8 +472,12 @@
double aj_m1, aj_lm1;
double sum_ri_2, sum_aij_2, sum_aij_ri, result, best_result, factor;
+ /* Passing a short** for an 's' argument is correct only
+ if the string contents is aligned for interpretation
+ as short[]. Due to the definition of PyStringObject,
+ this is currently (Python 2.6) the case. */
if ( !PyArg_ParseTuple(args, "s#s#:findfit",
- &cp1, &len1, &cp2, &len2) )
+ (char**)&cp1, &len1, (char**)&cp2, &len2) )
return 0;
if ( len1 & 1 || len2 & 1 ) {
PyErr_SetString(AudioopError, "Strings should be even-sized");
@@ -530,7 +534,7 @@
double sum_ri_2, sum_aij_ri, result;
if ( !PyArg_ParseTuple(args, "s#s#:findfactor",
- &cp1, &len1, &cp2, &len2) )
+ (char**)&cp1, &len1, (char**)&cp2, &len2) )
return 0;
if ( len1 & 1 || len2 & 1 ) {
PyErr_SetString(AudioopError, "Strings should be even-sized");
@@ -562,7 +566,8 @@
double aj_m1, aj_lm1;
double result, best_result;
- if ( !PyArg_ParseTuple(args, "s#i:findmax", &cp1, &len1, &len2) )
+ if ( !PyArg_ParseTuple(args, "s#i:findmax",
+ (char**)&cp1, &len1, &len2) )
return 0;
if ( len1 & 1 ) {
PyErr_SetString(AudioopError, "Strings should be even-sized");