config: update Config_foreach_callback_wrapper to use git_config_entry *.

This fixes:

  $ python setup.py build_ext --inplace
  src/pygit2/config.c: In function ‘Config_foreach’:
  src/pygit2/config.c:261:13: warning: passing argument 2 of ‘git_config_foreach’ from incompatible pointer type
  ../libgit2/include/git2/config.h:420:17: note: expected ‘int (*)(const struct git_config_entry *, void *)’ but argument is of type ‘int (*)(const char *, const char *, void *)’

Signed-off-by: W. Trevor King <wking@tremily.us>
This commit is contained in:
W. Trevor King 2012-10-25 10:54:38 -04:00
parent 86075d3f50
commit 396fbef698

@ -214,8 +214,7 @@ Config_setitem(Config *self, PyObject *py_key, PyObject *py_value)
}
int
Config_foreach_callback_wrapper(const char *c_name, const char *c_value,
void *c_payload)
Config_foreach_callback_wrapper(const git_config_entry *entry, void *c_payload)
{
PyObject *args = (PyObject *)c_payload;
PyObject *py_callback = NULL;
@ -227,9 +226,9 @@ Config_foreach_callback_wrapper(const char *c_name, const char *c_value,
return 0;
if (py_payload)
args = Py_BuildValue("ssO", c_name, c_value, py_payload);
args = Py_BuildValue("ssO", entry->name, entry->value, py_payload);
else
args = Py_BuildValue("ss", c_name, c_value);
args = Py_BuildValue("ss", entry->name, entry->value);
if (!(py_result = PyObject_CallObject(py_callback,args)))
return 0;