Wireshark-dev: Re: [Wireshark-dev] [Wireshark-commits] rev 39422: /trunk/gtk/ /trunk/gtk/: main
On Fri, Oct 14, 2011 at 12:11 PM, Guy Harris
<guy@xxxxxxxxxxxx>
wrote:
Yes, it can; the only reason it couldn't be static would
be if it were called from outside gtk/main_menubar.c, which it doesn't appear
to be.
Its definition might have to protected with the same #ifdef as
its use(s), to avoid "defined but not used" warnings, but that's another
matter.
Given that its only called from merge_lua_menu_items(), might
make_menu_items() be too generic a function name?
I don't mind keeping
the function static, but protecting the whole definition with #ifdef
HAVE_LUA_5_1
While I'm at it shall I rename make_menu_items()
to make_lua_menu_items() ?
Martin
Perhaps you
can use my proposal AND rename the function?
Index: main_menubar.c
===================================================================
--- main_menubar.c (revision 913)
+++ main_menubar.c (working copy)
@@ -3694,6 +3694,8 @@
* Creates an action group for the menu items in xpath, and returns it. The
cal ler should
* use g_object_unref() on the returned pointer if transferring scope.
*/
+#ifdef HAVE_LUA
+/* NOTE currently only used from Lua, remove this ifdef when used
+outside of #i
fdef LUA */
static GtkActionGroup*
make_menu_actions(const char *path, const menu_item_t *menu_item_data) {
GtkActionGroup *action_group;
@@ -3775,11 +3777,11 @@
return action_group;
}
-
+#endif
static void
merge_lua_menu_items(GList *merge_lua_menu_items_list _U_) { -#ifdef
HAVE_LUA_5_1
+#ifdef HAVE_LUA
guint merge_id;
GtkActionGroup *action_group;
menu_item_t
*menu_item_data;