Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-29 Thread Gaetan Nadon
On 14-01-27 04:59 PM, Keith Packard wrote:
 Cool. Any comments on the libXfont patch, or should I just push it?
I had not tried it (confusion on my part), but it fails for me as it
does for Knut.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-29 Thread Keith Packard
Knut Petersen knut_peter...@t-online.de writes:

 It's always a good idea to fix a few of the 16747 warnings I see during a 
 successful build,
 but your libXfont patch fails:

Looks like I did the libXfont changes when I was doing the other warning
fixes and hadn't rebased to current master. Sorry for the noise.

Here's a patch from current master
2a3429413df27224ceeddd22500ce43b5431d698

From 5744412cc0d5523bf51ae71e6fe5ec3f9daadfca Mon Sep 17 00:00:00 2001
From: Keith Packard kei...@keithp.com
Date: Fri, 15 Nov 2013 21:46:15 +0900
Subject: [PATCH] Warning fixes.

Many const char issues.

One extra 'i' declared in ScaleFont; we can just use the same 'i' as
exists at the top level scope.

Also ignore bad-function-cast in ftfuncs.c and bitscale.c because
we're casting the return value from floor or ceil from double to
int. As floor and ceil are kinda designed to generate integer results,
it's pretty clear that we're doing what we want and that the compiler
is generating noise. I'm not sure why bad-function-cast is ever a good
warning to turn on, but I'll leave that for another day.

Signed-off-by: Keith Packard kei...@keithp.com
---
 include/X11/fonts/fntfil.h   | 14 +++---
 include/X11/fonts/fontmisc.h |  2 +-
 src/FreeType/ftfuncs.c   |  2 ++
 src/bitmap/bitscale.c|  4 ++--
 src/builtins/builtin.h   |  4 ++--
 src/builtins/dir.c   |  2 +-
 src/builtins/file.c  |  2 +-
 src/builtins/fpe.c   |  2 +-
 src/fc/fsconvert.c   |  2 +-
 src/fc/fserve.c  | 18 +-
 src/fc/fserve.h  |  2 +-
 src/fontfile/catalogue.c | 26 ++
 src/fontfile/dirfile.c   |  4 +++-
 src/fontfile/fontfile.c  | 16 
 src/util/patcache.c  | 14 +++---
 15 files changed, 60 insertions(+), 54 deletions(-)

diff --git a/include/X11/fonts/fntfil.h b/include/X11/fonts/fntfil.h
index a32df63..24be79a 100644
--- a/include/X11/fonts/fntfil.h
+++ b/include/X11/fonts/fntfil.h
@@ -72,12 +72,12 @@ typedef struct _FontRenderer	*FontRendererPtr;
 #define FontAliasFile	fonts.alias
 #define FontScalableFilefonts.scale
 
-extern int FontFileNameCheck ( char *name );
+extern int FontFileNameCheck ( const char *name );
 extern int FontFileInitFPE ( FontPathElementPtr fpe );
 extern int FontFileResetFPE ( FontPathElementPtr fpe );
 extern int FontFileFreeFPE ( FontPathElementPtr fpe );
 extern int FontFileOpenFont ( pointer client, FontPathElementPtr fpe,
-			  Mask flags, char *name, int namelen,
+			  Mask flags, const char *name, int namelen,
 			  fsBitmapFormat format, fsBitmapFormatMask fmask,
 			  XID id, FontPtr *pFont, char **aliasName,
 			  FontPtr non_cachable_font );
@@ -87,14 +87,14 @@ extern int FontFileOpenBitmap ( FontPathElementPtr fpe, FontPtr *pFont,
 fsBitmapFormat format,
 fsBitmapFormatMask fmask );
 extern int FontFileListFonts ( pointer client, FontPathElementPtr fpe,
-			   char *pat, int len, int max,
+			   const char *pat, int len, int max,
 			   FontNamesPtr names );
 extern int FontFileStartListFonts ( pointer client, FontPathElementPtr fpe,
-char *pat, int len, int max,
+const char *pat, int len, int max,
 pointer *privatep, int mark_aliases );
 extern int FontFileStartListFontsWithInfo ( pointer client,
 	FontPathElementPtr fpe,
-	char *pat, int len, int max,
+	const char *pat, int len, int max,
 	pointer *privatep );
 extern int FontFileListNextFontWithInfo ( pointer client,
 	  FontPathElementPtr fpe,
@@ -103,7 +103,7 @@ extern int FontFileListNextFontWithInfo ( pointer client,
 	  int *numFonts, pointer private );
 extern int FontFileStartListFontsAndAliases ( pointer client,
 	  FontPathElementPtr fpe,
-	  char *pat, int len, int max,
+	  const char *pat, int len, int max,
 	  pointer *privatep );
 extern int FontFileListNextFontOrAlias ( pointer client,
 	 FontPathElementPtr fpe,
@@ -173,7 +173,7 @@ extern int FontFileMatchBitmapSource ( FontPathElementPtr fpe,
    fsBitmapFormatMask fmask,
    Bool noSpecificSize );
 
-extern int FontFileReadDirectory ( char *directory, FontDirectoryPtr *pdir );
+extern int FontFileReadDirectory ( const char *directory, FontDirectoryPtr *pdir );
 extern Bool FontFileDirectoryChanged ( FontDirectoryPtr dir );
 
 #endif /* _FONTFILE_H_ */
diff --git a/include/X11/fonts/fontmisc.h b/include/X11/fonts/fontmisc.h
index 73a8247..d3926a7 100644
--- a/include/X11/fonts/fontmisc.h
+++ b/include/X11/fonts/fontmisc.h
@@ -91,7 +91,7 @@ RepadBitmap (
 
 extern void CopyISOLatin1Lowered(
 char * /*dest*/,
-char * /*source*/,
+const char * /*source*/,
 int /*length*/
 );
 
diff --git a/src/FreeType/ftfuncs.c b/src/FreeType/ftfuncs.c
index 44e5e02..65efefc 100644
--- a/src/FreeType/ftfuncs.c
+++ b/src/FreeType/ftfuncs.c
@@ -1069,6 +1069,8 @@ FT_Do_SBit_Metrics( 

Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-29 Thread Gaetan Nadon
On 14-01-29 03:10 PM, Keith Packard wrote:
 Looks like I did the libXfont changes when I was doing the other warning
 fixes and hadn't rebased to current master. Sorry for the noise.

 Here's a patch from current master
 2a3429413df27224ceeddd22500ce43b5431d698

patcache.c:130:1: error: conflicting types for 'CacheFontPattern'
/home/nadon/xorg/inst/include/X11/fonts/font.h:141:18: note: previous
declaration of 'CacheFontPattern' was here

patcache.c:176:1: error: conflicting types for 'FindCachedFontPattern'
/home/nadon/xorg/inst/include/X11/fonts/font.h:151:21: note: previous
declaration of 'FindCachedFontPattern' was here

make[3]: *** [patcache.lo] Error 1


fontsproto top commit: 7f951a3b8ad71211e34a52878a030d5df823c49e
I checked that font.h in the installed dir is the same as in the module dir.
Other than this patch, everything else is from git master in my source
tree. Maybe I am missing something...

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-29 Thread Keith Packard
Gaetan Nadon mems...@videotron.ca writes:

 fontsproto top commit: 7f951a3b8ad71211e34a52878a030d5df823c49e
 I checked that font.h in the installed dir is the same as in the module dir.
 Other than this patch, everything else is from git master in my source
 tree. Maybe I am missing something...

Yes, I sent you the patch for fontsproto that fixes these. That had been
sent out on December 13th before, but hasn't seen any review yet.

That patch is titled 'Allow paths and patterns to be const'

If these all work together for you, I'll go ahead and merge everything
to master and we can work out suitable configure.ac fixes to make sure
everyone is happy.

-- 
keith.pack...@intel.com


pgpKBMHlaiyJX.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-29 Thread Gaetan Nadon
On 14-01-29 04:41 PM, Keith Packard wrote:
 Gaetan Nadon mems...@videotron.ca writes:

 fontsproto top commit: 7f951a3b8ad71211e34a52878a030d5df823c49e
 I checked that font.h in the installed dir is the same as in the module dir.
 Other than this patch, everything else is from git master in my source
 tree. Maybe I am missing something...
 Yes, I sent you the patch for fontsproto that fixes these. That had been
 sent out on December 13th before, but hasn't seen any review yet.

 That patch is titled 'Allow paths and patterns to be const'

 If these all work together for you, I'll go ahead and merge everything
 to master and we can work out suitable configure.ac fixes to make sure
 everyone is happy.

The Warning Fixes patch compiles correctly with the Dec 13th rebased
patch  Allow paths and patterns to be const.

Reviewed-by: Gaetan Nadon mems...@videotron.ca
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-29 Thread Keith Packard
Gaetan Nadon mems...@videotron.ca writes:

 The Warning Fixes patch compiles correctly with the Dec 13th rebased
 patch  Allow paths and patterns to be const.

 Reviewed-by: Gaetan Nadon mems...@videotron.ca

Thanks, I've gone ahead and pushed this patch after pushing the
fontsproto patch.
   2a34294..a96cc1f  master - master

-- 
keith.pack...@intel.com


pgpw6zmKaeFc_.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-28 Thread Knut Petersen

On 27.01.2014 22:59, Keith Packard wrote:

Gaetan Nadon mems...@videotron.ca writes:


On 14-01-27 03:00 PM, Keith Packard wrote:

Here's a patch for libXfont. I have no patch for xfs, and would welcome
anyone to go ahead and fix that.

xfs is fine. My source tree became into an invalid state at which point
Knut came to the rescue.

Cool. Any comments on the libXfont patch, or should I just push it?


It's always a good idea to fix a few of the 16747 warnings I see during a 
successful build,
but your libXfont patch fails:

knut@golem:~/fast/xorg/lib/libXfont git pull
Already up-to-date.

knut@golem:~/fast/xorg/lib/libXfont git log | head -n 1
commit 2a3429413df27224ceeddd22500ce43b5431d698

knut@golem:~/fast/xorg/lib/libXfont patch -p 1  
~/fast/0001-Warning-fixes.patch
patching file include/X11/fonts/fntfil.h
patching file include/X11/fonts/fontmisc.h
patching file src/builtins/builtin.h
patching file src/builtins/dir.c
patching file src/builtins/file.c
patching file src/builtins/fpe.c
Hunk #2 FAILED at 54.
1 out of 2 hunks FAILED -- saving rejects to file src/builtins/fpe.c.rej
patching file src/fc/fsconvert.c
patching file src/fc/fserve.c
Hunk #9 succeeded at 3145 (offset 1 line).
patching file src/fc/fserve.h
patching file src/fontfile/catalogue.c
Hunk #6 FAILED at 282.
Hunk #7 FAILED at 297.
Hunk #8 FAILED at 318.
Hunk #9 FAILED at 331.
Hunk #10 succeeded at 341 (offset -9 lines).
Hunk #11 succeeded at 377 (offset -9 lines).
Hunk #12 succeeded at 415 (offset -9 lines).
4 out of 12 hunks FAILED -- saving rejects to file src/fontfile/catalogue.c.rej
patching file src/fontfile/dirfile.c
patching file src/fontfile/fontfile.c
patching file src/util/patcache.c

cu,
 Knut
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-27 Thread Keith Packard
Knut Petersen knut_peter...@t-online.de writes:

 Hi Gaetan!

 Keith pushed xserver 60014a4 and broke building of xserver master.

 Keith's first fontproto patch didn´t apply as it was based on another patch.
 Both patches together fixed xserver but broke libXfont and xfs.

Here's a patch for libXfont. I have no patch for xfs, and would welcome
anyone to go ahead and fix that.

Sorry for breaking stuff at random; getting patches pushed to each
repository turns out to be a pain to get synchronized correctly...

From a2e24231571cfc6cce2dbdce91c86203dc68d9bc Mon Sep 17 00:00:00 2001
From: Keith Packard kei...@keithp.com
Date: Fri, 15 Nov 2013 21:46:15 +0900
Subject: [PATCH] Warning fixes.

Almost all of these are const char issues.

Signed-off-by: Keith Packard kei...@keithp.com
---
 include/X11/fonts/fntfil.h   | 14 +++---
 include/X11/fonts/fontmisc.h |  2 +-
 src/builtins/builtin.h   |  4 ++--
 src/builtins/dir.c   |  2 +-
 src/builtins/file.c  |  2 +-
 src/builtins/fpe.c   |  5 +
 src/fc/fsconvert.c   |  2 +-
 src/fc/fserve.c  | 18 +-
 src/fc/fserve.h  |  2 +-
 src/fontfile/catalogue.c | 35 ++-
 src/fontfile/dirfile.c   |  2 +-
 src/fontfile/fontfile.c  | 16 
 src/util/patcache.c  | 14 +++---
 13 files changed, 54 insertions(+), 64 deletions(-)

diff --git a/include/X11/fonts/fntfil.h b/include/X11/fonts/fntfil.h
index a32df63..24be79a 100644
--- a/include/X11/fonts/fntfil.h
+++ b/include/X11/fonts/fntfil.h
@@ -72,12 +72,12 @@ typedef struct _FontRenderer	*FontRendererPtr;
 #define FontAliasFile	fonts.alias
 #define FontScalableFilefonts.scale
 
-extern int FontFileNameCheck ( char *name );
+extern int FontFileNameCheck ( const char *name );
 extern int FontFileInitFPE ( FontPathElementPtr fpe );
 extern int FontFileResetFPE ( FontPathElementPtr fpe );
 extern int FontFileFreeFPE ( FontPathElementPtr fpe );
 extern int FontFileOpenFont ( pointer client, FontPathElementPtr fpe,
-			  Mask flags, char *name, int namelen,
+			  Mask flags, const char *name, int namelen,
 			  fsBitmapFormat format, fsBitmapFormatMask fmask,
 			  XID id, FontPtr *pFont, char **aliasName,
 			  FontPtr non_cachable_font );
@@ -87,14 +87,14 @@ extern int FontFileOpenBitmap ( FontPathElementPtr fpe, FontPtr *pFont,
 fsBitmapFormat format,
 fsBitmapFormatMask fmask );
 extern int FontFileListFonts ( pointer client, FontPathElementPtr fpe,
-			   char *pat, int len, int max,
+			   const char *pat, int len, int max,
 			   FontNamesPtr names );
 extern int FontFileStartListFonts ( pointer client, FontPathElementPtr fpe,
-char *pat, int len, int max,
+const char *pat, int len, int max,
 pointer *privatep, int mark_aliases );
 extern int FontFileStartListFontsWithInfo ( pointer client,
 	FontPathElementPtr fpe,
-	char *pat, int len, int max,
+	const char *pat, int len, int max,
 	pointer *privatep );
 extern int FontFileListNextFontWithInfo ( pointer client,
 	  FontPathElementPtr fpe,
@@ -103,7 +103,7 @@ extern int FontFileListNextFontWithInfo ( pointer client,
 	  int *numFonts, pointer private );
 extern int FontFileStartListFontsAndAliases ( pointer client,
 	  FontPathElementPtr fpe,
-	  char *pat, int len, int max,
+	  const char *pat, int len, int max,
 	  pointer *privatep );
 extern int FontFileListNextFontOrAlias ( pointer client,
 	 FontPathElementPtr fpe,
@@ -173,7 +173,7 @@ extern int FontFileMatchBitmapSource ( FontPathElementPtr fpe,
    fsBitmapFormatMask fmask,
    Bool noSpecificSize );
 
-extern int FontFileReadDirectory ( char *directory, FontDirectoryPtr *pdir );
+extern int FontFileReadDirectory ( const char *directory, FontDirectoryPtr *pdir );
 extern Bool FontFileDirectoryChanged ( FontDirectoryPtr dir );
 
 #endif /* _FONTFILE_H_ */
diff --git a/include/X11/fonts/fontmisc.h b/include/X11/fonts/fontmisc.h
index 73a8247..d3926a7 100644
--- a/include/X11/fonts/fontmisc.h
+++ b/include/X11/fonts/fontmisc.h
@@ -91,7 +91,7 @@ RepadBitmap (
 
 extern void CopyISOLatin1Lowered(
 char * /*dest*/,
-char * /*source*/,
+const char * /*source*/,
 int /*length*/
 );
 
diff --git a/src/builtins/builtin.h b/src/builtins/builtin.h
index 75dff8d..f9a4cea 100644
--- a/src/builtins/builtin.h
+++ b/src/builtins/builtin.h
@@ -54,9 +54,9 @@ extern const int		builtin_dir_count;
 extern const BuiltinAliasRec	builtin_alias[];
 extern const int		builtin_alias_count;
 
-extern FontFilePtr	BuiltinFileOpen (char *);
+extern FontFilePtr	BuiltinFileOpen (const char *);
 extern int		BuiltinFileClose (BufFilePtr, int);
-extern int BuiltinReadDirectory (char *, FontDirectoryPtr *);
+extern int BuiltinReadDirectory (const char *, FontDirectoryPtr *);
 extern void BuiltinRegisterFontFileFunctions 

Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-27 Thread Gaetan Nadon
On 14-01-27 03:00 PM, Keith Packard wrote:
 Here's a patch for libXfont. I have no patch for xfs, and would welcome
 anyone to go ahead and fix that.
xfs is fine. My source tree became into an invalid state at which point
Knut came to the rescue.
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-27 Thread Keith Packard
Gaetan Nadon mems...@videotron.ca writes:

 On 14-01-27 03:00 PM, Keith Packard wrote:
 Here's a patch for libXfont. I have no patch for xfs, and would welcome
 anyone to go ahead and fix that.
 xfs is fine. My source tree became into an invalid state at which point
 Knut came to the rescue.

Cool. Any comments on the libXfont patch, or should I just push it?

-- 
keith.pack...@intel.com


pgpXIKRMaxcxo.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-23 Thread Gaetan Nadon
On 14-01-23 02:27 AM, Knut Petersen wrote:
 AFAIS 431a426 supersedes the two prior fontproto patches.
I wasn't aware of that, I thought the patch was yet to come pending review.

Yes, things compile ok now.

Thanks!
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-22 Thread Keith Packard
Knut Petersen knut_peter...@t-online.de writes:

 I assume there´s not only a fontsproto patch as this patch alone breaks 
 libXfont
 for obvious reasons.

Indeed, another un-reviewed patch in libXfont.

From a2e24231571cfc6cce2dbdce91c86203dc68d9bc Mon Sep 17 00:00:00 2001
From: Keith Packard kei...@keithp.com
Date: Fri, 15 Nov 2013 21:46:15 +0900
Subject: [PATCH] Warning fixes.

Almost all of these are const char issues.

Signed-off-by: Keith Packard kei...@keithp.com
---
 include/X11/fonts/fntfil.h   | 14 +++---
 include/X11/fonts/fontmisc.h |  2 +-
 src/builtins/builtin.h   |  4 ++--
 src/builtins/dir.c   |  2 +-
 src/builtins/file.c  |  2 +-
 src/builtins/fpe.c   |  5 +
 src/fc/fsconvert.c   |  2 +-
 src/fc/fserve.c  | 18 +-
 src/fc/fserve.h  |  2 +-
 src/fontfile/catalogue.c | 35 ++-
 src/fontfile/dirfile.c   |  2 +-
 src/fontfile/fontfile.c  | 16 
 src/util/patcache.c  | 14 +++---
 13 files changed, 54 insertions(+), 64 deletions(-)

diff --git a/include/X11/fonts/fntfil.h b/include/X11/fonts/fntfil.h
index a32df63..24be79a 100644
--- a/include/X11/fonts/fntfil.h
+++ b/include/X11/fonts/fntfil.h
@@ -72,12 +72,12 @@ typedef struct _FontRenderer*FontRendererPtr;
 #define FontAliasFile  fonts.alias
 #define FontScalableFilefonts.scale
 
-extern int FontFileNameCheck ( char *name );
+extern int FontFileNameCheck ( const char *name );
 extern int FontFileInitFPE ( FontPathElementPtr fpe );
 extern int FontFileResetFPE ( FontPathElementPtr fpe );
 extern int FontFileFreeFPE ( FontPathElementPtr fpe );
 extern int FontFileOpenFont ( pointer client, FontPathElementPtr fpe,
- Mask flags, char *name, int namelen,
+ Mask flags, const char *name, int namelen,
  fsBitmapFormat format, fsBitmapFormatMask fmask,
  XID id, FontPtr *pFont, char **aliasName,
  FontPtr non_cachable_font );
@@ -87,14 +87,14 @@ extern int FontFileOpenBitmap ( FontPathElementPtr fpe, 
FontPtr *pFont,
fsBitmapFormat format,
fsBitmapFormatMask fmask );
 extern int FontFileListFonts ( pointer client, FontPathElementPtr fpe,
-  char *pat, int len, int max,
+  const char *pat, int len, int max,
   FontNamesPtr names );
 extern int FontFileStartListFonts ( pointer client, FontPathElementPtr fpe,
-   char *pat, int len, int max,
+   const char *pat, int len, int max,
pointer *privatep, int mark_aliases );
 extern int FontFileStartListFontsWithInfo ( pointer client,
FontPathElementPtr fpe,
-   char *pat, int len, int max,
+   const char *pat, int len, int max,
pointer *privatep );
 extern int FontFileListNextFontWithInfo ( pointer client,
  FontPathElementPtr fpe,
@@ -103,7 +103,7 @@ extern int FontFileListNextFontWithInfo ( pointer client,
  int *numFonts, pointer private );
 extern int FontFileStartListFontsAndAliases ( pointer client,
  FontPathElementPtr fpe,
- char *pat, int len, int max,
+ const char *pat, int len, int max,
  pointer *privatep );
 extern int FontFileListNextFontOrAlias ( pointer client,
 FontPathElementPtr fpe,
@@ -173,7 +173,7 @@ extern int FontFileMatchBitmapSource ( FontPathElementPtr 
fpe,
   fsBitmapFormatMask fmask,
   Bool noSpecificSize );
 
-extern int FontFileReadDirectory ( char *directory, FontDirectoryPtr *pdir );
+extern int FontFileReadDirectory ( const char *directory, FontDirectoryPtr 
*pdir );
 extern Bool FontFileDirectoryChanged ( FontDirectoryPtr dir );
 
 #endif /* _FONTFILE_H_ */
diff --git a/include/X11/fonts/fontmisc.h b/include/X11/fonts/fontmisc.h
index 73a8247..d3926a7 100644
--- a/include/X11/fonts/fontmisc.h
+++ b/include/X11/fonts/fontmisc.h
@@ -91,7 +91,7 @@ RepadBitmap (
 
 extern void CopyISOLatin1Lowered(
 char * /*dest*/,
-char * /*source*/,
+const char * /*source*/,
 int /*length*/
 );
 
diff --git a/src/builtins/builtin.h b/src/builtins/builtin.h
index 75dff8d..f9a4cea 100644
--- a/src/builtins/builtin.h
+++ b/src/builtins/builtin.h
@@ -54,9 +54,9 @@ extern const int  

Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-22 Thread Keith Packard
Gaetan Nadon mems...@videotron.ca writes:

 Now applies correctly,

 Reviewed-by: Gaetan Nadon mems...@videotron.ca

I've pushed just this patch (having swapped the order of the two patches 
locally).
   d84789d..431a426  master - master

Did you want for your review to apply to the const pattern patch as well though?

-- 
keith.pack...@intel.com


pgpiFFmbnJuSF.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-22 Thread Gaetan Nadon
On 14-01-22 12:45 PM, Keith Packard wrote:
 Gaetan Nadon mems...@videotron.ca writes:

 Now applies correctly,

 Reviewed-by: Gaetan Nadon mems...@videotron.ca
 I've pushed just this patch (having swapped the order of the two patches 
 locally).
d84789d..431a426  master - master

 Did you want for your review to apply to the const pattern patch as well 
 though?


With the original const patch before the swap, I recompiled:

libXfont: (6371fcf2b60e)

patcache.c:130:1: error: conflicting types for 'CacheFontPattern'
/home/nadon/xorg/inst/include/X11/fonts/font.h:141:18: note:
previous declaration of 'CacheFontPattern' was here
patcache.c:176:1: error: conflicting types for 'FindCachedFontPattern'
/home/nadon/xorg/inst/include/X11/fonts/font.h:151:21: note:
previous declaration of 'FindCachedFontPattern' was here

app-xfs: (b7cd80d37de)

difs/fonts.c: In function 'FontWakeup':
difs/fonts.c:172:52: warning: declaration of 'LastSelectMask'
shadows a global declaration [-Wshadow]
./include/globals.h:74:15: warning: shadowed declaration is here
[-Wshadow]
difs/fonts.c: At top level:
difs/fonts.c:1406:1: error: conflicting types for 'RegisterFPEFunctions'
/home/nadon/xorg/inst/include/X11/fonts/fontproto.h:28:12: note:
previous declaration of 'RegisterFPEFunctions' was here
difs/fonts.c: In function 'RegisterFPEFunctions':
difs/fonts.c:1432:45: warning: assignment from incompatible pointer
type [enabled by default]

xserver: (2d2d49dab5c5):OK

I cannot find where FONT_PATH_ELEMENT_NAME_CONST is defined.


___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-22 Thread Julien Cristau
On Wed, Jan 22, 2014 at 09:41:41 -0800, Keith Packard wrote:

 Knut Petersen knut_peter...@t-online.de writes:
 
  I assume there´s not only a fontsproto patch as this patch alone breaks 
  libXfont
  for obvious reasons.
 
 Indeed, another un-reviewed patch in libXfont.
 
 From a2e24231571cfc6cce2dbdce91c86203dc68d9bc Mon Sep 17 00:00:00 2001
 From: Keith Packard kei...@keithp.com
 Date: Fri, 15 Nov 2013 21:46:15 +0900
 Subject: [PATCH] Warning fixes.
 
 Almost all of these are const char issues.
 
 Signed-off-by: Keith Packard kei...@keithp.com

with a couple minor comments below..

Reviewed-by: Julien Cristau jcris...@debian.org

[...]
 diff --git a/src/fontfile/catalogue.c b/src/fontfile/catalogue.c
 index 09ca2ae..81a1e13 100644
 --- a/src/fontfile/catalogue.c
 +++ b/src/fontfile/catalogue.c
 @@ -40,7 +40,7 @@ static const char CataloguePrefix[] = catalogue:;
  static int CatalogueFreeFPE (FontPathElementPtr fpe);
  
  static int
 -CatalogueNameCheck (char *name)
 +CatalogueNameCheck (const char *name)
  {
  return strncmp(name, CataloguePrefix, sizeof(CataloguePrefix) - 1) == 0;
  }
 @@ -116,7 +116,7 @@ CatalogueUnrefFPEs (FontPathElementPtr fpe)
   if (subfpe-refcount == 0)
   {
   FontFileFreeFPE (subfpe);
 - free(subfpe-name);
 + free((void *) subfpe-name);
   free(subfpe);
   }
  }

that's kind of ick, but I guess no way to avoid it...

 @@ -158,6 +158,7 @@ CatalogueRescan (FontPathElementPtr fpe, Bool forceScan)
  CatalogueUnrefFPEs (fpe);
  while (entry = readdir(dir), entry != NULL)
  {
 +char *name;
   snprintf(link, sizeof link, %s/%s, path, entry-d_name);
   len = readlink(link, dest, sizeof dest - 1);
   if (len  0)

indent

 @@ -191,15 +192,16 @@ CatalogueRescan (FontPathElementPtr fpe, Bool forceScan)
* (which uses font-fpe-type) goes to CatalogueCloseFont. */
   subfpe-type = fpe-type;
   subfpe-name_length = len;
 - subfpe-name = malloc (len + 1);
 - if (subfpe-name == NULL)
 + name = malloc (len + 1);
 + if (name == NULL)
   {
   free(subfpe);
   continue;
   }
  
 - memcpy(subfpe-name, dest, len);
 - subfpe-name[len] = '\0';
 + memcpy(name, dest, len);
 + name[len] = '\0';
 +subfpe-name = name;

indent

  
   /* The X server will manipulate the subfpe ref counts
* associated with the font in OpenFont and CloseFont, so we

Cheers,
Julien
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-22 Thread Knut Petersen

Hi Gaetan!

Keith pushed xserver 60014a4 and broke building of xserver master.

Keith's first fontproto patch didn´t apply as it was based on another patch.
Both patches together fixed xserver but broke libXfont and xfs.

At that time FONT_PATH_ELEMENT_NAME_CONST was defined in fontstruct.h

Then Keith pushed 431a426 to fontsproto.
With fontsproto 431a426 xserver builds as well as libXfont and xfs.

AFAIS 431a426 supersedes the two prior fontproto patches.

The libXfont and xfs errors show clearly that you still used fontsproto d84789dc
plus the two patches and not 431a426 during your attempts to build libXfont
and xfs.

cu,
 Knut
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-20 Thread Knut Petersen

On 20.01.2014 01:52, Keith Packard wrote:

Gaetan Nadon mems...@videotron.ca writes:


On 14-01-19 04:01 PM, Keith Packard wrote:

The pointer typedef is being removed because it causes so many
compiler warnings when -Wshadow is enabled.

Signed-off-by: Keith Packard kei...@keithp.com
---
  fontproto.h  |  2 +-
  fontstruct.h | 36 ++--
  2 files changed, 19 insertions(+), 19 deletions(-)

Code changes are ok, but patch does not apply. Looks like lines are offset.

 Applied patch fontproto.h cleanly.
 Applying patch fontstruct.h with 2 rejects...
 Hunk #1 applied cleanly.
 Rejected hunk #2.
 Rejected hunk #3.

I am on master branch top commit  d84789dc33

Right, this patch is on top of a previous fontsproto patch which also
has not been applied.


I assume there´s not only a fontsproto patch as this patch alone breaks libXfont
for obvious reasons.


That one allowed paths and patterns to be declared
const. I'll attach that here; the pointer patch comes after this one.

So many patches...



Not enough ;-)

  CC   patcache.lo
. ../../config.h
. ../../include/X11/fonts/fontmisc.h
.. /home/knut/fast/xorg/X11-t/usr/include/X11/Xfuncs.h
... /home/knut/fast/xorg/X11-t/usr/include/X11/Xosdefs.h
... /usr/include/string.h
 /usr/include/features.h
. /usr/include/sys/cdefs.h
.. /usr/include/bits/wordsize.h
. /usr/include/gnu/stubs.h
.. /usr/include/gnu/stubs-32.h
 /usr/lib/gcc/i586-suse-linux/4.8/include/stddef.h
 /usr/include/xlocale.h
 /usr/include/bits/string.h
 /usr/include/bits/string2.h
. /usr/include/endian.h
.. /usr/include/bits/endian.h
.. /usr/include/bits/byteswap.h
... /usr/include/bits/types.h
 /usr/include/bits/wordsize.h
 /usr/include/bits/typesizes.h
... /usr/include/bits/wordsize.h
... /usr/include/bits/byteswap-16.h
. /usr/include/stdlib.h
.. /usr/lib/gcc/i586-suse-linux/4.8/include/stddef.h
.. /usr/include/stdlib.h
... /usr/lib/gcc/i586-suse-linux/4.8/include/stddef.h
... /usr/include/bits/waitflags.h
... /usr/include/bits/waitstatus.h
... /usr/include/sys/types.h
 /usr/include/time.h
 /usr/lib/gcc/i586-suse-linux/4.8/include/stddef.h
 /usr/include/sys/select.h
. /usr/include/bits/select.h
.. /usr/include/bits/wordsize.h
. /usr/include/bits/sigset.h
. /usr/include/time.h
. /usr/include/bits/time.h
 /usr/include/sys/sysmacros.h
 /usr/include/bits/pthreadtypes.h
. /usr/include/bits/wordsize.h
... /usr/include/alloca.h
 /usr/lib/gcc/i586-suse-linux/4.8/include/stddef.h
... /usr/include/bits/stdlib-bsearch.h
... /usr/include/bits/stdlib-float.h
.. /usr/include/stdio.h
... /usr/lib/gcc/i586-suse-linux/4.8/include/stddef.h
... /usr/include/libio.h
 /usr/include/_G_config.h
. /usr/lib/gcc/i586-suse-linux/4.8/include/stddef.h
. /usr/include/wchar.h
 /usr/lib/gcc/i586-suse-linux/4.8/include/stdarg.h
... /usr/include/bits/stdio_lim.h
... /usr/include/bits/sys_errlist.h
... /usr/include/bits/stdio.h
.. /usr/include/unistd.h
... /usr/include/bits/posix_opt.h
... /usr/include/bits/environments.h
 /usr/include/bits/wordsize.h
... /usr/lib/gcc/i586-suse-linux/4.8/include/stddef.h
... /usr/include/bits/confname.h
... /usr/include/getopt.h
.. /home/knut/fast/xorg/X11-t/usr/include/X11/Xdefs.h
. /home/knut/fast/xorg/X11-t/usr/include/X11/fonts/fontstruct.h
.. /home/knut/fast/xorg/X11-t/usr/include/X11/Xproto.h
... /home/knut/fast/xorg/X11-t/usr/include/X11/Xmd.h
... /home/knut/fast/xorg/X11-t/usr/include/X11/Xprotostr.h
.. /home/knut/fast/xorg/X11-t/usr/include/X11/fonts/font.h
... /home/knut/fast/xorg/X11-t/usr/include/X11/fonts/fsmasks.h
.. /home/knut/fast/xorg/X11-t/usr/include/X11/Xfuncproto.h
.. /home/knut/fast/xorg/X11-t/usr/include/X11/fonts/fontproto.h
patcache.c:130:1: error: conflicting types for 'CacheFontPattern'
 CacheFontPattern (FontPatternCachePtr cache,
 ^
In file included from 
/home/knut/fast/xorg/X11-t/usr/include/X11/fonts/fontstruct.h:28:0,
 from patcache.c:35:
/home/knut/fast/xorg/X11-t/usr/include/X11/fonts/font.h:141:18: note: previous 
declaration of 'CacheFontPattern' was here
 extern void  CacheFontPattern (
  ^
patcache.c:176:1: error: conflicting types for 'FindCachedFontPattern'
 FindCachedFontPattern (FontPatternCachePtr cache,
 ^
In file included from 
/home/knut/fast/xorg/X11-t/usr/include/X11/fonts/fontstruct.h:28:0,
 from patcache.c:35:
/home/knut/fast/xorg/X11-t/usr/include/X11/fonts/font.h:151:21: note: previous 
declaration of 'FindCachedFontPattern' was here
 extern FontPtr  FindCachedFontPattern (



cu,
 knut
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-20 Thread Gaetan Nadon
On 14-01-19 07:52 PM, Keith Packard wrote:
 Gaetan Nadon mems...@videotron.ca writes:

  On 14-01-19 04:01 PM, Keith Packard wrote:
  The pointer typedef is being removed because it causes so many
  compiler warnings when -Wshadow is enabled.
 
  Signed-off-by: Keith Packard kei...@keithp.com
  ---
   fontproto.h  |  2 +-
   fontstruct.h | 36 ++--
   2 files changed, 19 insertions(+), 19 deletions(-)
 
  Code changes are ok, but patch does not apply. Looks like lines are offset.
 
  Applied patch fontproto.h cleanly.
  Applying patch fontstruct.h with 2 rejects...
  Hunk #1 applied cleanly.
  Rejected hunk #2.
  Rejected hunk #3.
 
  I am on master branch top commit  d84789dc33
 Right, this patch is on top of a previous fontsproto patch which also
 has not been applied. That one allowed paths and patterns to be declared
 const. I'll attach that here; the pointer patch comes after this one.

Now applies correctly,

Reviewed-by: Gaetan Nadon mems...@videotron.ca






___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel


Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-19 Thread Gaetan Nadon
On 14-01-19 04:01 PM, Keith Packard wrote:
 The pointer typedef is being removed because it causes so many
 compiler warnings when -Wshadow is enabled.

 Signed-off-by: Keith Packard kei...@keithp.com
 ---
  fontproto.h  |  2 +-
  fontstruct.h | 36 ++--
  2 files changed, 19 insertions(+), 19 deletions(-)

Code changes are ok, but patch does not apply. Looks like lines are offset.

Applied patch fontproto.h cleanly.
Applying patch fontstruct.h with 2 rejects...
Hunk #1 applied cleanly.
Rejected hunk #2.
Rejected hunk #3.

I am on master branch top commit  d84789dc33
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH] Replace 'pointer' with the equivalent 'void *'.

2014-01-19 Thread Keith Packard
Gaetan Nadon mems...@videotron.ca writes:

 On 14-01-19 04:01 PM, Keith Packard wrote:
 The pointer typedef is being removed because it causes so many
 compiler warnings when -Wshadow is enabled.

 Signed-off-by: Keith Packard kei...@keithp.com
 ---
  fontproto.h  |  2 +-
  fontstruct.h | 36 ++--
  2 files changed, 19 insertions(+), 19 deletions(-)

 Code changes are ok, but patch does not apply. Looks like lines are offset.

 Applied patch fontproto.h cleanly.
 Applying patch fontstruct.h with 2 rejects...
 Hunk #1 applied cleanly.
 Rejected hunk #2.
 Rejected hunk #3.

 I am on master branch top commit  d84789dc33

Right, this patch is on top of a previous fontsproto patch which also
has not been applied. That one allowed paths and patterns to be declared
const. I'll attach that here; the pointer patch comes after this one.

So many patches...

From 3c5d879aed884803b13d31469a0af7891e56f848 Mon Sep 17 00:00:00 2001
From: Keith Packard kei...@keithp.com
Date: Fri, 15 Nov 2013 21:47:31 +0900
Subject: [PATCH 1/2] Allow paths and patterns to be const

Signed-off-by: Keith Packard kei...@keithp.com
---
 font.h   |  4 ++--
 fontstruct.h | 16 ++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/font.h b/font.h
index b71046b..a834655 100644
--- a/font.h
+++ b/font.h
@@ -140,7 +140,7 @@ extern void		EmptyFontPatternCache (
 
 extern void		CacheFontPattern (
 FontPatternCachePtr /* cache */,
-char * /* pattern */,
+const char * /* pattern */,
 int /* patlen */,
 FontPtr /* pFont */
 );
@@ -150,7 +150,7 @@ extern FontResolutionPtr GetClientResolutions(
 
 extern FontPtr		FindCachedFontPattern (
 FontPatternCachePtr /* cache */,
-char * /* pattern */,
+const char * /* pattern */,
 int /* patlen */
 );
 
diff --git a/fontstruct.h b/fontstruct.h
index 97e771a..ae35a8e 100644
--- a/fontstruct.h
+++ b/fontstruct.h
@@ -143,23 +143,27 @@ typedef struct _FontNames {
 char  **names;
 }   FontNamesRec;
 
+
 /* External view of font paths */
 typedef struct _FontPathElement {
 int name_length;
-char   *name;
+#if FONT_PATH_ELEMENT_NAME_CONST
+const
+#endif
+char*name;
 int type;
 int refcount;
 pointer private;
 }   FontPathElementRec;
 
-typedef Bool (*NameCheckFunc) (char *name);
+typedef Bool (*NameCheckFunc) (const char *name);
 typedef int (*InitFpeFunc) (FontPathElementPtr fpe);
 typedef int (*FreeFpeFunc) (FontPathElementPtr fpe);
 typedef int (*ResetFpeFunc) (FontPathElementPtr fpe);
 typedef int (*OpenFontFunc) ( pointer client,
 			  FontPathElementPtr fpe,
 			  Mask flags,
-			  char* name,
+			  const char* name,
 			  int namelen,
 			  fsBitmapFormat format,
 			  fsBitmapFormatMask fmask,
@@ -170,14 +174,14 @@ typedef int (*OpenFontFunc) ( pointer client,
 typedef void (*CloseFontFunc) (FontPathElementPtr fpe, FontPtr pFont);
 typedef int (*ListFontsFunc) (pointer client,
 			  FontPathElementPtr fpe,
-			  char* pat,
+			  const char* pat,
 			  int len,
 			  int max,
 			  FontNamesPtr names);
 
 typedef int (*StartLfwiFunc) (pointer client,
 			  FontPathElementPtr fpe,
-			  char* pat,
+			  const char* pat,
 			  int len,
 			  int max,
 			  pointer* privatep);
@@ -205,7 +209,7 @@ typedef int (*LoadGlyphsFunc) (pointer client,
 
 typedef int (*StartLaFunc) (pointer client,
 			FontPathElementPtr fpe,
-			char* pat,
+			const char* pat,
 			int len,
 			int max,
 			pointer* privatep);
-- 
1.8.5.2


-- 
keith.pack...@intel.com


pgp_ZqDaTdT0v.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel