[libchamplain] Using G_N_ELEMENTS instead of hardcoding the array size
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: svn-commits-list gnome org
- Subject: [libchamplain] Using G_N_ELEMENTS instead of hardcoding the array size
- Date: Tue, 16 Jun 2009 14:30:18 -0400 (EDT)
commit 32715a7902360b964eae33f21af326278f4301d4
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date: Mon Jun 15 23:17:44 2009 +0200
Using G_N_ELEMENTS instead of hardcoding the array size
.../perl/Champlain/xs/ChamplainMapSourceFactory.xs | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/bindings/perl/Champlain/xs/ChamplainMapSourceFactory.xs b/bindings/perl/Champlain/xs/ChamplainMapSourceFactory.xs
index a6d602a..84d1ba5 100644
--- a/bindings/perl/Champlain/xs/ChamplainMapSourceFactory.xs
+++ b/bindings/perl/Champlain/xs/ChamplainMapSourceFactory.xs
@@ -2,11 +2,15 @@
static GPerlCallback*
champlainperl_constructor_create (SV *func, SV *data) {
- GType param_types[2] = {
+ GType param_types [] = {
CHAMPLAIN_TYPE_MAP_SOURCE_DESC,
G_TYPE_POINTER,
};
- return gperl_callback_new(func, data, 2, param_types, CHAMPLAIN_TYPE_MAP_SOURCE);
+ return gperl_callback_new(
+ func, data,
+ G_N_ELEMENTS(param_types), param_types,
+ CHAMPLAIN_TYPE_MAP_SOURCE
+ );
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]