[pygobject] pygi-info.c: Robustify pointer arithmetic
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] pygi-info.c: Robustify pointer arithmetic
- Date: Fri, 27 Jul 2012 20:13:20 +0000 (UTC)
commit 8bc98fc6665ebab763ee92361929139a0ebe66b5
Author: Martin Pitt <martinpitt gnome org>
Date: Fri Jul 27 20:52:00 2012 +0200
pygi-info.c: Robustify pointer arithmetic
In _wrap_g_field_info_{get,set}_value(), use explicit char* casts to point out
that we are using byte offsets. Fixes warnings:
pygi-info.c:1277:43: warning: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith]
gi/pygi-info.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gi/pygi-info.c b/gi/pygi-info.c
index 8aafe8b..9f92cd3 100644
--- a/gi/pygi-info.c
+++ b/gi/pygi-info.c
@@ -1274,7 +1274,7 @@ _wrap_g_field_info_get_value (PyGIBaseInfo *self,
offset = g_field_info_get_offset ( (GIFieldInfo *) self->info);
- value.v_pointer = pointer + offset;
+ value.v_pointer = (char*) pointer + offset;
goto argument_to_object;
}
@@ -1410,7 +1410,7 @@ _wrap_g_field_info_set_value (PyGIBaseInfo *self,
size = g_struct_info_get_size ( (GIStructInfo *) info);
g_assert (size > 0);
- g_memmove (pointer + offset, value.v_pointer, size);
+ g_memmove ((char*) pointer + offset, value.v_pointer, size);
g_base_info_unref (info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]