[PATCH:libXi] Remove check that can never be true.

2013-06-27 Thread Thomas Klausner
clang warns:
warning: comparison of constant 268435455 with expression of type
'CARD16' (aka 'unsigned short') is always false
---
 src/XGetFCtl.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/XGetFCtl.c b/src/XGetFCtl.c
index bb50bf3..2d71fab 100644
--- a/src/XGetFCtl.c
+++ b/src/XGetFCtl.c
@@ -125,9 +125,6 @@ XGetFeedbackControl(
case StringFeedbackClass:
{
xStringFeedbackState *strf = (xStringFeedbackState *) f;
-
-   if (strf-num_syms_supported = (INT_MAX / sizeof(KeySym)))
-   goto out;
size += sizeof(XStringFeedbackState) +
(strf-num_syms_supported * sizeof(KeySym));
}
-- 
1.8.3.1

___
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:libX11 1/4] Stop truncating source to destination length if it is larger.

2013-06-25 Thread Thomas Klausner
It seems useless to do that since the code tests for both source
length and destination to be non-zero. This fixes a cut'n'paste
problem in xterm where the paste length was limited to 1024 (BUFSIZ)
in button.c.
---
 modules/lc/gen/lcGenConv.c | 28 
 1 file changed, 28 deletions(-)

diff --git a/modules/lc/gen/lcGenConv.c b/modules/lc/gen/lcGenConv.c
index 42d63c5..1041dc7 100644
--- a/modules/lc/gen/lcGenConv.c
+++ b/modules/lc/gen/lcGenConv.c
@@ -764,9 +764,6 @@ mbstowcs_org(
 return( 0 );
 }
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
ch = *inbufptr++;
@@ -921,9 +918,6 @@ wcstombs_org(
 int defstr_len = strlen(default_string);
 
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
 wc = *inbufptr++;
@@ -1080,9 +1074,6 @@ wcstocts(
 int from_size = *from_left;
 char *ext_seg_len = NULL;
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
 wc = *inbufptr++;
@@ -1272,9 +1263,6 @@ ctstowcs(
 return( 0 );
 }
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
ch = *inbufptr++;
@@ -1666,9 +1654,6 @@ mbstostr(
 return( 0 );
 }
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
ch = *inbufptr++;
@@ -1956,10 +1941,6 @@ wcstostr(
 const char *default_string = XLC_PUBLIC(lcd, default_string);
 int defstr_len = strlen(default_string);
 
-
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
 wc = *inbufptr++;
@@ -2114,9 +2095,6 @@ wctocs(
 char *outbufptr = *to;
 int from_size = *from_left;
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 if (*from_left  *to_left) {
 
 wc = *inbufptr++;
@@ -2427,9 +2405,6 @@ strtombs(
 char *outbufptr = *to;
 int from_size = *from_left;
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
 ch = *inbufptr++;
@@ -2537,9 +2512,6 @@ strtowcs(
 wchar_t *outbufptr = (wchar_t *)*to;
 int from_size = *from_left;
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
 ch = *inbufptr++;
-- 
1.8.3.1

___
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:libX11 2/4] Use newer callback-based API for XIM.

2013-06-25 Thread Thomas Klausner
Let libX11 load and make available the newer (X11R6) callback-based
API for XIM (expected by emacs).

This patch updates the files to match the other nls/ files.

Patch from Ian D. Leroux idler...@fastmail.fm on pkgsrc-us...@netbsd.org
following a hint by Nhat Minh Lê nhat.minh...@gmail.com.

Reviewed-by: James Cloos cl...@jhcloos.com
---
 nls/C/XI18N_OBJS   | 2 +-
 nls/en_US.UTF-8/XI18N_OBJS | 5 ++---
 nls/iso8859-1/XI18N_OBJS   | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/nls/C/XI18N_OBJS b/nls/C/XI18N_OBJS
index 32e4f35..3a9a1bb 100644
--- a/nls/C/XI18N_OBJS
+++ b/nls/C/XI18N_OBJS
@@ -3,6 +3,6 @@
 #  XI18N objects table for euro locales
 #
 XLCcommon/xlibi18n _XlcGenericLoader   # XLC_open
-XIMcommon/ximcp_XimOpenIM  # XIM_open
+XIMcommon/ximcp_XimOpenIM _XimRegisterIMInstantiateCallback  
_XimUnRegisterIMInstantiateCallback # XIM_openXIM_register XIM_unregister
 XOMcommon/xomGeneric   _XomGenericOpenOM   # XOM_open
 
diff --git a/nls/en_US.UTF-8/XI18N_OBJS b/nls/en_US.UTF-8/XI18N_OBJS
index f201bf4..97b30b9 100644
--- a/nls/en_US.UTF-8/XI18N_OBJS
+++ b/nls/en_US.UTF-8/XI18N_OBJS
@@ -3,6 +3,5 @@
 #  XI18N objects table for euro locales
 #
 XLCcommon/xlcUTF8Load  _XlcUtf8Loader  # XLC_open
-XOMcommon/xomLTRTTB_XomGenericOpenOM   # XOM_open
-XIMcommon/xiiimp   _SwitchOpenIM   # XIM_open
-XIMcommon/xiiimp   _XimpLocalOpenIM# XIM_open
+XOMcommon/xomGeneric   _XomGenericOpenOM   # XOM_open
+XIMcommon/ximcp_XimOpenIM _XimRegisterIMInstantiateCallback  
_XimUnRegisterIMInstantiateCallback # XIM_openXIM_register XIM_unregister
diff --git a/nls/iso8859-1/XI18N_OBJS b/nls/iso8859-1/XI18N_OBJS
index 32e4f35..3a9a1bb 100644
--- a/nls/iso8859-1/XI18N_OBJS
+++ b/nls/iso8859-1/XI18N_OBJS
@@ -3,6 +3,6 @@
 #  XI18N objects table for euro locales
 #
 XLCcommon/xlibi18n _XlcGenericLoader   # XLC_open
-XIMcommon/ximcp_XimOpenIM  # XIM_open
+XIMcommon/ximcp_XimOpenIM _XimRegisterIMInstantiateCallback  
_XimUnRegisterIMInstantiateCallback # XIM_openXIM_register XIM_unregister
 XOMcommon/xomGeneric   _XomGenericOpenOM   # XOM_open
 
-- 
1.8.3.1

___
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:libX11 3/4] Check for symbol existence with #ifdef, not #if

2013-06-25 Thread Thomas Klausner
Reviewed-by: Jamey Sharp ja...@minilop.net
---
 src/XlibInt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/XlibInt.c b/src/XlibInt.c
index b06e57b..92a4340 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -239,7 +239,7 @@ void _XSeqSyncFunction(
 static int
 _XPrivSyncFunction (Display *dpy)
 {
-#if XTHREADS
+#ifdef XTHREADS
 assert(!dpy-lock_fns);
 #endif
 assert(dpy-synchandler == _XPrivSyncFunction);
-- 
1.8.3.1

___
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:libX11 4/4] Fix out-of-range comparison.

2013-06-25 Thread Thomas Klausner
clang complained (correctly):
warning: comparison of constant 768614336404564650 with expression
of type 'CARD32' (aka 'unsigned int') is always true
[-Wtautological-constant-out-of-range-compare]
---
 src/Font.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Font.c b/src/Font.c
index a32f740..ac18024 100644
--- a/src/Font.c
+++ b/src/Font.c
@@ -588,7 +588,7 @@ _XF86BigfontQueryFont (
if (!(extcodes-serverCapabilities  CAP_VerifiedLocal)) {
struct shmid_ds buf;
if (!(shmctl(reply.shmid, IPC_STAT, buf) = 0
-  reply.nCharInfos  (LONG_MAX / sizeof(XCharStruct))
+  reply.nCharInfos  (INT_MAX / sizeof(XCharStruct))
   buf.shm_segsz = reply.shmsegoffset + reply.nCharInfos 
* sizeof(XCharStruct) + sizeof(CARD32)
   *(CARD32 *)(addr + reply.shmsegoffset + 
reply.nCharInfos * sizeof(XCharStruct)) == extcodes-serverSignature)) {
shmdt(addr);
-- 
1.8.3.1

___
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:libX11] Fix more out-of-range comparisons.

2013-06-25 Thread Thomas Klausner
---
 src/FontNames.c | 2 +-
 src/GetFPath.c  | 2 +-
 src/ListExt.c   | 2 +-
 src/ModMap.c| 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/FontNames.c b/src/FontNames.c
index b5bc7b4..7647115 100644
--- a/src/FontNames.c
+++ b/src/FontNames.c
@@ -66,7 +66,7 @@ int *actualCount) /* RETURN */
 
 if (rep.nFonts) {
flist = Xmalloc (rep.nFonts * sizeof(char *));
-   if (rep.length  (LONG_MAX  2)) {
+   if (rep.length  (INT_MAX  2)) {
rlen = rep.length  2;
ch = Xmalloc(rlen + 1);
/* +1 to leave room for last null-terminator */
diff --git a/src/GetFPath.c b/src/GetFPath.c
index abd4a5d..8f8c614 100644
--- a/src/GetFPath.c
+++ b/src/GetFPath.c
@@ -50,7 +50,7 @@ char **XGetFontPath(
 
if (rep.nPaths) {
flist = Xmalloc(rep.nPaths * sizeof (char *));
-   if (rep.length  (LONG_MAX  2)) {
+   if (rep.length  (INT_MAX  2)) {
nbytes = (unsigned long) rep.length  2;
ch = Xmalloc (nbytes + 1);
 /* +1 to leave room for last null-terminator */
diff --git a/src/ListExt.c b/src/ListExt.c
index e925c47..59599d1 100644
--- a/src/ListExt.c
+++ b/src/ListExt.c
@@ -55,7 +55,7 @@ char **XListExtensions(
 
if (rep.nExtensions) {
list = Xmalloc (rep.nExtensions * sizeof (char *));
-   if (rep.length  (LONG_MAX  2)) {
+   if (rep.length  (INT_MAX  2)) {
rlen = rep.length  2;
ch = Xmalloc (rlen + 1);
 /* +1 to leave room for last null-terminator */
diff --git a/src/ModMap.c b/src/ModMap.c
index 5c5b426..04cd676 100644
--- a/src/ModMap.c
+++ b/src/ModMap.c
@@ -42,7 +42,7 @@ XGetModifierMapping(register Display *dpy)
 GetEmptyReq(GetModifierMapping, req);
 (void) _XReply (dpy, (xReply *)rep, 0, xFalse);
 
-if (rep.length  (LONG_MAX  2)) {
+if (rep.length  (INT_MAX  2)) {
nbytes = (unsigned long)rep.length  2;
res = Xmalloc(sizeof (XModifierKeymap));
if (res)
-- 
1.8.3.1

___
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


libXt fixes for compilation with clang-3.4

2013-06-25 Thread Thomas Klausner
This fixes all warnings that clang-3.4 reports, except for

Error.c:265:30: warning: format string is not a string literal 
[-Wformat-nonliteral]
(void) fprintf (stderr, buffer,
^~
Error.c:307:40: warning: format string is not a string literal 
[-Wformat-nonliteral]
(void) snprintf (message, BIGBUF, buffer,


and:
sharedlib.c:184:12: warning: unused variable 'dummy' [-Wunused-variable]
static int dummy;   /* avoid warning from ranlib */
   ^

___
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:libXt 1/6] Remove unnecessary clause.

2013-06-25 Thread Thomas Klausner
len is unsigned and can't be smaller than zero.
---
 src/Alloc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/Alloc.c b/src/Alloc.c
index c523d81..477dfe0 100644
--- a/src/Alloc.c
+++ b/src/Alloc.c
@@ -140,9 +140,6 @@ Cardinal XtAsprintf(
 len = vsnprintf(buf, sizeof(buf), format, ap);
 va_end(ap);
 
-if (len  0)
-   _XtAllocError(vsnprintf);
-
 *new_string = XtMalloc(len + 1); /* snprintf doesn't count trailing '\0' */
 if (len  sizeof(buf))
 {
-- 
1.8.3.1

___
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:libXt 2/6] Avoid shadowing variables.

2013-06-25 Thread Thomas Klausner
---
 src/Composite.c | 10 +-
 src/Convert.c   |  2 +-
 src/Geometry.c  |  8 
 src/Intrinsic.c |  6 +++---
 src/NextEvent.c |  1 -
 src/Object.c| 16 
 src/Selection.c |  1 -
 src/TMaction.c  | 10 +-
 8 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/src/Composite.c b/src/Composite.c
index 29893d8..ef77e53 100644
--- a/src/Composite.c
+++ b/src/Composite.c
@@ -175,17 +175,17 @@ static void InheritAllowsChangeManagedSet(
 }
 
 static void CompositeClassPartInitialize(
-   WidgetClass widgetClass)
+   WidgetClass cwidgetClass)
 {
 register CompositePartPtr wcPtr;
 register CompositePartPtr superPtr = NULL;
 
 wcPtr = (CompositePartPtr)
-   (((CompositeWidgetClass)widgetClass)-composite_class);
+   (((CompositeWidgetClass)cwidgetClass)-composite_class);
 
-if (widgetClass != compositeWidgetClass)
+if (cwidgetClass != compositeWidgetClass)
/* don't compute possible bogus pointer */
-   superPtr = (CompositePartPtr)(((CompositeWidgetClass)widgetClass
+   superPtr = (CompositePartPtr)(((CompositeWidgetClass)cwidgetClass
-core_class.superclass)-composite_class);
 
 /* We don't need to check for null super since we'll get to composite
@@ -200,7 +200,7 @@ static void CompositeClassPartInitialize(
 if (wcPtr-change_managed == XtInheritChangeManaged) {
wcPtr-change_managed =
superPtr-change_managed;
-   InheritAllowsChangeManagedSet(widgetClass);
+   InheritAllowsChangeManagedSet(cwidgetClass);
 }
 
 if (wcPtr-insert_child == XtInheritInsertChild) {
diff --git a/src/Convert.c b/src/Convert.c
index cea8fd3..bbb8ff1 100644
--- a/src/Convert.c
+++ b/src/Convert.c
@@ -812,7 +812,7 @@ CallConverter(
unsigned int supplied_size = to-size;
Boolean do_ref = cP-do_ref_count  cache_ref_return;
Boolean do_free = False;
-   Boolean retval =
+   retval =
(*(XtTypeConverter)converter)(dpy, args, num_args, from, to, 
closure);
 
if (retval == False  supplied_size  to-size) {
diff --git a/src/Geometry.c b/src/Geometry.c
index d64c8e2..6f95d44 100644
--- a/src/Geometry.c
+++ b/src/Geometry.c
@@ -726,10 +726,10 @@ void XtTranslateCoords(
 Widget has no shell ancestor,
(String *)NULL, (Cardinal *)NULL);
 else {
-   Position x, y;
-   _XtShellGetCoordinates( w, x, y );
-   *rootx += x + w-core.border_width;
-   *rooty += y + w-core.border_width;
+   Position px, py;
+   _XtShellGetCoordinates( w, px, py );
+   *rootx += px + w-core.border_width;
+   *rooty += py + w-core.border_width;
 }
 UNLOCK_APP(app);
 }
diff --git a/src/Intrinsic.c b/src/Intrinsic.c
index 29bf716..7783050 100644
--- a/src/Intrinsic.c
+++ b/src/Intrinsic.c
@@ -88,7 +88,7 @@ String XtCXtToolkitError = XtToolkitError;
 
 Boolean XtIsSubclass(
 Widgetwidget,
-WidgetClass widgetClass)
+WidgetClass xwidgetClass)
 {
 register WidgetClass w;
 Boolean retval = FALSE;
@@ -97,7 +97,7 @@ Boolean XtIsSubclass(
 LOCK_APP(app);
 LOCK_PROCESS;
 for (w = widget-core.widget_class; w != NULL; w = 
w-core_class.superclass)
-   if (w == widgetClass) {
+   if (w == xwidgetClass) {
retval = TRUE;
break;
}
@@ -125,7 +125,7 @@ Boolean _XtCheckSubclassFlag(
 
 Boolean _XtIsSubclassOf(
 Widget object,
-WidgetClass widgetClass,
+WidgetClass xwidgetClass,
 WidgetClass superClass,
 _XtXtEnum flag)
 {
diff --git a/src/NextEvent.c b/src/NextEvent.c
index 4f2dcfb..c6fbcf1 100644
--- a/src/NextEvent.c
+++ b/src/NextEvent.c
@@ -272,7 +272,6 @@ static void InitFds (
wf-fdlistlen = wf-num_dpys = 0;
 
 if (!ignoreInputs  app-input_list != NULL) {
-   int ii;
for (ii = 0; ii  (int) app-input_max; ii++)
if (app-input_list[ii] != NULL)
wf-fdlistlen++;
diff --git a/src/Object.c b/src/Object.c
index ae1ac75..3626aba 100644
--- a/src/Object.c
+++ b/src/Object.c
@@ -130,7 +130,7 @@ externaldef(objectClass) WidgetClass objectClass
 
 
 static void ConstructCallbackOffsets(
-WidgetClass widgetClass)
+WidgetClass cwidgetClass)
 {
 static XrmQuark QCallback = NULLQUARK;
 register int i;
@@ -138,7 +138,7 @@ static void ConstructCallbackOffsets(
 register CallbackTable newTable;
 register CallbackTable superTable;
 register XrmResourceList resourceList;
-ObjectClass objectClass = (ObjectClass)widgetClass;
+ObjectClass cobjectClass = (ObjectClass)cwidgetClass;
 
 /*
   This function builds an array of pointers to the resource
@@ -150,9 +150,9 @@ static void ConstructCallbackOffsets(
 if (QCallback == NULLQUARK)
QCallback = XrmPermStringToQuark(XtRCallback);
 
-if (objectClass-object_class.superclass != NULL) {
+if (cobjectClass-object_class.superclass != NULL) {
superTable = (CallbackTable)
-  

[PATCH:libXt 5/6] Silence compiler clang warnings.

2013-06-25 Thread Thomas Klausner
Fixes:
warning: cast from function call of type 'char *' to non-matching
type 'XtArgVal' (aka 'long') [-Wbad-function-cast]
---
 src/Resources.c | 2 +-
 src/Varargs.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Resources.c b/src/Resources.c
index 1d2871c..657c55d 100644
--- a/src/Resources.c
+++ b/src/Resources.c
@@ -738,7 +738,7 @@ static XtCacheRef *GetResources(
 */
 
if(rx-xrm_size  sizeof(XtArgVal)) {
-   arg-value = (XtArgVal) __XtMalloc(rx-xrm_size);
+   arg-value = (XtArgVal)(void *) 
__XtMalloc(rx-xrm_size);
arg-size = -(arg-size);
} else { /* will fit - copy directly into value field */
arg-value = (XtArgVal) NULL;
diff --git a/src/Varargs.c b/src/Varargs.c
index b33e287..fd81bd0 100644
--- a/src/Varargs.c
+++ b/src/Varargs.c
@@ -243,8 +243,8 @@ TypedArgToArg(
else if (to_val.size == sizeof(XtArgVal))
arg_return-value = *(XtArgVal *)to_val.addr;
else if (to_val.size  sizeof(XtArgVal)) {
-   arg_return-value = (XtArgVal) __XtMalloc(to_val.size);
-   memory_return-value = (XtArgVal)
+   arg_return-value = (XtArgVal)(void *) __XtMalloc(to_val.size);
+   memory_return-value = (XtArgVal)(void *)
memcpy((void *)arg_return-value, to_val.addr, to_val.size);
}
 }
-- 
1.8.3.1

___
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:libXt 3/6] Mark non-returning function with appropriate attribute.

2013-06-25 Thread Thomas Klausner
---
 src/Error.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/Error.c b/src/Error.c
index fc9b11a..334e001 100644
--- a/src/Error.c
+++ b/src/Error.c
@@ -75,6 +75,13 @@ in this Software without prior written authorization from 
The Open Group.
 #include stdio.h
 #include stdlib.h
 
+#if (defined(__GNUC__)  ((__GNUC__ * 100 + __GNUC_MINOR__) = 205))   \
+   || (defined(__SUNPRO_C)  (__SUNPRO_C = 0x590))
+# define ATTR_NORETURN __attribute((noreturn))
+#else
+# define ATTR_NORETURN
+#endif /* GNUC  */
+
 /* The error handlers in the application context aren't used since we can't
come up with a uniform way of using them.  If you can, define
GLOBALERRORS to be FALSE (or 0). */
@@ -89,7 +96,7 @@ static XrmDatabase errorDB = NULL;
 static Boolean error_inited = FALSE;
 void _XtDefaultErrorMsg(String, String, String, String, String*, Cardinal*);
 void _XtDefaultWarningMsg(String, String, String, String, String*, Cardinal*);
-void _XtDefaultError(String);
+void _XtDefaultError(String) ATTR_NORETURN;
 void _XtDefaultWarning(String);
 static XtErrorMsgHandler errorMsgHandler = _XtDefaultErrorMsg;
 static XtErrorMsgHandler warningMsgHandler = _XtDefaultWarningMsg;
-- 
1.8.3.1

___
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:libXt 6/6] Ignore test-driver from automake-1.13.

2013-06-25 Thread Thomas Klausner
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 84e5899..1b9e5df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,6 +41,7 @@ mkinstalldirs
 py-compile
 stamp-h?
 symlink-tree
+test-driver
 texinfo.tex
 ylwrap
 
-- 
1.8.3.1

___
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:libXt 4/6] Fix char vs. unsigned char warnings.

2013-06-25 Thread Thomas Klausner
---
 src/ResConfig.c | 4 ++--
 src/TMparse.c   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/ResConfig.c b/src/ResConfig.c
index 152d9cf..5a7f6d2 100644
--- a/src/ResConfig.c
+++ b/src/ResConfig.c
@@ -892,7 +892,7 @@ _XtResourceConfigurationEH (
int actual_format;
unsigned long   nitems;
unsigned long   leftover;
-   unsigned char   *data = NULL;
+   char*data = NULL;
unsigned long   resource_len;
char*data_ptr;
char*resource;
@@ -952,7 +952,7 @@ _XtResourceConfigurationEH (
pd-rcm_data, 0L, 8192L,
TRUE, XA_STRING,
actual_type, actual_format, nitems, leftover,
-   data ) == Success  actual_type == XA_STRING
+   (unsigned char **)data ) == Success  actual_type == XA_STRING
actual_format == 8) {
/*
 *  data format is:
diff --git a/src/TMparse.c b/src/TMparse.c
index 83b39d5..df94181 100644
--- a/src/TMparse.c
+++ b/src/TMparse.c
@@ -1472,10 +1472,10 @@ static String ParseRepeat(
 {
 
 /*** Parse the repetitions, for double click etc... ***/
-if (*str != '(' || !(isdigit(str[1]) || str[1] == '+' || str[1] == ')'))
+if (*str != '(' || !(isdigit((unsigned char)str[1]) || str[1] == '+' || 
str[1] == ')'))
return str;
 str++;
-if (isdigit(*str)) {
+if (isdigit((unsigned char)*str)) {
String start = str;
char repStr[7];
size_t len;
-- 
1.8.3.1

___
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:libXt 1/6] Remove unnecessary clause.

2013-06-25 Thread Thomas Klausner
On Tue, Jun 25, 2013 at 11:13:54PM +0200, Mark Kettenis wrote:
  From: Thomas Klausner w...@netbsd.org
  Date: Tue, 25 Jun 2013 23:02:45 +0200
  
  len is unsigned and can't be smaller than zero.
 
 But vsnprintf(3) returns a signed integer, which can be -1.

But you can't put that in an unsigned variable and expect this comparison to 
fire...
feel free to propose a different patch.
 Thomas

  ---
   src/Alloc.c | 3 ---
   1 file changed, 3 deletions(-)
  
  diff --git a/src/Alloc.c b/src/Alloc.c
  index c523d81..477dfe0 100644
  --- a/src/Alloc.c
  +++ b/src/Alloc.c
  @@ -140,9 +140,6 @@ Cardinal XtAsprintf(
   len = vsnprintf(buf, sizeof(buf), format, ap);
   va_end(ap);
   
  -if (len  0)
  -   _XtAllocError(vsnprintf);
  -
   *new_string = XtMalloc(len + 1); /* snprintf doesn't count trailing 
  '\0' */
   if (len  sizeof(buf))
   {
  -- 
  1.8.3.1
  
  ___
  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
 
___
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:libXt 1/6] Remove unnecessary clause.

2013-06-25 Thread Thomas Klausner
On Tue, Jun 25, 2013 at 02:18:53PM -0700, Alan Coopersmith wrote:
 On 06/25/13 02:13 PM, Mark Kettenis wrote:
 From: Thomas Klausner w...@netbsd.org
 Date: Tue, 25 Jun 2013 23:02:45 +0200
 
 len is unsigned and can't be smaller than zero.
 
 But vsnprintf(3) returns a signed integer, which can be -1.
 
 Right, so I guess we either make len be signed, or change the if statement
 to if (len == (Cardinal) -1).

Ok, here's an alternate patch.
 Thomas
diff --git a/src/Alloc.c b/src/Alloc.c
index c523d81..c9ffce8 100644
--- a/src/Alloc.c
+++ b/src/Alloc.c
@@ -133,7 +133,7 @@ Cardinal XtAsprintf(
 ...)
 {
 char buf[256];
-Cardinal len;
+int len;
 va_list ap;
 
 va_start(ap, format);
___
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:libXt 3/6] Mark non-returning function with appropriate attribute.

2013-06-25 Thread Thomas Klausner
On Tue, Jun 25, 2013 at 02:20:58PM -0700, Alan Coopersmith wrote:
 On 06/25/13 02:02 PM, Thomas Klausner wrote:
 ---
   src/Error.c | 9 -
   1 file changed, 8 insertions(+), 1 deletion(-)
 
 diff --git a/src/Error.c b/src/Error.c
 index fc9b11a..334e001 100644
 --- a/src/Error.c
 +++ b/src/Error.c
 @@ -75,6 +75,13 @@ in this Software without prior written authorization from 
 The Open Group.
   #include stdio.h
   #include stdlib.h
 
 +#if (defined(__GNUC__)  ((__GNUC__ * 100 + __GNUC_MINOR__) = 205))   \
 +|| (defined(__SUNPRO_C)  (__SUNPRO_C = 0x590))
 +# define ATTR_NORETURN __attribute((noreturn))
 +#else
 +# define ATTR_NORETURN
 +#endif /* GNUC  */
 +
 
 We prefer to use _X_NORETURN from X11/Xfuncproto.h so we don't have to
 individually edit 100 modules when another compiler adds support for a
 given attribute.

Ok, attached.

Btw, what's the appropriate method to create a patch that's a merged
version of previous patches, which are separate commits in my local
copy of the repository? Just creating diffs against origin like I do
now creates patches in a different format. On the other hand, checking
out HEAD again, copying the change over and making a new commit is a
bit much effort. There must be an easier way.

Thanks,
 Thomas
diff --git a/src/Error.c b/src/Error.c
index fc9b11a..50f6c3c 100644
--- a/src/Error.c
+++ b/src/Error.c
@@ -89,7 +89,7 @@ static XrmDatabase errorDB = NULL;
 static Boolean error_inited = FALSE;
 void _XtDefaultErrorMsg(String, String, String, String, String*, Cardinal*);
 void _XtDefaultWarningMsg(String, String, String, String, String*, Cardinal*);
-void _XtDefaultError(String);
+void _XtDefaultError(String) _X_NORETURN;
 void _XtDefaultWarning(String);
 static XtErrorMsgHandler errorMsgHandler = _XtDefaultErrorMsg;
 static XtErrorMsgHandler warningMsgHandler = _XtDefaultWarningMsg;
___
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:libXt 1/6] Use appropriate variable type for vsnprintf return value.

2013-06-25 Thread Thomas Klausner
---
 src/Alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Alloc.c b/src/Alloc.c
index c523d81..c9ffce8 100644
--- a/src/Alloc.c
+++ b/src/Alloc.c
@@ -133,7 +133,7 @@ Cardinal XtAsprintf(
 ...)
 {
 char buf[256];
-Cardinal len;
+int len;
 va_list ap;
 
 va_start(ap, format);
-- 
1.8.3.1

___
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:libXt 3/6] Mark non-returning function with appropriate attribute.

2013-06-25 Thread Thomas Klausner
---
 src/Error.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Error.c b/src/Error.c
index fc9b11a..50f6c3c 100644
--- a/src/Error.c
+++ b/src/Error.c
@@ -89,7 +89,7 @@ static XrmDatabase errorDB = NULL;
 static Boolean error_inited = FALSE;
 void _XtDefaultErrorMsg(String, String, String, String, String*, Cardinal*);
 void _XtDefaultWarningMsg(String, String, String, String, String*, Cardinal*);
-void _XtDefaultError(String);
+void _XtDefaultError(String) _X_NORETURN;
 void _XtDefaultWarning(String);
 static XtErrorMsgHandler errorMsgHandler = _XtDefaultErrorMsg;
 static XtErrorMsgHandler warningMsgHandler = _XtDefaultWarningMsg;
-- 
1.8.3.1

___
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: managing patches with git

2013-06-25 Thread Thomas Klausner
On Tue, Jun 25, 2013 at 03:13:18PM -0700, Alan Coopersmith wrote:
 To resync with HEAD, I use git pull --rebase.
 
 To merge patches, or change previous ones, I use git rebase -i origin,
 especially with the squash and fixup options (or reword if I'm
 just adding reviewed-by tags  similar commit comment changes).
 
 http://git-scm.com/book/en/Git-Tools-Rewriting-History
 https://help.github.com/articles/interactive-rebase

Thank you for the help!

I've resent the two modified patches after rebasing.
 Thomas
___
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:libX11 2/8] Let libX11 load and make available the newer (X11R6) callback-based API for XIM (expected by emacs).

2013-06-20 Thread Thomas Klausner
On Sun, Jun 16, 2013 at 02:37:09AM -0400, James Cloos wrote:
  TK == Thomas Klausner w...@netbsd.org writes:
 
 TK They basically all look like this:
 TK -XIMcommon/ximcp_XimOpenIM  # XIM_open
 TK +XIM common/ximcp _XimOpenIM _XimRegisterIMInstantiateCallback
 TK _XimUnRegisterIMInstantiateCallback # XIM_open XIM_register
 TK XIM_unregister
 
 2nd comment:
 
 I see how that file works.
 
 The idea then is to make the common/ximcp locales such as C match the
 pattern used for XIM in most of the other common/ximcp locales, yes?
 
 If so, that looks reasonable, given that the majority already do.

Yes, that's the idea. Thanks for looking at it!
 Thomas
___
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:libX11 2/8] Let libX11 load and make available the newer (X11R6) callback-based API for XIM (expected by emacs).

2013-06-15 Thread Thomas Klausner
On Thu, Jun 06, 2013 at 11:17:49PM -0700, Alan Coopersmith wrote:
 For patches 2, 4,  5 from this series, while I have vague memories that
 I once knew how those files worked, I certainly don't have access to those
 brain cells any more, so will leave these for someone with more familiarity
 with the Xlib i18n bits to throw out a reviewed-by tag - I'm willing to push
 if someone steps forward to review.   (Or you might get someone like James
 Cloos to both review  push, as he does for much of the i18n config changes.)

James, can you please take a look at these? (Patches 2, 4, and 5 from
the patchset).

They basically all look like this:
-XIMcommon/ximcp_XimOpenIM  # XIM_open
+XIMcommon/ximcp_XimOpenIM _XimRegisterIMInstantiateCallback  
_XimUnRegisterIMInstantiateCallback # XIM_openXIM_register XIM_unregister

and were needed by emacs to support Multi_key.

If they are correct, similar changes might be needed in more files.

Thanks,
 Thomas
___
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:libpciaccess 3/3] Support more pci functions on NetBSD.

2013-06-14 Thread Thomas Klausner
Hi Matthieu!

Thanks for the review!

On Thu, Jun 13, 2013 at 12:28:05AM +0200, Matthieu Herrb wrote:
  +#if defined(__i386__) || defined(__amd64__)
  +#include machine/sysarch.h
  +//#include machine/pio.h
^^
 Please Remove the commented out line above

Ok, will do.

  +static struct pci_io_handle *
  +pci_device_netbsd_open_legacy_io(struct pci_io_handle *ret,
  +struct pci_device *dev, pciaddr_t base, pciaddr_t size)
  +{
  +#if defined(__i386__)
  +   struct i386_iopl_args ia;
  +
  +   ia.iopl = 1;
  +   if (sysarch(I386_IOPL, ia))
  +   return NULL;
  +
  +   ret-base = base;
  +   ret-size = size;
  +   return ret;
  +#elif defined(__amd64__)
  +   struct x86_64_iopl_args ia;
  +
  +   ia.iopl = 1;
  +   if (sysarch(X86_64_IOPL, ia))
  +   return NULL;
  +
  +   ret-base = base;
  +   ret-size = size;
  +   return ret;
  +#elif defined(PCI_MAGIC_IO_RANGE)
  +   ret-memory = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,
  +   aperturefd, PCI_MAGIC_IO_RANGE + base);
 
 Hmm where is aperturefd defined in the NetBSD case ? (I know it's is
 defined as static in  openbsd_pci.c, but I can't find the similar hack
 for NetBSD

That's a copy'n'paste error from openbsd_pci.c. PCI_MAGIC_IO_RANGE is
only defined for a few ports of NetBSD anyway, and neither me nor
Chuck know what the proper way to do this is. I guess I'll just remove
this #elif clause.

 -- and it should not be needed in NetBSD's case where all
 memory can be be mapped through the /dev/pci* entry).

Can you please expand on this or suggest what the patch should look
like?

Thanks,
 Thomas
___
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 2/2] Use __UNCONST to work around const problem.

2013-06-12 Thread Thomas Klausner
On Thu, Jun 06, 2013 at 11:23:00PM -0700, Alan Coopersmith wrote:
 On 06/ 2/13 05:15 PM, Thomas Klausner wrote:
 On Mon, Jun 03, 2013 at 01:37:31AM +0200, Thomas Klausner wrote:
 On Sun, Jun 02, 2013 at 04:35:51PM -0700, Alan Coopersmith wrote:
 On 06/ 2/13 12:30 PM, Thomas Klausner wrote:
 XXX: should probably be fixed differently.
 ---
   xrandr.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/xrandr.c b/xrandr.c
 index da786cb..0b285a3 100644
 --- a/xrandr.c
 +++ b/xrandr.c
 @@ -1524,7 +1524,7 @@ crtc_set_transform (crtc_t *crtc, transform_t 
 *transform)
   if (major  1 || (major == 1  minor = 3))
   XRRSetCrtcTransform (dpy, crtc-crtc.xid,
transform-transform,
 -  transform-filter,
 +  __UNCONST(transform-filter),
transform-params,
transform-nparams);
   }
 Better would be if we wouldn't need the unconst cast though :)
 
 That's still true :)
 
 Looks like we don't, since XRRSetCrtcTransform now takes const for that
 argument:
 
 http://cgit.freedesktop.org/xorg/lib/libXrandr/commit/?id=6dfe7d4fa04a5054ee3daeb654ac5a763f37fed1
 
 Try building with libXrandr 1.4.1 without this unconst-ing change.

You're right, please disregard this one.
 Thomas
___
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:libpciaccess 1/3] Enable boot_vga support only if WSDISPLAYIO_GET_BUSID is defined.

2013-06-12 Thread Thomas Klausner
Fixes build on NetBSD-5.
---
 src/netbsd_pci.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/netbsd_pci.c b/src/netbsd_pci.c
index 3566d7b..c9bd052 100644
--- a/src/netbsd_pci.c
+++ b/src/netbsd_pci.c
@@ -248,6 +248,7 @@ pci_device_netbsd_write(struct pci_device *dev, const void 
*data,
return 0;
 }
 
+#if defined(WSDISPLAYIO_GET_BUSID)
 static int
 pci_device_netbsd_boot_vga(struct pci_device *dev)
 {
@@ -284,6 +285,7 @@ pci_device_netbsd_boot_vga(struct pci_device *dev)
 
return 1;
 }
+#endif
 
 static void
 pci_system_netbsd_destroy(void)
@@ -518,7 +520,11 @@ static const struct pci_system_methods netbsd_pci_methods 
= {
.read = pci_device_netbsd_read,
.write = pci_device_netbsd_write,
.fill_capabilities = pci_fill_capabilities_generic,
+#if defined(WSDISPLAYIO_GET_BUSID)
.boot_vga = pci_device_netbsd_boot_vga,
+#else
+   .boot_vga = NULL,
+#endif
 };
 
 int
-- 
1.8.2.3

___
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:libpciaccess 2/3] Fix build on NetBSD-4.

2013-06-12 Thread Thomas Klausner
---
 configure.ac | 10 ++
 src/netbsd_pci.c | 13 +
 2 files changed, 23 insertions(+)

diff --git a/configure.ac b/configure.ac
index 3441b63..537cfe3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -108,7 +108,17 @@ AC_SYS_LARGEFILE
 
 AC_CHECK_HEADERS([err.h])
 
+if test x$netbsd = xyes; then
+AC_CHECK_HEADERS([machine/sysarch.h])
+AC_CHECK_HEADERS([machine/mtrr.h], [have_mtrr_h=yes], [have_mtrr_h=no],
+[#ifdef HAVE_MACHINE_SYSARCH_H
+#include sys/types.h
+#include machine/sysarch.h
+#endif
+])
+else
 AC_CHECK_HEADER([asm/mtrr.h], [have_mtrr_h=yes], [have_mtrr_h=no])
+fi
 
 if test x$have_mtrr_h = xyes; then
 AC_DEFINE(HAVE_MTRR, 1, [Use MTRRs on mappings])
diff --git a/src/netbsd_pci.c b/src/netbsd_pci.c
index c9bd052..2d99680 100644
--- a/src/netbsd_pci.c
+++ b/src/netbsd_pci.c
@@ -21,10 +21,23 @@
 #include sys/mman.h
 #include sys/types.h
 
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
 #ifdef HAVE_MTRR
 #include machine/sysarch.h
 #include machine/mtrr.h
+#ifdef _X86_SYSARCH_L
 #define netbsd_set_mtrr(mr, num)   _X86_SYSARCH_L(set_mtrr)(mr, num)
+#else
+#ifdef __i386__
+#define netbsd_set_mtrr(mr, num)   i386_set_mtrr((mr), (num))
+#endif
+#ifdef __amd64__
+#define netbsd_set_mtrr(mr, num)   x86_64_set_mtrr((mr), (num))
+#endif
+#endif
 #endif
 
 #include dev/pci/pcidevs.h
-- 
1.8.2.3

___
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:libpciaccess 3/3] Support more pci functions on NetBSD.

2013-06-12 Thread Thomas Klausner
From Chuck Silvers c...@chuq.com based on openbsd_pci.c.

Signed-off-by: Thomas Klausner w...@netbsd.org
---
 src/netbsd_pci.c | 335 +++
 1 file changed, 335 insertions(+)

diff --git a/src/netbsd_pci.c b/src/netbsd_pci.c
index 2d99680..ab49272 100644
--- a/src/netbsd_pci.c
+++ b/src/netbsd_pci.c
@@ -523,6 +523,332 @@ pci_device_netbsd_read_rom(struct pci_device *dev, void 
*buffer)
 return 0;
 }
 
+#if defined(__i386__) || defined(__amd64__)
+#include machine/sysarch.h
+//#include machine/pio.h
+
+/*
+ * Functions to provide access to x86 programmed I/O instructions.
+ *
+ * The in[bwl]() and out[bwl]() functions are split into two varieties: one to
+ * use a small, constant, 8-bit port number, and another to use a large or
+ * variable port number.  The former can be compiled as a smaller instruction.
+ */
+
+
+#ifdef __OPTIMIZE__
+
+#define__use_immediate_port(port) \
+   (__builtin_constant_p((port))  (port)  0x100)
+
+#else
+
+#define__use_immediate_port(port)  0
+
+#endif
+
+
+#defineinb(port) \
+(/* CONSTCOND */ __use_immediate_port(port) ? __inbc(port) : __inb(port))
+
+static __inline u_int8_t
+__inbc(unsigned port)
+{
+   u_int8_t data;
+   __asm __volatile(inb %w1,%0 : =a (data) : id (port));
+   return data;
+}
+
+static __inline u_int8_t
+__inb(unsigned port)
+{
+   u_int8_t data;
+   __asm __volatile(inb %w1,%0 : =a (data) : d (port));
+   return data;
+}
+
+static __inline void
+insb(unsigned port, void *addr, int cnt)
+{
+   void *dummy1;
+   int dummy2;
+   __asm __volatile(cld\n\trepne\n\tinsb :
+=D (dummy1), =c (dummy2)   :
+d (port), 0 (addr), 1 (cnt)  :
+memory);
+}
+
+#defineinw(port) \
+(/* CONSTCOND */ __use_immediate_port(port) ? __inwc(port) : __inw(port))
+
+static __inline u_int16_t
+__inwc(unsigned port)
+{
+   u_int16_t data;
+   __asm __volatile(inw %w1,%0 : =a (data) : id (port));
+   return data;
+}
+
+static __inline u_int16_t
+__inw(unsigned port)
+{
+   u_int16_t data;
+   __asm __volatile(inw %w1,%0 : =a (data) : d (port));
+   return data;
+}
+
+static __inline void
+insw(unsigned port, void *addr, int cnt)
+{
+   void *dummy1;
+   int dummy2;
+   __asm __volatile(cld\n\trepne\n\tinsw :
+=D (dummy1), =c (dummy2)   :
+d (port), 0 (addr), 1 (cnt)  :
+memory);
+}
+
+#defineinl(port) \
+(/* CONSTCOND */ __use_immediate_port(port) ? __inlc(port) : __inl(port))
+
+static __inline u_int32_t
+__inlc(unsigned port)
+{
+   u_int32_t data;
+   __asm __volatile(inl %w1,%0 : =a (data) : id (port));
+   return data;
+}
+
+static __inline u_int32_t
+__inl(unsigned port)
+{
+   u_int32_t data;
+   __asm __volatile(inl %w1,%0 : =a (data) : d (port));
+   return data;
+}
+
+static __inline void
+insl(unsigned port, void *addr, int cnt)
+{
+   void *dummy1;
+   int dummy2;
+   __asm __volatile(cld\n\trepne\n\tinsl :
+=D (dummy1), =c (dummy2)   :
+d (port), 0 (addr), 1 (cnt)  :
+memory);
+}
+
+#defineoutb(port, data) \
+(/* CONSTCOND */__use_immediate_port(port) ? __outbc(port, data) : \
+   __outb(port, data))
+
+static __inline void
+__outbc(unsigned port, u_int8_t data)
+{
+   __asm __volatile(outb %0,%w1 : : a (data), id (port));
+}
+
+static __inline void
+__outb(unsigned port, u_int8_t data)
+{
+   __asm __volatile(outb %0,%w1 : : a (data), d (port));
+}
+
+static __inline void
+outsb(unsigned port, const void *addr, int cnt)
+{
+   void *dummy1;
+   int dummy2;
+   __asm __volatile(cld\n\trepne\n\toutsb:
+=S (dummy1), =c (dummy2)   :
+d (port), 0 (addr), 1 (cnt));
+}
+
+#defineoutw(port, data) \
+(/* CONSTCOND */ __use_immediate_port(port) ? __outwc(port, data) : \
+   __outw(port, data))
+
+static __inline void
+__outwc(unsigned port, u_int16_t data)
+{
+   __asm __volatile(outw %0,%w1 : : a (data), id (port));
+}
+
+static __inline void
+__outw(unsigned port, u_int16_t data)
+{
+   __asm __volatile(outw %0,%w1 : : a (data), d (port));
+}
+
+static __inline void
+outsw(unsigned port, const void *addr, int cnt)
+{
+   void *dummy1;
+   int dummy2;
+   __asm __volatile(cld\n\trepne\n\toutsw:
+=S (dummy1), =c (dummy2)   :
+d (port), 0 (addr), 1 (cnt));
+}
+
+#defineoutl(port, data) \
+(/* CONSTCOND */ __use_immediate_port(port) ? __outlc(port, data

Re: [PATCH:libpciaccess 1/2] Move 'const' to correct place, so it has meaning.

2013-06-12 Thread Thomas Klausner
On Tue, Jun 11, 2013 at 11:22:32PM -0700, Alan Coopersmith wrote:
 Thanks for following these through - I've now pushed both patches
 of this set to git master:
 
 To ssh://git.freedesktop.org/git/xorg/lib/libpciaccess
719888a..5aff35d  master - master

Thank you!

 Looks like we should make a libpciaccess 0.13.2 release soon with
 all the changes that have accumulated since 0.13.1:
 
 http://cgit.freedesktop.org/xorg/lib/libpciaccess/log/
 
 (A couple for Linux, a bunch for Solaris, BSD  even one for Hurd.)

I'm looking forward to that.

I have, however, sent a few more NetBSD patches for libpciaccess a
minute ago -- it'd be good if those could go in too.

I'd really like review for the last patch of that series. Matthieu,
are you willing to review this as well?

Thanks,
 Thomas
___
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:libpciaccess 2/2] Update NetBSD support.

2013-06-11 Thread Thomas Klausner
From Michael Lorenz macal...@netbsd.org

Signed-off-by: Michael Lorenz macal...@netbsd.org
Signed-off-by: Thomas Klausner w...@netbsd.org

Reviewed-by: Matthieu Herrb matthieu.he...@laas.fr
---
 configure.ac |   4 +-
 src/netbsd_pci.c | 471 +++
 2 files changed, 342 insertions(+), 133 deletions(-)

diff --git a/configure.ac b/configure.ac
index 91374e5..3441b63 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,10 +77,10 @@ case $host_os in
*netbsd*)
case $host in
*i386*)
-   PCIACCESS_LIBS=-li386
+   PCIACCESS_LIBS=-li386 -lpci
;;
*x86_64*|*amd64*)
-   PCIACCESS_LIBS=-lx86_64
+   PCIACCESS_LIBS=-lx86_64 -lpci
;;
esac
netbsd=yes
diff --git a/src/netbsd_pci.c b/src/netbsd_pci.c
index 63585e3..f5a90c0 100644
--- a/src/netbsd_pci.c
+++ b/src/netbsd_pci.c
@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2008 Juan Romero Pardines
  * Copyright (c) 2008 Mark Kettenis
+ * Copyright (c) 2009 Michael Lorenz
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -20,12 +21,15 @@
 #include sys/mman.h
 #include sys/types.h
 
+#ifdef HAVE_MTRR
 #include machine/sysarch.h
 #include machine/mtrr.h
+#define netbsd_set_mtrr(mr, num)   _X86_SYSARCH_L(set_mtrr)(mr, num)
+#endif
 
+#include dev/pci/pcidevs.h
 #include dev/pci/pciio.h
 #include dev/pci/pcireg.h
-#include dev/pci/pcidevs.h
 
 #include errno.h
 #include fcntl.h
@@ -35,126 +39,152 @@
 #include unistd.h
 
 
+#include pci.h
+#include dev/wscons/wsconsio.h
+
 #include pciaccess.h
 #include pciaccess_private.h
 
-static int pcifd;
+typedef struct _pcibus {
+   int fd; /* /dev/pci* */
+   int num;/* bus number */
+   int maxdevs;/* maximum number of devices */
+} PciBus;
+
+static PciBus buses[32];   /* indexed by pci_device.domain */
+static int nbuses = 0; /* number of buses found */
+
+/*
+ * NetBSD's userland has a /dev/pci* entry for each bus but userland has no way
+ * to tell if a bus is a subordinate of another one or if it's on a different
+ * host bridge. On some architectures ( macppc for example ) all root buses 
have
+ * bus number 0 but on sparc64 for example the two roots in an Ultra60 have
+ * different bus numbers - one is 0 and the other 128.
+ * With each /dev/pci* we can map everything on the same root and we can also
+ * see all devices on the same root, trying to do that causes problems though:
+ * - since we can't tell which /dev/pci* is a subordinate we would find some
+ *   devices more than once
+ * - we would have to guess subordinate bus numbers which is a waste of time
+ *   since we can ask each /dev/pci* for its bus number so we can scan only the
+ *   buses we know exist, not all 256 which may exist in each domain.
+ * - some bus_space_mmap() methods may limit mappings to address ranges which
+ *   belong to known devices on that bus only.
+ * Each host bridge may or may not have its own IO range, to avoid guesswork
+ * here each /dev/pci* will let userland map its appropriate IO range at
+ * PCI_MAGIC_IO_RANGE if defined in machine/param.h
+ * With all this we should be able to use any PCI graphics device on any PCI
+ * bus on any architecture as long as Xorg has a driver, without allowing
+ * arbitrary mappings via /dev/mem and without userland having to know or care
+ * about translating bus addresses to physical addresses or the other way 
+ * around.
+ */
 
 static int
-pci_read(int bus, int dev, int func, uint32_t reg, uint32_t *val)
+pci_read(int domain, int bus, int dev, int func, uint32_t reg, uint32_t *val)
 {
-   struct pciio_bdf_cfgreg io;
-   int err;
+   uint32_t rval;
 
-   bzero(io, sizeof(io));
-   io.bus = bus;
-   io.device = dev;
-   io.function = func;
-   io.cfgreg.reg = reg;
+   if ((domain  0) || (domain  nbuses))
+   return -1;
 
-   err = ioctl(pcifd, PCI_IOC_BDF_CFGREAD, io);
-   if (err)
-   return (err);
+   if (pcibus_conf_read(buses[domain].fd, (unsigned int)bus,
+   (unsigned int)dev, (unsigned int)func, reg, rval) == -1)
+   return (-1);
 
-   *val = io.cfgreg.val;
+   *val = rval;
 
return 0;
 }
 
 static int
-pci_write(int bus, int dev, int func, uint32_t reg, uint32_t val)
+pci_write(int domain, int bus, int dev, int func, uint32_t reg, uint32_t val)
 {
-   struct pciio_bdf_cfgreg io;
 
-   bzero(io, sizeof(io));
-   io.bus = bus;
-   io.device = dev;
-   io.function = func;
-   io.cfgreg.reg = reg;
-   io.cfgreg.val = val;
+   if ((domain  0) || (domain  nbuses))
+   return -1;
 
-   return ioctl(pcifd, PCI_IOC_BDF_CFGWRITE, io

[PATCH:libpciaccess 1/2] Move 'const' to correct place, so it has meaning.

2013-06-11 Thread Thomas Klausner
---
 src/common_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common_interface.c b/src/common_interface.c
index 6dccf8e..3425edc 100644
--- a/src/common_interface.c
+++ b/src/common_interface.c
@@ -268,7 +268,7 @@ pci_device_map_range(struct pci_device *dev, pciaddr_t base,
 
 
 for (region = 0; region  6; region++) {
-const struct pci_mem_region const* r = dev-regions[region];
+const struct pci_mem_region * const r = dev-regions[region];
 
 if (r-size != 0) {
 if ((r-base_addr = base)  ((r-base_addr + r-size)  base)) {
-- 
1.8.2.3

___
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:libpciaccess 3/3] Update NetBSD support. From Michael Lorenz macal...@netbsd.org.

2013-06-09 Thread Thomas Klausner
On Sun, Jun 09, 2013 at 09:32:37AM -0700, Alan Coopersmith wrote:
 On 06/ 8/13 11:28 AM, Thomas Klausner wrote:
 On Fri, Jun 07, 2013 at 08:39:52PM -0700, Alan Coopersmith wrote:
 On 06/ 2/13 01:38 PM, Thomas Klausner wrote:
 ---
   configure.ac |   4 +-
   src/netbsd_pci.c | 471 
  +++
   2 files changed, 342 insertions(+), 133 deletions(-)
 
 Since that's a substantial amount of code, any chance of Signed-off-by tags
 to indicate permission to contribute it to us?
 
 I have the confirmation in private email, I'll try to get him to post
 it publicly.
 
 We don't need a public post from the original author per se, but try to record
 who gave/got the permission via the Signed-off-by tags in the commit 
 message:
 
 http://www.x.org/wiki/Development/Documentation/SubmittingPatches#Signing_off_and_reviewing

So in this case, would I add an Acked-by line for Michael and a
Signed-off-by line for myself?
 Thomas
___
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:libpciaccess 3/3] Update NetBSD support. From Michael Lorenz macal...@netbsd.org.

2013-06-08 Thread Thomas Klausner
On Fri, Jun 07, 2013 at 08:39:52PM -0700, Alan Coopersmith wrote:
 On 06/ 2/13 01:38 PM, Thomas Klausner wrote:
 ---
   configure.ac |   4 +-
   src/netbsd_pci.c | 471 
  +++
   2 files changed, 342 insertions(+), 133 deletions(-)
 
 Since that's a substantial amount of code, any chance of Signed-off-by tags
 to indicate permission to contribute it to us?

I have the confirmation in private email, I'll try to get him to post
it publicly.
 Thomas
___
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:libX11 8/8] Deal with the limited range of VAX floating point numbers when compiling for VAX.

2013-06-07 Thread Thomas Klausner
On Thu, Jun 06, 2013 at 11:14:07PM -0700, Alan Coopersmith wrote:
 On 06/ 2/13 04:19 PM, Thomas Klausner wrote:
 On Sun, Jun 02, 2013 at 04:11:08PM -0700, Alan Coopersmith wrote:
 People still compile X for VAX?   I had no idea...
 
 Yes, NetBSD-6.1 was released for vax, including X.
 
 http://netbsd.org/ports/vax/
 
 Of course, it was cross-compiled.
 
 Okay - but you're responsible for maintaining VAX support then - no one else
 will notice if VAX breaks.

Understood.

 Pushed the patch to git master:
 
 To ssh://git.freedesktop.org/git/xorg/lib/libX11
0a48235..ed3d830  master - master

Thanks,
 Thomas
___
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:xf86-video-glint] when doing DDC2 on Permedia2 make sure to clear the USE_MONID bit in the DDCdata register so the i2c bits actually do something Now DDC2 works on my PGX32 / Raptor 8P

2013-06-04 Thread Thomas Klausner
On Mon, Jun 03, 2013 at 08:47:05AM -0700, Matt Turner wrote:
 Not sure I like just commenting out code like this.
 
 Fix the commit title and summary message.

Ok, I've improved the patch, I hope it's acceptable now.

Thanks,
 Thomas
___
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:libX11 1/8] Avoid .TS H and .TH for now as it doesn't alter the output in this case, and improve the output with mandoc(1).

2013-06-02 Thread Thomas Klausner
---
 man/XCreateGC.man | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/man/XCreateGC.man b/man/XCreateGC.man
index 62a2f00..de0d039 100644
--- a/man/XCreateGC.man
+++ b/man/XCreateGC.man
@@ -460,7 +460,7 @@ are:
 .\ and operation.
 .\.CP T 1
 .\Display Functions
-.TS H
+.TS
 lw(1.5i) cw(.5i) lw(2i).
 _
 .sp 6p
@@ -469,7 +469,6 @@ Function Name   Value   Operation
 .sp 6p
 _
 .sp 6p
-.TH
 T{
 .ZN GXclear
 T} T{
-- 
1.8.2.3

___
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:libXScrnSaver] Don't declare a 'const char *' when you pass it to a 'char *'.

2013-06-02 Thread Thomas Klausner
---
 src/XScrnSaver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/XScrnSaver.c b/src/XScrnSaver.c
index 2a89246..bf53c03 100644
--- a/src/XScrnSaver.c
+++ b/src/XScrnSaver.c
@@ -36,7 +36,7 @@ in this Software without prior written authorization from the 
X Consortium.
 
 static XExtensionInfo _screen_saver_info_data;
 static XExtensionInfo *screen_saver_info = _screen_saver_info_data;
-static const char *screen_saver_extension_name = ScreenSaverName;
+static char *screen_saver_extension_name = ScreenSaverName;
 
 #define ScreenSaverCheckExtension(dpy,i,val) \
   XextCheckExtension (dpy, i, screen_saver_extension_name, val)
-- 
1.8.2.3

___
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] Protect config.h inclusion with ifdef HAVE_CONFIG_H, like usual.

2013-06-02 Thread Thomas Klausner
---
 src/fontfile/bunzip2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/fontfile/bunzip2.c b/src/fontfile/bunzip2.c
index 44d19f0..4078796 100644
--- a/src/fontfile/bunzip2.c
+++ b/src/fontfile/bunzip2.c
@@ -26,7 +26,9 @@
  */
 
 
+#ifdef HAVE_CONFIG_H
 #include config.h
+#endif
 
 #include X11/fonts/fontmisc.h
 #include X11/fonts/bufio.h
-- 
1.8.2.3

___
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:libX11 3/8] ifdef out code that truncates the source length to the destination length if it is larger. Seems useless to do that since the code tests for both source length and destination to be

2013-06-02 Thread Thomas Klausner
---
 modules/lc/gen/lcGenConv.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/modules/lc/gen/lcGenConv.c b/modules/lc/gen/lcGenConv.c
index 42d63c5..5a4fd64 100644
--- a/modules/lc/gen/lcGenConv.c
+++ b/modules/lc/gen/lcGenConv.c
@@ -764,8 +764,10 @@ mbstowcs_org(
 return( 0 );
 }
 
+#ifdef notdef
 if (*from_left  *to_left)
 *from_left = *to_left;
+#endif
 
 while (*from_left  *to_left) {
 
@@ -921,8 +923,10 @@ wcstombs_org(
 int defstr_len = strlen(default_string);
 
 
+#ifdef notdef
 if (*from_left  *to_left)
 *from_left = *to_left;
+#endif
 
 while (*from_left  *to_left) {
 
@@ -1080,8 +1084,10 @@ wcstocts(
 int from_size = *from_left;
 char *ext_seg_len = NULL;
 
+#ifdef notdef
 if (*from_left  *to_left)
 *from_left = *to_left;
+#endif
 
 while (*from_left  *to_left) {
 
@@ -1272,8 +1278,10 @@ ctstowcs(
 return( 0 );
 }
 
+#ifdef notdef
 if (*from_left  *to_left)
 *from_left = *to_left;
+#endif
 
 while (*from_left  *to_left) {
 
@@ -1666,8 +1674,10 @@ mbstostr(
 return( 0 );
 }
 
+#ifdef notdef
 if (*from_left  *to_left)
 *from_left = *to_left;
+#endif
 
 while (*from_left  *to_left) {
 
@@ -1957,8 +1967,10 @@ wcstostr(
 int defstr_len = strlen(default_string);
 
 
+#ifdef notdef
 if (*from_left  *to_left)
 *from_left = *to_left;
+#endif
 
 while (*from_left  *to_left) {
 
@@ -2114,8 +2126,10 @@ wctocs(
 char *outbufptr = *to;
 int from_size = *from_left;
 
+#ifdef notdef
 if (*from_left  *to_left)
 *from_left = *to_left;
+#endif
 
 if (*from_left  *to_left) {
 
@@ -2427,8 +2441,10 @@ strtombs(
 char *outbufptr = *to;
 int from_size = *from_left;
 
+#ifdef notdef
 if (*from_left  *to_left)
 *from_left = *to_left;
+#endif
 
 while (*from_left  *to_left) {
 
@@ -2537,8 +2553,10 @@ strtowcs(
 wchar_t *outbufptr = (wchar_t *)*to;
 int from_size = *from_left;
 
+#ifdef notdef
 if (*from_left  *to_left)
 *from_left = *to_left;
+#endif
 
 while (*from_left  *to_left) {
 
-- 
1.8.2.3

___
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:libX11 5/8] Let libX11 load and make available the newer (X11R6) callback-based API for XIM (expected by emacs).

2013-06-02 Thread Thomas Klausner
Patch from Ian D. Leroux idler...@fastmail.fm on pkgsrc-users
following a hint by Nhat Minh Lê nhat.minh...@gmail.com.
---
 nls/iso8859-1/XI18N_OBJS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nls/iso8859-1/XI18N_OBJS b/nls/iso8859-1/XI18N_OBJS
index 32e4f35..3a9a1bb 100644
--- a/nls/iso8859-1/XI18N_OBJS
+++ b/nls/iso8859-1/XI18N_OBJS
@@ -3,6 +3,6 @@
 #  XI18N objects table for euro locales
 #
 XLCcommon/xlibi18n _XlcGenericLoader   # XLC_open
-XIMcommon/ximcp_XimOpenIM  # XIM_open
+XIMcommon/ximcp_XimOpenIM _XimRegisterIMInstantiateCallback  
_XimUnRegisterIMInstantiateCallback # XIM_openXIM_register XIM_unregister
 XOMcommon/xomGeneric   _XomGenericOpenOM   # XOM_open
 
-- 
1.8.2.3

___
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:libX11 6/8] Check for symbol existence with #ifdef, not #if.

2013-06-02 Thread Thomas Klausner
---
 src/XlibInt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/XlibInt.c b/src/XlibInt.c
index b06e57b..92a4340 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -239,7 +239,7 @@ void _XSeqSyncFunction(
 static int
 _XPrivSyncFunction (Display *dpy)
 {
-#if XTHREADS
+#ifdef XTHREADS
 assert(!dpy-lock_fns);
 #endif
 assert(dpy-synchandler == _XPrivSyncFunction);
-- 
1.8.2.3

___
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:libX11 2/8] Let libX11 load and make available the newer (X11R6) callback-based API for XIM (expected by emacs).

2013-06-02 Thread Thomas Klausner
Patch from Ian D. Leroux idler...@fastmail.fm on pkgsrc-users
following a hint by Nhat Minh Lê nhat.minh...@gmail.com.
---
 nls/C/XI18N_OBJS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nls/C/XI18N_OBJS b/nls/C/XI18N_OBJS
index 32e4f35..3a9a1bb 100644
--- a/nls/C/XI18N_OBJS
+++ b/nls/C/XI18N_OBJS
@@ -3,6 +3,6 @@
 #  XI18N objects table for euro locales
 #
 XLCcommon/xlibi18n _XlcGenericLoader   # XLC_open
-XIMcommon/ximcp_XimOpenIM  # XIM_open
+XIMcommon/ximcp_XimOpenIM _XimRegisterIMInstantiateCallback  
_XimUnRegisterIMInstantiateCallback # XIM_openXIM_register XIM_unregister
 XOMcommon/xomGeneric   _XomGenericOpenOM   # XOM_open
 
-- 
1.8.2.3

___
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:libX11 8/8] Deal with the limited range of VAX floating point numbers when compiling for VAX.

2013-06-02 Thread Thomas Klausner
---
 src/xcms/cmsTrig.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/xcms/cmsTrig.c b/src/xcms/cmsTrig.c
index a917b78..fc65d9b 100644
--- a/src/xcms/cmsTrig.c
+++ b/src/xcms/cmsTrig.c
@@ -71,7 +71,11 @@ _XcmsModuloF(
 #define XCMS_SIXTHPI   0.523598775598298820
 #define XCMS_RADIANS(d)((d) * XCMS_PI / 180.0)
 #define XCMS_DEGREES(r)((r) * 180.0 / XCMS_PI)
+#ifdef __vax__
+#define XCMS_X6_UNDERFLOWS (3.784659e-07)  /* X**6 almost underflows*/
+#else
 #define XCMS_X6_UNDERFLOWS (4.209340e-52)  /* X**6 almost underflows */
+#endif
 #define XCMS_X16_UNDERFLOWS(5.421010e-20)  /* X**16 almost underflows*/
 #define XCMS_CHAR_BIT  8
 #define XCMS_LONG_MAX  0x7FFF
-- 
1.8.2.3

___
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:libX11 4/8] Let libX11 load and make available the newer (X11R6) callback-based API for XIM (expected by emacs).

2013-06-02 Thread Thomas Klausner
Patch from Ian D. Leroux idler...@fastmail.fm on pkgsrc-users
following a hint by Nhat Minh Lê nhat.minh...@gmail.com.

AND

fix a couple of defaults that make emacs and a few other things work.
as reported on tech-x11.
---
 nls/en_US.UTF-8/XI18N_OBJS | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/nls/en_US.UTF-8/XI18N_OBJS b/nls/en_US.UTF-8/XI18N_OBJS
index f201bf4..97b30b9 100644
--- a/nls/en_US.UTF-8/XI18N_OBJS
+++ b/nls/en_US.UTF-8/XI18N_OBJS
@@ -3,6 +3,5 @@
 #  XI18N objects table for euro locales
 #
 XLCcommon/xlcUTF8Load  _XlcUtf8Loader  # XLC_open
-XOMcommon/xomLTRTTB_XomGenericOpenOM   # XOM_open
-XIMcommon/xiiimp   _SwitchOpenIM   # XIM_open
-XIMcommon/xiiimp   _XimpLocalOpenIM# XIM_open
+XOMcommon/xomGeneric   _XomGenericOpenOM   # XOM_open
+XIMcommon/ximcp_XimOpenIM _XimRegisterIMInstantiateCallback  
_XimUnRegisterIMInstantiateCallback # XIM_openXIM_register XIM_unregister
-- 
1.8.2.3

___
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:libXmu] Fix a const issue.

2013-06-02 Thread Thomas Klausner
---
 src/StrToGrav.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/StrToGrav.c b/src/StrToGrav.c
index ca8bb53..e7ad699 100644
--- a/src/StrToGrav.c
+++ b/src/StrToGrav.c
@@ -106,7 +106,7 @@ Boolean
 XmuCvtGravityToString(Display *dpy, XrmValue *args, Cardinal *num_args,
  XrmValue *fromVal, XrmValue *toVal, XtPointer *data)
 {
-  static char *buffer;
+  static const char *buffer;
   Cardinal size;
   struct _namepair *np;
   XtGravity gravity;
-- 
1.8.2.3

___
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:libXtst] Fix some const issues.

2013-06-02 Thread Thomas Klausner
---
 src/XRecord.c | 2 +-
 src/XTest.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/XRecord.c b/src/XRecord.c
index 5bbd5ac..e146778 100644
--- a/src/XRecord.c
+++ b/src/XRecord.c
@@ -74,7 +74,7 @@ static inline void _XEatDataWords(Display *dpy, unsigned long 
n)
 
 static XExtensionInfo _xrecord_info_data;
 static XExtensionInfo *xrecord_info = _xrecord_info_data;
-static const char *xrecord_extension_name = RECORD_NAME;
+static char *xrecord_extension_name = RECORD_NAME;
 
 #define XRecordCheckExtension(dpy,i,val) \
 XextCheckExtension(dpy, i, xrecord_extension_name, val)
diff --git a/src/XTest.c b/src/XTest.c
index 3e4bb17..04370e4 100644
--- a/src/XTest.c
+++ b/src/XTest.c
@@ -40,7 +40,7 @@ from The Open Group.
 
 static XExtensionInfo _xtest_info_data;
 static XExtensionInfo *xtest_info = _xtest_info_data;
-static const char *xtest_extension_name = XTestExtensionName;
+static char *xtest_extension_name = XTestExtensionName;
 
 #define XTestCheckExtension(dpy,i,val) \
   XextCheckExtension (dpy, i, xtest_extension_name, val)
-- 
1.8.2.3

___
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:mkfontscale 1/2] Protect config.h inclusion like usual.

2013-06-02 Thread Thomas Klausner
---
 ident.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ident.c b/ident.c
index bf54483..8addee7 100644
--- a/ident.c
+++ b/ident.c
@@ -47,7 +47,9 @@
and 0 if it should be processed normally.  identifyBitmap is
much faster than parsing the whole font. */
 
+#ifdef HAVE_CONFIG_H
 #include config.h
+#endif
 
 #include stdlib.h
 #include string.h
-- 
1.8.2.3

___
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:mkfontscale 2/2] Remove a couple of 'const' that aren't OK for the caller.

2013-06-02 Thread Thomas Klausner
---
 mkfontscale.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mkfontscale.c b/mkfontscale.c
index 53c5303..15efaac 100644
--- a/mkfontscale.c
+++ b/mkfontscale.c
@@ -60,7 +60,7 @@
 #define QUOTE(x)   #x
 #define STRINGIFY(x)   QUOTE(x)
 
-static const char *encodings_array[] =
+static char *encodings_array[] =
 { ascii-0,
   iso8859-1, iso8859-2, iso8859-3, iso8859-4, iso8859-5,
   iso8859-6, iso8859-6.8, iso8859-6.8x, iso8859-6.16,
@@ -79,7 +79,7 @@ static const char *encodings_array[] =
   gb2312.1980-0, gb18030.2000-0, gb18030.2000-1,
   ksc5601.1987-0, ksc5601.1992-3};
 
-static const char *extra_encodings_array[] =
+static char *extra_encodings_array[] =
 { iso10646-1, adobe-fontspecific, microsoft-symbol };
 
 static ListPtr encodings, extra_encodings;
-- 
1.8.2.3

___
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:xrandr 2/2] Use __UNCONST to work around const problem.

2013-06-02 Thread Thomas Klausner
XXX: should probably be fixed differently.
---
 xrandr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xrandr.c b/xrandr.c
index da786cb..0b285a3 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -1524,7 +1524,7 @@ crtc_set_transform (crtc_t *crtc, transform_t *transform)
 if (major  1 || (major == 1  minor = 3))
XRRSetCrtcTransform (dpy, crtc-crtc.xid,
 transform-transform,
-transform-filter,
+__UNCONST(transform-filter),
 transform-params,
 transform-nparams);
 }
-- 
1.8.2.3

___
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:xrandr 1/2] Protect config.h like usual.

2013-06-02 Thread Thomas Klausner
---
 xrandr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xrandr.c b/xrandr.c
index 94e5c2e..da786cb 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -41,7 +41,9 @@
 #include stdarg.h
 #include math.h
 
+#ifdef HAVE_CONFIG_H
 #include config.h
+#endif
 
 static char*program_name;
 static Display *dpy;
-- 
1.8.2.3

___
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:libXt] Add missing comma to fix DEBUG build.

2013-06-02 Thread Thomas Klausner
---
 src/ResConfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ResConfig.c b/src/ResConfig.c
index 161366a..152d9cf 100644
--- a/src/ResConfig.c
+++ b/src/ResConfig.c
@@ -981,7 +981,7 @@ _XtResourceConfigurationEH (
resource = XtNewString (data_ptr);
value = XtNewString (data_value);
 #ifdef DEBUG
-   fprintf (stderr, resource_len=%d\n
+   fprintf (stderr, resource_len=%d\n,
 resource_len);
fprintf (stderr, resource = %s\t value = %s\n,
 resource, value);
-- 
1.8.2.3

___
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:libX11 7/8] Add missing stdio header for printf(3) in DEBUG build.

2013-06-02 Thread Thomas Klausner
On Sun, Jun 02, 2013 at 10:02:39PM +0200, walter harms wrote:
 
 
 Am 02.06.2013 20:49, schrieb Thomas Klausner:
  ---
   src/xcms/cmsMath.c | 4 
   1 file changed, 4 insertions(+)
  
  diff --git a/src/xcms/cmsMath.c b/src/xcms/cmsMath.c
  index 70b0675..487eb3f 100644
  --- a/src/xcms/cmsMath.c
  +++ b/src/xcms/cmsMath.c
  @@ -35,6 +35,10 @@ in this Software without prior written authorization 
  from The Open Group.
   #include Xlibint.h
   #include Xcmsint.h
   
  +#ifdef DEBUG
  +#include stdio.h
  +#endif
  +
 
 I guess libX11 can take the overhead even when DEBUG is nodef
 just include.
 
 #include stdio.h  /* debug code needs that */

Fine with me. Should I send an updated patch for that?
 Thomas
___
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:libXinerama] Const fix.

2013-06-02 Thread Thomas Klausner
---
 src/Xinerama.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Xinerama.c b/src/Xinerama.c
index 67a35b5..17e8ec8 100644
--- a/src/Xinerama.c
+++ b/src/Xinerama.c
@@ -51,7 +51,7 @@ static inline void _XEatDataWords(Display *dpy, unsigned long 
n)
 
 static XExtensionInfo _panoramiX_ext_info_data;
 static XExtensionInfo *panoramiX_ext_info = _panoramiX_ext_info_data;
-static const char *panoramiX_extension_name = PANORAMIX_PROTOCOL_NAME;
+static char *panoramiX_extension_name = PANORAMIX_PROTOCOL_NAME;
 
 #define PanoramiXCheckExtension(dpy,i,val) \
   XextCheckExtension (dpy, i, panoramiX_extension_name, val)
-- 
1.8.2.3

___
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:libXRes] Const fix.

2013-06-02 Thread Thomas Klausner
---
 src/XRes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/XRes.c b/src/XRes.c
index 51e905f..aef32ce 100644
--- a/src/XRes.c
+++ b/src/XRes.c
@@ -28,7 +28,7 @@ static inline void _XEatDataWords(Display *dpy, unsigned long 
n)
 
 static XExtensionInfo _xres_ext_info_data;
 static XExtensionInfo *xres_ext_info = _xres_ext_info_data;
-static const char *xres_extension_name = XRES_NAME;
+static char *xres_extension_name = XRES_NAME;
 
 #define XResCheckExtension(dpy,i,val) \
   XextCheckExtension (dpy, i, xres_extension_name, val)
-- 
1.8.2.3

___
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:libXrandr] Add some casts for gcc with more warnings enabled.

2013-06-02 Thread Thomas Klausner
---
 src/XrrProvider.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/XrrProvider.c b/src/XrrProvider.c
index 309e321..cc339cd 100644
--- a/src/XrrProvider.c
+++ b/src/XrrProvider.c
@@ -77,7 +77,7 @@ XRRGetProviderResources(Display *dpy, Window window)
 xrpr-nproviders = rep.nProviders;
 xrpr-providers = (RRProvider *)(xrpr + 1);
 
-_XRead32(dpy, xrpr-providers, rep.nProviders  2);
+_XRead32(dpy, (RRProvider *)xrpr-providers, rep.nProviders  2);
 
 if (nbytes  nbytesRead)
   _XEatData (dpy, (unsigned long) (nbytes - nbytesRead));
@@ -156,7 +156,7 @@ XRRGetProviderInfo(Display *dpy, XRRScreenResources 
*resources, RRProvider provi
 _XRead32(dpy, xpi-outputs, rep.nOutputs  2);
 
 _XRead32(dpy, xpi-associated_providers, rep.nAssociatedProviders  2);
-_XRead32(dpy, xpi-associated_capability, rep.nAssociatedProviders  2);
+_XRead32(dpy, (RRProvider *)xpi-associated_capability, 
rep.nAssociatedProviders  2);
 
 _XReadPad(dpy, xpi-name, rep.nameLength);
 xpi-name[rep.nameLength] = '\0';
-- 
1.8.2.3

___
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:xdm] Add a cast to avoid a compiler error.

2013-06-02 Thread Thomas Klausner
XXX: this code should be revisited.
---
 xdm/prngc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xdm/prngc.c b/xdm/prngc.c
index f0db8eb..fe737e3 100644
--- a/xdm/prngc.c
+++ b/xdm/prngc.c
@@ -130,7 +130,7 @@ reopen:
msg[0] = 0x02;
msg[1] = len;
 
-   if (atomicio(write, fd, msg, sizeof(msg)) != sizeof(msg)) {
+   if (atomicio((ssize_t (*)(int, void *, size_t))write, fd, msg, 
sizeof(msg)) != sizeof(msg)) {
if (errno == EPIPE  errors  10) {
close(fd);
errors++;
-- 
1.8.2.3

___
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:xkbcomp] Protect config.h like usual.

2013-06-02 Thread Thomas Klausner
---
 utils.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/utils.h b/utils.h
index 417d104..b00067d 100644
--- a/utils.h
+++ b/utils.h
@@ -35,7 +35,9 @@
 #include   X11/Xfuncs.h
 
 #include stddef.h
+#ifdef HAVE_CONFIG_H
 #include config.h
+#endif
 
 #ifndef NUL
 #defineNUL '\0'
-- 
1.8.2.3

___
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:libpciaccess 1/3] Protect config.h like usual.

2013-06-02 Thread Thomas Klausner
---
 src/common_bridge.c  | 3 +++
 src/common_device_name.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/src/common_bridge.c b/src/common_bridge.c
index 82a13fd..b4b5d7e 100644
--- a/src/common_bridge.c
+++ b/src/common_bridge.c
@@ -29,7 +29,10 @@
  * \author Ian Romanick i...@us.ibm.com
  */
 
+#ifdef HAVE_CONFIG_H
 #include config.h
+#endif
+
 #include stdio.h
 #include stdlib.h
 #include ctype.h
diff --git a/src/common_device_name.c b/src/common_device_name.c
index ad9ed9d..8c73dbd 100644
--- a/src/common_device_name.c
+++ b/src/common_device_name.c
@@ -28,7 +28,10 @@
  * with a particular device or vendor.
  */
 
+#ifdef HAVE_CONFIG_H
 #include config.h
+#endif
+
 #include stdio.h
 #include stdlib.h
 #include ctype.h
-- 
1.8.2.3

___
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:libpciaccess 2/3] Remove useless extra const in const sometype const * var = value; . Found using clang -Wduplicate-decl-specifier.

2013-06-02 Thread Thomas Klausner
---
 src/common_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common_interface.c b/src/common_interface.c
index 6dccf8e..8eace4e 100644
--- a/src/common_interface.c
+++ b/src/common_interface.c
@@ -268,7 +268,7 @@ pci_device_map_range(struct pci_device *dev, pciaddr_t base,
 
 
 for (region = 0; region  6; region++) {
-const struct pci_mem_region const* r = dev-regions[region];
+const struct pci_mem_region * r = dev-regions[region];
 
 if (r-size != 0) {
 if ((r-base_addr = base)  ((r-base_addr + r-size)  base)) {
-- 
1.8.2.3

___
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:libpciaccess 3/3] Update NetBSD support. From Michael Lorenz macal...@netbsd.org.

2013-06-02 Thread Thomas Klausner
---
 configure.ac |   4 +-
 src/netbsd_pci.c | 471 +++
 2 files changed, 342 insertions(+), 133 deletions(-)

diff --git a/configure.ac b/configure.ac
index 91374e5..3441b63 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,10 +77,10 @@ case $host_os in
*netbsd*)
case $host in
*i386*)
-   PCIACCESS_LIBS=-li386
+   PCIACCESS_LIBS=-li386 -lpci
;;
*x86_64*|*amd64*)
-   PCIACCESS_LIBS=-lx86_64
+   PCIACCESS_LIBS=-lx86_64 -lpci
;;
esac
netbsd=yes
diff --git a/src/netbsd_pci.c b/src/netbsd_pci.c
index 63585e3..f5a90c0 100644
--- a/src/netbsd_pci.c
+++ b/src/netbsd_pci.c
@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2008 Juan Romero Pardines
  * Copyright (c) 2008 Mark Kettenis
+ * Copyright (c) 2009 Michael Lorenz
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -20,12 +21,15 @@
 #include sys/mman.h
 #include sys/types.h
 
+#ifdef HAVE_MTRR
 #include machine/sysarch.h
 #include machine/mtrr.h
+#define netbsd_set_mtrr(mr, num)   _X86_SYSARCH_L(set_mtrr)(mr, num)
+#endif
 
+#include dev/pci/pcidevs.h
 #include dev/pci/pciio.h
 #include dev/pci/pcireg.h
-#include dev/pci/pcidevs.h
 
 #include errno.h
 #include fcntl.h
@@ -35,126 +39,152 @@
 #include unistd.h
 
 
+#include pci.h
+#include dev/wscons/wsconsio.h
+
 #include pciaccess.h
 #include pciaccess_private.h
 
-static int pcifd;
+typedef struct _pcibus {
+   int fd; /* /dev/pci* */
+   int num;/* bus number */
+   int maxdevs;/* maximum number of devices */
+} PciBus;
+
+static PciBus buses[32];   /* indexed by pci_device.domain */
+static int nbuses = 0; /* number of buses found */
+
+/*
+ * NetBSD's userland has a /dev/pci* entry for each bus but userland has no way
+ * to tell if a bus is a subordinate of another one or if it's on a different
+ * host bridge. On some architectures ( macppc for example ) all root buses 
have
+ * bus number 0 but on sparc64 for example the two roots in an Ultra60 have
+ * different bus numbers - one is 0 and the other 128.
+ * With each /dev/pci* we can map everything on the same root and we can also
+ * see all devices on the same root, trying to do that causes problems though:
+ * - since we can't tell which /dev/pci* is a subordinate we would find some
+ *   devices more than once
+ * - we would have to guess subordinate bus numbers which is a waste of time
+ *   since we can ask each /dev/pci* for its bus number so we can scan only the
+ *   buses we know exist, not all 256 which may exist in each domain.
+ * - some bus_space_mmap() methods may limit mappings to address ranges which
+ *   belong to known devices on that bus only.
+ * Each host bridge may or may not have its own IO range, to avoid guesswork
+ * here each /dev/pci* will let userland map its appropriate IO range at
+ * PCI_MAGIC_IO_RANGE if defined in machine/param.h
+ * With all this we should be able to use any PCI graphics device on any PCI
+ * bus on any architecture as long as Xorg has a driver, without allowing
+ * arbitrary mappings via /dev/mem and without userland having to know or care
+ * about translating bus addresses to physical addresses or the other way 
+ * around.
+ */
 
 static int
-pci_read(int bus, int dev, int func, uint32_t reg, uint32_t *val)
+pci_read(int domain, int bus, int dev, int func, uint32_t reg, uint32_t *val)
 {
-   struct pciio_bdf_cfgreg io;
-   int err;
+   uint32_t rval;
 
-   bzero(io, sizeof(io));
-   io.bus = bus;
-   io.device = dev;
-   io.function = func;
-   io.cfgreg.reg = reg;
+   if ((domain  0) || (domain  nbuses))
+   return -1;
 
-   err = ioctl(pcifd, PCI_IOC_BDF_CFGREAD, io);
-   if (err)
-   return (err);
+   if (pcibus_conf_read(buses[domain].fd, (unsigned int)bus,
+   (unsigned int)dev, (unsigned int)func, reg, rval) == -1)
+   return (-1);
 
-   *val = io.cfgreg.val;
+   *val = rval;
 
return 0;
 }
 
 static int
-pci_write(int bus, int dev, int func, uint32_t reg, uint32_t val)
+pci_write(int domain, int bus, int dev, int func, uint32_t reg, uint32_t val)
 {
-   struct pciio_bdf_cfgreg io;
 
-   bzero(io, sizeof(io));
-   io.bus = bus;
-   io.device = dev;
-   io.function = func;
-   io.cfgreg.reg = reg;
-   io.cfgreg.val = val;
+   if ((domain  0) || (domain  nbuses))
+   return -1;
 
-   return ioctl(pcifd, PCI_IOC_BDF_CFGWRITE, io);
+   return pcibus_conf_write(buses[domain].fd, (unsigned int)bus,
+   (unsigned int)dev, (unsigned int)func, reg, val);
 }
 
 static int
-pci_nfuncs(int bus, int dev)
+pci_nfuncs(int domain, 

[PATCH:xf86-video-ast] Use uint32_t for a variable that's passed to a function expecting a uint32_t.

2013-06-02 Thread Thomas Klausner
---
 src/ast_vgatool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ast_vgatool.c b/src/ast_vgatool.c
index 513cf7b..378822a 100644
--- a/src/ast_vgatool.c
+++ b/src/ast_vgatool.c
@@ -2709,7 +2709,7 @@ void vGetDefaultSettings(ScrnInfoPtr pScrn)
 Bool InitVGA(ScrnInfoPtr pScrn, ULONG Flags)
 {
ASTRecPtr pAST;
-   ULONG ulData;
+   uint32_t ulData;
 
pAST = ASTPTR(pScrn);
 
@@ -3005,7 +3005,7 @@ GetVGAEDID(ScrnInfoPtr pScrn, unsigned char *pEDIDBuffer)
 Bool bInitAST1180(ScrnInfoPtr pScrn)
 {
 ASTRecPtr pAST;
-ULONG ulData;
+uint32_t ulData;
 
 pAST = ASTPTR(pScrn);
 
-- 
1.8.2.3

___
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:xf86-video-glint] when doing DDC2 on Permedia2 make sure to clear the USE_MONID bit in the DDCdata register so the i2c bits actually do something Now DDC2 works on my PGX32 / Raptor 8P

2013-06-02 Thread Thomas Klausner
From Michael Lorez macal...@netbsd.org
---
 src/pm2_dac.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/pm2_dac.c b/src/pm2_dac.c
index 85093ff..b6771a5 100644
--- a/src/pm2_dac.c
+++ b/src/pm2_dac.c
@@ -458,8 +458,14 @@ Permedia2I2CPutBits(I2CBusPtr b, int scl, int sda)
 {
 GLINTPtr pGlint = (GLINTPtr) b-DriverPrivate.ptr;
 int r = (pGlint-DDCBus == b) ? PMDDCData : VSSerialBusControl;
+/*
+This is bogus.
+All this line does is to preserve the USE_MONID bit if set which prevents
+the i2c bits from doing anything
 CARD32 v = GLINT_READ_REG(r)  ~(ClkOut | DataOut);
-
+*/
+CARD32 v = 0;
+   
 if (scl  0) v |= ClkOut;
 if (sda  0) v |= DataOut;
 
-- 
1.8.2.3

___
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:xf86-video-i740] I740_Sync is only define if HAVE_XAA_H, so limit prototype to same define.

2013-06-02 Thread Thomas Klausner
---
 src/i740_dga.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/i740_dga.c b/src/i740_dga.c
index 532d614..eb362c5 100644
--- a/src/i740_dga.c
+++ b/src/i740_dga.c
@@ -41,10 +41,10 @@
 
 static Bool I740_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, int 
*, int *, int *);
 static Bool I740_SetMode(ScrnInfoPtr, DGAModePtr);
-static void I740_Sync(ScrnInfoPtr);
 static int  I740_GetViewport(ScrnInfoPtr);
 static void I740_SetViewport(ScrnInfoPtr, int, int, int);
 #ifdef HAVE_XAA_H
+static void I740_Sync(ScrnInfoPtr);
 static void I740_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long);
 static void I740_BlitRect(ScrnInfoPtr, int, int, int, int, int, int);
 #if 0
@@ -57,8 +57,8 @@ static DGAFunctionRec I740DGAFuncs = {
I740_SetMode,
I740_SetViewport,
I740_GetViewport,
-   I740_Sync,
 #ifdef HAVE_XAA_H
+   I740_Sync,
I740_FillRect,
I740_BlitRect,
 #if 0
-- 
1.8.2.3

___
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:libX11 3/8] ifdef out code that truncates the source length to the destination length if it is larger. Seems useless to do that since the code tests for both source length and destination t

2013-06-02 Thread Thomas Klausner
On Sun, Jun 02, 2013 at 04:15:55PM -0700, Alan Coopersmith wrote:
 Style tip: the first line of a commit message should be a short summary
 that fits into an 80 column screen - that's what git shows as the commit
 title and the changelog message that goes into new release announcements,
 as well as the subject line of git format-patch output (as you can see,
 this patch has a subject line that's too long to read in most mail clients).

Ok. I'll do that in the future.

 Is there any point in ifdef'ing these out vs. removing them as commit
 002b36e308a26a1 did for one already?

Actually, no. I'll send an updated patch.

 In any case, I don't think this is a release blocker for 1.6, so should
 wait until after that release is made.

Fine with me, as long as it doesn't get lost :)
 Thomas

 
   -alan-
 
 
 On 06/ 2/13 11:49 AM, Thomas Klausner wrote:
 ---
   modules/lc/gen/lcGenConv.c | 18 ++
   1 file changed, 18 insertions(+)
 
 diff --git a/modules/lc/gen/lcGenConv.c b/modules/lc/gen/lcGenConv.c
 index 42d63c5..5a4fd64 100644
 --- a/modules/lc/gen/lcGenConv.c
 +++ b/modules/lc/gen/lcGenConv.c
 @@ -764,8 +764,10 @@ mbstowcs_org(
   return( 0 );
   }
 
 +#ifdef notdef
   if (*from_left  *to_left)
   *from_left = *to_left;
 +#endif
 
   while (*from_left  *to_left) {
 
 @@ -921,8 +923,10 @@ wcstombs_org(
   int defstr_len = strlen(default_string);
 
 
 +#ifdef notdef
   if (*from_left  *to_left)
   *from_left = *to_left;
 +#endif
 
   while (*from_left  *to_left) {
 
 @@ -1080,8 +1084,10 @@ wcstocts(
   int from_size = *from_left;
   char *ext_seg_len = NULL;
 
 +#ifdef notdef
   if (*from_left  *to_left)
   *from_left = *to_left;
 +#endif
 
   while (*from_left  *to_left) {
 
 @@ -1272,8 +1278,10 @@ ctstowcs(
   return( 0 );
   }
 
 +#ifdef notdef
   if (*from_left  *to_left)
   *from_left = *to_left;
 +#endif
 
   while (*from_left  *to_left) {
 
 @@ -1666,8 +1674,10 @@ mbstostr(
   return( 0 );
   }
 
 +#ifdef notdef
   if (*from_left  *to_left)
   *from_left = *to_left;
 +#endif
 
   while (*from_left  *to_left) {
 
 @@ -1957,8 +1967,10 @@ wcstostr(
   int defstr_len = strlen(default_string);
 
 
 +#ifdef notdef
   if (*from_left  *to_left)
   *from_left = *to_left;
 +#endif
 
   while (*from_left  *to_left) {
 
 @@ -2114,8 +2126,10 @@ wctocs(
   char *outbufptr = *to;
   int from_size = *from_left;
 
 +#ifdef notdef
   if (*from_left  *to_left)
   *from_left = *to_left;
 +#endif
 
   if (*from_left  *to_left) {
 
 @@ -2427,8 +2441,10 @@ strtombs(
   char *outbufptr = *to;
   int from_size = *from_left;
 
 +#ifdef notdef
   if (*from_left  *to_left)
   *from_left = *to_left;
 +#endif
 
   while (*from_left  *to_left) {
 
 @@ -2537,8 +2553,10 @@ strtowcs(
   wchar_t *outbufptr = (wchar_t *)*to;
   int from_size = *from_left;
 
 +#ifdef notdef
   if (*from_left  *to_left)
   *from_left = *to_left;
 +#endif
 
   while (*from_left  *to_left) {
 
 
 
 
 -- 
   -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:libX11 8/8] Deal with the limited range of VAX floating point numbers when compiling for VAX.

2013-06-02 Thread Thomas Klausner
On Sun, Jun 02, 2013 at 04:11:08PM -0700, Alan Coopersmith wrote:
 People still compile X for VAX?   I had no idea...

Yes, NetBSD-6.1 was released for vax, including X.

http://netbsd.org/ports/vax/

Of course, it was cross-compiled.
 Thomas
___
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] Remove code limiting buffer size.

2013-06-02 Thread Thomas Klausner
Remove code that truncates the source length to the destination
length if it is larger. Seems useless to do that since the code
tests for both source length and destination to be non-zero. This
fixes cut-n-paste problem in xterm where the paste length was
limited to 1024 (BUFSIZ) in button.c
---
 modules/lc/gen/lcGenConv.c | 29 -
 1 file changed, 29 deletions(-)

diff --git a/modules/lc/gen/lcGenConv.c b/modules/lc/gen/lcGenConv.c
index 42d63c5..f051b8d 100644
--- a/modules/lc/gen/lcGenConv.c
+++ b/modules/lc/gen/lcGenConv.c
@@ -764,9 +764,6 @@ mbstowcs_org(
 return( 0 );
 }
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
ch = *inbufptr++;
@@ -920,10 +917,6 @@ wcstombs_org(
 const char *default_string = XLC_PUBLIC(lcd, default_string);
 int defstr_len = strlen(default_string);
 
-
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
 wc = *inbufptr++;
@@ -1080,9 +1073,6 @@ wcstocts(
 int from_size = *from_left;
 char *ext_seg_len = NULL;
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
 wc = *inbufptr++;
@@ -1272,9 +1262,6 @@ ctstowcs(
 return( 0 );
 }
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
ch = *inbufptr++;
@@ -1666,9 +1653,6 @@ mbstostr(
 return( 0 );
 }
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
ch = *inbufptr++;
@@ -1956,10 +1940,6 @@ wcstostr(
 const char *default_string = XLC_PUBLIC(lcd, default_string);
 int defstr_len = strlen(default_string);
 
-
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
 wc = *inbufptr++;
@@ -2114,9 +2094,6 @@ wctocs(
 char *outbufptr = *to;
 int from_size = *from_left;
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 if (*from_left  *to_left) {
 
 wc = *inbufptr++;
@@ -2427,9 +2404,6 @@ strtombs(
 char *outbufptr = *to;
 int from_size = *from_left;
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
 ch = *inbufptr++;
@@ -2537,9 +2511,6 @@ strtowcs(
 wchar_t *outbufptr = (wchar_t *)*to;
 int from_size = *from_left;
 
-if (*from_left  *to_left)
-*from_left = *to_left;
-
 while (*from_left  *to_left) {
 
 ch = *inbufptr++;
-- 
1.8.2.3

___
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:libXxf86vm] Const fix.

2013-06-02 Thread Thomas Klausner
On Sun, Jun 02, 2013 at 04:32:13PM -0700, Alan Coopersmith wrote:
 On 06/ 2/13 01:13 PM, Thomas Klausner wrote:
 ---
   src/XF86VMode.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/XF86VMode.c b/src/XF86VMode.c
 index fb94816..5cd8020 100644
 --- a/src/XF86VMode.c
 +++ b/src/XF86VMode.c
 @@ -62,7 +62,7 @@ static inline void _XEatDataWords(Display *dpy, unsigned 
 long n)
 
   static XExtensionInfo _xf86vidmode_info_data;
   static XExtensionInfo *xf86vidmode_info = _xf86vidmode_info_data;
 -static const char *xf86vidmode_extension_name = XF86VIDMODENAME;
 +static char *xf86vidmode_extension_name = XF86VIDMODENAME;
 
   #define XF86VidModeCheckExtension(dpy,i,val) \
 XextCheckExtension (dpy, i, xf86vidmode_extension_name, val)
 
 
 NAK.

(this one and the others you NAKed):

I guess the problem is that the libXext code is still 1.2.0.

Ignore them for now, I'll get back to you with these if they are still
there with 1.3.2.

Sorry for the noise here,
 Thomas
___
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 2/2] Use __UNCONST to work around const problem.

2013-06-02 Thread Thomas Klausner
On Sun, Jun 02, 2013 at 04:35:51PM -0700, Alan Coopersmith wrote:
 On 06/ 2/13 12:30 PM, Thomas Klausner wrote:
 XXX: should probably be fixed differently.
 ---
   xrandr.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/xrandr.c b/xrandr.c
 index da786cb..0b285a3 100644
 --- a/xrandr.c
 +++ b/xrandr.c
 @@ -1524,7 +1524,7 @@ crtc_set_transform (crtc_t *crtc, transform_t 
 *transform)
   if (major  1 || (major == 1  minor = 3))
  XRRSetCrtcTransform (dpy, crtc-crtc.xid,
   transform-transform,
 - transform-filter,
 + __UNCONST(transform-filter),
   transform-params,
   transform-nparams);
   }
 
 
 Sorry, breaks the build since __UNCONST is not defined.

Yeah, needs the bits
#ifndef __UNCONST
#define __UNCONST(x) (x)
#endif
like the other patch.

Better would be if we wouldn't need the unconst cast though :)
 Thomas
___
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 2/2] Use __UNCONST to work around const problem.

2013-06-02 Thread Thomas Klausner
On Mon, Jun 03, 2013 at 01:37:31AM +0200, Thomas Klausner wrote:
 On Sun, Jun 02, 2013 at 04:35:51PM -0700, Alan Coopersmith wrote:
  On 06/ 2/13 12:30 PM, Thomas Klausner wrote:
  XXX: should probably be fixed differently.
  ---
xrandr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
  
  diff --git a/xrandr.c b/xrandr.c
  index da786cb..0b285a3 100644
  --- a/xrandr.c
  +++ b/xrandr.c
  @@ -1524,7 +1524,7 @@ crtc_set_transform (crtc_t *crtc, transform_t 
  *transform)
if (major  1 || (major == 1  minor = 3))
 XRRSetCrtcTransform (dpy, crtc-crtc.xid,
  transform-transform,
  -   transform-filter,
  +   __UNCONST(transform-filter),
  transform-params,
  transform-nparams);
}
  
  
  Sorry, breaks the build since __UNCONST is not defined.
 
 Yeah, needs the bits
 #ifndef __UNCONST
 #define __UNCONST(x) (x)
 #endif
 like the other patch.

Sorry about that. A bit more helpful answer: the __UNCONST(x) that
NetBSD uses is in /usr/include/sys/cdefs.h
   #define __UNCONST(a)   ((void *)(unsigned long)(const void *)(a))

Do you want a patch for the two __UNCONST uses that has that fallback
define (perhaps __XORG_UNCONST to avoid clashes), or is there a good
common place to put it?

 Better would be if we wouldn't need the unconst cast though :)

That's still true :)
 Thomas
___
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: [xinit] XSLASHGLOB

2013-05-31 Thread Thomas Klausner
Hi Alan  other X.Org developers!

Can you please take a look at this? No comments for two months, but no
commit either.

I've also asked about a patch I sent last August that had no feedback,
for xrdb.

I'm planning on sending more diffs soon but wanted to get the old
stuff committed first.

Thanks,
 Thomas

On Thu, Apr 04, 2013 at 02:59:34PM +0200, Thomas Klausner wrote:
 On Mon, Apr 01, 2013 at 10:18:10PM -0700, Alan Coopersmith wrote:
  On 07/12/12 04:57 AM, Thomas Klausner wrote:
   Hi!
   
   While looking at NetBSD xsrc patches I found one for xinit.
   
   Index: xinit/dist/xinitrc.cpp
   ===
   RCS file: /cvsroot/xsrc/external/mit/xinit/dist/xinitrc.cpp,v
   retrieving revision 1.1.1.3
   retrieving revision 1.2
   diff -u -r1.1.1.3 -r1.2
   --- xinit/dist/xinitrc.cpp  21 Nov 2010 03:47:48 -  1.1.1.3
   +++ xinit/dist/xinitrc.cpp  6 Mar 2011 01:05:51 -   1.2
   @@ -84,8 +84,9 @@
XCOMM This is the fallback case if nothing else is executed above
#endif /* !defined(__SCO__)   !defined(__UNIXWARE__) */
   
   +XCOMM do not use slash-star in the glob; slash-questionmark-star is 
   equivalent
if [ -d XINITDIR/xinitrc.d ] ; then
   -   for f in XINITDIR/xinitrc.dXSLASHGLOB.sh ; do
   +   for f in XINITDIR/xinitrc.d/?*.sh ; do
   [ -x $f ]  . $f
   done
   unset f
   
   The commit message was:
   Use xinitrc.d/?*.sh as the matching pattern instead of needing a
   fragile sed substitution XSLASHGLOB to produce xinitrc.d/*.sh. (If
   that were used literally the slash-star would confuse cpp.)
   
   Fixes PR 44619. Patch has been sent upstream.
   
   
   I don't know where it was sent or if the discussion had a result, so
   I'd like to know if the patch would be accepted? (with an additional
   patch removing it from cpprules.in as well).
  
  Seems reasonable to me - I don't remember discussing it before, and does
  seem cleaner than patching it up in sed.
 
 Thanks for the reply. I've just sent a git diff for cleaning this up.
  Thomas
___
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:xrdb] Add a command line flag -cppargs which allows passing arguments to cpp (while still complying with the access(2) check for the cpp executable).

2013-05-31 Thread Thomas Klausner
Any comments?
 Thomas

On Thu, Aug 23, 2012 at 04:48:10PM +0200, Thomas Klausner wrote:
 See thread starting at
 http://mail-index.netbsd.org/tech-x11/2009/12/01/msg000687.html
 ---
  man/xrdb.man |  4 
  xrdb.c   | 27 +++
  2 files changed, 27 insertions(+), 4 deletions(-)
 
 diff --git a/man/xrdb.man b/man/xrdb.man
 index e30b0d5..d024210 100644
 --- a/man/xrdb.man
 +++ b/man/xrdb.man
 @@ -217,6 +217,10 @@ Although
  was designed to use CPP, any program that acts as a filter
  and accepts the -D, -I, and -U options may be used.
  .TP 8
 +.B -cppargs \fIargs\fP
 +This option specifies the arguments to provide to the C preprocessor
 +program to be used.
 +.TP 8
  .B -nocpp
  This option indicates that
  .I xrdb
 diff --git a/xrdb.c b/xrdb.c
 index cf2758a..4447c56 100644
 --- a/xrdb.c
 +++ b/xrdb.c
 @@ -127,6 +127,10 @@ static char tmpname3[32];
  static int oper = OPLOAD;
  static char *editFile = NULL;
  static const char *cpp_program = NULL;
 +#ifndef CPP_ARGS
 +#define CPP_ARGS NULL
 +#endif
 +static const char *cpp_args = CPP_ARGS;
  static const char* const cpp_locations[] = { CPP };
  static char *backup_suffix = BACKUP_SUFFIX;
  static Bool dont_execute = False;
 @@ -729,6 +733,7 @@ Syntax (void)
 -screensdo screen-specific resources for all 
 screens\n
 -n  show but don't do changes\n
 -cpp filename   preprocessor to use [%s]\n
 +   -cppargs args   arguments for preprocessor\n
 -nocpp  do not use a preprocessor\n
 -query  query resources\n
 -load   load resources from file [default]\n
 @@ -886,6 +891,10 @@ main(int argc, char *argv[])
   if (++i = argc) Syntax ();
   cpp_program = argv[i];
   continue;
 + } else if (isabbreviation (-cppargs, arg, 2)) {
 + if (++i = argc) Syntax ();
 + cpp_args = argv[i];
 + continue;
   } else if (!strcmp (-n, arg)) {
   dont_execute = True;
   continue;
 @@ -1230,7 +1239,10 @@ Process(int scrno, Bool doScreen, Bool execute)
   fprintf(input, \n#include \%s\\n, filename);
   fclose(input);
   (void) mktemp(tmpname3);
 - if (asprintf(cmd, %s -P%s %s  %s, cpp_program, includes.val,
 + if (asprintf(cmd, %s%s%s -P%s %s  %s, cpp_program,
 +  cpp_args ?   : ,
 +  cpp_args ? cpp_args : ,
 +  includes.val,
tmpname2, tmpname3) == -1)
   fatal(%s: Out of memory\n, ProgramName);
   if (system(cmd)  0)
 @@ -1245,7 +1257,10 @@ Process(int scrno, Bool doScreen, Bool execute)
   fprintf(stdin, \n#include \%s\\n, filename);
   fflush(stdin);
   fseek(stdin, 0, 0);
 - if (asprintf(cmd, %s -P%s, cpp_program, includes.val) == -1)
 + if (asprintf(cmd, %s%s%s -P%s, cpp_program,
 +  cpp_args ?   : ,
 +  cpp_args ? cpp_args : ,
 +  includes.val) == -1)
   fatal(%s: Out of memory\n, ProgramName);
   if (!(input = popen(cmd, r)))
   fatal(%s: cannot run '%s'\n, ProgramName, cmd);
 @@ -1260,7 +1275,9 @@ Process(int scrno, Bool doScreen, Bool execute)
   if (cpp_program) {
  #ifdef WIN32
   (void) mktemp(tmpname3);
 - if (asprintf(cmd, %s -P%s %s %s  %s, cpp_program,
 + if (asprintf(cmd, %s%s%s -P%s %s %s  %s, cpp_program,
 +  cpp_args ?   : ,
 +  cpp_args ? cpp_args : ,
includes.val, defines.val,
filename ? filename : , tmpname3) == -1)
   fatal(%s: Out of memory\n, ProgramName);
 @@ -1270,7 +1287,9 @@ Process(int scrno, Bool doScreen, Bool execute)
   if (!(input = fopen(tmpname3, r)))
   fatal(%s: can't open file '%s'\n, ProgramName, tmpname3);
  #else
 - if (asprintf(cmd, %s -P%s %s %s, cpp_program,
 + if (asprintf(cmd, %s%s%s -P%s %s %s, cpp_program,
 +  cpp_args ?   : ,
 +  cpp_args ? cpp_args : ,
includes.val, defines.val,
filename ? filename : ) == -1)
   fatal(%s: Out of memory\n, ProgramName);
 -- 
 1.7.11.3
___
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


[w...@netbsd.org: [PATCH:xinit] Use xinitrc.d/?*.sh as the matching pattern instead of needing a fragile sed substitution XSLASHGLOB to produce xinitrc.d/*.sh. (If that were used literally the slash-s

2013-05-31 Thread Thomas Klausner
Hi Alan!

Here it is again, as requested. Hope the forward works fine.

Thanks for looking at this,
 Thomas

- Forwarded message from Thomas Klausner w...@netbsd.org -

Date: Thu,  4 Apr 2013 14:58:30 +0200
From: Thomas Klausner w...@netbsd.org
To: xorg-devel@lists.x.org, Alan Coopersmith alan.coopersm...@oracle.com
Cc: Thomas Klausner w...@netbsd.org
Subject: [PATCH:xinit] Use xinitrc.d/?*.sh as the matching pattern instead of 
needing a fragile sed substitution XSLASHGLOB to produce xinitrc.d/*.sh. (If 
that were used literally the slash-star would confuse
cpp.)
X-Mailer: git-send-email 1.8.1.5

---
 cpprules.in | 1 -
 xinitrc.cpp | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/cpprules.in b/cpprules.in
index 92a987d..eaea428 100644
--- a/cpprules.in
+++ b/cpprules.in
@@ -10,7 +10,6 @@ CPP_SED_MAGIC = $(SED) -e '/^\#  *[0-9][0-9]*  *.*$$/d' \
-e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \
-e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
-e '/^[ ]*XHASH/s/XHASH/\#/' \
-   -e '/XSLASHGLOB/s/XSLASHGLOB/\/\*/' \
-e '/\@\@$$/s/\@\@$$/\\/'
 
 SUFFIXES = .cpp
diff --git a/xinitrc.cpp b/xinitrc.cpp
index 049a8e4..81c238b 100644
--- a/xinitrc.cpp
+++ b/xinitrc.cpp
@@ -85,7 +85,7 @@ XCOMM This is the fallback case if nothing else is executed 
above
 #endif /* !defined(__SCO__)   !defined(__UNIXWARE__) */
 
 if [ -d XINITDIR/xinitrc.d ] ; then
-   for f in XINITDIR/xinitrc.dXSLASHGLOB.sh ; do
+   for f in XINITDIR/xinitrc.d/?*.sh ; do
[ -x $f ]  . $f
done
unset f
-- 
1.8.1.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


- End forwarded message -
___
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: [xinit] XSLASHGLOB

2013-04-04 Thread Thomas Klausner
On Mon, Apr 01, 2013 at 10:18:10PM -0700, Alan Coopersmith wrote:
 On 07/12/12 04:57 AM, Thomas Klausner wrote:
  Hi!
  
  While looking at NetBSD xsrc patches I found one for xinit.
  
  Index: xinit/dist/xinitrc.cpp
  ===
  RCS file: /cvsroot/xsrc/external/mit/xinit/dist/xinitrc.cpp,v
  retrieving revision 1.1.1.3
  retrieving revision 1.2
  diff -u -r1.1.1.3 -r1.2
  --- xinit/dist/xinitrc.cpp  21 Nov 2010 03:47:48 -  1.1.1.3
  +++ xinit/dist/xinitrc.cpp  6 Mar 2011 01:05:51 -   1.2
  @@ -84,8 +84,9 @@
   XCOMM This is the fallback case if nothing else is executed above
   #endif /* !defined(__SCO__)   !defined(__UNIXWARE__) */
  
  +XCOMM do not use slash-star in the glob; slash-questionmark-star is 
  equivalent
   if [ -d XINITDIR/xinitrc.d ] ; then
  -   for f in XINITDIR/xinitrc.dXSLASHGLOB.sh ; do
  +   for f in XINITDIR/xinitrc.d/?*.sh ; do
  [ -x $f ]  . $f
  done
  unset f
  
  The commit message was:
  Use xinitrc.d/?*.sh as the matching pattern instead of needing a
  fragile sed substitution XSLASHGLOB to produce xinitrc.d/*.sh. (If
  that were used literally the slash-star would confuse cpp.)
  
  Fixes PR 44619. Patch has been sent upstream.
  
  
  I don't know where it was sent or if the discussion had a result, so
  I'd like to know if the patch would be accepted? (with an additional
  patch removing it from cpprules.in as well).
 
 Seems reasonable to me - I don't remember discussing it before, and does
 seem cleaner than patching it up in sed.

Thanks for the reply. I've just sent a git diff for cleaning this up.
 Thomas
___
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:xinit] Use xinitrc.d/?*.sh as the matching pattern instead of needing a fragile sed substitution XSLASHGLOB to produce xinitrc.d/*.sh. (If that were used literally the slash-star would confuse

2013-04-04 Thread Thomas Klausner
---
 cpprules.in | 1 -
 xinitrc.cpp | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/cpprules.in b/cpprules.in
index 92a987d..eaea428 100644
--- a/cpprules.in
+++ b/cpprules.in
@@ -10,7 +10,6 @@ CPP_SED_MAGIC = $(SED) -e '/^\#  *[0-9][0-9]*  *.*$$/d' \
-e '/^[ ]*XCOMM$$/s/XCOMM/\#/' \
-e '/^[ ]*XCOMM[^a-zA-Z0-9_]/s/XCOMM/\#/' \
-e '/^[ ]*XHASH/s/XHASH/\#/' \
-   -e '/XSLASHGLOB/s/XSLASHGLOB/\/\*/' \
-e '/\@\@$$/s/\@\@$$/\\/'
 
 SUFFIXES = .cpp
diff --git a/xinitrc.cpp b/xinitrc.cpp
index 049a8e4..81c238b 100644
--- a/xinitrc.cpp
+++ b/xinitrc.cpp
@@ -85,7 +85,7 @@ XCOMM This is the fallback case if nothing else is executed 
above
 #endif /* !defined(__SCO__)   !defined(__UNIXWARE__) */
 
 if [ -d XINITDIR/xinitrc.d ] ; then
-   for f in XINITDIR/xinitrc.dXSLASHGLOB.sh ; do
+   for f in XINITDIR/xinitrc.d/?*.sh ; do
[ -x $f ]  . $f
done
unset f
-- 
1.8.1.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: fd passing for X

2013-01-23 Thread Thomas Klausner
On Sat, Oct 06, 2012 at 11:26:05AM -0700, Keith Packard wrote:
 Thomas Klausner t...@giga.or.at writes:
 
  On Fri, Oct 05, 2012 at 01:46:57PM -0700, Keith Packard wrote:
  I did a bunch of experiments with fd passing in Linux to see how it
  might work in X.
 
  Do you have a test program I could run on NetBSD to see if it works
  there as well?
 
 All of the tests I did are in a git repository that you can fetch from
 
 git://keithp.com/git/fdpassing

Ok, that was quite some time ago, sorry for that.
Here are the results when I run these on NetBSD-6.99.16/amd64:
# ./fdpassing 
passing fd 1
wrote 1
# received fd 3
read 1
hello, world

# ./lostfd 
passing fd 1
wrote 1 without fd
passing fd 2
wrote 1 with fd
# read 1
recvmsg: Invalid argument

# ./multiwrite 
not passing fd
wrote 1 without fd
passing fd 1
wrote 1 with fd
not passing fd
wrote 1 without fd
# read 1
received fd 3
read 2
hello, world

# ./xreq 
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
passing fd 1
passing fd 4
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
passing fd 1
passing fd 4
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
passing fd 1
passing fd 4
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
not passing fd
passing fd 1
passing fd 4
# got 256
got 32
recvmsg: Invalid argument

# ./zerowrite 
not passing fd
wrote 1 without fd
passing fd 1
wrote 0 with fd
not passing fd
wrote 1 without fd
# read 1
received fd 3
read 1
hello, world

I guess the recvmsg errors shouldn't happen?
 Thomas 


___
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: xscope: missing xtrans configure check

2012-10-23 Thread Thomas Klausner
On Fri, Oct 19, 2012 at 10:23:58PM -0700, Alan Coopersmith wrote:
 That looks like a bug - I saw it hang in the QueryFont call when I ran
 with the installed xscope 1.3.1 on my system, but running with the
 local build I have here (1.3.99.901 plus the three patches I mailed
 this week) let it proceed fine.   I wonder if it's related to the
 BIG-REQUESTS handling bug I fixed in the meantime, or the patch a
 bit earlier in git (but still post 1.3.1) from Peter Jeremy to fix
 a deadlock when the server or client blocks on write.

I tried the git version and it doesn't have this problem any longer.
Please make a release :)

Thanks,
 Thomas
___
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


xscope: missing xtrans configure check

2012-10-18 Thread Thomas Klausner
xscope configure doesn't check for xtrans, but the build fails if it's
not found, because one of its headers is included.

Patch needed?
 Thomas
___
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: xscope: missing xtrans configure check

2012-10-18 Thread Thomas Klausner
On Fri, Oct 19, 2012 at 08:45:50AM +1000, Peter Hutterer wrote:
 On Thu, Oct 18, 2012 at 11:46:00AM +0200, Thomas Klausner wrote:
  xscope configure doesn't check for xtrans, but the build fails if it's
  not found, because one of its headers is included.
  
  Patch needed?
 
 yes, if it fails to build, it needs the check

Hm, there already seems to be a check for it in the configure.ac to
turn off the xscope dependency, but it seems someone didn't consider
that when changing code.

I'm not comfortable changing that because I don't know enough about
the tool or xtrans, so perhaps someone familiar with xscope can try
building with xtrans disabled and fix the fallout?
 Thomas
___
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: xscope: missing xtrans configure check

2012-10-18 Thread Thomas Klausner
On Thu, Oct 18, 2012 at 10:35:26PM -0700, Alan Coopersmith wrote:
 I do see it doesn't build without xtrans now - is there some reason
 that's a useful way to build it?   Should we just make the xtrans
 requirement absolute?   It's not hard to fix, but since no one maintains
 the non-xtrans mode, we may go another 5 years after the next time it
 breaks before anyone notices.

Thanks for looking at it. I don't particularly need it, I just wanted
to report the build failure.

Actually, I built it with xtrans enabled and tried running an xterm
against it, but gave up after about 4-5 minutes where nothing
happened. (xterms without xscope start immediately.) Perhaps I was too
impatient.
 Thomas
___
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: fd passing for X

2012-10-06 Thread Thomas Klausner
On Fri, Oct 05, 2012 at 01:46:57PM -0700, Keith Packard wrote:
 I did a bunch of experiments with fd passing in Linux to see how it
 might work in X.

Do you have a test program I could run on NetBSD to see if it works there as 
well?
 Thomas
___
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: xcursor-themes - why no index.theme files?

2012-09-21 Thread Thomas Klausner
On Fri, Sep 21, 2012 at 11:38:44AM +0200, Alan Coopersmith wrote:
 On 09/20/12 10:45 PM, Thomas Klausner wrote:
 Subject basically says it, but: Why are no index.theme file installed
 for the cursor themes from xcursor-themes?
 
 Because no one submitted a patch to add them?
 
 It's hard to know why no one ever thought it was useful to do something,
 especially in a package as lightly maintained as xcursor-themes.

Ok, perhaps the intention of my question wasn't very clear.

I've tried using the themes, and didn't manage to. I did however
manage to use Oxygen_Black from kde, which comes with an index.theme.
I'm not sure if that's the relevant difference or something else, but
I wonder if the themes are even usable without those files.
 Thomas
___
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: xcursor-themes - why no index.theme files?

2012-09-21 Thread Thomas Klausner
On Fri, Sep 21, 2012 at 11:55:57AM +0200, Alan Coopersmith wrote:
 They work fine for me without the index.theme with libXcursor  in the
 GNOME 2.x Appearance preferences.   Perhaps something else has added a
 index.themes requirement without telling us?

Or perhaps I'm setting it up incorrectly.
# ls -l ~/.icons
total 0
lrwxrwxr-x  1 wiz  users  33 Sep 20 21:51 default - 
/usr/pkg/share/icons/Oxygen_Black
# ls -l .icons/default/
total 4
drwxr-xr-x  2 root  wheel  2048 Sep 18 08:06 cursors
-rw-r--r--  1 root  wheel87 Jun  1 15:20 index.theme

That's all I did (and a server restart) to get these cursors.
What do I need to do to get e.g. whiteglass?
 Thomas
___
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


xcursor-themes - why no index.theme files?

2012-09-20 Thread Thomas Klausner
Subject basically says it, but: Why are no index.theme file installed
for the cursor themes from xcursor-themes?
 Thomas
___
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: xwininfo: const in iconv

2012-08-25 Thread Thomas Klausner
On Fri, Aug 24, 2012 at 06:14:20PM -0700, Alan Coopersmith wrote:
 I think that's already taken care of via the AM_ICONV autoconf macro that
 checks for the constness of the pointer and sets ICONV_CONST appropriately,
 but we don't seem to have released a tarball with that fix (commit
 1410b0f0a9d50973) in yet.
 
 Do you still need your patch if you build from git master?   If not, we
 can easily roll a release since it looks like a number of commits happened
 after the last release, but none in a while, so it's hopefully somewhat
 stable.

With master, I don't see any warning about the iconv line.
Many other warnings though :)

xwininfo.c: In function ‘scale_init’:
xwininfo.c:327:27: warning: declaration of ‘screen’ shadows a global declaration
xwininfo.c:258:22: warning: shadowed declaration is here

These are the lines:
xwininfo.c:static xcb_screen_t *screen;
xwininfo.c:scale_init (xcb_screen_t *screen)

Patch attached.

xwininfo.c: In function ‘wm_size_hints_reply’:
xwininfo.c:707:40: warning: declaration of ‘dpy’ shadows a global declaration
xwininfo.c:257:26: warning: shadowed declaration is here
xwininfo.c:708:61: warning: declaration of ‘err’ shadows a global declaration
xwininfo.c:259:29: warning: shadowed declaration is here
xwininfo.c: In function ‘Display_Window_Id’:
xwininfo.c:845:3: warning: cast discards qualifiers from pointer target type
xwininfo.c: In function ‘wm_hints_reply’:
xwininfo.c:1611:35: warning: declaration of ‘dpy’ shadows a global declaration
xwininfo.c:257:26: warning: shadowed declaration is here
xwininfo.c:1612:51: warning: declaration of ‘err’ shadows a global declaration
xwininfo.c:259:29: warning: shadowed declaration is here
xwininfo.c: In function ‘get_net_wm_name’:
xwininfo.c:1781:36: warning: declaration of ‘dpy’ shadows a global declaration
xwininfo.c:257:26: warning: shadowed declaration is here
xwininfo.c: In function ‘get_friendly_name’:
xwininfo.c:1970:6: warning: array subscript has type ‘char’
xwininfo.c: In function ‘usage’:
xwininfo.c:282:1: warning: function might be possible candidate for attribute 
‘noreturn’
xwininfo.c: In function ‘print_utf8.clone.5’:
xwininfo.c:1830:19: warning: ‘codepoint’ may be used uninitialized in this 
function
xwininfo.c:1830:19: note: ‘codepoint’ was declared here

Should I try fixing the others as well?
 Thomas
diff --git a/xwininfo.c b/xwininfo.c
index f1126e6..5cfdba7 100644
--- a/xwininfo.c
+++ b/xwininfo.c
@@ -324,12 +324,12 @@ static int bp = 0, bmm = 0;
 static int english = 0, metric = 0;
 
 static void
-scale_init (xcb_screen_t *screen)
+scale_init (xcb_screen_t *scale_screen)
 {
-xp = screen-width_in_pixels;
-yp = screen-height_in_pixels;
-xmm = screen-width_in_millimeters;
-ymm = screen-height_in_millimeters;
+xp = scale_screen-width_in_pixels;
+yp = scale_screen-height_in_pixels;
+xmm = scale_screen-width_in_millimeters;
+ymm = scale_screen-height_in_millimeters;
 bp  = xp  + yp;
 bmm = xmm + ymm;
 }
___
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:xwininfo] Get rid of a number of warnings. Signed-off-by: Thomas Klausner w...@netbsd.org

2012-08-25 Thread Thomas Klausner
---
 xwininfo.c | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/xwininfo.c b/xwininfo.c
index f1126e6..a9f1e96 100644
--- a/xwininfo.c
+++ b/xwininfo.c
@@ -251,7 +251,7 @@ static Bool window_id_format_dec = False;
 static iconv_t iconv_from_utf8;
 #endif
 static const char *user_encoding;
-static void print_utf8 (const char *, char *, size_t, const char *);
+static void print_utf8 (const char *, const char *, size_t, const char *);
 static char *get_friendly_name (const char *, const char *);
 
 static xcb_connection_t *dpy;
@@ -324,12 +324,12 @@ static int bp = 0, bmm = 0;
 static int english = 0, metric = 0;
 
 static void
-scale_init (xcb_screen_t *screen)
+scale_init (xcb_screen_t *scale_screen)
 {
-xp = screen-width_in_pixels;
-yp = screen-height_in_pixels;
-xmm = screen-width_in_millimeters;
-ymm = screen-height_in_millimeters;
+xp = scale_screen-width_in_pixels;
+yp = scale_screen-height_in_pixels;
+xmm = scale_screen-width_in_millimeters;
+ymm = scale_screen-height_in_millimeters;
 bp  = xp  + yp;
 bmm = xmm + ymm;
 }
@@ -704,10 +704,10 @@ fetch_win_attributes (struct wininfo *w)
 
 #ifndef USE_XCB_ICCCM
 static Bool
-wm_size_hints_reply (xcb_connection_t *dpy, xcb_get_property_cookie_t cookie,
-wm_size_hints_t *hints_return, xcb_generic_error_t **err)
+wm_size_hints_reply (xcb_connection_t *wshr_dpy, xcb_get_property_cookie_t 
cookie,
+wm_size_hints_t *hints_return, xcb_generic_error_t 
**wshr_err)
 {
-xcb_get_property_reply_t *prop = xcb_get_property_reply (dpy, cookie, err);
+xcb_get_property_reply_t *prop = xcb_get_property_reply (wshr_dpy, cookie, 
wshr_err);
 int length;
 
 if (!prop || (prop-type != XCB_ATOM_WM_SIZE_HINTS) ||
@@ -842,7 +842,7 @@ Display_Window_Id (struct wininfo *w, Bool newline_wanted)
if (wm_name_encoding == XCB_ATOM_STRING) {
printf ( \%.*s\, wm_name_len, wm_name);
} else if (wm_name_encoding == atom_utf8_string) {
-   print_utf8 ( \, (char *) wm_name, wm_name_len,  \);
+   print_utf8 ( \, wm_name, wm_name_len,  \);
} else {
/* Encodings we don't support, including COMPOUND_TEXT */
const char *enc_name = Get_Atom_Name (dpy, wm_name_encoding);
@@ -1608,10 +1608,10 @@ static const binding _state_hints[] = {
 
 #ifndef USE_XCB_ICCCM
 static Bool
-wm_hints_reply (xcb_connection_t *dpy, xcb_get_property_cookie_t cookie,
-   wm_hints_t *hints_return, xcb_generic_error_t **err)
+wm_hints_reply (xcb_connection_t *whr_dpy, xcb_get_property_cookie_t cookie,
+   wm_hints_t *hints_return, xcb_generic_error_t **whr_err)
 {
-xcb_get_property_reply_t *prop = xcb_get_property_reply (dpy, cookie, err);
+xcb_get_property_reply_t *prop = xcb_get_property_reply (whr_dpy, cookie, 
whr_err);
 int length;
 
 if (!prop || (prop-type != XCB_ATOM_WM_HINTS) || (prop-format != 32)) {
@@ -1778,16 +1778,16 @@ wininfo_wipe (struct wininfo *w)
 
 /* Gets UTF-8 encoded EMWH property _NET_WM_NAME for a window */
 static xcb_get_property_cookie_t
-get_net_wm_name (xcb_connection_t *dpy, xcb_window_t win)
+get_net_wm_name (xcb_connection_t *gnwn_dpy, xcb_window_t win)
 {
 if (!atom_net_wm_name)
-   atom_net_wm_name = Get_Atom (dpy, _NET_WM_NAME);
+   atom_net_wm_name = Get_Atom (gnwn_dpy, _NET_WM_NAME);
 
 if (!atom_utf8_string)
-   atom_utf8_string = Get_Atom (dpy, UTF8_STRING);
+   atom_utf8_string = Get_Atom (gnwn_dpy, UTF8_STRING);
 
 if (atom_net_wm_name  atom_utf8_string)
-   return xcb_get_property (dpy, False, win, atom_net_wm_name,
+   return xcb_get_property (gnwn_dpy, False, win, atom_net_wm_name,
 atom_utf8_string, 0, BUFSIZ);
 else {
xcb_get_property_cookie_t dummy = { 0 };
@@ -1878,7 +1878,7 @@ is_valid_utf8 (const char *string, int len)
  * Length of the string is specified in bytes, or -1 for going until '\0'
  */
 static void
-print_utf8 (const char *prefix, char *u8str, size_t length, const char *suffix)
+print_utf8 (const char *prefix, const char *u8str, size_t length, const char 
*suffix)
 {
 size_t inlen = length;
 
@@ -1967,7 +1967,7 @@ get_friendly_name (const char *string, const char *prefix)
} else if (first) {
first = False;
} else {
-   *n = tolower(*n);
+   *n = tolower((unsigned char)*n);
}
 }
 
-- 
1.7.11.3

___
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: xwininfo: const in iconv

2012-08-25 Thread Thomas Klausner
On Sat, Aug 25, 2012 at 10:51:10AM -0700, Alan Coopersmith wrote:
  These are the lines:
  xwininfo.c:static xcb_screen_t *screen;
  xwininfo.c:scale_init (xcb_screen_t *screen)
  
  Patch attached.
 
 Looks good to me.
 
  xwininfo.c: In function ‘wm_size_hints_reply’:
  xwininfo.c:707:40: warning: declaration of ‘dpy’ shadows a global 
  declaration
  xwininfo.c:257:26: warning: shadowed declaration is here
  xwininfo.c:708:61: warning: declaration of ‘err’ shadows a global 
  declaration
  xwininfo.c:259:29: warning: shadowed declaration is here
  xwininfo.c: In function ‘Display_Window_Id’:
  xwininfo.c:845:3: warning: cast discards qualifiers from pointer target type
  xwininfo.c: In function ‘wm_hints_reply’:
  xwininfo.c:1611:35: warning: declaration of ‘dpy’ shadows a global 
  declaration
  xwininfo.c:257:26: warning: shadowed declaration is here
  xwininfo.c:1612:51: warning: declaration of ‘err’ shadows a global 
  declaration
  xwininfo.c:259:29: warning: shadowed declaration is here
  xwininfo.c: In function ‘get_net_wm_name’:
  xwininfo.c:1781:36: warning: declaration of ‘dpy’ shadows a global 
  declaration
  xwininfo.c:257:26: warning: shadowed declaration is here
  xwininfo.c: In function ‘get_friendly_name’:
  xwininfo.c:1970:6: warning: array subscript has type ‘char’
  xwininfo.c: In function ‘usage’:
  xwininfo.c:282:1: warning: function might be possible candidate for 
  attribute ‘noreturn’
  xwininfo.c: In function ‘print_utf8.clone.5’:
  xwininfo.c:1830:19: warning: ‘codepoint’ may be used uninitialized in this 
  function
  xwininfo.c:1830:19: note: ‘codepoint’ was declared here
  
  Should I try fixing the others as well?
 
 If you'd like to, please go ahead.   We've got a lot of noise in our builds
 still that we'd like to clean up to help root out the bugs hiding in them.

I've just sent a patch to the mailing list which fixes all but two of them.
xwininfo.c: In function ‘usage’:
xwininfo.c:282:1: warning: function might be possible candidate for attribute 
‘noreturn’

I'm not sure how to portably specify this attribute.

xwininfo.c: In function ‘print_utf8.clone.5’:
xwininfo.c:1830:19: warning: ‘codepoint’ may be used uninitialized in this 
function
xwininfo.c:1830:19: note: ‘codepoint’ was declared here

I haven't tracked down why gcc-4.5.2 believes this.
 Thomas
___
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: New keyboard config files for some Sharp hardware

2012-08-25 Thread Thomas Klausner
On Thu, Aug 23, 2012 at 08:05:44AM -0700, Alan Coopersmith wrote:
 On 08/23/12 08:00 AM, Thomas Klausner wrote:
  Keyboard config files for 5 Sharp machines, from Nonaka Kimihiro 
  non...@netbsd.org.
 
 xkeyboard-config has it's own mailing list for patch submission:
 http://www.freedesktop.org/wiki/Software/XKeyboardConfig/Development

Thanks for the hint.  I filed a bug report in bugzilla, as the homepage 
requests:
https://bugs.freedesktop.org/show_bug.cgi?id=54065
 Thomas
___
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:xwininfo 2/2] Mark usage() as not returning.

2012-08-25 Thread Thomas Klausner
Signed-off-by: Thomas Klausner w...@netbsd.org
---
 xwininfo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xwininfo.c b/xwininfo.c
index a9f1e96..34d7702 100644
--- a/xwininfo.c
+++ b/xwininfo.c
@@ -278,6 +278,7 @@ static size_t strlcat (char *dst, const char *src, size_t 
dstsize)
 /*
  * Report the syntax for calling xwininfo:
  */
+_X_NORETURN
 static void
 usage (void)
 {
-- 
1.7.11.3

___
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: xwininfo: const in iconv

2012-08-25 Thread Thomas Klausner
On Sat, Aug 25, 2012 at 04:29:48PM -0700, Alan Coopersmith wrote:
 On 08/25/12 03:11 PM, Thomas Klausner wrote:
  I've just sent a patch to the mailing list which fixes all but two of them.
  xwininfo.c: In function ‘usage’:
  xwininfo.c:282:1: warning: function might be possible candidate for 
  attribute ‘noreturn’
  
  I'm not sure how to portably specify this attribute.
 
 We have a macro for that in Xfuncproto.h, so you can use that, as Jeremy just
 did for this one:
 
 http://cgit.freedesktop.org/xorg/app/xwininfo/commit/?id=fa40ecdfb5cd068ba531b4439df5bbf660469d3a
 
 You can see the other attribute macros available in:
 http://cgit.freedesktop.org/xorg/proto/x11proto/tree/Xfuncproto.h.in#n84

Thank you, that's helpful. I've just sent another patch which adds
this to xwininfo.

I noticed that even after pulling your merge of my first patch, when
'git format-patch' wants to send both patches (the one you merged and
the new one). What's the proper procedure to make git forget my
first patch, or learn that it was already merged?
 Thomas
___
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:xrdb] Add a command line flag -cppargs which allows passing arguments to cpp (while still complying with the access(2) check for the cpp executable).

2012-08-23 Thread Thomas Klausner
See thread starting at
http://mail-index.netbsd.org/tech-x11/2009/12/01/msg000687.html
---
 man/xrdb.man |  4 
 xrdb.c   | 27 +++
 2 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/man/xrdb.man b/man/xrdb.man
index e30b0d5..d024210 100644
--- a/man/xrdb.man
+++ b/man/xrdb.man
@@ -217,6 +217,10 @@ Although
 was designed to use CPP, any program that acts as a filter
 and accepts the -D, -I, and -U options may be used.
 .TP 8
+.B -cppargs \fIargs\fP
+This option specifies the arguments to provide to the C preprocessor
+program to be used.
+.TP 8
 .B -nocpp
 This option indicates that
 .I xrdb
diff --git a/xrdb.c b/xrdb.c
index cf2758a..4447c56 100644
--- a/xrdb.c
+++ b/xrdb.c
@@ -127,6 +127,10 @@ static char tmpname3[32];
 static int oper = OPLOAD;
 static char *editFile = NULL;
 static const char *cpp_program = NULL;
+#ifndef CPP_ARGS
+#define CPP_ARGS   NULL
+#endif
+static const char *cpp_args = CPP_ARGS;
 static const char* const cpp_locations[] = { CPP };
 static char *backup_suffix = BACKUP_SUFFIX;
 static Bool dont_execute = False;
@@ -729,6 +733,7 @@ Syntax (void)
  -screensdo screen-specific resources for all 
screens\n
  -n  show but don't do changes\n
  -cpp filename   preprocessor to use [%s]\n
+ -cppargs args   arguments for preprocessor\n
  -nocpp  do not use a preprocessor\n
  -query  query resources\n
  -load   load resources from file [default]\n
@@ -886,6 +891,10 @@ main(int argc, char *argv[])
if (++i = argc) Syntax ();
cpp_program = argv[i];
continue;
+   } else if (isabbreviation (-cppargs, arg, 2)) {
+   if (++i = argc) Syntax ();
+   cpp_args = argv[i];
+   continue;
} else if (!strcmp (-n, arg)) {
dont_execute = True;
continue;
@@ -1230,7 +1239,10 @@ Process(int scrno, Bool doScreen, Bool execute)
fprintf(input, \n#include \%s\\n, filename);
fclose(input);
(void) mktemp(tmpname3);
-   if (asprintf(cmd, %s -P%s %s  %s, cpp_program, includes.val,
+   if (asprintf(cmd, %s%s%s -P%s %s  %s, cpp_program,
+cpp_args ?   : ,
+cpp_args ? cpp_args : ,
+includes.val,
 tmpname2, tmpname3) == -1)
fatal(%s: Out of memory\n, ProgramName);
if (system(cmd)  0)
@@ -1245,7 +1257,10 @@ Process(int scrno, Bool doScreen, Bool execute)
fprintf(stdin, \n#include \%s\\n, filename);
fflush(stdin);
fseek(stdin, 0, 0);
-   if (asprintf(cmd, %s -P%s, cpp_program, includes.val) == -1)
+   if (asprintf(cmd, %s%s%s -P%s, cpp_program,
+cpp_args ?   : ,
+cpp_args ? cpp_args : ,
+includes.val) == -1)
fatal(%s: Out of memory\n, ProgramName);
if (!(input = popen(cmd, r)))
fatal(%s: cannot run '%s'\n, ProgramName, cmd);
@@ -1260,7 +1275,9 @@ Process(int scrno, Bool doScreen, Bool execute)
if (cpp_program) {
 #ifdef WIN32
(void) mktemp(tmpname3);
-   if (asprintf(cmd, %s -P%s %s %s  %s, cpp_program,
+   if (asprintf(cmd, %s%s%s -P%s %s %s  %s, cpp_program,
+cpp_args ?   : ,
+cpp_args ? cpp_args : ,
 includes.val, defines.val,
 filename ? filename : , tmpname3) == -1)
fatal(%s: Out of memory\n, ProgramName);
@@ -1270,7 +1287,9 @@ Process(int scrno, Bool doScreen, Bool execute)
if (!(input = fopen(tmpname3, r)))
fatal(%s: can't open file '%s'\n, ProgramName, tmpname3);
 #else
-   if (asprintf(cmd, %s -P%s %s %s, cpp_program,
+   if (asprintf(cmd, %s%s%s -P%s %s %s, cpp_program,
+cpp_args ?   : ,
+cpp_args ? cpp_args : ,
 includes.val, defines.val,
 filename ? filename : ) == -1)
fatal(%s: Out of memory\n, ProgramName);
-- 
1.7.11.3

___
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


New keyboard config files for some Sharp hardware

2012-08-23 Thread Thomas Klausner
Keyboard config files for 5 Sharp machines, from Nonaka Kimihiro 
non...@netbsd.org.
___
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:xkeyboard-config 1/4] Added keyboard config files for Sharp Zaurus SL-C3x00.

2012-08-23 Thread Thomas Klausner
From: Nonaka Kimihiro non...@netbsd.org

---
 symbols/sharp_vndr/sl-c3x00 | 74 +
 1 file changed, 74 insertions(+)
 create mode 100644 symbols/sharp_vndr/sl-c3x00

diff --git a/symbols/sharp_vndr/sl-c3x00 b/symbols/sharp_vndr/sl-c3x00
new file mode 100644
index 000..d1dca0c
--- /dev/null
+++ b/symbols/sharp_vndr/sl-c3x00
@@ -0,0 +1,74 @@
+// $NetBSD: sl-c3x00,v 1.1 2009/12/13 04:54:51 nonaka Exp $
+// $OpenBSD: zaurus,v 1.2 2008/03/05 17:24:55 matthieu Exp $
+
+partial default alphanumeric_keys
+xkb_symbols basic {
+   name[Group1]= Sharp SL-C3x00;
+
+   // Upper row
+   key AE01 { [ 1, exclam ] };
+   key AE02 { [ 2, quotedbl ] };
+   key AE03 { [ 3, numbersign ] };
+   key AE04 { [ 4, dollar ] };
+   key AE05 { [ 5, percent ] };
+   key AE06 { [ 6, ampersand ] };
+   key AE07 { [ 7, quoteright ] };
+   key AE08 { [ 8, parenleft ] };
+   key AE09 { [ 9, parenright ] };
+   key AE10 { [ 0, asciitilde ] };
+   key BKSP { type=CTRL+ALT,
+   symbols[Group1]= [ BackSpace, Terminate_Server ] };
+
+   key AD01 { [ q, Q ] };
+   key AD02 { [ w, W, asciicircum ] };
+   key AD03 { [ e, E, equal ] };
+   key AD04 { [ r, R, plus ] };
+   key AD05 { [ t, T, bracketleft ] };
+   key AD06 { [ y, Y, bracketright ] };
+   key AD07 { [ u, U, braceleft ] };
+   key AD08 { [ i, I, braceright ] };
+   key AD09 { [ o, O ] };
+   key AD10 { [ p, P ] };
+   
+   key TAB { [ Tab, ISO_Left_Tab, Caps_Lock ] };
+
+   key AC01 { [ a, A ] };
+   key AC02 { [ s, S ] };
+   key AC03 { [ d, D, quoteleft ] };
+   key AC04 { [ f, F, backslash ] };
+   key AC05 { [ g, G, semicolon ] };
+   key AC06 { [ h, H, colon ] };
+   key AC07 { [ j, J, asterisk ] };
+   key AC08 { [ k, K, yen ] };
+   key AC09 { [ l, L, bar ] };
+
+   key LFSH { [ Shift_L ] };
+   key AB01 { [ z, Z ] };
+   key AB02 { [ x, X, SunCut ] };
+   key AB03 { [ c, C, SunCopy ] };
+   key AB04 { [ v, V, SunPaste ] };
+   key AB05 { [ b, B, underscore ] };
+   key AB06 { [ n, N ] };
+   key AB07 { [ m, M ] };
+   key RTSH { [ Shift_R ] };
+   key RTRN { [ Return ] };
+   
+   key RALT { [ ISO_Level3_Shift ] };
+
+   key LCTL { [ Control_L ] };
+   key AE11 { [ minus, minus, at ] };
+   key SPCE { [ space ] };
+   key AB08 { [ comma, slash, less ] };
+   key AB09 { [ period, question, greater ] };
+   // End alphanumeric section
+   
+   // keypad
+   key UP { [ Up, Up, Prior ] };
+   key LEFT { [ Left, Left, Home ] };
+   key DOWN { [ Down, Down, Next ] };
+   key RGHT { [ Right, Right, End ] };
+
+   key ESC { [ Escape ] };
+
+   include level3(ralt_switch)
+};
-- 
1.7.11.3

___
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:xkeyboard-config 3/4] Added keyboard config files for Sharp WS011SH/WS020SH.

2012-08-23 Thread Thomas Klausner
From: Nonaka Kimihiro non...@netbsd.org

---
 symbols/sharp_vndr/ws011sh | 78 ++
 symbols/sharp_vndr/ws020sh | 67 +++
 2 files changed, 145 insertions(+)
 create mode 100644 symbols/sharp_vndr/ws011sh
 create mode 100644 symbols/sharp_vndr/ws020sh

diff --git a/symbols/sharp_vndr/ws011sh b/symbols/sharp_vndr/ws011sh
new file mode 100644
index 000..45976df
--- /dev/null
+++ b/symbols/sharp_vndr/ws011sh
@@ -0,0 +1,78 @@
+// $NetBSD: ws011sh,v 1.2 2010/05/30 10:10:20 nonaka Exp $
+
+partial default alphanumeric_keys
+xkb_symbols basic {
+   name[Group1]= Sharp WS011SH;
+
+   // Upper row
+   key HZTG {
+   type[Group1] = THREE_LEVEL,
+   symbols[Group1] = [ Zenkaku_Hankaku, Zenkaku_Hankaku, exclam ]
+   };
+
+   key AD01 { [ q, Q, quotedbl ] };
+   key AD02 { [ w, W, numbersign ] };
+   key AD03 { [ e, E, dollar ] };
+   key AD04 { [ r, R, percent ] };
+   key AD05 { [ t, T, ampersand ] };
+   key AD06 { [ y, Y, 1 ] };
+   key AD07 { [ u, U, 2 ] };
+   key AD08 { [ i, I, 3 ] };
+   key AD09 { [ o, O, underscore ] };
+   key AD10 { [ p, P, at ] };
+   key BKSP { [ BackSpace, BackSpace, Delete ] };
+   
+   key TAB { [ Tab, Tab, Escape ] };
+   key AC01 { [ a, A, bracketleft ] };
+   key AC02 { [ s, S, apostrophe ] };
+   key AC03 { [ d, D, parenleft ] };
+   key AC04 { [ f, F, parenright ] };
+   key AC05 { [ g, G, asterisk ] };
+   key AC06 { [ h, H, 4 ] };
+   key AC07 { [ j, J, 5 ] };
+   key AC08 { [ k, K, 6 ] };
+   key AC09 { [ l, L, plus ] };
+   key AE11 { [ minus, equal, backslash ] };
+   key AE02 { [ grave, braceleft, braceright ] };
+
+   key LFSH { [ Shift_L ] };
+   key AB01 { [ z, Z, bracketright ] };
+   key AB02 { [ x, X, asciicircum ] };
+   key AB03 { [ c, C, asciitilde ] };
+   key AB04 { [ v, V, bar ] };
+   key AB05 { [ b, B, 7 ] };
+   key AB06 { [ n, N, 8 ] };
+   key AB07 { [ m, M, 9 ] };
+   key AB08 { [ comma, less, semicolon ] };
+   key AB09 { [ period, greater, colon ] };
+   key AB10 { [ slash, question, 0 ] };
+   key RTSH { [ Shift_R ] };
+   key RTRN { [ Return ] };
+
+   key RALT { [ ISO_Level3_Shift ] };
+
+   key LCTL { [ Control_L ] };
+   key SPCE { [ space ] };
+   // End alphanumeric section
+   
+   key UP { [ Up, Up, Prior ] };
+   key LEFT { [ Left, Left, Home ] };
+   key DOWN { [ Down, Down, Next ] };
+   key RGHT { [ Right, Right, End ] };
+
+   key ESC { [ Escape ] };
+
+   // keypad
+   key KP1 { [ 1 ] };
+   key KP2 { [ 2 ] };
+   key KP3 { [ 3 ] };
+   key KP4 { [ 4 ] };
+   key KP5 { [ 5 ] };
+   key KP6 { [ 6 ] };
+   key KP7 { [ 7 ] };
+   key KP8 { [ 8 ] };
+   key KP9 { [ 9 ] };
+   key KP0 { [ 0 ] };
+
+   include level3(ralt_switch)
+};
diff --git a/symbols/sharp_vndr/ws020sh b/symbols/sharp_vndr/ws020sh
new file mode 100644
index 000..5231e14
--- /dev/null
+++ b/symbols/sharp_vndr/ws020sh
@@ -0,0 +1,67 @@
+// $NetBSD: ws020sh,v 1.1 2010/05/25 13:12:51 nonaka Exp $
+
+partial default alphanumeric_keys
+xkb_symbols basic {
+   name[Group1]= Sharp WS020SH;
+
+   // Upper row
+   key HZTG {
+   type[Group1]=THREE_LEVEL,
+   symbols[Group1]= [ Zenkaku_Hankaku, Zenkaku_Hankaku, exclam ]
+   };
+
+   key AD01 { [ q, Q, quotedbl ] };
+   key AD02 { [ w, W, numbersign ] };
+   key AD03 { [ e, E, dollar ] };
+   key AD04 { [ r, R, percent ] };
+   key AD05 { [ t, T, ampersand ] };
+   key AD06 { [ y, Y, underscore ] };
+   key AD07 { [ u, U, 1 ] };
+   key AD08 { [ i, I, 2 ] };
+   key AD09 { [ o, O, 3 ] };
+   key AD10 { [ p, P, at ] };
+   key BKSP { [ BackSpace, BackSpace, Delete ] };
+   
+   key TAB { [ Tab, Tab, Escape ] };
+   key AC01 { [ a, A, bracketleft ] };
+   key AC02 { [ s, S, apostrophe ] };
+   key AC03 { [ d, D, parenleft ] };
+   key AC04 { [ f, F, parenright ] };
+   key AC05 { [ g, G, asterisk ] };
+   key AC06 { [ h, H, 4 ] };
+   key AC07 { [ j, J, 5 ] };
+   key AC08 { [ k, K, 6 ] };
+   key AC09 { [ l, L, plus ] };
+   key AE11 { [ minus, equal, backslash ] };
+   key AE02 { [ grave, braceleft, braceright ] };
+
+   key LFSH { [ Shift_L ] };
+   key AB01 { [ z, Z, bracketright ] };
+   key AB02 { [ x, X, asciicircum ] };
+   key AB03 { [ c, C, asciitilde ] };
+   key AB04 { [ v, V, bar ] };
+   key AB05 { [ b, B, 7 ] };
+   key AB06 { [ n, N, 8 ] };
+   key AB07 { [ m, M, 9 ] };
+   key AB08 { [ comma, less, semicolon ] };
+   key AB09 { [ period, greater, colon ] };
+   key AB10 { [ slash, question, 0 ] };
+   key RTSH { [ Shift_R ] };
+   key RTRN { [ Return ] };
+
+   key RALT { [ 

[PATCH:xkeyboard-config 2/4] Added keyboard config files for Sharp WS003SH/WS007SH.

2012-08-23 Thread Thomas Klausner
From: Nonaka Kimihiro non...@netbsd.org

---
 symbols/sharp_vndr/ws003sh | 73 ++
 symbols/sharp_vndr/ws007sh | 73 ++
 2 files changed, 146 insertions(+)
 create mode 100644 symbols/sharp_vndr/ws003sh
 create mode 100644 symbols/sharp_vndr/ws007sh

diff --git a/symbols/sharp_vndr/ws003sh b/symbols/sharp_vndr/ws003sh
new file mode 100644
index 000..7c3d98f
--- /dev/null
+++ b/symbols/sharp_vndr/ws003sh
@@ -0,0 +1,73 @@
+// $NetBSD: ws003sh,v 1.1 2010/05/15 15:33:30 nonaka Exp $
+
+partial default alphanumeric_keys
+xkb_symbols basic {
+   name[Group1]= Sharp WS003SH;
+
+   // Upper row
+   key AE01 { [ 1, exclam ] };
+   key AE02 { [ 2, quotedbl ] };
+   key AE03 { [ 3, numbersign ] };
+   key AE04 { [ 4, dollar ] };
+   key AE05 { [ 5, percent ] };
+   key AE06 { [ 6, ampersand ] };
+   key AE07 { [ 7, quoteright, quoteleft ] };
+   key AE08 { [ 8, parenleft, braceleft ] };
+   key AE09 { [ 9, parenright, braceright ] };
+   key AE10 { [ 0 ] };
+   key AE11 { [ minus, equal, backslash ] };
+   key BKSP { [ BackSpace, BackSpace, Delete ] };
+
+   key AD01 { [ q, Q ] };
+   key AD02 { [ w, W, asciicircum ] };
+   key AD03 { [ e, E, asciitilde ] };
+   key AD04 { [ r, R, bar ] };
+   key AD05 { [ t, T ] };
+   key AD06 { [ y, Y ] };
+   key AD07 { [ u, U, bracketleft ] };
+   key AD08 { [ i, I, bracketright ] };
+   key AD09 { [ o, O, underscore ] };
+   key AD10 { [ p, P, at ] };
+   
+   key TAB { [ Tab, Tab, Escape ] };
+
+   key AC01 { [ a, A ] };
+   key AC02 { [ s, S ] };
+   key AC03 { [ d, D ] };
+   key AC04 { [ f, F ] };
+   key AC05 { [ g, G ] };
+   key AC06 { [ h, H ] };
+   key AC07 { [ j, J ] };
+   key AC08 { [ k, K, plus ] };
+   key AC09 { [ l, L, asterisk ] };
+
+   key LFSH { [ Shift_L ] };
+   key AB01 { [ z, Z ] };
+   key AB02 { [ x, X ] };
+   key AB03 { [ c, C ] };
+   key AB04 { [ v, V ] };
+   key AB05 { [ b, B ] };
+   key AB06 { [ n, N ] };
+   key AB07 { [ m, M ] };
+   key AB08 { [ comma, semicolon, less ] };
+   key AB09 { [ period, colon, greater ] };
+   key AB10 { [ slash, question ] };
+   key RTSH { [ Shift_R ] };
+   key RTRN { [ Return ] };
+
+   key RALT { [ ISO_Level3_Shift ] };
+
+   key LCTL { [ Control_L ] };
+   key SPCE { [ space ] };
+   // End alphanumeric section
+   
+   // keypad
+   key UP { [ Up, Up, Prior ] };
+   key LEFT { [ Left, Left, Home ] };
+   key DOWN { [ Down, Down, Next ] };
+   key RGHT { [ Right, Right, End ] };
+
+   key ESC { [ Escape ] };
+
+   include level3(ralt_switch)
+};
diff --git a/symbols/sharp_vndr/ws007sh b/symbols/sharp_vndr/ws007sh
new file mode 100644
index 000..d287eb5
--- /dev/null
+++ b/symbols/sharp_vndr/ws007sh
@@ -0,0 +1,73 @@
+// $NetBSD: ws007sh,v 1.1 2010/05/15 15:33:30 nonaka Exp $
+
+partial default alphanumeric_keys
+xkb_symbols basic {
+   name[Group1]= Sharp WS007SH;
+
+   // Upper row
+   key AE01 { [ 1, exclam ] };
+   key AE02 { [ 2, quotedbl ] };
+   key AE03 { [ 3, numbersign ] };
+   key AE04 { [ 4, dollar ] };
+   key AE05 { [ 5, percent ] };
+   key AE06 { [ 6, ampersand ] };
+   key AE07 { [ 7, quoteright, quoteleft ] };
+   key AE08 { [ 8, parenleft, braceleft ] };
+   key AE09 { [ 9, parenright, braceright ] };
+   key AE10 { [ 0 ] };
+   key AE11 { [ minus, equal, backslash ] };
+   key BKSP { [ BackSpace, BackSpace, Delete ] };
+
+   key AD01 { [ q, Q ] };
+   key AD02 { [ w, W, asciicircum ] };
+   key AD03 { [ e, E, asciitilde ] };
+   key AD04 { [ r, R, bar ] };
+   key AD05 { [ t, T ] };
+   key AD06 { [ y, Y ] };
+   key AD07 { [ u, U, bracketleft ] };
+   key AD08 { [ i, I, bracketright ] };
+   key AD09 { [ o, O, underscore ] };
+   key AD10 { [ p, P, at ] };
+   
+   key TAB { [ Tab, Tab, Escape ] };
+
+   key AC01 { [ a, A ] };
+   key AC02 { [ s, S ] };
+   key AC03 { [ d, D ] };
+   key AC04 { [ f, F ] };
+   key AC05 { [ g, G ] };
+   key AC06 { [ h, H ] };
+   key AC07 { [ j, J ] };
+   key AC08 { [ k, K, plus ] };
+   key AC09 { [ l, L, asterisk ] };
+
+   key LFSH { [ Shift_L ] };
+   key AB01 { [ z, Z ] };
+   key AB02 { [ x, X ] };
+   key AB03 { [ c, C ] };
+   key AB04 { [ v, V ] };
+   key AB05 { [ b, B ] };
+   key AB06 { [ n, N ] };
+   key AB07 { [ m, M ] };
+   key AB08 { [ comma, semicolon, less ] };
+   key AB09 { [ period, colon, greater ] };
+   key AB10 { [ slash, question ] };
+   key RTSH { [ Shift_R ] };
+   key RTRN { [ Return ] };
+
+   key RALT { [ ISO_Level3_Shift ] };
+
+   key LCTL { [ Control_L ] };
+   key SPCE { [ space ] };
+ 

[PATCH:xkeyboard-config 4/4] Hook new Sharp keyboard config files into the build.

2012-08-23 Thread Thomas Klausner
From: Nonaka Kimihiro non...@netbsd.org

---
 configure.in   | 1 +
 rules/base.ml_s.part   | 5 +
 symbols/sharp_vndr/Makefile.am | 8 
 3 files changed, 14 insertions(+)
 create mode 100644 symbols/sharp_vndr/Makefile.am

diff --git a/configure.in b/configure.in
index 83e25b9..200ad3f 100644
--- a/configure.in
+++ b/configure.in
@@ -102,6 +102,7 @@ symbols/macintosh_vndr/Makefile
 symbols/nec_vndr/Makefile
 symbols/nokia_vndr/Makefile
 symbols/sgi_vndr/Makefile
+symbols/sharp_vndr/Makefile
 symbols/sony_vndr/Makefile
 symbols/sun_vndr/Makefile
 symbols/xfree68_vndr/Makefile
diff --git a/rules/base.ml_s.part b/rules/base.ml_s.part
index 5d3b46d..7e01486 100644
--- a/rules/base.ml_s.part
+++ b/rules/base.ml_s.part
@@ -36,6 +36,11 @@
   olpc $olpclayouts=   olpc+%l%(m)
   olpc *   =   olpc+%l%(v)
  $thinkpadsbr  =   pc+br(thinkpad)
+  sl-c3x00 *   =   pc+sharp_vndr/sl-c3x00(basic)
+  ws003sh  *   =   pc+sharp_vndr/ws003sh(basic)
+  ws007sh  *   =   pc+sharp_vndr/ws007sh(basic)
+  ws011sh  *   =   pc+sharp_vndr/ws011sh(basic)
+  ws020sh  *   =   pc+sharp_vndr/ws020sh(basic)
   htcdream $htcdreamlayouts=   %l(htcdream)
   *$nonlatin   =   pc+us+%l%(v):2
   **   =   pc+%l%(v)
diff --git a/symbols/sharp_vndr/Makefile.am b/symbols/sharp_vndr/Makefile.am
new file mode 100644
index 000..5b2d4aa
--- /dev/null
+++ b/symbols/sharp_vndr/Makefile.am
@@ -0,0 +1,8 @@
+symbolsdir = $(xkb_base)/symbols/sharp_vndr
+
+dist_symbols_DATA = \
+sl-c3x00 \
+ws003sh \
+ws007sh \
+ws011sh \
+ws020sh
-- 
1.7.11.3

___
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


xwininfo: const in iconv

2012-08-23 Thread Thomas Klausner
When compiling xwininfo on NetBSD, I get:
xwininfo.c:1912:6: warning: passing argument 2 of 'iconv' from incompatible 
pointer type
/usr/include/iconv.h:46:8: note: expected 'const char ** restrict' but argument 
is of type 'char **'

In NetBSD's xsrc we use the attached patch to fix this.

I think that the argument is const on NetBSD and Solaris and not-const
on Linux (and perhaps other systems).

Suggestions how to fix this, or is it just not worth the effort?
 Thomas
Index: xwininfo/dist/xwininfo.c
===
RCS file: /cvsroot/xsrc/external/mit/xwininfo/dist/xwininfo.c,v
retrieving revision 1.1.1.5
retrieving revision 1.3
diff -u -r1.1.1.5 -r1.3
--- xwininfo/dist/xwininfo.c23 Jul 2011 05:56:36 -  1.1.1.5
+++ xwininfo/dist/xwininfo.c23 Jul 2011 06:02:16 -  1.3
@@ -1909,7 +1909,7 @@
char *outp = convbuf;
size_t outlen = sizeof(convbuf);
 
-   convres = iconv (iconv_from_utf8, inp, inlen, outp, outlen);
+   convres = iconv (iconv_from_utf8, (const char **)inp, inlen, 
outp, outlen);
 
if ((convres == -1)  (errno == E2BIG)) {
done = False;
___
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

Fix build on NetBSD-5

2012-08-13 Thread Thomas Klausner
Fix compilation on systems that don't provide O_CLOEXEC.
I wonder if it will work as intended, or if more is needed.
___
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: NetBSD patches: how to move forward

2012-07-31 Thread Thomas Klausner
On Mon, Jul 30, 2012 at 03:50:39PM -0700, Alan Coopersmith wrote:
 Even during non-holiday seasons, patience is advisable for patches
 outside the well-maintained areas (Xserver, active drivers).
 There's only a few of us who go through the rest so we try not to
 let stuff slip through, even if we don't get to it right away.

Ok. Sorry for being impatient.

  Should I keep sending patches in the meantime? (Lots more to come.)
 
 Sure.   Though after enough of them (where enough is vaguely defined)
 we may just ask you to get commit access to push them yourself.

Ok. I have commit access to other freedesktop hosted projects already,
so that shouldn't be too hard to set up, when we get there.
 Thomas
___
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


NetBSD patches: how to move forward

2012-07-27 Thread Thomas Klausner
Hi!

No comments and no commits for my patches in the last week.

Is there a procedure I should follow so these don't get dropped, or
should I just be more patient because it's holiday season? :)

Should I keep sending patches in the meantime? (Lots more to come.)

Thanks,
 Thomas
___
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:libXTrap] Fix memset usage.

2012-07-20 Thread Thomas Klausner
On Fri, Jul 20, 2012 at 08:40:26AM +0200, Rémi Cardona wrote:
 Le 18/07/2012 16:47, Thomas Klausner a écrit :
  -(void)memset(tc,0L,sizeof(tc));
  +(void)memset(tc,0L,sizeof(*tc));
 
 I'd say you might as well drop the useless cast too.

There are twelve memsets with casts, only one of them has the bug.
So do you want a second patch that removes the casts, or just remove this one 
cast?
Merging them in one will hide the bug fix in the noise.
 Thomas
___
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


libXTrap patches

2012-07-20 Thread Thomas Klausner
Original patch, marked as reviewed, and memset cleanup requested
by Rémi Cardona.
___
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:libXTrap 1/2] Fix memset usage.

2012-07-20 Thread Thomas Klausner
From Joerg Sonnenberger jo...@netbsd.org

Signed-off-by: Thomas Klausner w...@netbsd.org
Reviewed-by: Rémi Cardona remi.card...@free.fr
---
 src/XEConTxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/XEConTxt.c b/src/XEConTxt.c
index e2dff16..d075c4f 100644
--- a/src/XEConTxt.c
+++ b/src/XEConTxt.c
@@ -69,7 +69,7 @@ XETC *XECreateTC(Display *dpy, CARD32 valuemask, XETCValues 
*value)
 {   
 firsttime = False;
 /* The first Trap Context is the Template (default) TC */
-(void)memset(tc,0L,sizeof(tc));
+(void)memset(tc,0L,sizeof(*tc));
 tc-eventBase = 0x7FFFL;
 tc-errorBase = 0x7FFFL;
 tc-values.v.max_pkt_size = 0x7FFFL;
-- 
1.7.11.1

___
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

<    1   2   3   4   5   >