XQuartz: Silence clang warnings about shadow declarations
authorJeremy Huddleston <jeremyhu@apple.com>
Thu, 19 May 2011 21:35:56 +0000 (14:35 -0700)
committerJeremy Huddleston <jeremyhu@apple.com>
Sun, 22 May 2011 18:17:59 +0000 (11:17 -0700)
X11Application.m:1272:26: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
                xp_error e;
                         ^
X11Application.m:1098:36: note: previous declaration is here
- (void) sendX11NSEvent:(NSEvent *)e {
                                   ^
1 warning generated.

bundle-main.c:648:36: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
                    int max_files, i;
                                   ^
bundle-main.c:594:9: note: previous declaration is here
    int i;
        ^
1 warning generated.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
hw/xquartz/X11Application.m
hw/xquartz/mach-startup/bundle-main.c

index 283132e..7c41cbc 100644 (file)
@@ -1269,7 +1269,7 @@ static const char *untrusted_str(NSEvent *e) {
 #if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
 /* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so we can't call xp_find_window from the Appkit thread */
                 xp_window_id wid = 0;
-                xp_error e;
+                xp_error err;
 
                 /* Sigh. Need to check that we're really over one of
                  * our windows. (We need to receive pointer events while
@@ -1277,9 +1277,9 @@ static const char *untrusted_str(NSEvent *e) {
                  * when another window is over us or we might show a tooltip)
                  */
 
-                e = xp_find_window(location.x, location.y, 0, &wid);
+                err = xp_find_window(location.x, location.y, 0, &wid);
 
-                if (e != XP_Success || (e == XP_Success && wid == 0))
+                if (err != XP_Success || (err == XP_Success && wid == 0))
 #endif
                 {
                     bgMouseLocation = location;
index 0e62914..94c6068 100644 (file)
@@ -645,7 +645,7 @@ int main(int argc, char **argv, char **envp) {
                 child2 = fork();
 
                 switch (child2) {
-                    int max_files, i;
+                    int max_files;
 
                     case -1:                            /* error */
                         FatalError("fork() failed: %s\n", strerror(errno));