From: Emmanuel Rodriguez Date: Mon, 15 Jun 2009 21:17:44 +0000 (+0200) Subject: Using G_N_ELEMENTS instead of hardcoding the array size X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32715a7902360b964eae33f21af326278f4301d4;p=libchamplain Using G_N_ELEMENTS instead of hardcoding the array size --- 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 + ); }