[libchamplain] Using G_N_ELEMENTS instead of hardcoding the array size



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]