[pygobject/gsoc2009: 44/160] Shorten lables thanks to scopes
- From: Simon van der Linden <svdlinden src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pygobject/gsoc2009: 44/160] Shorten lables thanks to scopes
- Date: Fri, 14 Aug 2009 21:25:47 +0000 (UTC)
commit aa0f9728f639dedd3ff9e9a44bea62d7f4fa1ace
Author: Simon van der Linden <svdlinden src gnome org>
Date: Mon Jul 20 15:16:58 2009 +0200
Shorten lables thanks to scopes
gi/pygargument.c | 10 +++++-----
gi/pygiinfo.c | 28 ++++++++++++++--------------
2 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/gi/pygargument.c b/gi/pygargument.c
index b8175d7..aab413a 100644
--- a/gi/pygargument.c
+++ b/gi/pygargument.c
@@ -213,7 +213,7 @@ pygi_gi_type_info_check_py_object(GITypeInfo *type_info, PyObject *object)
pygi_gi_type_tag_get_py_bounds(type_tag, &lower, &upper);
if (lower == NULL || upper == NULL) {
retval = -1;
- goto gi_type_info_check_py_object_check_number_clean;
+ goto check_number_clean;
}
/* Check bounds */
@@ -223,14 +223,14 @@ pygi_gi_type_info_check_py_object(GITypeInfo *type_info, PyObject *object)
if (PyErr_Occurred()) {
retval = -1;
- goto gi_type_info_check_py_object_check_number_error_clean;
+ goto check_number_error_clean;
}
lower_str = PyObject_Str(lower);
upper_str = PyObject_Str(upper);
if (lower_str == NULL || upper_str == NULL) {
retval = -1;
- goto gi_type_info_check_py_object_check_number_error_clean;
+ goto check_number_error_clean;
}
PyErr_Format(PyExc_ValueError, "Must range from %s to %s",
@@ -239,12 +239,12 @@ pygi_gi_type_info_check_py_object(GITypeInfo *type_info, PyObject *object)
retval = 0;
-gi_type_info_check_py_object_check_number_error_clean:
+check_number_error_clean:
Py_XDECREF(lower_str);
Py_XDECREF(upper_str);
}
-gi_type_info_check_py_object_check_number_clean:
+check_number_clean:
Py_XDECREF(lower);
Py_XDECREF(upper);
break;
diff --git a/gi/pygiinfo.c b/gi/pygiinfo.c
index 0decf5c..3f393c1 100644
--- a/gi/pygiinfo.c
+++ b/gi/pygiinfo.c
@@ -1473,7 +1473,7 @@ _wrap_g_field_info_get_value(PyGIBaseInfo *self, PyObject *args)
gsize size;
buffer = pygi_py_object_get_buffer(object, &size);
if (buffer == NULL) {
- goto field_info_get_value_return;
+ goto return_;
}
} else {
buffer = pygobject_get(object);
@@ -1486,7 +1486,7 @@ _wrap_g_field_info_get_value(PyGIBaseInfo *self, PyObject *args)
if (!(g_field_info_get_flags((GIFieldInfo *)self->info) & GI_FIELD_IS_READABLE)) {
PyErr_SetString(PyExc_RuntimeError, "Field is not readable");
- goto field_info_get_value_return;
+ goto return_;
}
info = g_type_info_get_interface (field_type_info);
@@ -1509,7 +1509,7 @@ _wrap_g_field_info_get_value(PyGIBaseInfo *self, PyObject *args)
g_memmove(value.v_pointer, buffer + offset, size);
g_base_info_unref(info);
- goto field_info_get_value_g_argument_to_py_object;
+ goto g_argument_to_py_object;
}
case GI_INFO_TYPE_UNION:
case GI_INFO_TYPE_BOXED:
@@ -1524,19 +1524,19 @@ _wrap_g_field_info_get_value(PyGIBaseInfo *self, PyObject *args)
g_base_info_unref(info);
if (PyErr_Occurred()) {
- goto field_info_get_value_return;
+ goto return_;
}
}
if (!g_field_info_get_field((GIFieldInfo *)self->info, buffer, &value)) {
PyErr_SetString(PyExc_RuntimeError, "Failed to get value for field");
- goto field_info_get_value_return;
+ goto return_;
}
-field_info_get_value_g_argument_to_py_object:
+g_argument_to_py_object:
retval = pyg_argument_to_pyobject(&value, field_type_info);
-field_info_get_value_return:
+return_:
g_base_info_unref((GIBaseInfo *)field_type_info);
Py_XINCREF(retval);
@@ -1572,7 +1572,7 @@ _wrap_g_field_info_set_value(PyGIBaseInfo *self, PyObject *args)
gsize size;
buffer = pygi_py_object_get_buffer(object, &size);
if (buffer == NULL) {
- goto field_info_set_value_return;
+ goto return_;
}
} else {
buffer = pygobject_get(object);
@@ -1582,13 +1582,13 @@ _wrap_g_field_info_set_value(PyGIBaseInfo *self, PyObject *args)
check_retval = pygi_gi_type_info_check_py_object(field_type_info, py_value);
if (check_retval < 0) {
- goto field_info_set_value_return;
+ goto return_;
}
if (!check_retval) {
PyErr_PREFIX_FROM_FORMAT("%s.set_value() argument 1: ",
g_base_info_get_namespace(self->info));
- goto field_info_set_value_return;
+ goto return_;
}
value = pyg_argument_from_pyobject(py_value, field_type_info);
@@ -1600,7 +1600,7 @@ _wrap_g_field_info_set_value(PyGIBaseInfo *self, PyObject *args)
if (!(g_field_info_get_flags((GIFieldInfo *)self->info) & GI_FIELD_IS_WRITABLE)) {
PyErr_SetString(PyExc_RuntimeError, "Field is not writable");
- goto field_info_set_value_return;
+ goto return_;
}
info = g_type_info_get_interface(field_type_info);
@@ -1619,7 +1619,7 @@ _wrap_g_field_info_set_value(PyGIBaseInfo *self, PyObject *args)
retval = Py_None;
g_base_info_unref(info);
- goto field_info_set_value_return;
+ goto return_;
}
case GI_INFO_TYPE_UNION:
case GI_INFO_TYPE_BOXED:
@@ -1636,12 +1636,12 @@ _wrap_g_field_info_set_value(PyGIBaseInfo *self, PyObject *args)
if (!g_field_info_set_field((GIFieldInfo *)self->info, buffer, &value)) {
PyErr_SetString(PyExc_RuntimeError, "Failed to set value for field");
- goto field_info_set_value_return;
+ goto return_;
}
retval = Py_None;
-field_info_set_value_return:
+return_:
g_base_info_unref((GIBaseInfo *)field_type_info);
Py_XINCREF(retval);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]