From 32715a7902360b964eae33f21af326278f4301d4 Mon Sep 17 00:00:00 2001 From: Emmanuel Rodriguez Date: Mon, 15 Jun 2009 23:17:44 +0200 Subject: [PATCH] Using G_N_ELEMENTS instead of hardcoding the array size --- bindings/perl/Champlain/xs/ChamplainMapSourceFactory.xs | 8 ++++++-- 1 file 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 + ); } -- 2.39.5