]> err.no Git - libchamplain/commitdiff
Using G_N_ELEMENTS instead of hardcoding the array size
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Mon, 15 Jun 2009 21:17:44 +0000 (23:17 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Mon, 15 Jun 2009 21:57:29 +0000 (17:57 -0400)
bindings/perl/Champlain/xs/ChamplainMapSourceFactory.xs

index a6d602afe2db9f49ca116c9d7a629144f7dc379b..84d1ba5d1de03fb129b81eead949d29bf7a5f724 100644 (file)
@@ -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
+       );
 }