[xorg-x11-proto-devel] Backport pointer-to-void* changes

Adam Jackson ajax at fedoraproject.org
Thu Jan 23 20:30:18 UTC 2014


commit 57077ff00b5e09f68afa872f8021d5b59d85bd99
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Jan 23 15:30:38 2014 -0500

    Backport pointer-to-void* changes

 ...-Replace-pointer-with-the-equivalent-void.patch |  139 ++++++++++++++++++++
 xorg-x11-proto-devel.spec                          |   16 ++-
 ...o-0001-Replace-pointer-with-explicit-void.patch |   33 +++++
 3 files changed, 187 insertions(+), 1 deletions(-)
---
diff --git a/fontsproto-0001-Replace-pointer-with-the-equivalent-void.patch b/fontsproto-0001-Replace-pointer-with-the-equivalent-void.patch
new file mode 100644
index 0000000..6b8928a
--- /dev/null
+++ b/fontsproto-0001-Replace-pointer-with-the-equivalent-void.patch
@@ -0,0 +1,139 @@
+From 431a426623b2e46a0968d8fc631f36ec0cf7298f Mon Sep 17 00:00:00 2001
+From: Keith Packard <keithp at keithp.com>
+Date: Sun, 19 Jan 2014 12:59:45 -0800
+Subject: [PATCH] Replace 'pointer' with the equivalent 'void *'.
+
+The pointer typedef is being removed because it causes so many
+compiler warnings when -Wshadow is enabled.
+
+Signed-off-by: Keith Packard <keithp at keithp.com>
+Reviewed-by: Gaetan Nadon <memsize at videotron.ca>
+---
+ fontproto.h  |  2 +-
+ fontstruct.h | 36 ++++++++++++++++++------------------
+ 2 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/fontproto.h b/fontproto.h
+index 1ab8f37..490629e 100644
+--- a/fontproto.h
++++ b/fontproto.h
+@@ -74,7 +74,7 @@ extern FontPtr  CreateFontRec (void);
+ extern void  DestroyFontRec (FontPtr font);
+ extern Bool     _FontSetNewPrivate (FontPtr        /* pFont */,
+ 				    int            /* n */,
+-				    pointer        /* ptr */);
++				    void *         /* ptr */);
+ extern int      AllocateFontPrivateIndex (void);
+ extern void ResetFontPrivateIndex (void);
+ 
+diff --git a/fontstruct.h b/fontstruct.h
+index 97e771a..44bed90 100644
+--- a/fontstruct.h
++++ b/fontstruct.h
+@@ -122,14 +122,14 @@ typedef struct _Font {
+     void        (*unload_font) (FontPtr         /* font */);
+     void        (*unload_glyphs) (FontPtr         /* font */);
+     FontPathElementPtr fpe;
+-    pointer     svrPrivate;
+-    pointer     fontPrivate;
+-    pointer     fpePrivate;
++    void        *svrPrivate;
++    void        *fontPrivate;
++    void        *fpePrivate;
+     int		maxPrivate;
+-    pointer	*devPrivates;
++    void        **devPrivates;
+ }           FontRec;
+ 
+-#define FontGetPrivate(pFont,n) ((n) > (pFont)->maxPrivate ? (pointer) 0 : \
++#define FontGetPrivate(pFont,n) ((n) > (pFont)->maxPrivate ? (void *) 0 : \
+ 			     (pFont)->devPrivates[n])
+ 
+ #define FontSetPrivate(pFont,n,ptr) ((n) > (pFont)->maxPrivate ? \
+@@ -149,14 +149,14 @@ typedef struct _FontPathElement {
+     char       *name;
+     int         type;
+     int         refcount;
+-    pointer     private;
++    void        *private;
+ }           FontPathElementRec;
+ 
+ typedef Bool (*NameCheckFunc) (char *name);
+ typedef int (*InitFpeFunc) (FontPathElementPtr fpe);
+ typedef int (*FreeFpeFunc) (FontPathElementPtr fpe);
+ typedef int (*ResetFpeFunc) (FontPathElementPtr fpe);
+-typedef int (*OpenFontFunc) ( pointer client,
++typedef int (*OpenFontFunc) ( void *client,
+ 			      FontPathElementPtr fpe,
+ 			      Mask flags,
+ 			      char* name,
+@@ -168,55 +168,55 @@ typedef int (*OpenFontFunc) ( pointer client,
+ 			      char** aliasName,
+ 			      FontPtr non_cachable_font);
+ typedef void (*CloseFontFunc) (FontPathElementPtr fpe, FontPtr pFont);
+-typedef int (*ListFontsFunc) (pointer client,
++typedef int (*ListFontsFunc) (void *client,
+ 			      FontPathElementPtr fpe,
+ 			      char* pat,
+ 			      int len,
+ 			      int max,
+ 			      FontNamesPtr names);
+ 
+-typedef int (*StartLfwiFunc) (pointer client,
++typedef int (*StartLfwiFunc) (void *client,
+ 			      FontPathElementPtr fpe,
+ 			      char* pat,
+ 			      int len,
+ 			      int max,
+-			      pointer* privatep);
++			      void ** privatep);
+ 
+-typedef int (*NextLfwiFunc) (pointer client,
++typedef int (*NextLfwiFunc) (void *client,
+ 			     FontPathElementPtr fpe,
+ 			     char** name,
+ 			     int* namelen,
+ 			     FontInfoPtr* info,
+ 			     int* numFonts,
+-			     pointer private);
++			     void *private);
+ 
+ typedef int (*WakeupFpeFunc) (FontPathElementPtr fpe,
+ 			      unsigned long* LastSelectMask);
+ 
+-typedef void (*ClientDiedFunc) (pointer client,
++typedef void (*ClientDiedFunc) (void *client,
+ 			       FontPathElementPtr fpe);
+ 
+-typedef int (*LoadGlyphsFunc) (pointer client,
++typedef int (*LoadGlyphsFunc) (void *client,
+ 			       FontPtr pfont,
+ 			       Bool range_flag,
+ 			       unsigned int nchars,
+ 			       int item_size,
+ 			       unsigned char* data);
+ 
+-typedef int (*StartLaFunc) (pointer client,
++typedef int (*StartLaFunc) (void *client,
+ 			    FontPathElementPtr fpe,
+ 			    char* pat,
+ 			    int len,
+ 			    int max,
+-			    pointer* privatep);
++			    void ** privatep);
+ 
+-typedef int (*NextLaFunc) (pointer client,
++typedef int (*NextLaFunc) (void *client,
+ 			   FontPathElementPtr fpe,
+ 			   char** namep,
+ 			   int* namelenp,
+ 			   char** resolvedp,
+ 			   int* resolvedlenp,
+-			   pointer private);
++			   void *private);
+ 
+ typedef void (*SetPathFunc)(void);
+ 
+-- 
+1.8.4.2
+
diff --git a/xorg-x11-proto-devel.spec b/xorg-x11-proto-devel.spec
index d84431f..0e24e34 100644
--- a/xorg-x11-proto-devel.spec
+++ b/xorg-x11-proto-devel.spec
@@ -7,7 +7,7 @@
 Summary: X.Org X11 Protocol headers
 Name: xorg-x11-proto-devel
 Version: 7.7
-Release: 8%{?dist}
+Release: 9%{?dist}
 License: MIT
 Group: Development/System
 URL: http://www.x.org
@@ -45,6 +45,9 @@ Source30: http://xorg.freedesktop.org/archive/individual/proto/xproxymanagementp
 
 Source40: make-git-snapshot.sh
 
+Patch0: fontsproto-0001-Replace-pointer-with-the-equivalent-void.patch
+Patch1: xproto-0001-Replace-pointer-with-explicit-void.patch
+
 BuildRequires: pkgconfig
 BuildRequires: xorg-x11-util-macros >= 1.0.2-1
 BuildRequires: autoconf automake libtool
@@ -61,6 +64,14 @@ X.Org X11 Protocol headers
 %prep
 %setup -q -c %{name}-%{version} -a1 -a2 -a3 -a4 -a5 -a7 -a8 -a9 -a10 -a13 -a14 -a15 -a16 -a17 -a19 -a20 -a21 -a22 -a23 -a24 -a25 -a27 -a28 -a29 -a30 -a31 -a32 -a33
 
+pushd fontsproto-*
+%patch0 -p1
+popd
+
+pushd xproto-*
+%patch1 -p1
+popd
+
 %build
 
 # Proceed through each proto package directory, building them all
@@ -277,6 +288,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/pkgconfig/xproxymngproto.pc
 
 %changelog
+* Thu Jan 23 2014 Adam Jackson <ajax at redhat.com> 7.7-9
+- Backport pointer-to-void* changes
+
 * Tue Dec 10 2013 Adam Jackson <ajax at redhat.com> 7.7-8
 - glproto 1.4.17
 
diff --git a/xproto-0001-Replace-pointer-with-explicit-void.patch b/xproto-0001-Replace-pointer-with-explicit-void.patch
new file mode 100644
index 0000000..e994ab8
--- /dev/null
+++ b/xproto-0001-Replace-pointer-with-explicit-void.patch
@@ -0,0 +1,33 @@
+From 148d89f0b3a652acc54b1a21807ffd6d0e81e279 Mon Sep 17 00:00:00 2001
+From: Keith Packard <keithp at keithp.com>
+Date: Sun, 15 Dec 2013 08:27:09 -0800
+Subject: [PATCH] Replace 'pointer' with explicit 'void *'
+
+To get rid of the 'pointer' typedef, stop using it locally. That way,
+when _XTYPEDEF_POINTER is defined before Xdefs.h is included, it won't
+get defined and Xdefs.h will still compile.
+
+Signed-off-by: Keith Packard <keithp at keithp.com>
+Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
+---
+ Xdefs.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Xdefs.h b/Xdefs.h
+index 46ffdad..e25a208 100644
+--- a/Xdefs.h
++++ b/Xdefs.h
+@@ -101,8 +101,8 @@ typedef FSID AccContext;
+ typedef struct timeval **OSTimePtr;
+ 
+ 
+-typedef void (* BlockHandlerProcPtr)(pointer /* blockData */,
++typedef void (* BlockHandlerProcPtr)(void * /* blockData */,
+ 				     OSTimePtr /* pTimeout */,
+-				     pointer /* pReadmask */);
++				     void * /* pReadmask */);
+ 
+ #endif
+-- 
+1.8.4.2
+


More information about the scm-commits mailing list