Fix warnings
This commit is contained in:
20
pygit2.c
20
pygit2.c
@@ -321,8 +321,8 @@ py_str_to_git_oid(PyObject *py_str, git_oid *oid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define git_oid_to_python(oid) \
|
#define git_oid_to_python(id) \
|
||||||
PyString_FromStringAndSize(oid.id, GIT_OID_RAWSZ)
|
PyString_FromStringAndSize((const char*)id, GIT_OID_RAWSZ)
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
git_oid_to_py_str(const git_oid *oid)
|
git_oid_to_py_str(const git_oid *oid)
|
||||||
@@ -485,7 +485,7 @@ Repository_write(Repository *self, PyObject *args)
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
return Error_set_str(err, "failed to write data");
|
return Error_set_str(err, "failed to write data");
|
||||||
|
|
||||||
return git_oid_to_python(oid);
|
return git_oid_to_python(oid.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -697,7 +697,7 @@ Repository_create_commit(Repository *self, PyObject *args)
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
return Error_set(err);
|
return Error_set(err);
|
||||||
|
|
||||||
return git_oid_to_python(oid);
|
return git_oid_to_python(oid.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -738,7 +738,7 @@ Repository_create_tag(Repository *self, PyObject *args)
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return git_oid_to_python(oid);
|
return git_oid_to_python(oid.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -1010,7 +1010,7 @@ Object_get_oid(Object *self)
|
|||||||
oid = git_object_id(self->obj);
|
oid = git_object_id(self->obj);
|
||||||
assert(oid);
|
assert(oid);
|
||||||
|
|
||||||
return PyString_FromStringAndSize(oid->id, GIT_OID_RAWSZ);
|
return git_oid_to_python(oid->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -1309,7 +1309,7 @@ TreeEntry_get_oid(TreeEntry *self)
|
|||||||
const git_oid *oid;
|
const git_oid *oid;
|
||||||
|
|
||||||
oid = git_tree_entry_id(self->entry);
|
oid = git_tree_entry_id(self->entry);
|
||||||
return PyString_FromStringAndSize(oid->id, GIT_OID_RAWSZ);
|
return git_oid_to_python(oid->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -1998,7 +1998,7 @@ Index_create_tree(Index *self)
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
return Error_set(err);
|
return Error_set(err);
|
||||||
|
|
||||||
return git_oid_to_python(oid);
|
return git_oid_to_python(oid.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyMethodDef Index_methods[] = {
|
static PyMethodDef Index_methods[] = {
|
||||||
@@ -2151,7 +2151,7 @@ IndexEntry_get_path(IndexEntry *self)
|
|||||||
static PyObject *
|
static PyObject *
|
||||||
IndexEntry_get_oid(IndexEntry *self)
|
IndexEntry_get_oid(IndexEntry *self)
|
||||||
{
|
{
|
||||||
return git_oid_to_python(self->entry->oid);
|
return git_oid_to_python(self->entry->oid.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
@@ -2477,7 +2477,7 @@ Reference_get_oid(Reference *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 2- Convert and return it */
|
/* 2- Convert and return it */
|
||||||
return PyString_FromStringAndSize(oid->id, GIT_OID_RAWSZ);
|
return git_oid_to_python(oid->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Reference in New Issue
Block a user