xserver: Branch 'xorg-server-1.4-apple' - 2 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Sat Sep 5 02:54:13 PDT 2009


 hw/xquartz/X11Controller.h            |   10 ++++++++++
 hw/xquartz/X11Controller.m            |    8 --------
 hw/xquartz/mach-startup/bundle-main.c |   11 ++++++-----
 3 files changed, 16 insertions(+), 13 deletions(-)

New commits:
commit fb55aa6bab036cc4bf84d9b29a8df99940dd8a3f
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Sep 5 02:51:09 2009 -0700

    XQuartz: Fix a strcpy/strcmp typo
    (cherry picked from commit 701c24da3ef76a05ccb2d7e84ccfa1b7c5d38e15)

diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index be5d24b..7531a0e 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -327,7 +327,7 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv,
     char **_envp = alloca((envpCnt + 1) * sizeof(char *));
     size_t i;
     
-    /* If we didn't get handed a launchd DISPLAY socket, we shoul
+    /* If we didn't get handed a launchd DISPLAY socket, we should
      * unset DISPLAY or we can run into problems with pbproxy
      */
     if(!launchd_socket_handed_off)
@@ -484,14 +484,15 @@ static void setup_env() {
             }
 
             if(s && *s) {
-                temp = (char *)malloc(sizeof(char) * (strlen(pds) + 3));
+                size_t pds_len = strlen(pds);
+                temp = (char *)malloc(sizeof(char) * pds_len);
                 if(!temp) {
                     fprintf(stderr, "Memory allocation error creating space for socket name test.\n");
                 }
-                strcpy(temp, pds);
-                strcat(temp, ":0");
+                strlcpy(temp, pds, pds_len - 3);
+                strlcat(temp, ":0", pds_len);
 
-                if(strcpy(temp, s) != 0) {
+                if(strcmp(temp, s) != 0) {
                     /* If we don't have a match, unset it. */
                     unsetenv("DISPLAY");
                 }
commit 0ad3d2d70950281b38216089f63c5087ebefee91
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sun Aug 9 16:13:32 2009 -0700

    XQuartz: Check NSINTEGER_DEFINED to make sure the NSInteger and NSUInteger types are defined.
    (cherry picked from commit 36e02a8649c0a545084cce5fb2c5717277b9273c)

diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index 170bccc..a86b20f 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -45,6 +45,16 @@
 #undef BOOL
 #endif
 
+#ifndef NSINTEGER_DEFINED
+#if __LP64__ || NS_BUILD_32_LIKE_64
+typedef long NSInteger;
+typedef unsigned long NSUInteger;
+#else
+typedef int NSInteger;
+typedef unsigned int NSUInteger;
+#endif
+#endif
+
 @interface X11Controller : NSObject
 {
     IBOutlet NSPanel *prefs_panel;
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index 9900537..2a533de 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -164,11 +164,7 @@ BOOL xquartz_resetenv_display = NO;
 
       item = (NSMenuItem *) [menu addItemWithTitle:name action:@selector
 				  (item_selected:) keyEquivalent:shortcut];
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
       [item setKeyEquivalentModifierMask:(NSUInteger) windowItemModMask];
-#else
-      [item setKeyEquivalentModifierMask:windowItemModMask];
-#endif
       [item setTarget:self];
       [item setTag:i];
       [item setEnabled:YES];
@@ -177,11 +173,7 @@ BOOL xquartz_resetenv_display = NO;
 				       action:@selector
 				       (item_selected:) keyEquivalent:shortcut
 				       atIndex:i];
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
       [item setKeyEquivalentModifierMask:(NSUInteger) windowItemModMask];
-#else
-      [item setKeyEquivalentModifierMask:windowItemModMask];
-#endif
       [item setTarget:self];
       [item setTag:i];
       [item setEnabled:YES];


More information about the xorg-commit mailing list