From c64472f47e5434caddb247ca9e7500111b82f7dc Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 25 Oct 2017 11:48:57 -0400 Subject: MqTabLabel, MqMainMenu, MqWebView: Use G_STMT_START/G_STMT_END in macros --- (limited to 'src/web-view.c') diff --git a/src/web-view.c b/src/web-view.c index ca7f4fb..2c07216 100644 --- a/src/web-view.c +++ b/src/web-view.c @@ -195,7 +195,7 @@ menu_open_audio_win_activate_cb(GtkAction G_GNUC_UNUSED *action, #define ITEM_DECLS_NO_CUSTOM \ WebKitContextMenuItem *menu_item; #define NEW_CUSTOM_ITEM(NAME, LABEL) \ - do { \ + G_STMT_START { \ /* Don't blame me; blame WebKitGTK+ for using GtkAction. */ \ G_GNUC_BEGIN_IGNORE_DEPRECATIONS \ action = gtk_action_new(#NAME, (LABEL), NULL, NULL); \ @@ -204,25 +204,25 @@ menu_open_audio_win_activate_cb(GtkAction G_GNUC_UNUSED *action, G_CALLBACK(menu_##NAME##_activate_cb), web_view); \ menu_item = webkit_context_menu_item_new(action); \ webkit_context_menu_append(context_menu, menu_item); \ - } while (0) + } G_STMT_END #define NEW_STOCK_ITEM(STOCK) \ - do { \ + G_STMT_START { \ menu_item = webkit_context_menu_item_new_from_stock_action( \ WEBKIT_CONTEXT_MENU_ACTION_##STOCK); \ webkit_context_menu_append(context_menu, menu_item); \ - } while (0) + } G_STMT_END #define NEW_SEPARATOR_ITEM() \ - do { \ + G_STMT_START { \ webkit_context_menu_append(context_menu, \ webkit_context_menu_item_new_separator()); \ - } while (0) + } G_STMT_END #define RESTORE_ITEMS(ITEMS) \ - do { \ + G_STMT_START { \ for (; ITEMS; ITEMS = ITEMS->next) { \ webkit_context_menu_append(context_menu, ITEMS->data); \ g_object_unref(ITEMS->data); \ } \ - } while (0) + } G_STMT_END static void context_menu_link_cb(WebKitContextMenu *context_menu, MqWebView *web_view) @@ -313,10 +313,10 @@ context_menu_document_cb(WebKitContextMenu *context_menu, GList *nav_items, } #define PRESERVE_ITEM(ITEMS) \ - do { \ + G_STMT_START { \ g_object_ref(items->data); \ ITEMS = g_list_prepend(ITEMS, items->data); \ - } while (0) + } G_STMT_END static gboolean context_menu_cb(WebKitWebView *wk_web_view, WebKitContextMenu *context_menu, -- cgit v0.9.1