From 329e8125aa3b4c83121f8290a5436c2cb4c1cf96 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 1 Oct 2014 12:14:43 +0100 Subject: [PATCH] hw/xwin: Fix compilation with -Werror=declaration-after-statement xevents.c: In function 'winClipboardInitMonitoredSelections': xevents.c:129:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < CLIP_NUM_SELECTIONS; ++i) Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winclipboard/xevents.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xwin/winclipboard/xevents.c b/hw/xwin/winclipboard/xevents.c index d0077b846..33d52aafd 100644 --- a/hw/xwin/winclipboard/xevents.c +++ b/hw/xwin/winclipboard/xevents.c @@ -126,7 +126,8 @@ void winClipboardInitMonitoredSelections(void) { /* Initialize static variables */ - for (int i = 0; i < CLIP_NUM_SELECTIONS; ++i) + int i; + for (i = 0; i < CLIP_NUM_SELECTIONS; ++i) s_iOwners[i] = None; lastOwnedSelectionIndex = CLIP_OWN_NONE;