Skip to content

Commit

Permalink
fixed C compiler warning for _substitutions_only.c
Browse files Browse the repository at this point in the history
see github issue #8
  • Loading branch information
taleinat committed Feb 18, 2015
1 parent 59c9a51 commit 1141f78
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/fuzzysearch/_substitutions_only.c
Expand Up @@ -5,6 +5,7 @@
#endif


#define DECLARE_VARS
#define PREPARE
#define OUTPUT_VALUE(x) DO_FREES; Py_RETURN_TRUE
#define RETURN_AT_END Py_RETURN_FALSE
Expand All @@ -17,14 +18,16 @@
#undef RETURN_AT_END
#undef OUTPUT_VALUE
#undef PREPARE
#undef DECLARE_VARS


#ifdef IS_PY3K
#define PyInt_FromLong(x) PyLong_FromLong(x)
#endif
#define DECLARE_VARS \
PyObject *results; \
PyObject *next_result
#define PREPARE \
PyObject *results; \
PyObject *next_result; \
results = PyList_New(0); \
if (unlikely(!results)) \
return NULL;
Expand All @@ -51,6 +54,7 @@
#undef RETURN_AT_END
#undef OUTPUT_VALUE
#undef PREPARE
#undef DECLARE_VARS


static PyMethodDef substitutions_only_methods[] = {
Expand Down
2 changes: 2 additions & 0 deletions src/fuzzysearch/_substitutions_only_lp_template.h
Expand Up @@ -11,6 +11,8 @@ FUNCTION_NAME(PyObject *self, PyObject *args)
unsigned int *sub_counts;
unsigned int seq_idx, subseq_idx, count_idx;

DECLARE_VARS;

if (!PyArg_ParseTuple(
args,
#ifdef IS_PY3K
Expand Down
2 changes: 2 additions & 0 deletions src/fuzzysearch/_substitutions_only_ngrams_template.h
Expand Up @@ -34,6 +34,8 @@ FUNCTION_NAME(PyObject *self, PyObject *args)
int subseq_sum;
int n_differences;

DECLARE_VARS;

if (!PyArg_ParseTuple(
args,
#ifdef IS_PY3K
Expand Down

0 comments on commit 1141f78

Please sign in to comment.