[Xquartz-changes] xserver: Branch 'master' - 4 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Sun Dec 29 12:51:32 PST 2013


 hw/xquartz/GL/indirect.c   |    4 ++--
 hw/xquartz/X11Controller.m |    2 +-
 hw/xquartz/darwinfb.h      |    2 +-
 hw/xquartz/xpr/x-hook.c    |   27 ++++++---------------------
 4 files changed, 10 insertions(+), 25 deletions(-)

New commits:
commit c4f510b6e5dcb478a67de24baa80425bf1dee8ab
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Dec 29 12:45:23 2013 -0800

    XQuartz: Simplify hook_run to quiet static analyzer
    
    x-hook.c:96:9: warning: Called function pointer is an uninitalized pointer value
            (*fun[i])(arg, data[i]);
            ^~~~~~~~~~~~~~~~~~~~~~~
    1 warning generated.
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/xpr/x-hook.c b/hw/xquartz/xpr/x-hook.c
index b5d8ab9..3922bb8 100644
--- a/hw/xquartz/xpr/x-hook.c
+++ b/hw/xquartz/xpr/x-hook.c
@@ -70,34 +70,19 @@ X_PFX(hook_remove) (x_list * lst, x_hook_function * fun, void *data) {
 
 X_EXTERN void
 X_PFX(hook_run) (x_list * lst, void *arg) {
-    x_list *node, *cell;
-    x_hook_function **fun;
-    void **data;
-    int length, i;
+    x_list *node;
 
     if (!lst)
         return;
 
-    length = X_PFX(list_length) (lst);
-    fun = malloc(sizeof(x_hook_function *) * length);
-    data = malloc(sizeof(void *) * length);
-
-    if (!fun || !data) {
-        FatalError("Failed to allocate memory in %s\n", __func__);
-    }
+    for (node = lst; node != NULL; node = node->next) {
+        x_list *cell = node->data;
 
-    for (i = 0, node = lst; node != NULL; node = node->next, i++) {
-        cell = node->data;
-        fun[i] = CELL_FUN(cell);
-        data[i] = CELL_DATA(cell);
-    }
+        x_hook_function *fun = CELL_FUN(cell);
+        void *data = CELL_DATA(cell);
 
-    for (i = 0; i < length; i++) {
-        (*fun[i])(arg, data[i]);
+        (*fun)(arg, data);
     }
-
-    free(fun);
-    free(data);
 }
 
 X_EXTERN void
commit c73adebb5357e9e5cc9159ef4fb4672a9eddc4d3
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Dec 29 12:41:18 2013 -0800

    XQuartz: Mark applicationWillTerminate: noreturn
    
    X11Controller.m:938:1: warning: method 'applicationWillTerminate:' could be declared with attribute 'noreturn'
          [-Wmissing-noreturn,Semantic Issue]
    {
    ^
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index 752bda3..5445c6f 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -934,7 +934,7 @@ extern char *bundle_id_prefix;
             == NSAlertDefaultReturn) ? NSTerminateNow : NSTerminateCancel;
 }
 
-- (void) applicationWillTerminate:(NSNotification *)aNotification
+- (void) applicationWillTerminate:(NSNotification *)aNotification _X_NORETURN
 {
     int remain;
     [X11App prefs_synchronize];
commit aa011c18bcc031bd3a935b53163561c434e597e6
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Dec 29 12:36:51 2013 -0800

    XQuartz: Fix get_proc_address signature
    
    indirect.c:675:28: warning: incompatible pointer types passing 'glx_gpa_proc (*)(const char *)' to parameter of type
          'glx_gpa_proc' (aka 'glx_func_ptr (*)(const char *)') [-Wincompatible-pointer-types,Semantic Issue]
        __glXsetGetProcAddress(&get_proc_address);
                               ^~~~~~~~~~~~~~~~~
    ../../../glx/glxserver.h:122:42: note: passing argument to parameter 'get_proc_address' here [Semantic Issue]
    void __glXsetGetProcAddress(glx_gpa_proc get_proc_address);
                                             ^
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index 8dabda1..19b7d86 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -643,10 +643,10 @@ __glFloorLog2(GLuint val)
 
 static void *opengl_framework_handle;
 
-static glx_gpa_proc
+static glx_func_ptr
 get_proc_address(const char *sym)
 {
-    return (glx_gpa_proc) dlsym(opengl_framework_handle, sym);
+    return (glx_func_ptr) dlsym(opengl_framework_handle, sym);
 }
 
 static void
commit 9e69ed7d128cc66b7288784c3d01aae0bcff3f59
Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Sun Dec 29 12:31:23 2013 -0800

    XQuartz: Fix darwinfb.h header guard
    
    ./darwinfb.h:28:9: warning: '_DARWIN_FB_H' is used as a header guard here, followed by #define of a different macro
          [-Wheader-guard,Lexical or Preprocessor Issue]
            ^~~~~~~~~~~~
    ./darwinfb.h:29:9: note: '_DARWIN_DB_H' is defined here; did you mean '_DARWIN_FB_H'? [Lexical or Preprocessor Issue]
            ^~~~~~~~~~~~
            _DARWIN_FB_H
    
    Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

diff --git a/hw/xquartz/darwinfb.h b/hw/xquartz/darwinfb.h
index 5de360d..541128b 100644
--- a/hw/xquartz/darwinfb.h
+++ b/hw/xquartz/darwinfb.h
@@ -26,7 +26,7 @@
  */
 
 #ifndef _DARWIN_FB_H
-#define _DARWIN_DB_H
+#define _DARWIN_FB_H
 
 #include "scrnintstr.h"
 


More information about the Xquartz-changes mailing list