From 65e41486f478dae996459e8e8b834be8c9b1e6a9 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 12 May 2008 04:33:30 +0000 Subject: Added do { ... } while (0) to the GUI_V* macros, so that they will work as expected if, for instance, someone writes "if (...) GUI_V1_MENU_ITEM( ... );" I don't expect anyone will want to write statements like that, but just to avoid nasty surprises... svn-id: r32049 --- engines/kyra/gui_lok.h | 104 ++++++++++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 49 deletions(-) (limited to 'engines/kyra/gui_lok.h') diff --git a/engines/kyra/gui_lok.h b/engines/kyra/gui_lok.h index aa3bcdcc7f..607ef0b605 100644 --- a/engines/kyra/gui_lok.h +++ b/engines/kyra/gui_lok.h @@ -31,59 +31,65 @@ namespace Kyra { #define GUI_V1_BUTTON(button, a, b, c, d, e, f, g, h, i, j, k) \ - button.nextButton = 0; \ - button.index = a; \ - button.unk6 = button.unk8 = 0; \ - button.data0Val1 = b; \ - button.data1Val1 = c; \ - button.data2Val1 = d; \ - button.data0ShapePtr = button.data1ShapePtr = button.data2ShapePtr = 0; \ - button.flags = e; \ - button.dimTableIndex = f; \ - button.x = g; \ - button.y = h; \ - button.width = i; \ - button.height = j; \ - button.flags2 = k; \ - button.mouseWheel = 0 + do { \ + button.nextButton = 0; \ + button.index = a; \ + button.unk6 = button.unk8 = 0; \ + button.data0Val1 = b; \ + button.data1Val1 = c; \ + button.data2Val1 = d; \ + button.data0ShapePtr = button.data1ShapePtr = button.data2ShapePtr = 0; \ + button.flags = e; \ + button.dimTableIndex = f; \ + button.x = g; \ + button.y = h; \ + button.width = i; \ + button.height = j; \ + button.flags2 = k; \ + button.mouseWheel = 0; \ + } while (0) #define GUI_V1_MENU(menu, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) \ - menu.x = a; \ - menu.y = b; \ - menu.width = c; \ - menu.height = d; \ - menu.bkgdColor = e; \ - menu.color1 = f; \ - menu.color2 = g; \ - menu.menuNameString = h; \ - menu.textColor = i; \ - menu.titleX = j; \ - menu.titleY = k; \ - menu.highlightedItem = l; \ - menu.numberOfItems = m; \ - menu.scrollUpButtonX = n; \ - menu.scrollUpButtonY = o; \ - menu.scrollDownButtonX = p; \ - menu.scrollDownButtonY = q + do { \ + menu.x = a; \ + menu.y = b; \ + menu.width = c; \ + menu.height = d; \ + menu.bkgdColor = e; \ + menu.color1 = f; \ + menu.color2 = g; \ + menu.menuNameString = h; \ + menu.textColor = i; \ + menu.titleX = j; \ + menu.titleY = k; \ + menu.highlightedItem = l; \ + menu.numberOfItems = m; \ + menu.scrollUpButtonX = n; \ + menu.scrollUpButtonY = o; \ + menu.scrollDownButtonX = p; \ + menu.scrollDownButtonY = q; \ + } while (0) #define GUI_V1_MENU_ITEM(item, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) \ - item.enabled = a; \ - item.itemString = d; \ - item.x = e; \ - item.y = g; \ - item.width = h; \ - item.height = i; \ - item.textColor = j; \ - item.highlightColor = k; \ - item.titleX = l; \ - item.bkgdColor = n; \ - item.color1 = o; \ - item.color2 = p; \ - item.saveSlot = q; \ - item.labelString = r; \ - item.labelX = s; \ - item.labelY = t; \ - item.unk1F = v + do { \ + item.enabled = a; \ + item.itemString = d; \ + item.x = e; \ + item.y = g; \ + item.width = h; \ + item.height = i; \ + item.textColor = j; \ + item.highlightColor = k; \ + item.titleX = l; \ + item.bkgdColor = n; \ + item.color1 = o; \ + item.color2 = p; \ + item.saveSlot = q; \ + item.labelString = r; \ + item.labelX = s; \ + item.labelY = t; \ + item.unk1F = v; \ + } while (0) class KyraEngine_LoK; -- cgit v1.2.3