Fix memory leak and warning regarding adaptors_rep. Return 0 from main for successfu...
[free-sw/xcb/demo] / xcbrandr.c
index 44b3f3e..f3d84e2 100644 (file)
@@ -137,7 +137,7 @@ main (int argc, char **argv)
   int          width = 0, height = 0;
   int          have_pixel_size = 0;
   XCBGenericError *err;
-  CARD16 mask = (CARD16) StructureNotifyMask;
+  CARD16 mask = (CARD16) XCBEventMaskStructureNotify;
   CARD32 values[1];
   XCBRandRGetScreenInfoCookie scookie;
   int major_version, minor_version;
@@ -409,9 +409,6 @@ main (int argc, char **argv)
        XRRUpdateConfiguration (&event);
 #endif
        
-       if (event->response_type == ConfigureNotify)
-         printf("Received ConfigureNotify Event!\n");
-       
        switch (event->response_type - event_base) {
        case XCBRandRScreenChangeNotify:
          sce = (XCBRandRScreenChangeNotifyEvent *) event;
@@ -420,7 +417,7 @@ main (int argc, char **argv)
          printf(" window = %d\n root = %d\n size_index = %d\n rotation %d\n", 
               (int) sce->request_window.xid, (int) sce->root.xid, 
               sce->sizeID,  sce->rotation);
-         printf(" timestamp = %ld, config_timestamp = %ld\n",
+         printf(" timestamp = %d, config_timestamp = %d\n",
               sce->timestamp, sce->config_timestamp);
          printf(" Rotation = %x\n", sce->rotation);
          printf(" %d X %d pixels, %d X %d mm\n",
@@ -437,7 +434,9 @@ main (int argc, char **argv)
          else printf ("new Subpixel rendering model is %s\n", order[spo]);
          break;
        default:
-         if (event->response_type != ConfigureNotify) 
+         if (event->response_type == XCBConfigureNotify)
+           printf("Received ConfigureNotify Event!\n");
+          else
            printf("unknown event received, type = %d!\n", event->response_type);
        }
        }