[PATCH:libXfont 3/4] Initialize (unused) data field in fsListCataloguesReq before sending it.

2014-01-07 Thread Alan Coopersmith
Quiets cppcheck warning:
[fc/fserve.c:2972]: (error) Uninitialized variable: lcreq

Signed-off-by: Alan Coopersmith 
---
 src/fc/fserve.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/src/fc/fserve.c b/src/fc/fserve.c
index a445144..fc44d19 100644
--- a/src/fc/fserve.c
+++ b/src/fc/fserve.c
@@ -2964,6 +2964,7 @@ _fs_send_cat_sync (FSFpePtr conn)
  * by a bogus catalogue
  */
 lcreq.reqType = FS_ListCatalogues;
+lcreq.data = 0;
 lcreq.length = (SIZEOF(fsListCataloguesReq)) >> 2;
 lcreq.maxNames = 0;
 lcreq.nbytes = 0;
-- 
1.7.9.2

___
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


[PATCH:libXfont 2/4] Remove redundant declaration of FontFileStartListFonts()

2014-01-07 Thread Alan Coopersmith
Fixes gcc warning:
catalogue.c:336:1: warning: redundant redeclaration of
 'FontFileStartListFonts' [-Wredundant-decls]
In file included from ../../include/X11/fonts/fntfilst.h:40:0,
 from catalogue.c:32:
../../include/X11/fonts/fntfil.h:92:12: note: previous declaration
 of 'FontFileStartListFonts' was here

Signed-off-by: Alan Coopersmith 
---
 src/fontfile/catalogue.c |5 -
 1 file changed, 5 deletions(-)

diff --git a/src/fontfile/catalogue.c b/src/fontfile/catalogue.c
index 6b6fc09..6230930 100644
--- a/src/fontfile/catalogue.c
+++ b/src/fontfile/catalogue.c
@@ -332,11 +332,6 @@ CatalogueListFonts (pointer client, FontPathElementPtr 
fpe, char *pat,
 return Successful;
 }
 
-int
-FontFileStartListFonts(pointer client, FontPathElementPtr fpe,
-  char *pat, int len, int max,
-  pointer *privatep, int mark_aliases);
-
 typedef struct _LFWIData {
 pointer*privates;
 intcurrent;
-- 
1.7.9.2

___
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


[PATCH:libXfont 4/4] Remove redundant setting of 'len' in SPropRecValList_add_by_font_cap

2014-01-07 Thread Alan Coopersmith
Found by cppcheck 1.63:
[FreeType/xttcap.c:621] -> [FreeType/xttcap.c:624]: (performance)
 Variable 'len' is reassigned a value before the old one has been used.

Signed-off-by: Alan Coopersmith 
---
 src/FreeType/xttcap.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/src/FreeType/xttcap.c b/src/FreeType/xttcap.c
index 104dc89..cee752e 100644
--- a/src/FreeType/xttcap.c
+++ b/src/FreeType/xttcap.c
@@ -621,7 +621,6 @@ SPropRecValList_add_by_font_cap(SDynPropRecValList 
*pThisList,
 int len = term-p-1;
 char *value;
 
-len = term-p-1;
 value=malloc(len+1);
 memcpy(value, p+1, len);
 value[len]='\0';
-- 
1.7.9.2

___
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


[PATCH:libXfont 1/4] Fix unused variable 'dir' warnings

2014-01-07 Thread Alan Coopersmith
catalogue.c: In function 'CatalogueOpenFont':
catalogue.c:290:22: warning: variable 'dir' set but not used 
[-Wunused-but-set-variable]
catalogue.c: In function 'CatalogueListFonts':
catalogue.c:324:22: warning: variable 'dir' set but not used 
[-Wunused-but-set-variable]
fpe.c: In function 'BuiltinResetFPE':
fpe.c:57:22: warning: variable 'dir' set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Alan Coopersmith 
---
 src/builtins/fpe.c   |3 ---
 src/fontfile/catalogue.c |4 
 2 files changed, 7 deletions(-)

diff --git a/src/builtins/fpe.c b/src/builtins/fpe.c
index 83905da..689f22a 100644
--- a/src/builtins/fpe.c
+++ b/src/builtins/fpe.c
@@ -54,9 +54,6 @@ BuiltinInitFPE (FontPathElementPtr fpe)
 static int
 BuiltinResetFPE (FontPathElementPtr fpe)
 {
-FontDirectoryPtr   dir;
-
-dir = (FontDirectoryPtr) fpe->private;
 /* builtins can't change! */
 return Successful;
 }
diff --git a/src/fontfile/catalogue.c b/src/fontfile/catalogue.c
index 09ca2ae..6b6fc09 100644
--- a/src/fontfile/catalogue.c
+++ b/src/fontfile/catalogue.c
@@ -287,7 +287,6 @@ CatalogueOpenFont (pointer client, FontPathElementPtr fpe, 
Mask flags,
 {
 CataloguePtr cat = fpe->private;
 FontPathElementPtr subfpe;
-FontDirectoryPtr dir;
 int i, status;
 
 CatalogueRescan (fpe, FALSE);
@@ -295,7 +294,6 @@ CatalogueOpenFont (pointer client, FontPathElementPtr fpe, 
Mask flags,
 for (i = 0; i < cat->fpeCount; i++)
 {
subfpe = cat->fpeList[i];
-   dir = subfpe->private;
status = FontFileOpenFont(client, subfpe, flags,
  name, namelen, format, fmask, id,
  pFont, aliasName, non_cachable_font);
@@ -321,7 +319,6 @@ CatalogueListFonts (pointer client, FontPathElementPtr fpe, 
char *pat,
 {
 CataloguePtr cat = fpe->private;
 FontPathElementPtr subfpe;
-FontDirectoryPtr dir;
 int i;
 
 CatalogueRescan (fpe, FALSE);
@@ -329,7 +326,6 @@ CatalogueListFonts (pointer client, FontPathElementPtr fpe, 
char *pat,
 for (i = 0; i < cat->fpeCount; i++)
 {
subfpe = cat->fpeList[i];
-   dir = subfpe->private;
FontFileListFonts(client, subfpe, pat, len, max, names);
 }
 
-- 
1.7.9.2

___
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:libFS 6/7] Replace malloc(strlen + 1); strcpy() with strdup()

2014-01-07 Thread Jasper St. Pierre
OK then.

Reviewed-by: Jasper St. Pierre 


On Wed, Jan 8, 2014 at 12:53 AM, Alan Coopersmith <
alan.coopersm...@oracle.com> wrote:

> On 01/ 7/14 09:38 PM, Jasper St. Pierre wrote:
>
>> Does FSmalloc do anything special, or is it just a wrapper for historical
>> reasons?
>>
>
> It's mostly historical.  src/FSlibos.h defines it as:
>
> #ifdef MALLOC_0_RETURNS_NULL
> #define FSmalloc(size) malloc(((size) > 0 ? (size) : 1))
> #else
> #define FSmalloc(size) malloc((size))
> #endif
>
> (plus similar for FScalloc & FSrealloc).
>
> The +1 for the string-ending \0 byte ensures that the size will always be
> >0,
> thus the difference doesn't matter.
>
> --
> -Alan Coopersmith-  alan.coopersm...@oracle.com
>  Oracle Solaris Engineering - http://blogs.oracle.com/alanc
>



-- 
  Jasper
___
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:libFS 6/7] Replace malloc(strlen + 1); strcpy() with strdup()

2014-01-07 Thread Alan Coopersmith

On 01/ 7/14 09:38 PM, Jasper St. Pierre wrote:

Does FSmalloc do anything special, or is it just a wrapper for historical 
reasons?


It's mostly historical.  src/FSlibos.h defines it as:

#ifdef MALLOC_0_RETURNS_NULL
#define FSmalloc(size) malloc(((size) > 0 ? (size) : 1))
#else
#define FSmalloc(size) malloc((size))
#endif

(plus similar for FScalloc & FSrealloc).

The +1 for the string-ending \0 byte ensures that the size will always be >0,
thus the difference doesn't matter.

--
-Alan Coopersmith-  alan.coopersm...@oracle.com
 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
___
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:libFS 2/7] Remove unused internal helper _FSGetHostname

2014-01-07 Thread Jasper St. Pierre
Patches 2, 3, 4, 5 are:

Reviewed-by: Jasper St. Pierre 


On Tue, Jan 7, 2014 at 7:02 PM, Alan Coopersmith <
alan.coopersm...@oracle.com> wrote:

> Since we build with -export-symbols-regex '^FS.*', it wasn't available
> to callers outside libFS, and was never called by anything inside libFS.
>
> Xtrans provides it's own exact copy of this function, which gets
> the name _FSTransGetHostname when built in libFS, nothing in libFS
> outside the Xtrans code calls a gethostname() function.
>
> Flagged by cppcheck 1.62:
> [FSlibInt.c:1060]: (style) The function '_FSGetHostname' is never used.
>
> Signed-off-by: Alan Coopersmith 
> ---
>  src/FSlibInt.c |   51 ---
>  src/FSlibint.h |1 -
>  2 files changed, 52 deletions(-)
>
> diff --git a/src/FSlibInt.c b/src/FSlibInt.c
> index cb53e44..cd996d1 100644
> --- a/src/FSlibInt.c
> +++ b/src/FSlibInt.c
> @@ -1034,57 +1034,6 @@ _FSFreeQ(void)
>  return;
>  }
>
> -#ifdef _POSIX_SOURCE /* stupid makedepend [need if] */
> -#ifndef __QNX__ /* QNX's uname nodename entry is not same as tcpip
> hostname */
> -#define NEED_UTSNAME
> -#endif
> -#endif
> -#ifdef hpux
> -#define NEED_UTSNAME
> -#endif
> -#ifdef SVR4
> -#ifndef _SEQUENT_
> -#define NEED_UTSNAME
> -#endif
> -#endif
> -
> -#ifdef NEED_UTSNAME
> -#include 
> -#endif
> -
> -
> -/*
> - * _FSGetHostname - similar to gethostname but allows special processing.
> - */
> -int
> -_FSGetHostname(
> -char   *buf,
> -int maxlen)
> -{
> -int len;
> -
> -#ifdef NEED_UTSNAME
> -/*
> - * same host name crock as in server and xinit.
> - */
> -struct utsname name;
> -
> -uname(&name);
> -len = strlen(name.nodename);
> -if (len >= maxlen)
> -   len = maxlen - 1;
> -strncpy(buf, name.nodename, len);
> -buf[len] = '\0';
> -#else
> -buf[0] = '\0';
> -(void) gethostname(buf, maxlen);
> -buf[maxlen - 1] = '\0';
> -len = strlen(buf);
> -#endif /* NEED_UTSNAME */
> -
> -return len;
> -}
> -
>  #ifndef _FSANYSET
>  /*
>   * This is not always a macro.
> diff --git a/src/FSlibint.h b/src/FSlibint.h
> index 60a2ce6..7669778 100644
> --- a/src/FSlibint.h
> +++ b/src/FSlibint.h
> @@ -95,7 +95,6 @@ extern int _FSPrintDefaultError ( FSServer *svr,
> FSErrorEvent *event,
>  extern int _FSDefaultError ( FSServer *svr, FSErrorEvent *event );
>  extern char * _FSAllocScratch ( FSServer *svr, unsigned long nbytes );
>  extern void _FSFreeQ ( void );
> -extern int _FSGetHostname ( char *buf, int maxlen );
>
>  extern FSErrorHandler  FSSetErrorHandler ( FSErrorHandler handler );
>  extern FSIOErrorHandler FSSetIOErrorHandler ( FSIOErrorHandler handler );
> --
> 1.7.9.2
>
> ___
> 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
>



-- 
  Jasper
___
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:libFS 1/7] If EAGAIN == EWOULDBLOCK, only need to check errno for one of them

2014-01-07 Thread Jasper St. Pierre
Reviewed-by: Jasper St. Pierre 


On Tue, Jan 7, 2014 at 7:02 PM, Alan Coopersmith <
alan.coopersm...@oracle.com> wrote:

> Solaris  has:
>  #define EWOULDBLOCK   EAGAIN
> so checking (errno == EAGAIN || errno == EWOULDBLOCK) is overkill.
>
> This leads cppcheck 1.62 to complain:
> [FSlibInt.c:153] -> [FSlibInt.c:153]: (style) Same expression on both
> sides of '||'.
> [FSlibInt.c:301] -> [FSlibInt.c:301]: (style) Same expression on both
> sides of '||'.
> [FSlibInt.c:379] -> [FSlibInt.c:379]: (style) Same expression on both
> sides of '||'.
> [FSlibInt.c:472] -> [FSlibInt.c:472]: (style) Same expression on both
> sides of '||'.
>
> This quiets it, and reduces the number of calls Solaris Studio cc
> generates to the __errno() function to get the thread-specific errno value.
>
> Signed-off-by: Alan Coopersmith 
> ---
>  src/FSlibInt.c |5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/FSlibInt.c b/src/FSlibInt.c
> index 0fabc96..cb53e44 100644
> --- a/src/FSlibInt.c
> +++ b/src/FSlibInt.c
> @@ -66,11 +66,14 @@ static const char * _SysErrorMsg ( int n );
>
>  /* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
>   * systems are broken and return EWOULDBLOCK when they should return
> EAGAIN
> + *
> + * Solaris defines EWOULDBLOCK to be EAGAIN, so don't need to check twice
> + * for it.
>   */
>  #ifdef WIN32
>  #define ETEST() (WSAGetLastError() == WSAEWOULDBLOCK)
>  #else
> -#if defined(EAGAIN) && defined(EWOULDBLOCK)
> +#if defined(EAGAIN) && defined(EWOULDBLOCK) && (EAGAIN != EWOULDBLOCK)
>  #define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK)
>  #else
>  #ifdef EAGAIN
> --
> 1.7.9.2
>
> ___
> 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
>



-- 
  Jasper
___
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:libFS 6/7] Replace malloc(strlen + 1); strcpy() with strdup()

2014-01-07 Thread Jasper St. Pierre
Does FSmalloc do anything special, or is it just a wrapper for historical
reasons?


On Tue, Jan 7, 2014 at 7:02 PM, Alan Coopersmith <
alan.coopersm...@oracle.com> wrote:

> Signed-off-by: Alan Coopersmith 
> ---
>  src/FSOpenServ.c |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/FSOpenServ.c b/src/FSOpenServ.c
> index b8ccb2f..faebe13 100644
> --- a/src/FSOpenServ.c
> +++ b/src/FSOpenServ.c
> @@ -127,10 +127,9 @@ FSOpenServer(const char *server)
> return (FSServer *) NULL;
>  }
>
> -if ((svr->server_name = FSmalloc(strlen(server) + 1)) == NULL) {
> +if ((svr->server_name = strdup(server)) == NULL) {
> goto fail;
>  }
> -(void) strcpy(svr->server_name, server);
>
>  if ((svr->trans_conn = _FSConnectServer(svr->server_name)) == NULL) {
> goto fail;
> --
> 1.7.9.2
>
> ___
> 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
>



-- 
  Jasper
___
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 v2 randrproto] spec: RRCrtcChangeMask and RROutputChangeMask are not things

2014-01-07 Thread Alan Coopersmith

On 01/ 6/14 11:07 PM, Aaron Plattner wrote:

The correct names for these are RRCrtcChangeNotifyMask and
RROutputChangeNotifyMask, respectively.

v2: "when a the configuration" is also not a thing.

Signed-off-by: Aaron Plattner 
---
Good idea.

  randrproto.txt | 14 +++---
  1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/randrproto.txt b/randrproto.txt
index 2123e7e..864268e 100644
--- a/randrproto.txt
+++ b/randrproto.txt
@@ -406,19 +406,19 @@ The name of this extension is "RANDR".

New for version 1.2:

-   If 'enable' contains RRCrtcChangeMask, RRCrtcChangeNotify events
-   will be sent when a the configuration for a CRTC associated with the
+   If 'enable' contains RRCrtcChangeNotifyMask, RRCrtcChangeNotify events
+   will be sent when the configuration for a CRTC associated with the
screen changes, either through this protocol extension or due to
detected external changes. RRCrtcChangeNotify may also be sent when
this request executes if the CRTC configuration has changed since
the client connected, to avoid race conditions.

-   If 'enable' contains RROutputChangeMask, RROutputChangeNotify events
-   will be sent when a the configuration for an output associated with
+   If 'enable' contains RROutputChangeNotifyMask, RROutputChangeNotify
+   events will be sent when the configuration for an output associated with
the screen changes, either through this protocol extension or due to
-   detected external changes. RROutputChangeNotify may also be sent
-   when this request executes if the output configuration has changed
-   since the client connected, to avoid race conditions.
+   detected external changes. RROutputChangeNotify may also be sent when
+   this request executes if the output configuration has changed since the
+   client connected, to avoid race conditions.

If 'enable' contains RROutputPropertyNotifyMask,
RROutputPropertyNotify events will be sent when properties change on



Reviewed-by: Alan Coopersmith 

--
-Alan Coopersmith-  alan.coopersm...@oracle.com
 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
___
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


[PATCH:libFS 6/7] Replace malloc(strlen + 1); strcpy() with strdup()

2014-01-07 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith 
---
 src/FSOpenServ.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/FSOpenServ.c b/src/FSOpenServ.c
index b8ccb2f..faebe13 100644
--- a/src/FSOpenServ.c
+++ b/src/FSOpenServ.c
@@ -127,10 +127,9 @@ FSOpenServer(const char *server)
return (FSServer *) NULL;
 }
 
-if ((svr->server_name = FSmalloc(strlen(server) + 1)) == NULL) {
+if ((svr->server_name = strdup(server)) == NULL) {
goto fail;
 }
-(void) strcpy(svr->server_name, server);
 
 if ((svr->trans_conn = _FSConnectServer(svr->server_name)) == NULL) {
goto fail;
-- 
1.7.9.2

___
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


[PATCH:libFS 7/7] Use strlcpy instead of strcpy/strncpy if it is available

2014-01-07 Thread Alan Coopersmith
Signed-off-by: Alan Coopersmith 
---
 configure.ac   |3 +++
 src/FSErrDis.c |5 +
 src/FSlibInt.c |4 
 3 files changed, 12 insertions(+)

diff --git a/configure.ac b/configure.ac
index bcc4187..26fffb1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -51,6 +51,9 @@ PKG_CHECK_MODULES(FS, xproto >= 7.0.17 fontsproto xtrans)
 # Find needed libraries for TCP sockets (pre-pended in $LIBS)
 XTRANS_CONNECTION_FLAGS
 
+# Checks for library functions.
+AC_CHECK_FUNCS([strlcpy])
+
 # Allow checking code with lint, sparse, etc.
 XORG_WITH_LINT
 XORG_LINT_LIBRARY([FS])
diff --git a/src/FSErrDis.c b/src/FSErrDis.c
index 1a712ff..76ebab6 100644
--- a/src/FSErrDis.c
+++ b/src/FSErrDis.c
@@ -84,9 +84,14 @@ int FSGetErrorDatabaseText(
 {
 if (nbytes == 0)
return 0;
+#ifdef HAVE_STRLCPY
+if (strlcpy(buffer, defaultp, nbytes) >= nbytes)
+   return 0;
+#else
 (void) strncpy(buffer, defaultp, nbytes);
 if ((strlen(defaultp) + 1) > nbytes)
buffer[nbytes - 1] = '\0';
+#endif
 return 1;
 }
 
diff --git a/src/FSlibInt.c b/src/FSlibInt.c
index 71f6ac1..090da3f 100644
--- a/src/FSlibInt.c
+++ b/src/FSlibInt.c
@@ -850,7 +850,11 @@ _FSPrintDefaultError(
ext && (ext->codes.major_opcode != event->request_code);
ext = ext->next);
if (ext)
+#ifdef HAVE_STRLCPY
+   strlcpy(buffer, ext->name, sizeof(buffer));
+#else
strcpy(buffer, ext->name);
+#endif
else
buffer[0] = '\0';
 }
-- 
1.7.9.2

___
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


[PATCH:libFS 2/7] Remove unused internal helper _FSGetHostname

2014-01-07 Thread Alan Coopersmith
Since we build with -export-symbols-regex '^FS.*', it wasn't available
to callers outside libFS, and was never called by anything inside libFS.

Xtrans provides it's own exact copy of this function, which gets
the name _FSTransGetHostname when built in libFS, nothing in libFS
outside the Xtrans code calls a gethostname() function.

Flagged by cppcheck 1.62:
[FSlibInt.c:1060]: (style) The function '_FSGetHostname' is never used.

Signed-off-by: Alan Coopersmith 
---
 src/FSlibInt.c |   51 ---
 src/FSlibint.h |1 -
 2 files changed, 52 deletions(-)

diff --git a/src/FSlibInt.c b/src/FSlibInt.c
index cb53e44..cd996d1 100644
--- a/src/FSlibInt.c
+++ b/src/FSlibInt.c
@@ -1034,57 +1034,6 @@ _FSFreeQ(void)
 return;
 }
 
-#ifdef _POSIX_SOURCE /* stupid makedepend [need if] */
-#ifndef __QNX__ /* QNX's uname nodename entry is not same as tcpip hostname */
-#define NEED_UTSNAME
-#endif
-#endif
-#ifdef hpux
-#define NEED_UTSNAME
-#endif
-#ifdef SVR4
-#ifndef _SEQUENT_
-#define NEED_UTSNAME
-#endif
-#endif
-
-#ifdef NEED_UTSNAME
-#include 
-#endif
-
-
-/*
- * _FSGetHostname - similar to gethostname but allows special processing.
- */
-int
-_FSGetHostname(
-char   *buf,
-int maxlen)
-{
-int len;
-
-#ifdef NEED_UTSNAME
-/*
- * same host name crock as in server and xinit.
- */
-struct utsname name;
-
-uname(&name);
-len = strlen(name.nodename);
-if (len >= maxlen)
-   len = maxlen - 1;
-strncpy(buf, name.nodename, len);
-buf[len] = '\0';
-#else
-buf[0] = '\0';
-(void) gethostname(buf, maxlen);
-buf[maxlen - 1] = '\0';
-len = strlen(buf);
-#endif /* NEED_UTSNAME */
-
-return len;
-}
-
 #ifndef _FSANYSET
 /*
  * This is not always a macro.
diff --git a/src/FSlibint.h b/src/FSlibint.h
index 60a2ce6..7669778 100644
--- a/src/FSlibint.h
+++ b/src/FSlibint.h
@@ -95,7 +95,6 @@ extern int _FSPrintDefaultError ( FSServer *svr, FSErrorEvent 
*event,
 extern int _FSDefaultError ( FSServer *svr, FSErrorEvent *event );
 extern char * _FSAllocScratch ( FSServer *svr, unsigned long nbytes );
 extern void _FSFreeQ ( void );
-extern int _FSGetHostname ( char *buf, int maxlen );
 
 extern FSErrorHandler  FSSetErrorHandler ( FSErrorHandler handler );
 extern FSIOErrorHandler FSSetIOErrorHandler ( FSIOErrorHandler handler );
-- 
1.7.9.2

___
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


[PATCH:libFS 3/7] Remove unused internal helper _FSAllocScratch

2014-01-07 Thread Alan Coopersmith
Since we build with -export-symbols-regex '^FS.*', it wasn't available
to callers outside libFS, and was never called by anything inside libFS.

Seems to have been imported from XlibInt.c without ever being used.
The _FSserver fields that it used (and nothing else did) are replaced
with "unused" placeholders to maintain struct layout/size.

Flagged by cppcheck 1.62:
[FSlibInt.c:973]: (style) The function '_FSAllocScratch' is never used.

Signed-off-by: Alan Coopersmith 
---
 include/X11/fonts/FSlib.h |4 ++--
 src/FSlibInt.c|   19 ---
 src/FSlibint.h|1 -
 3 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/include/X11/fonts/FSlib.h b/include/X11/fonts/FSlib.h
index 11b3ba6..1cd7f13 100644
--- a/include/X11/fonts/FSlib.h
+++ b/include/X11/fonts/FSlib.h
@@ -148,8 +148,8 @@ struct _FSServer {
 int ext_number;
 Bool(*event_vec[132]) (FSServer *, FSEvent *, fsEvent *);
 Status (*wire_vec[132]) (FSServer *, FSEvent *, fsEvent *);
-char   *scratch_buffer;
-unsigned long scratch_length;
+void *unused_1; /* previously scratch_buffer */
+unsigned long unused_2; /* previously scratch_length */
 FSSyncHandler synchandler;
 unsigned long flags;
 struct _XtransConnInfo *trans_conn; /* transport connection object */
diff --git a/src/FSlibInt.c b/src/FSlibInt.c
index cd996d1..48091cf 100644
--- a/src/FSlibInt.c
+++ b/src/FSlibInt.c
@@ -964,25 +964,6 @@ _FSDefaultError(
 FSIOErrorHandler _FSIOErrorFunction = _FSDefaultIOError;
 FSErrorHandler _FSErrorFunction = _FSDefaultError;
 
-/*
- * This routine can be used to (cheaply) get some memory within a single
- * Xlib routine for scratch space.  It is reallocated from the same place
- * each time, unless the library needs a large scratch space.
- */
-char   *
-_FSAllocScratch(
-register FSServer  *svr,
-unsigned long   nbytes)
-{
-if (nbytes > svr->scratch_length) {
-   if (svr->scratch_buffer != NULL)
-   FSfree(svr->scratch_buffer);
-   return (svr->scratch_length = nbytes,
-   svr->scratch_buffer = FSmalloc(nbytes));
-}
-return (svr->scratch_buffer);
-}
-
 int
 FSFree(char *data)
 {
diff --git a/src/FSlibint.h b/src/FSlibint.h
index 7669778..b50509b 100644
--- a/src/FSlibint.h
+++ b/src/FSlibint.h
@@ -93,7 +93,6 @@ extern int _FSDefaultIOError ( FSServer *svr ) _X_NORETURN;
 extern int _FSPrintDefaultError ( FSServer *svr, FSErrorEvent *event,
  FILE *fp );
 extern int _FSDefaultError ( FSServer *svr, FSErrorEvent *event );
-extern char * _FSAllocScratch ( FSServer *svr, unsigned long nbytes );
 extern void _FSFreeQ ( void );
 
 extern FSErrorHandler  FSSetErrorHandler ( FSErrorHandler handler );
-- 
1.7.9.2

___
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


[PATCH:libFS 1/7] If EAGAIN == EWOULDBLOCK, only need to check errno for one of them

2014-01-07 Thread Alan Coopersmith
Solaris  has:
 #define EWOULDBLOCK   EAGAIN
so checking (errno == EAGAIN || errno == EWOULDBLOCK) is overkill.

This leads cppcheck 1.62 to complain:
[FSlibInt.c:153] -> [FSlibInt.c:153]: (style) Same expression on both sides of 
'||'.
[FSlibInt.c:301] -> [FSlibInt.c:301]: (style) Same expression on both sides of 
'||'.
[FSlibInt.c:379] -> [FSlibInt.c:379]: (style) Same expression on both sides of 
'||'.
[FSlibInt.c:472] -> [FSlibInt.c:472]: (style) Same expression on both sides of 
'||'.

This quiets it, and reduces the number of calls Solaris Studio cc
generates to the __errno() function to get the thread-specific errno value.

Signed-off-by: Alan Coopersmith 
---
 src/FSlibInt.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/FSlibInt.c b/src/FSlibInt.c
index 0fabc96..cb53e44 100644
--- a/src/FSlibInt.c
+++ b/src/FSlibInt.c
@@ -66,11 +66,14 @@ static const char * _SysErrorMsg ( int n );
 
 /* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
  * systems are broken and return EWOULDBLOCK when they should return EAGAIN
+ *
+ * Solaris defines EWOULDBLOCK to be EAGAIN, so don't need to check twice
+ * for it.
  */
 #ifdef WIN32
 #define ETEST() (WSAGetLastError() == WSAEWOULDBLOCK)
 #else
-#if defined(EAGAIN) && defined(EWOULDBLOCK)
+#if defined(EAGAIN) && defined(EWOULDBLOCK) && (EAGAIN != EWOULDBLOCK)
 #define ETEST() (errno == EAGAIN || errno == EWOULDBLOCK)
 #else
 #ifdef EAGAIN
-- 
1.7.9.2

___
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


[PATCH:libFS 4/7] Remove unused internal helper _FSEventsQueued

2014-01-07 Thread Alan Coopersmith
Since we build with -export-symbols-regex '^FS.*', it wasn't available
to callers outside libFS, and was never called by anything inside libFS.

Seems to have been imported from XlibInt.c without ever being used.

Flagged by cppcheck 1.62:
[FSlibInt.c:180]: (style) The function '_FSEventsQueued' is never used.

Signed-off-by: Alan Coopersmith 
---
 src/FSlibInt.c |   36 
 src/FSlibint.h |1 -
 2 files changed, 37 deletions(-)

diff --git a/src/FSlibInt.c b/src/FSlibInt.c
index 48091cf..eeab20c 100644
--- a/src/FSlibInt.c
+++ b/src/FSlibInt.c
@@ -176,42 +176,6 @@ _FSFlush(register FSServer *svr)
 svr->last_req = (char *) &_dummy_request;
 }
 
-int
-_FSEventsQueued(
-register FSServer  *svr,
-int mode)
-{
-register BytesReadable_t len;
-BytesReadable_t pend;
-charbuf[BUFSIZE];
-register fsReply *rep;
-
-if (mode == QueuedAfterFlush) {
-   _FSFlush(svr);
-   if (svr->qlen)
-   return (svr->qlen);
-}
-if (_FSTransBytesReadable(svr->trans_conn, &pend) < 0)
-   (*_FSIOErrorFunction) (svr);
-if ((len = pend) < SIZEOF(fsReply))
-   return (svr->qlen); /* _FSFlush can enqueue events */
-else if (len > BUFSIZE)
-   len = BUFSIZE;
-len /= SIZEOF(fsReply);
-pend = len * SIZEOF(fsReply);
-_FSRead(svr, buf, (long) pend);
-
-/* no space between comma and type or else macro will die */
-STARTITERATE(rep, fsReply, buf, (len > 0), len--) {
-   if (rep->generic.type == FS_Error)
-   _FSError(svr, (fsError *) rep);
-   else/* must be an event packet */
-   _FSEnq(svr, (fsEvent *) rep);
-}
-ENDITERATE
-   return (svr->qlen);
-}
-
 /* _FSReadEvents - Flush the output queue,
  * then read as many events as possible (but at least 1) and enqueue them
  */
diff --git a/src/FSlibint.h b/src/FSlibint.h
index b50509b..b5aba87 100644
--- a/src/FSlibint.h
+++ b/src/FSlibint.h
@@ -82,7 +82,6 @@ extern int _FSReply ( FSServer *svr, fsReply *rep, int extra, 
int discard );
 extern XtransConnInfo _FSConnectServer ( char *server_name );
 extern void _FSDisconnectServer ( XtransConnInfo trans_conn );
 extern void _FSSendClientPrefix ( FSServer *svr, fsConnClientPrefix *client );
-extern int _FSEventsQueued ( FSServer *svr, int mode );
 extern unsigned long _FSSetLastRequestRead ( FSServer *svr,
 fsGenericReply *rep );
 extern int _FSUnknownWireEvent ( FSServer *svr, FSEvent *re, fsEvent *event );
-- 
1.7.9.2

___
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


[PATCH:libFS 5/7] Remove unused internal helper _FSWireToEvent

2014-01-07 Thread Alan Coopersmith
Since we build with -export-symbols-regex '^FS.*', it wasn't available
to callers outside libFS, and was never called by anything inside libFS.

Seems to have been imported from XlibInt.c without ever being used.

Flagged by cppcheck 1.62:
[FSlibInt.c:753]: (style) The function '_FSWireToEvent' is never used.

Signed-off-by: Alan Coopersmith 
---
 src/FSlibInt.c |   29 -
 src/FSlibint.h |1 -
 2 files changed, 30 deletions(-)

diff --git a/src/FSlibInt.c b/src/FSlibInt.c
index eeab20c..71f6ac1 100644
--- a/src/FSlibInt.c
+++ b/src/FSlibInt.c
@@ -746,35 +746,6 @@ _FSUnknownNativeEvent(
 return (0);
 }
 
-/*
- * reformat a wire event into an FSEvent structure of the right type.
- */
-Bool
-_FSWireToEvent(
-register FSServer  *svr,   /* pointer to display structure */
-register FSEvent   *re,/* pointer to where event should be
-* reformatted */
-register fsEvent   *event) /* wire protocol event */
-{
-
-re->type = event->type & 0x7f;
-((FSAnyEvent *) re)->serial = _FSSetLastRequestRead(svr,
-  (fsGenericReply *) event);
-((FSAnyEvent *) re)->send_event = ((event->type & 0x80) != 0);
-((FSAnyEvent *) re)->server = svr;
-
-/*
- * Ignore the leading bit of the event type since it is set when a client
- * sends an event rather than the server.
- */
-
-switch (event->type & 0177) {
-default:
-   return (_FSUnknownWireEvent(svr, re, event));
-}
-}
-
-
 static const char *
 _SysErrorMsg(int n)
 {
diff --git a/src/FSlibint.h b/src/FSlibint.h
index b5aba87..5e539be 100644
--- a/src/FSlibint.h
+++ b/src/FSlibint.h
@@ -87,7 +87,6 @@ extern unsigned long _FSSetLastRequestRead ( FSServer *svr,
 extern int _FSUnknownWireEvent ( FSServer *svr, FSEvent *re, fsEvent *event );
 extern int _FSUnknownNativeEvent ( FSServer *svr, FSEvent *re,
   fsEvent *event );
-extern int _FSWireToEvent ( FSServer *svr, FSEvent *re, fsEvent *event );
 extern int _FSDefaultIOError ( FSServer *svr ) _X_NORETURN;
 extern int _FSPrintDefaultError ( FSServer *svr, FSErrorEvent *event,
  FILE *fp );
-- 
1.7.9.2

___
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] Xi: Honor pointer-emulating touch when setting the button mask in XIQueryDevice

2014-01-07 Thread Carlos Garnacho
Hey,

On lun, 2014-01-06 at 15:59 +1000, Peter Hutterer wrote:
> On Fri, Jan 03, 2014 at 05:41:45PM +0100, Carlos Garnacho wrote:
> > If a touch is currently active and emulating pointer events, XIQueryDevice 
> > must
> > set the button 1 in the mask so pointer emulation is complete, as clients 
> > using
> > XI2 would get inconsistent button states wrt events if querying the device. 
> > This
> > is already handled correctly on the core protocol requests.
> 
> the behaviour for XIQueryPointer is to include the button state for
> clients < XI 2.2, but don't include it for clients that know about touch (and 
> can
> thus handle touch). I think we should emulate the same behaviour here to be
> consistent (though I can't find the documentation for this anymore). This
> would of course mean that XI2.2+ clients can't tell if there's a
> pointer-emulating touch currently active...

Hmm, that is quite unfortunate... The background on this patch is
https://bugzilla.gnome.org/show_bug.cgi?id=709914#c20 , mutter is
querying the button state on EWMH messages to double check the button is
still pressed, but opting this out on XI2.2+ clients would still be
affecting mutter.

In this situation, mutter isn't even receiving input events at that
time, so all means to know a (pointer-emulating) touch is ongoing are
ruled out... I think this counts as a legitimate usecase of XI2.2+
client that cares of pointer emulation.

I now wonder how could this be handled, can just think of using an
special bit on the XIButtonState mask, and that of course requires
amending the spec...

  Carlos

> 
> Cheers,
>Peter
> 
> PS: xiquerypointer.c needs the loop below instead of a just buttonsDown > 0.
> Feel free to add that patch to your list ;)
> 
>  
> > Signed-off-by: Carlos Garnacho 
> > ---
> >  Xi/xiquerydevice.c | 14 +-
> >  1 file changed, 13 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Xi/xiquerydevice.c b/Xi/xiquerydevice.c
> > index 4e544f0..762968a 100644
> > --- a/Xi/xiquerydevice.c
> > +++ b/Xi/xiquerydevice.c
> > @@ -261,11 +261,23 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo * 
> > info, Bool reportState)
> >  bits = (unsigned char *) &info[1];
> >  memset(bits, 0, mask_len * 4);
> >  
> > -if (reportState)
> > +if (reportState) {
> >  for (i = 0; i < dev->button->numButtons; i++)
> >  if (BitIsOn(dev->button->down, i))
> >  SetBit(bits, i);
> >  
> > +/* Cater for touch pointer-emulation */
> > +if (dev->touch) {
> > +for (i = 0; i < dev->touch->num_touches; i++) {
> > +TouchPointInfoPtr ti = dev->touch->touches + i;
> > +if (ti->active && ti->emulate_pointer) {
> > +SetBit(bits, 1);
> > +break;
> > +}
> > +}
> > +}
> > +}
> > +
> >  bits += mask_len * 4;
> >  memcpy(bits, dev->button->labels, dev->button->numButtons * 
> > sizeof(Atom));
> >  
> > -- 
> > 1.8.5.2
> > 
> > ___
> > 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
> > 


___
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 video-s3] Remove mibstore.h

2014-01-07 Thread Trevor Woerner

On 01/07/14 16:32, Gaetan Nadon wrote:
> As it was done in numerous other drivers. Fixes compile error.
>
> Signed-off-by: Gaetan Nadon 
> ---
>  src/s3_driver.c |2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/src/s3_driver.c b/src/s3_driver.c
> index 61242ad..85763ba 100644
> --- a/src/s3_driver.c
> +++ b/src/s3_driver.c
> @@ -52,7 +52,6 @@
>  #include "compiler.h"
>  #include "mipointer.h"
>  #include "micmap.h"
> -#include "mibstore.h"
>  #include "fb.h"
>  #include "inputstr.h"
>  #include "shadowfb.h"
> @@ -822,7 +821,6 @@ static Bool S3ScreenInit(SCREEN_INIT_ARGS_DECL)
>   fbPictureInit (pScreen, 0, 0);
>   S3DGAInit(pScreen);
>  
> -miInitializeBackingStore(pScreen);
>  xf86SetBackingStore(pScreen);
>  
>   /* framebuffer manager setup */

Tested-by: Trevor Woerner 
___
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


[PATCH video-s3] Remove mibstore.h

2014-01-07 Thread Gaetan Nadon
As it was done in numerous other drivers. Fixes compile error.

Signed-off-by: Gaetan Nadon 
---
 src/s3_driver.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/src/s3_driver.c b/src/s3_driver.c
index 61242ad..85763ba 100644
--- a/src/s3_driver.c
+++ b/src/s3_driver.c
@@ -52,7 +52,6 @@
 #include "compiler.h"
 #include "mipointer.h"
 #include "micmap.h"
-#include "mibstore.h"
 #include "fb.h"
 #include "inputstr.h"
 #include "shadowfb.h"
@@ -822,7 +821,6 @@ static Bool S3ScreenInit(SCREEN_INIT_ARGS_DECL)
fbPictureInit (pScreen, 0, 0);
S3DGAInit(pScreen);
 
-miInitializeBackingStore(pScreen);
 xf86SetBackingStore(pScreen);
 
/* framebuffer manager setup */
-- 
1.7.9.5

___
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: [ANNOUNCE] libXfont 1.4.7

2014-01-07 Thread Alan Coopersmith

On 01/ 7/14 01:14 PM, Trevor Woerner wrote:

On 01/07/14 15:46, Alan Coopersmith wrote:

On 01/ 7/14 12:41 PM, Trevor Woerner wrote:

On 01/07/14 11:35, Alan Coopersmith wrote:

This release includes the fix for CVE-2013-6462, as well as other
security
hardening and code cleanups, and makes libXfont compatible with
libXtrans 1.3
on Solaris.


Should the libXfont_la_LDFLAGS be bumped to reflect this update?


I can't see why it would be updated - what would we update in it and why
do you think that's needed?



Builds from both this version and 1.4.6 produce:

 ${libdir}/libXfont.so.1.4.1

How would I know, looking at this file, whether the libXfont on my
system is the fixed one or not?


You wouldn't - library .so versions are not useful for tracking bug fixes.
The .so version has never changed for libXfont - it's the same since 1.0.


If the build output from both the old and the new produce the same file,
how would one distinguish between them? Aren't there situations when a
developer might want more than one version of a library installed on
their system (and use the *.so to pick one over the other)?


Not for libXfont.

--
-Alan Coopersmith-  alan.coopersm...@oracle.com
 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
___
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: [ANNOUNCE] libXfont 1.4.7

2014-01-07 Thread Alan Coopersmith

On 01/ 7/14 12:41 PM, Trevor Woerner wrote:

On 01/07/14 11:35, Alan Coopersmith wrote:

This release includes the fix for CVE-2013-6462, as well as other security
hardening and code cleanups, and makes libXfont compatible with libXtrans 1.3
on Solaris.


Should the libXfont_la_LDFLAGS be bumped to reflect this update?


I can't see why it would be updated - what would we update in it and why
do you think that's needed?

--
-Alan Coopersmith-  alan.coopersm...@oracle.com
 Oracle Solaris Engineering - http://blogs.oracle.com/alanc
___
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


[PATCH RESEND xserver] Default font path: remove the check for ${sysconfdir}/X11/fontpath.d

2014-01-07 Thread Gaetan Nadon
The location ${sysconfdir}/X11/fontpath.d is unknown at configuration time
(only at make time) as evidenced by the configuration output:

checking for ${prefix}/etc/X11/fontpath.d... no

Unlike font-util for the X fonts, there is no mechanism to query where
fontpath.d is. Fedora have chosen /etc/X11 and others have followed, but this
is not a standard. It might also be installed at another location, it may or may
not be under the xserver installation prefix. We just don't know. Debian does
not use this at all.

Distros are using --with-default-path when they support fontpath.d, so they
never relied on the server default as it never worked.

The patch essentially is a noop, which leaves the door open for anyone who
could potentially provide a reliable implementation of choosing fontpath.d
when applicable.

Signed-off-by: Gaetan Nadon 
---
 configure.ac |   17 +++--
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index a1fcaf0..7b84ab9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -491,17 +491,14 @@ XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1)
 XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi)
 XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi)
 
-dnl Uses --default-font-path if set, otherwise checks for /etc/X11/fontpath.d,
-dnl otherwise uses standard subdirectories of FONTROOTDIR. When cross
-dnl compiling, assume default font path uses standard FONTROOTDIR directories.
+dnl Uses --with-default-font-path if set, otherwise uses standard
+dnl subdirectories of FONTROOTDIR. Some distros set the default font path to
+dnl "catalogue:/etc/X11/fontpath.d,built-ins"
 
DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/"
-if test "$cross_compiling" != yes; then
-   AC_CHECK_FILE([${sysconfdir}/X11/fontpath.d],
-   [DEFAULT_FONT_PATH='catalogue:${sysconfdir}/X11/fontpath.d'],
-   [case $host_os in
-   darwin*) 
DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;;
-   esac])
-fi
+case $host_os in
+darwin*) 
DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;;
+esac
+
 AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], 
[Comma separated list of font dirs]),
[ FONTPATH="$withval" ],
[ FONTPATH="${DEFAULT_FONT_PATH}" ])
-- 
1.7.9.5

___
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


[PATCH xserver 4/5] xorg-tls: fix warning, replace AC_TRY_COMPILE with AC_COMPILE_IFELSE

2014-01-07 Thread Gaetan Nadon
The code produced in the configure script is identical.

Reviewed-by: Alan Coopersmith 
Signed-off-by: Gaetan Nadon 
---
 m4/xorg-tls.m4 |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/m4/xorg-tls.m4 b/m4/xorg-tls.m4
index e04f1ff..5768775 100644
--- a/m4/xorg-tls.m4
+++ b/m4/xorg-tls.m4
@@ -28,7 +28,7 @@ AC_DEFUN([XORG_TLS], [
 ac_cv_tls=none
 keywords="__thread __declspec(thread)"
 for kw in $keywords ; do
-AC_TRY_COMPILE([int $kw test;], [], ac_cv_tls=$kw ; break ;)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int $kw test;]], [])], 
ac_cv_tls=$kw ; break ;)
 done
 ])
 AC_MSG_RESULT($ac_cv_tls)
@@ -38,7 +38,7 @@ AC_DEFUN([XORG_TLS], [
 AC_CACHE_VAL(ac_cv_tls_model, [
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $STRICT_CFLAGS"
-AC_TRY_COMPILE([int $ac_cv_tls 
__attribute__((tls_model("initial-exec"))) test;], [],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int $ac_cv_tls 
__attribute__((tls_model("initial-exec"))) test;]], [])],
ac_cv_tls_model=yes, ac_cv_tls_model=no)
 CFLAGS="$save_CFLAGS"
 ])
-- 
1.7.9.5

___
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


[PATCH xserver 5/5] autoconf: fix warning by replacing AC_WARN with AC_MSG_WARN

2014-01-07 Thread Gaetan Nadon
A warning about the macro generating the warnings to the user...

Reviewed-by: Alan Coopersmith 
Signed-off-by: Gaetan Nadon 
---
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index a61eeed..55abdf2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2413,7 +2413,7 @@ AC_SUBST([prefix])
 AC_CONFIG_COMMANDS([sdksyms], [touch hw/xfree86/sdksyms.dep])
 
 if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno; then
-AC_WARN([
+AC_MSG_WARN([
  ***
  Neither HAL nor udev backend will be enabled.
  Input device hotplugging will not be available!
-- 
1.7.9.5

___
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


[PATCH xserver 1/5] autoconf: fix warning by replacing deprecated AC_HELP_STRING

2014-01-07 Thread Gaetan Nadon
We can also make do without the workaround introduced in 2005.
The 2.60 autoconf minimum version covers that now.

Reviewed-by: Alan Coopersmith 
Signed-off-by: Gaetan Nadon 
---
 configure.ac |   12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7ec1997..c15877d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -437,8 +437,6 @@ VENDOR_NAME="The X.Org Foundation"
 VENDOR_NAME_SHORT="X.Org"
 VENDOR_WEB="http://wiki.x.org";
 
-m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], 
m4_defn([AC_HELP_STRING]))])
-
 dnl Build options.
 AC_ARG_ENABLE(werror,AS_HELP_STRING([--enable-werror],
  [Obsolete - use --enable-strict-compilation instead]),
@@ -565,7 +563,7 @@ AC_ARG_ENABLE(install-libxf86config,
[Install libxf86config (default: disabled)]),
[INSTALL_LIBXF86CONFIG=$enableval],
[INSTALL_LIBXF86CONFIG=no])
-AC_ARG_ENABLE(visibility, AC_HELP_STRING([--enable-visibility], [Enable 
symbol visibility (default: auto)]),
+AC_ARG_ENABLE(visibility, AS_HELP_STRING([--enable-visibility], [Enable 
symbol visibility (default: auto)]),
[SYMBOL_VISIBILITY=$enableval],
[SYMBOL_VISIBILITY=auto])
 
@@ -627,8 +625,8 @@ AC_ARG_ENABLE(windowswm,  
AS_HELP_STRING([--enable-windowswm], [Build XWin w
 AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg 
with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes])
 AC_ARG_ENABLE(clientids,  AS_HELP_STRING([--disable-clientids], [Build 
Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], 
[CLIENTIDS=yes])
 AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess], [Build Xorg with 
pciaccess library (default: enabled)]), [PCI=$enableval], [PCI=yes])
-AC_ARG_ENABLE(linux_acpi, AC_HELP_STRING([--disable-linux-acpi], [Disable 
building ACPI support on Linux (if available).]), 
[enable_linux_acpi=$enableval], [enable_linux_acpi=yes])
-AC_ARG_ENABLE(linux_apm, AC_HELP_STRING([--disable-linux-apm], [Disable 
building APM support on Linux (if available).]), [enable_linux_apm=$enableval], 
[enable_linux_apm=yes])
+AC_ARG_ENABLE(linux_acpi, AS_HELP_STRING([--disable-linux-acpi], [Disable 
building ACPI support on Linux (if available).]), 
[enable_linux_acpi=$enableval], [enable_linux_acpi=yes])
+AC_ARG_ENABLE(linux_apm, AS_HELP_STRING([--disable-linux-apm], [Disable 
building APM support on Linux (if available).]), [enable_linux_apm=$enableval], 
[enable_linux_apm=yes])
 
 dnl DDXes.
 AC_ARG_ENABLE(xorg,  AS_HELP_STRING([--enable-xorg], [Build 
Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
@@ -645,8 +643,8 @@ AC_ARG_ENABLE(xfake,  
AS_HELP_STRING([--enable-xfake], [Build the kdrive
 AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the 
kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], 
[XFBDEV=auto])
 dnl kdrive options
 AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd 
driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto])
-AC_ARG_ENABLE(kdrive-mouse,   AC_HELP_STRING([--enable-kdrive-mouse], [Build 
mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], 
[KDRIVE_MOUSE=auto])
-AC_ARG_ENABLE(kdrive-evdev,   AC_HELP_STRING([--enable-kdrive-evdev], [Build 
evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], 
[KDRIVE_EVDEV=auto])
+AC_ARG_ENABLE(kdrive-mouse,   AS_HELP_STRING([--enable-kdrive-mouse], [Build 
mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], 
[KDRIVE_MOUSE=auto])
+AC_ARG_ENABLE(kdrive-evdev,   AS_HELP_STRING([--enable-kdrive-evdev], [Build 
evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], 
[KDRIVE_EVDEV=auto])
 AC_ARG_ENABLE(libunwind,  AS_HELP_STRING([--enable-libunwind], [Use 
libunwind for backtracing (default: auto)]), [LIBUNWIND="$enableval"], 
[LIBUNWIND="auto"])
 
 
-- 
1.7.9.5

___
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


[PATCH xserver 2/5] autoconf: fix warning, replace AC_TRY_LINK with AC_LINK_IFELSE

2014-01-07 Thread Gaetan Nadon
The code produced in the configure script is identical.

Reviewed-by: Alan Coopersmith 
Signed-off-by: Gaetan Nadon 
---
 configure.ac |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index c15877d..1859b8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -265,20 +265,20 @@ AM_CONDITIONAL(FREEBSD_KLDLOAD, [test 
"x$ac_cv_sys_linker_h" = xyes])
 
 AC_CACHE_CHECK([for SYSV IPC],
ac_cv_sysv_ipc,
-   [AC_TRY_LINK([
+   [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include 
 #include 
 #include 
 #include 
-],[
+]],[[
 { 
 int id;
 id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR);
 if (id < 0) return -1;
 return shmctl(id, IPC_RMID, 0);
-}],
-   [ac_cv_sysv_ipc=yes],
-   [ac_cv_sysv_ipc=no])])
+}]])],
+   [ac_cv_sysv_ipc=yes],
+   [ac_cv_sysv_ipc=no])])
 if test "x$ac_cv_sysv_ipc" = xyes; then
AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available])
 fi
-- 
1.7.9.5

___
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


[PATCH xserver 3/5] autoconf: fix warning, replace AC_TRY_COMPILE with AC_COMPILE_IFELSE

2014-01-07 Thread Gaetan Nadon
The code produced in the configure script is identical.

Reviewed-by: Alan Coopersmith 
Signed-off-by: Gaetan Nadon 
---
 configure.ac |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1859b8e..a61eeed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1820,13 +1820,13 @@ if test "x$XORG" = xyes; then
save_CFLAGS="$CFLAGS"
proto_inc=`$PKG_CONFIG --cflags xproto`
CFLAGS="$CFLAGS $VISIBILITY_CFLAGS $proto_inc"
-   AC_TRY_COMPILE(
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include 
 extern _X_HIDDEN int hidden_int;
 extern _X_EXPORT int public_int;
 extern _X_HIDDEN int hidden_int_func(void);
-extern _X_EXPORT int public_int_func(void);],
-   [],
+extern _X_EXPORT int public_int_func(void);]],
+   [])],
have_visibility=yes,
have_visibility=no)
CFLAGS=$save_CFLAGS
@@ -2386,12 +2386,12 @@ dnl though, thanks to the passing of some significant 
amount of time, the
 dnl above is probably a complete fallacy, and you should not rely on it.
 dnl but this is still actually better than imake, honest. -daniels
 
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include 
 #ifndef __GLIBC__
 #error not glibc
 #endif
-], [], [AC_DEFINE(_GNU_SOURCE, 1,
+]], [])], [AC_DEFINE(_GNU_SOURCE, 1,
[ Enable GNU and other extensions to the C environment for glibc])])
 
 AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix])
-- 
1.7.9.5

___
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 RESEND xserver] libtool: bump minimum required version to 2.2

2014-01-07 Thread Gaetan Nadon
On 13-12-05 05:02 PM, Gaetan Nadon wrote:
>>> Tested with autoconf 2.60, automake 1.10.3 and libtool 2.2
>> This all looks sensible, but I think we'll wait to change these kinds of
>> build dependencies until after 1.15 ships, if that seems good to you.
>>
> I had that in mind, that would be perfect, thanks.

Release 1.15 has passed now. Need someone else to review?
___
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 xrandr 0/3] Print GUIDs in canonical GUID format

2014-01-07 Thread Alex Deucher
On Mon, Jan 6, 2014 at 3:35 PM, Aaron Plattner  wrote:
> This set of changes modifies xrandr.c to print the GUID property specified in
> randrproto (see [1]) in the canonical hexadecimal format described in [2].
> E.g., before this change, my monitor reports a GUID of
>
> GUID: 16 -34 -112 112 0 4 -17 76 112 -110 -56 -123 0 0 0 102
>
> and after, it reports
>
> GUID: {10DE9070-0004-EF4C-7092-C8850066}
>
> [1] 
> http://cgit.freedesktop.org/xorg/proto/randrproto/commit/?id=19fc4c5a72eb9919d720ad66734029d9f8e313b1
> [2] http://en.wikipedia.org/wiki/Globally_unique_identifier
>
> Aaron Plattner (3):
>   Split output property printing into a helper function
>   Move EDID printing into a helper function
>   Special-case printing of the GUID property

For the series:

Reviewed-by: Alex Deucher 

>
>  xrandr.c | 129 
> +++
>  1 file changed, 89 insertions(+), 40 deletions(-)
>
> --
> 1.8.5.2
>
> ___
> 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
___
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