Fix compilation warnings

This commit is contained in:
J. David Ibáñez
2013-05-11 21:55:28 +02:00
parent 405d5ccdfb
commit 8c69751d4f
2 changed files with 7 additions and 3 deletions

View File

@@ -248,6 +248,9 @@ Oid_richcompare(PyObject *o1, PyObject *o2, int op)
case Py_GE:
res = (cmp >= 0) ? Py_True: Py_False;
break;
default:
PyErr_Format(PyExc_RuntimeError, "Unexpected '%d' op", op);
return NULL;
}
Py_INCREF(res);

View File

@@ -79,7 +79,8 @@
/* Utilities */
#define to_unicode(x, encoding, errors) to_unicode_n(x, strlen(x), encoding, errors)
#define to_unicode(x, encoding, errors)\
to_unicode_n(x, strlen(x), encoding, errors)
PYGIT2_FN_UNUSED
Py_LOCAL_INLINE(PyObject*)
@@ -150,8 +151,8 @@ char * py_str_to_c_str(PyObject *value, const char *encoding);
/* Helpers to make type init shorter. */
#define INIT_TYPE(type, base, new) \
if (base != NULL) type.tp_base = base; \
if (new != NULL) type.tp_new = new; \
type.tp_base = base; \
type.tp_new = new; \
if (PyType_Ready(&type) < 0) return NULL;
#define ADD_TYPE(module, type) \