X11: Fixed compiler warnings in DEBUG_XEVENTS sections.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 04 Jun 2015 10:59:02 -0400
changeset 9705f037dd7d7cc9
parent 9704 827a407ee74c
child 9706 92472fcca43f
X11: Fixed compiler warnings in DEBUG_XEVENTS sections.
src/video/x11/SDL_x11events.c
     1.1 --- a/src/video/x11/SDL_x11events.c	Thu Jun 04 17:52:51 2015 +0200
     1.2 +++ b/src/video/x11/SDL_x11events.c	Thu Jun 04 10:59:02 2015 -0400
     1.3 @@ -918,8 +918,8 @@
     1.4                  xdnd_version = (xevent.xclient.data.l[1] >> 24);
     1.5  #ifdef DEBUG_XEVENTS
     1.6                  printf("XID of source window : %ld\n", data->xdnd_source);
     1.7 -                printf("Protocol version to use : %ld\n", xdnd_version);
     1.8 -                printf("More then 3 data types : %ld\n", use_list); 
     1.9 +                printf("Protocol version to use : %d\n", xdnd_version);
    1.10 +                printf("More then 3 data types : %d\n", (int) use_list);
    1.11  #endif
    1.12   
    1.13                  if (use_list) {
    1.14 @@ -1066,7 +1066,7 @@
    1.15              unsigned char *propdata;
    1.16              int status, real_format;
    1.17              Atom real_type;
    1.18 -            unsigned long items_read, items_left, i;
    1.19 +            unsigned long items_read, items_left;
    1.20  
    1.21              char *name = X11_XGetAtomName(display, xevent.xproperty.atom);
    1.22              if (name) {
    1.23 @@ -1118,18 +1118,18 @@
    1.24  
    1.25                      printf("{");
    1.26                      for (i = 0; i < items_read; i++) {
    1.27 -                        char *name = X11_XGetAtomName(display, atoms[i]);
    1.28 -                        if (name) {
    1.29 -                            printf(" %s", name);
    1.30 -                            X11_XFree(name);
    1.31 +                        char *atomname = X11_XGetAtomName(display, atoms[i]);
    1.32 +                        if (atomname) {
    1.33 +                            printf(" %s", atomname);
    1.34 +                            X11_XFree(atomname);
    1.35                          }
    1.36                      }
    1.37                      printf(" }\n");
    1.38                  } else {
    1.39 -                    char *name = X11_XGetAtomName(display, real_type);
    1.40 -                    printf("Unknown type: %ld (%s)\n", real_type, name ? name : "UNKNOWN");
    1.41 -                    if (name) {
    1.42 -                        X11_XFree(name);
    1.43 +                    char *atomname = X11_XGetAtomName(display, real_type);
    1.44 +                    printf("Unknown type: %ld (%s)\n", real_type, atomname ? atomname : "UNKNOWN");
    1.45 +                    if (atomname) {
    1.46 +                        X11_XFree(atomname);
    1.47                      }
    1.48                  }
    1.49              }