Fix compile warnings
This commit is contained in:
@@ -133,9 +133,10 @@ int
|
|||||||
Config_contains(Config *self, PyObject *py_key) {
|
Config_contains(Config *self, PyObject *py_key) {
|
||||||
int err;
|
int err;
|
||||||
const char *c_value;
|
const char *c_value;
|
||||||
const char *c_key;
|
char *c_key;
|
||||||
|
|
||||||
if (!(c_key = py_str_to_c_str(py_key,NULL)))
|
c_key = py_str_to_c_str(py_key,NULL);
|
||||||
|
if (c_key == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
err = git_config_get_string(&c_value, self->config, c_key);
|
err = git_config_get_string(&c_value, self->config, c_key);
|
||||||
@@ -157,7 +158,7 @@ Config_getitem(Config *self, PyObject *py_key)
|
|||||||
int64_t c_intvalue;
|
int64_t c_intvalue;
|
||||||
int c_boolvalue;
|
int c_boolvalue;
|
||||||
const char *c_charvalue;
|
const char *c_charvalue;
|
||||||
const char *c_key;
|
char *c_key;
|
||||||
|
|
||||||
if (!(c_key = py_str_to_c_str(py_key,NULL)))
|
if (!(c_key = py_str_to_c_str(py_key,NULL)))
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -191,8 +192,8 @@ int
|
|||||||
Config_setitem(Config *self, PyObject *py_key, PyObject *py_value)
|
Config_setitem(Config *self, PyObject *py_key, PyObject *py_value)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
const char *c_key;
|
char *c_key;
|
||||||
const char *py_str;
|
char *py_str;
|
||||||
|
|
||||||
if (!(c_key = py_str_to_c_str(py_key,NULL)))
|
if (!(c_key = py_str_to_c_str(py_key,NULL)))
|
||||||
return -1;
|
return -1;
|
||||||
@@ -208,8 +209,7 @@ Config_setitem(Config *self, PyObject *py_key, PyObject *py_value)
|
|||||||
} else {
|
} else {
|
||||||
py_value = PyObject_Str(py_value);
|
py_value = PyObject_Str(py_value);
|
||||||
py_str = py_str_to_c_str(py_value,NULL);
|
py_str = py_str_to_c_str(py_value,NULL);
|
||||||
err = git_config_set_string(self->config, c_key,
|
err = git_config_set_string(self->config, c_key, py_str);
|
||||||
py_str);
|
|
||||||
free(py_str);
|
free(py_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -85,7 +85,7 @@ Signature_dealloc(Signature *self)
|
|||||||
Py_DECREF(self->obj);
|
Py_DECREF(self->obj);
|
||||||
else {
|
else {
|
||||||
git_signature_free((git_signature*)self->signature);
|
git_signature_free((git_signature*)self->signature);
|
||||||
free((void*)self->encoding);
|
free((char*)self->encoding);
|
||||||
}
|
}
|
||||||
Py_TYPE(self)->tp_free((PyObject*)self);
|
Py_TYPE(self)->tp_free((PyObject*)self);
|
||||||
}
|
}
|
||||||
|
@@ -43,7 +43,7 @@ void
|
|||||||
TreeEntry_dealloc(TreeEntry *self)
|
TreeEntry_dealloc(TreeEntry *self)
|
||||||
{
|
{
|
||||||
Py_XDECREF(self->owner);
|
Py_XDECREF(self->owner);
|
||||||
git_tree_entry_free(self->entry);
|
git_tree_entry_free((git_tree_entry*)self->entry);
|
||||||
PyObject_Del(self);
|
PyObject_Del(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user