aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2016-08-27 00:04:03 +0200
committerUlrich Sibiller <uli42@gmx.de>2016-10-10 22:52:30 +0200
commitaf1f7cee091216b445ed6e697301cd640c70d883 (patch)
tree82bdb8ff7e78ecfd9dec3712b6614de173523020 /nx-X11
parent3e75c816d2439b2a565418c0b298d056ce2437bc (diff)
downloadnx-libs-af1f7cee091216b445ed6e697301cd640c70d883.tar.gz
nx-libs-af1f7cee091216b445ed6e697301cd640c70d883.tar.bz2
nx-libs-af1f7cee091216b445ed6e697301cd640c70d883.zip
Lift XKB*.c to libX11 1.3.4
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/lib/X11/XKB.c24
-rw-r--r--nx-X11/lib/X11/XKBAlloc.c28
-rw-r--r--nx-X11/lib/X11/XKBBell.c19
-rw-r--r--nx-X11/lib/X11/XKBBind.c30
-rw-r--r--nx-X11/lib/X11/XKBCompat.c21
-rw-r--r--nx-X11/lib/X11/XKBCtrls.c36
-rw-r--r--nx-X11/lib/X11/XKBCvt.c28
-rw-r--r--nx-X11/lib/X11/XKBExtDev.c32
-rw-r--r--nx-X11/lib/X11/XKBGAlloc.c42
-rw-r--r--nx-X11/lib/X11/XKBGeom.c70
-rw-r--r--nx-X11/lib/X11/XKBGetByName.c17
-rw-r--r--nx-X11/lib/X11/XKBGetMap.c40
-rw-r--r--nx-X11/lib/X11/XKBList.c19
-rw-r--r--nx-X11/lib/X11/XKBMAlloc.c32
-rw-r--r--nx-X11/lib/X11/XKBMisc.c37
-rw-r--r--nx-X11/lib/X11/XKBNames.c28
-rw-r--r--nx-X11/lib/X11/XKBRdBuf.c22
-rw-r--r--nx-X11/lib/X11/XKBSetGeom.c25
-rw-r--r--nx-X11/lib/X11/XKBSetMap.c18
-rw-r--r--nx-X11/lib/X11/XKBUse.c20
-rw-r--r--nx-X11/lib/X11/XKBleds.c26
21 files changed, 326 insertions, 288 deletions
diff --git a/nx-X11/lib/X11/XKB.c b/nx-X11/lib/X11/XKB.c
index 1347fd485..008609608 100644
--- a/nx-X11/lib/X11/XKB.c
+++ b/nx-X11/lib/X11/XKB.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -35,7 +35,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
XkbInternAtomFunc _XkbInternAtomFunc= XInternAtom;
XkbGetAtomNameFunc _XkbGetAtomNameFunc= XGetAtomName;
-Bool
+Bool
XkbQueryExtension( Display *dpy,
int * opcodeReturn,
int * eventBaseReturn,
@@ -58,7 +58,7 @@ XkbQueryExtension( Display *dpy,
return True;
}
-Bool
+Bool
XkbLibraryVersion(int *libMajorRtrn,int *libMinorRtrn)
{
int supported;
@@ -69,7 +69,7 @@ int supported;
supported= True;
else supported= False;
}
- else {
+ else {
supported = True;
}
@@ -113,7 +113,7 @@ XkbSelectEvents( Display * dpy,
else xkbi->selected_map_details= 0;
}
if (affect&XkbNewKeyboardNotifyMask) {
- if (selectAll&XkbNewKeyboardNotifyMask)
+ if (selectAll&XkbNewKeyboardNotifyMask)
xkbi->selected_nkn_details= XkbAllNewKeyboardEventsMask;
else xkbi->selected_nkn_details= 0;
if (!(xkbi->xlib_ctrls&XkbLC_IgnoreNewKeyboards)) {
diff --git a/nx-X11/lib/X11/XKBAlloc.c b/nx-X11/lib/X11/XKBAlloc.c
index 826bf6ed8..995c955cc 100644
--- a/nx-X11/lib/X11/XKBAlloc.c
+++ b/nx-X11/lib/X11/XKBAlloc.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -39,7 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/extensions/XKBproto.h>
#include "XKBlibint.h"
-#else
+#else
#include <stdio.h>
#include <nx-X11/X.h>
@@ -157,7 +157,7 @@ XkbNamesPtr names;
if ((which&XkbKeyNamesMask)&&(names->keys==NULL)) {
if ((!XkbIsLegalKeycode(xkb->min_key_code))||
(!XkbIsLegalKeycode(xkb->max_key_code))||
- (xkb->max_key_code<xkb->min_key_code))
+ (xkb->max_key_code<xkb->min_key_code))
return BadValue;
names->keys= _XkbTypedCalloc((xkb->max_key_code+1),XkbKeyNameRec);
if (names->keys==NULL)
@@ -217,7 +217,7 @@ XkbNamesPtr names;
return;
names= xkb->names;
if (freeMap)
- which= XkbAllNamesMask;
+ which= XkbAllNamesMask;
if (which&XkbKTLevelNamesMask) {
XkbClientMapPtr map= xkb->map;
if ((map!=NULL)&&(map->types!=NULL)) {
@@ -284,7 +284,7 @@ XkbFreeControls(XkbDescPtr xkb,unsigned which,Bool freeMap)
/***===================================================================***/
-Status
+Status
XkbAllocIndicatorMaps(XkbDescPtr xkb)
{
if (xkb==NULL)
@@ -362,7 +362,7 @@ register int i;
}
if (devi->num_leds>=devi->sz_leds) {
XkbDeviceLedInfoRec *prev_leds = devi->leds;
-
+
if (devi->sz_leds>0) devi->sz_leds*= 2;
else devi->sz_leds= 1;
devi->leds= _XkbTypedRealloc(devi->leds,devi->sz_leds,
@@ -459,7 +459,7 @@ XkbDeviceInfoPtr devi;
}
-void
+void
XkbFreeDeviceInfo(XkbDeviceInfoPtr devi,unsigned which,Bool freeDevI)
{
if (devi) {
diff --git a/nx-X11/lib/X11/XKBBell.c b/nx-X11/lib/X11/XKBBell.c
index 4ddbe6617..ff2d5543a 100644
--- a/nx-X11/lib/X11/XKBBell.c
+++ b/nx-X11/lib/X11/XKBBell.c
@@ -6,24 +6,23 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -39,7 +38,7 @@ XkbDeviceBell( Display * dpy,
Window window,
int deviceID,
int bellClass,
- int bellID,
+ int bellID,
int percent,
Atom name)
{
diff --git a/nx-X11/lib/X11/XKBBind.c b/nx-X11/lib/X11/XKBBind.c
index badbd88b7..2d67e9e1e 100644
--- a/nx-X11/lib/X11/XKBBind.c
+++ b/nx-X11/lib/X11/XKBBind.c
@@ -74,7 +74,7 @@ XkbKeycodeToKeysym(Display *dpy,
int level)
{
XkbDescRec *xkb;
-
+
if (_XkbUnavailable(dpy))
return NoSymbol;
@@ -109,7 +109,7 @@ XKeycodeToKeysym(Display *dpy,
int col)
{
XkbDescRec *xkb;
-
+
if (_XkbUnavailable(dpy))
return _XKeycodeToKeysym(dpy, kc, col);
@@ -118,7 +118,7 @@ XKeycodeToKeysym(Display *dpy,
xkb = dpy->xkb_info->desc;
if ((kc<xkb->min_key_code)||(kc>xkb->max_key_code))
return NoSymbol;
-
+
if (col>3) {
int lastSym,tmp,nGrp;
@@ -226,8 +226,8 @@ XLookupKeysym(register XKeyEvent *event, int col)
}
/*
- * Not a public entry point -- XkbTranslateKey is an obsolete name
- * that is preserved here so that functions linked against the old
+ * Not a public entry point -- XkbTranslateKey is an obsolete name
+ * that is preserved here so that functions linked against the old
* version will continue to work in a shared library environment.
*/
int
@@ -325,10 +325,10 @@ XkbTranslateKeyCode( register XkbDescPtr xkb,
if (mods_rtrn) {
*mods_rtrn= type->mods.mask&(~preserve);
/* The Motif VTS doesn't get the help callback called if help
- * is bound to Shift+<whatever>, and it appears as though it
- * is XkbTranslateKeyCode that is causing the problem. The
- * core X version of XTranslateKey always OR's in ShiftMask
- * and LockMask for mods_rtrn, so this "fix" keeps this behavior
+ * is bound to Shift+<whatever>, and it appears as though it
+ * is XkbTranslateKeyCode that is causing the problem. The
+ * core X version of XTranslateKey always OR's in ShiftMask
+ * and LockMask for mods_rtrn, so this "fix" keeps this behavior
* and solves the VTS problem.
*/
if ((xkb->dpy)&&(xkb->dpy->xkb_info)&&
@@ -365,7 +365,6 @@ XkbRefreshKeyboardMapping(register XkbMapNotifyEvent *event)
changes= xkbi->changes;
else bzero(&changes,sizeof(changes));
XkbNoteMapChanges(&changes,event,XKB_XLIB_MAP_MASK);
- LockDisplay(dpy);
if ((rtrn=XkbGetMapChanges(dpy,xkbi->desc,&changes))!=Success) {
#ifdef DEBUG
fprintf(stderr,"Internal Error! XkbGetMapChanges failed:\n");
@@ -376,7 +375,6 @@ XkbRefreshKeyboardMapping(register XkbMapNotifyEvent *event)
xkbi->flags&= ~XkbMapPending;
bzero(&xkbi->changes,sizeof(XkbMapChangesRec));
}
- UnlockDisplay(dpy);
return rtrn;
}
return BadMatch;
@@ -631,7 +629,7 @@ XkbTranslateKeySym( register Display * dpy,
}
if (change) {
if (n==1)
- *sym_rtrn=(*xkb->cvt.MBToKS)(xkb->cvt.MBToKSPriv,buffer,n,0);
+ *sym_rtrn=(*xkb->cvt.MBToKS)(xkb->cvt.MBToKSPriv,buffer,n,NULL);
else *sym_rtrn= NoSymbol;
}
}
@@ -697,7 +695,7 @@ XLookupString ( register XKeyEvent * event,
}
}
}
- }
+ }
#ifdef USE_OWN_COMPOSE
if ( status ) {
@@ -710,7 +708,7 @@ XLookupString ( register XKeyEvent * event,
status->compose_ptr = NULL;
status->chars_matched = 0;
}
- if ( ((status->chars_matched>0)&&(status->compose_ptr!=NULL)) ||
+ if ( ((status->chars_matched>0)&&(status->compose_ptr!=NULL)) ||
XimCompIsComposeKey(*keysym,event->keycode,status) ) {
XimCompRtrn rtrn;
@@ -816,7 +814,7 @@ XkbLookupKeyBinding( Display * dpy,
int nbytes,
int * extra_rtrn)
{
- register struct _XKeytrans *p;
+ register struct _XKeytrans *p;
if (extra_rtrn)
*extra_rtrn= 0;
@@ -840,7 +838,7 @@ char
XkbToControl( char ch )
{
register char c = ch;
-
+
if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F;
else if (c == '2') c = '\000';
else if (c >= '3' && c <= '7') c -= ('3' - '\033');
diff --git a/nx-X11/lib/X11/XKBCompat.c b/nx-X11/lib/X11/XKBCompat.c
index 44bf8d30a..35359522c 100644
--- a/nx-X11/lib/X11/XKBCompat.c
+++ b/nx-X11/lib/X11/XKBCompat.c
@@ -6,24 +6,23 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86$ */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -43,7 +42,7 @@ _XkbReadGetCompatMapReply( Display * dpy,
register int i;
XkbReadBufferRec buf;
- if (!_XkbInitReadBuffer(dpy,&buf,(int)rep->length*4))
+ if (!_XkbInitReadBuffer(dpy,&buf,(int)rep->length*4))
return BadAlloc;
if (nread_rtrn)
@@ -96,7 +95,7 @@ XkbReadBufferRec buf;
}
}
i= _XkbFreeReadBuffer(&buf);
- if (i)
+ if (i)
fprintf(stderr,"CompatMapReply! Bad length (%d extra bytes)\n",i);
if (i || buf.error)
return BadLength;
diff --git a/nx-X11/lib/X11/XKBCtrls.c b/nx-X11/lib/X11/XKBCtrls.c
index 1ab1e7656..198953d79 100644
--- a/nx-X11/lib/X11/XKBCtrls.c
+++ b/nx-X11/lib/X11/XKBCtrls.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -47,10 +47,10 @@ xkbSetControlsReq *req;
return req;
}
-Bool
+Bool
XkbSetAutoRepeatRate( Display *dpy,
- unsigned int deviceSpec,
- unsigned int timeout,
+ unsigned int deviceSpec,
+ unsigned int timeout,
unsigned int interval)
{
register xkbSetControlsReq *req;
@@ -68,7 +68,7 @@ XkbSetAutoRepeatRate( Display *dpy,
return True;
}
-Bool
+Bool
XkbGetAutoRepeatRate( Display * dpy,
unsigned int deviceSpec,
unsigned int * timeoutp,
@@ -87,7 +87,7 @@ XkbGetAutoRepeatRate( Display * dpy,
req->reqType = xkbi->codes->major_opcode;
req->xkbReqType = X_kbGetControls;
req->deviceSpec = deviceSpec;
- if (!_XReply(dpy, (xReply *)&rep,
+ if (!_XReply(dpy, (xReply *)&rep,
(SIZEOF(xkbGetControlsReply)-SIZEOF(xReply))>>2, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
@@ -171,7 +171,7 @@ XkbChangeEnabledControls( Display * dpy,
return True;
}
-Status
+Status
XkbGetControls(Display *dpy, unsigned long which, XkbDescPtr xkb)
{
register xkbGetControlsReq *req;
@@ -194,12 +194,12 @@ XkbGetControls(Display *dpy, unsigned long which, XkbDescPtr xkb)
UnlockDisplay(dpy);
SyncHandle();
return BadAlloc;
- }
+ }
}
req->reqType = xkbi->codes->major_opcode;
req->xkbReqType = X_kbGetControls;
req->deviceSpec = xkb->device_spec;
- if (!_XReply(dpy, (xReply *)&rep,
+ if (!_XReply(dpy, (xReply *)&rep,
(SIZEOF(xkbGetControlsReply)-SIZEOF(xReply))>>2, xFalse)) {
UnlockDisplay(dpy);
SyncHandle();
@@ -260,14 +260,14 @@ XkbGetControls(Display *dpy, unsigned long which, XkbDescPtr xkb)
}
if (which&XkbPerKeyRepeatMask) {
memcpy(ctrls->per_key_repeat,rep.perKeyRepeat,
- XkbPerKeyBitArraySize);
+ XkbPerKeyBitArraySize);
}
UnlockDisplay(dpy);
SyncHandle();
return Success;
}
-Bool
+Bool
XkbSetControls(Display *dpy, unsigned long which, XkbDescPtr xkb)
{
register xkbSetControlsReq *req;
diff --git a/nx-X11/lib/X11/XKBCvt.c b/nx-X11/lib/X11/XKBCvt.c
index ea991b74e..d8ceddbdc 100644
--- a/nx-X11/lib/X11/XKBCvt.c
+++ b/nx-X11/lib/X11/XKBCvt.c
@@ -54,7 +54,7 @@ from The Open Group.
#define XKB_EXTEND_LOOKUP_STRING
#endif
-static int
+static int
_XkbHandleSpecialSym(KeySym keysym, char *buffer, int nbytes, int *extra_rtrn)
{
@@ -62,14 +62,14 @@ _XkbHandleSpecialSym(KeySym keysym, char *buffer, int nbytes, int *extra_rtrn)
if (!(((keysym >= XK_BackSpace) && (keysym <= XK_Clear)) ||
(keysym == XK_Return) || (keysym == XK_Escape) ||
(keysym == XK_KP_Space) || (keysym == XK_KP_Tab) ||
- (keysym == XK_KP_Enter) ||
+ (keysym == XK_KP_Enter) ||
((keysym >= XK_KP_Multiply) && (keysym <= XK_KP_9)) ||
(keysym == XK_KP_Equal) ||
(keysym == XK_Delete)))
return 0;
if (nbytes<1) {
- if (extra_rtrn)
+ if (extra_rtrn)
*extra_rtrn= 1;
return 0;
}
@@ -83,7 +83,7 @@ _XkbHandleSpecialSym(KeySym keysym, char *buffer, int nbytes, int *extra_rtrn)
}
/*ARGSUSED*/
-static int
+static int
_XkbKSToKnownSet ( XPointer priv,
KeySym keysym,
char * buffer,
@@ -141,7 +141,7 @@ _XkbKnownSetToKS(XPointer priv,char *buffer,int nbytes,Status *status)
return NoSymbol;
if (((buffer[0]&0x80)==0)&&(buffer[0]>=32))
return buffer[0];
- else if ((buffer[0]&0x7f)>=32) {
+ else if ((buffer[0]&0x7f)>=32) {
XkbToKS *map= (XkbToKS *)priv;
if ( map ) {
if ( map->map ) return map->prefix|map->map[buffer[0]&0x7f];
@@ -185,8 +185,8 @@ Strcmp(char *str1, char *str2)
}
#endif
-int
-_XkbGetConverters(char *encoding_name, XkbConverters *cvt_rtrn)
+int
+_XkbGetConverters(const char *encoding_name, XkbConverters *cvt_rtrn)
{
if ( !cvt_rtrn ) return 0;
@@ -200,14 +200,14 @@ _XkbGetConverters(char *encoding_name, XkbConverters *cvt_rtrn)
/***====================================================================***/
-/*
+/*
* The function _XkbGetCharset seems to be missnamed as what it seems to
* be used for is to determine the encoding-name for the locale. ???
*/
#ifdef XKB_EXTEND_LOOKUP_STRING
-/*
+/*
* XKB_EXTEND_LOOKUP_STRING is not used by the SI. It is used by various
* X Consortium/X Project Team members, so we leave it in the source as
* an simplify integration by these companies.
@@ -217,7 +217,7 @@ _XkbGetConverters(char *encoding_name, XkbConverters *cvt_rtrn)
static char *_XkbKnownLanguages = "c=ascii:da,de,en,es,fr,is,it,nl,no,pt,sv=iso8859-1:hu,pl,cs=iso8859-2:eo=iso8859-3:sp=iso8859-5:ar,ara=iso8859-6:el=iso8859-7:he=iso8859-8:tr=iso8859-9:lt,lv=iso8859-13:et,fi=iso8859-15:ru=koi8-r:uk=koi8-u:th,th_TH,th_TH.iso8859-11=iso8859-11:th_TH.TIS620=tis620:hy=armscii-8:vi=tcvn-5712:ka=georgian-academy:be,bg=microsoft-cp1251";
char *
-_XkbGetCharset()
+_XkbGetCharset(void)
{
/*
* PAGE USAGE TUNING: explicitly initialize to move these to data
@@ -255,7 +255,7 @@ _XkbGetCharset()
return buf;
}
}
- else {
+ else {
charset = NULL;
}
@@ -275,7 +275,7 @@ _XkbGetCharset()
#ifndef S_ISREG
# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#endif
-
+
if ( (stat(cf,&sbuf)==0) && S_ISREG(sbuf.st_mode) &&
(file = fopen(cf,"r")) ) {
tmp = _XkbAlloc(sbuf.st_size+1);
@@ -298,7 +298,7 @@ _XkbGetCharset()
if ( (set=strchr(tmp,'=')) == NULL )
break;
*set++ = '\0';
- if ( (next=strchr(set,':')) != NULL )
+ if ( (next=strchr(set,':')) != NULL )
*next++ = '\0';
while ( tmp && *tmp ) {
if ( (end=strchr(tmp,',')) != NULL )
@@ -318,7 +318,7 @@ _XkbGetCharset()
}
#else
char *
-_XkbGetCharset()
+_XkbGetCharset(void)
{
char *tmp;
XLCd lcd;
diff --git a/nx-X11/lib/X11/XKBExtDev.c b/nx-X11/lib/X11/XKBExtDev.c
index 5cbf8e538..de5570337 100644
--- a/nx-X11/lib/X11/XKBExtDev.c
+++ b/nx-X11/lib/X11/XKBExtDev.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -36,7 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
/***====================================================================***/
-extern void
+extern void
XkbNoteDeviceChanges( XkbDeviceChangesPtr old,
XkbExtensionDeviceNotifyEvent * new,
unsigned int wanted)
@@ -172,7 +172,7 @@ XkbReadBufferRec buf;
XkbAction * act;
int tmp;
- if (!_XkbInitReadBuffer(dpy,&buf,(int)rep->length*4))
+ if (!_XkbInitReadBuffer(dpy,&buf,(int)rep->length*4))
return BadAlloc;
if ((rep->totalBtns>0)&&(rep->totalBtns!=devi->num_btns)) {
@@ -203,7 +203,7 @@ int tmp;
}
}
tmp= _XkbFreeReadBuffer(&buf);
- if (tmp)
+ if (tmp)
fprintf(stderr,"GetDeviceInfo! Bad length (%d extra bytes)\n",tmp);
if (tmp || buf.error)
return BadLength;
@@ -333,7 +333,7 @@ XkbGetDeviceButtonActions( Display * dpy,
xkbGetDeviceInfoReply rep;
Status status;
- if ((dpy->flags & XlibDisplayNoXkb) ||
+ if ((dpy->flags & XlibDisplayNoXkb) ||
(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
return BadMatch;
if (!devi)
@@ -374,7 +374,7 @@ XkbGetDeviceLedInfo( Display * dpy,
xkbGetDeviceInfoReply rep;
Status status;
- if ((dpy->flags & XlibDisplayNoXkb) ||
+ if ((dpy->flags & XlibDisplayNoXkb) ||
(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
return BadMatch;
if (((which&XkbXI_IndicatorsMask)==0)||(which&(~XkbXI_IndicatorsMask)))
@@ -395,7 +395,7 @@ XkbGetDeviceLedInfo( Display * dpy,
UnlockDisplay(dpy);
SyncHandle();
return BadLength;
- }
+ }
devi->type= rep.devType;
devi->supported= rep.supported;
devi->unsupported= rep.unsupported;
@@ -755,7 +755,7 @@ XkbChangeDeviceInfo( Display * dpy,
return ok;
}
-Bool
+Bool
XkbSetDeviceLedInfo( Display * dpy,
XkbDeviceInfoPtr devi,
unsigned ledClass,
@@ -765,7 +765,7 @@ XkbSetDeviceLedInfo( Display * dpy,
return False;
}
-Bool
+Bool
XkbSetDeviceButtonActions( Display * dpy,
XkbDeviceInfoPtr devi,
unsigned int first,
diff --git a/nx-X11/lib/X11/XKBGAlloc.c b/nx-X11/lib/X11/XKBGAlloc.c
index f5e6737af..46b997b7f 100644
--- a/nx-X11/lib/X11/XKBGAlloc.c
+++ b/nx-X11/lib/X11/XKBGAlloc.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/extensions/XKBgeom.h>
#include <nx-X11/extensions/XKBproto.h>
-#else
+#else
#include <stdio.h>
#include <nx-X11/X.h>
@@ -58,7 +58,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
/***====================================================================***/
-static void
+static void
_XkbFreeGeomLeafElems( Bool freeAll,
int first,
int count,
@@ -72,14 +72,14 @@ _XkbFreeGeomLeafElems( Bool freeAll,
if (*elems!=NULL) {
_XkbFree(*elems);
*elems= NULL;
- }
+ }
return;
}
if ((first>=(*num_inout))||(first<0)||(count<1))
return;
- if (first+count>=(*num_inout)) {
+ if (first+count>=(*num_inout)) {
/* truncating the array is easy */
(*num_inout)= first;
}
@@ -99,7 +99,7 @@ typedef void (*ContentsClearFunc)(
char * /* priv */
);
-static void
+static void
_XkbFreeGeomNonLeafElems( Bool freeAll,
int first,
int count,
@@ -187,7 +187,7 @@ XkbFreeGeomKeyAliases( XkbGeometryPtr geom,
int first,
int count,
Bool freeAll)
-{
+{
_XkbFreeGeomLeafElems(freeAll,first,count,
&geom->num_key_aliases,&geom->sz_key_aliases,
(char **)&geom->key_aliases,
@@ -248,7 +248,7 @@ XkbFreeGeomOutlines(XkbShapePtr shape,int first,int count,Bool freeAll)
&shape->num_outlines,&shape->sz_outlines,
(char **)&shape->outlines,
sizeof(XkbOutlineRec),_XkbClearOutline);
-
+
return;
}
@@ -276,7 +276,7 @@ XkbFreeGeomShapes(XkbGeometryPtr geom,int first,int count,Bool freeAll)
/***====================================================================***/
-void
+void
XkbFreeGeomOverlayKeys(XkbOverlayRowPtr row,int first,int count,Bool freeAll)
{
_XkbFreeGeomLeafElems(freeAll,first,count,
@@ -397,7 +397,7 @@ _XkbClearDoodad(char *doodad_in)
XkbDoodadPtr doodad= (XkbDoodadPtr)doodad_in;
switch (doodad->any.type) {
- case XkbTextDoodad:
+ case XkbTextDoodad:
{
if (doodad->text.text!=NULL) {
_XkbFree(doodad->text.text);
@@ -409,7 +409,7 @@ XkbDoodadPtr doodad= (XkbDoodadPtr)doodad_in;
}
}
break;
- case XkbLogoDoodad:
+ case XkbLogoDoodad:
{
if (doodad->logo.logo_name!=NULL) {
_XkbFree(doodad->logo.logo_name);
@@ -542,7 +542,7 @@ _XkbGeomAlloc( XPointer * old,
#define _XkbAllocOverlayKeys(r,n) _XkbGeomAlloc((XPointer *)&(r)->keys,\
&(r)->num_keys,&(r)->sz_keys,\
(n),sizeof(XkbOverlayKeyRec))
-
+
Status
XkbAllocGeomProps(XkbGeometryPtr geom,int nProps)
{
@@ -688,7 +688,7 @@ register XkbPropertyPtr prop;
if (prop->value)
strcpy(prop->value,value);
return prop;
- }
+ }
}
if ((geom->num_properties>=geom->sz_properties)&&
(_XkbAllocProps(geom,1)!=Success)) {
@@ -945,7 +945,7 @@ Bool found;
}
}
if (!found)
- return NULL;
+ return NULL;
if ((row->num_keys>=row->sz_keys)&&(_XkbAllocOverlayKeys(row,1)!=Success))
return NULL;
key= &row->keys[row->num_keys];
diff --git a/nx-X11/lib/X11/XKBGeom.c b/nx-X11/lib/X11/XKBGeom.c
index c1fb5addd..5ab51b682 100644
--- a/nx-X11/lib/X11/XKBGeom.c
+++ b/nx-X11/lib/X11/XKBGeom.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -71,6 +71,9 @@ XkbPointPtr pt;
for (pt=outline->points,p=0;p<outline->num_points;p++,pt++) {
_XkbCheckBounds(&shape->bounds,pt->x,pt->y);
}
+ if (outline->num_points<2) {
+ _XkbCheckBounds(&shape->bounds,0,0);
+ }
}
return True;
}
@@ -248,9 +251,15 @@ Status rtrn;
char *name,*value;
ok= True;
for (i=0;(i<rep->nProperties)&&ok;i++) {
+ name=NULL;
+ value=NULL;
ok= _XkbGetReadBufferCountedString(buf,&name)&&ok;
ok= _XkbGetReadBufferCountedString(buf,&value)&&ok;
ok= ok&&(XkbAddGeomProperty(geom,name,value)!=NULL);
+ if (name)
+ _XkbFree(name);
+ if (value)
+ _XkbFree(value);
}
if (ok) rtrn= Success;
else rtrn= BadLength;
@@ -293,10 +302,15 @@ Status rtrn;
register int i;
char *spec;
for (i=0;i<rep->nColors;i++) {
+ spec = NULL;
if (!_XkbGetReadBufferCountedString(buf,&spec))
- return BadLength;
- if (XkbAddGeomColor(geom,spec,geom->num_colors)==NULL)
- return BadAlloc;
+ rtrn = BadLength;
+ else if (XkbAddGeomColor(geom,spec,geom->num_colors)==NULL)
+ rtrn = BadAlloc;
+ if (spec)
+ _XkbFree(spec);
+ if (rtrn != Success)
+ return rtrn;
}
return Success;
}
@@ -602,7 +616,7 @@ XkbGeometryPtr geom;
status= _XkbReadGeomKeyAliases(&buf,geom,rep);
left= _XkbFreeReadBuffer(&buf);
if ((status!=Success) || left || buf.error) {
- if (status==Success)
+ if (status==Success)
status= BadLength;
XkbFreeGeometry(geom,XkbGeomAllMask,True);
xkb->geom= NULL;
@@ -625,21 +639,27 @@ XkbGetGeometry(Display *dpy,XkbDescPtr xkb)
{
xkbGetGeometryReq *req;
xkbGetGeometryReply rep;
+Status status;
if ( (!xkb) || (dpy->flags & XlibDisplayNoXkb) ||
(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
return BadAccess;
-
+
+ LockDisplay(dpy);
GetReq(kbGetGeometry, req);
req->reqType = dpy->xkb_info->codes->major_opcode;
req->xkbReqType = X_kbGetGeometry;
req->deviceSpec = xkb->device_spec;
req->name= None;
if (!_XReply(dpy, (xReply *)&rep, 0, xFalse))
- return BadImplementation;
- if (!rep.found)
- return BadName;
- return _XkbReadGetGeometryReply(dpy,&rep,xkb,NULL);
+ status = BadImplementation;
+ else if (!rep.found)
+ status = BadName;
+ else
+ status = _XkbReadGetGeometryReply(dpy,&rep,xkb,NULL);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return status;
}
Status
@@ -647,20 +667,26 @@ XkbGetNamedGeometry(Display *dpy,XkbDescPtr xkb,Atom name)
{
xkbGetGeometryReq *req;
xkbGetGeometryReply rep;
+Status status;
if ( (name==None) || (dpy->flags & XlibDisplayNoXkb) ||
(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)) )
return BadAccess;
-
+
+ LockDisplay(dpy);
GetReq(kbGetGeometry, req);
req->reqType = dpy->xkb_info->codes->major_opcode;
req->xkbReqType = X_kbGetGeometry;
req->deviceSpec = xkb->device_spec;
req->name= (CARD32)name;
if ((!_XReply(dpy, (xReply *)&rep, 0, xFalse))||(!rep.found))
- return BadImplementation;
- if (!rep.found)
- return BadName;
- return _XkbReadGetGeometryReply(dpy,&rep,xkb,NULL);
+ status = BadImplementation;
+ else if (!rep.found)
+ status = BadName;
+ else
+ status = _XkbReadGetGeometryReply(dpy,&rep,xkb,NULL);
+ UnlockDisplay(dpy);
+ SyncHandle();
+ return status;
}
diff --git a/nx-X11/lib/X11/XKBGetByName.c b/nx-X11/lib/X11/XKBGetByName.c
index 4c71ec576..5c6eca0e2 100644
--- a/nx-X11/lib/X11/XKBGetByName.c
+++ b/nx-X11/lib/X11/XKBGetByName.c
@@ -6,24 +6,23 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86$ */
#define NEED_MAP_READERS
#ifdef HAVE_CONFIG_H
diff --git a/nx-X11/lib/X11/XKBGetMap.c b/nx-X11/lib/X11/XKBGetMap.c
index 2d9a4ea1c..a38907671 100644
--- a/nx-X11/lib/X11/XKBGetMap.c
+++ b/nx-X11/lib/X11/XKBGetMap.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -104,7 +104,7 @@ XkbKeyTypePtr type;
type->num_levels = desc->numLevels;
type->map_count = desc->nMapEntries;
if (desc->nMapEntries>0) {
- register xkbKTMapEntryWireDesc *wire;
+ register xkbKTMapEntryWireDesc *wire;
register XkbKTMapEntryPtr entry;
register int size;
@@ -122,7 +122,7 @@ XkbKeyTypePtr type;
}
if (desc->preserve) {
- register xkbModsWireDesc * pwire;
+ register xkbModsWireDesc * pwire;
register XkbModsPtr preserve;
register int sz;
@@ -515,7 +515,7 @@ _XkbHandleGetMapReply(Display *dpy,XkbDescPtr xkb)
xkbGetMapReply rep;
if (!_XReply(dpy, (xReply *)&rep,
- ( (SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply)) >> 2 ),
+ ( (SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply)) >> 2 ),
xFalse)) {
return BadImplementation;
}
@@ -714,7 +714,10 @@ XkbGetKeyExplicitComponents( Display * dpy,
if ((num>0)&&(first>=xkb->min_key_code)&&(first+num<=xkb->max_key_code))
bzero(&xkb->server->explicit[first],num);
}
- status= _XkbHandleGetMapReply(dpy, xkb);
+ if (xkb)
+ status= _XkbHandleGetMapReply(dpy, xkb);
+ else
+ status = BadMatch;
UnlockDisplay(dpy);
SyncHandle();
@@ -743,7 +746,10 @@ XkbGetKeyModifierMap(Display *dpy,unsigned first,unsigned num,XkbDescPtr xkb)
if ((num>0)&&(first>=xkb->min_key_code)&&(first+num<=xkb->max_key_code))
bzero(&xkb->map->modmap[first],num);
}
- status= _XkbHandleGetMapReply(dpy, xkb);
+ if (xkb)
+ status= _XkbHandleGetMapReply(dpy, xkb);
+ else
+ status = BadMatch;
UnlockDisplay(dpy);
SyncHandle();
@@ -772,7 +778,11 @@ XkbGetKeyVirtualModMap(Display *dpy,unsigned first,unsigned num,XkbDescPtr xkb)
if ((num>0)&&(first>=xkb->min_key_code)&&(first+num<=xkb->max_key_code))
bzero(&xkb->server->vmodmap[first],num*sizeof(unsigned short));
}
- status= _XkbHandleGetMapReply(dpy, xkb);
+
+ if (xkb)
+ status= _XkbHandleGetMapReply(dpy, xkb);
+ else
+ status = BadMatch;
UnlockDisplay(dpy);
SyncHandle();
@@ -809,8 +819,8 @@ XkbGetMapChanges(Display *dpy,XkbDescPtr xkb,XkbMapChangesPtr changes)
req->firstVModMapKey = changes->first_vmodmap_key;
req->nVModMapKeys = changes->num_vmodmap_keys;
status= _XkbHandleGetMapReply(dpy, xkb);
- SyncHandle();
UnlockDisplay(dpy);
+ SyncHandle();
return status;
}
UnlockDisplay(dpy);
diff --git a/nx-X11/lib/X11/XKBList.c b/nx-X11/lib/X11/XKBList.c
index 4080535ba..569e732b4 100644
--- a/nx-X11/lib/X11/XKBList.c
+++ b/nx-X11/lib/X11/XKBList.c
@@ -6,24 +6,23 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86$ */
#define NEED_MAP_READERS
#ifdef HAVE_CONFIG_H
@@ -185,7 +184,7 @@ int extraLen,len,mapLen,codesLen,typesLen,compatLen,symsLen,geomLen;
}
if (_XkbInitReadBuffer(dpy,&buf,extraLen)) {
Status status;
-
+
status= Success;
list= _XkbTypedCalloc(1,XkbComponentListRec);
if (!list) {
diff --git a/nx-X11/lib/X11/XKBMAlloc.c b/nx-X11/lib/X11/XKBMAlloc.c
index ffc822fed..594ef7f71 100644
--- a/nx-X11/lib/X11/XKBMAlloc.c
+++ b/nx-X11/lib/X11/XKBMAlloc.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/keysym.h>
#include "XKBlibint.h"
-#else
+#else
#include <stdio.h>
#include <nx-X11/X.h>
@@ -98,7 +98,7 @@ fprintf(stderr,"bad keycode (%d,%d) in XkbAllocClientMap\n",
return BadAlloc;
}
map->size_types= nTotalTypes;
- bzero(&map->types[map->num_types],
+ bzero(&map->types[map->num_types],
((map->size_types-map->num_types)*sizeof(XkbKeyTypeRec)));
}
}
@@ -191,7 +191,7 @@ XkbServerMapPtr map;
return BadAlloc;
}
map->size_acts= need;
- bzero(&map->acts[map->num_acts],
+ bzero(&map->acts[map->num_acts],
((map->size_acts-map->num_acts)*sizeof(XkbAction)));
}
if (map->key_acts==NULL) {
@@ -313,6 +313,8 @@ XkbClientMapPtr map;
tmp= XkbNumRequiredTypes+1;
if (XkbAllocClientMap(xkb,XkbKeyTypesMask,tmp)!=Success)
return NULL;
+ if (!map)
+ map = xkb->map;
tmp= 0;
if (map->num_types<=XkbKeypadIndex)
tmp|= XkbKeypadMask;
@@ -401,7 +403,7 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys;
if ((map_count>type->map_count)||(type->map==NULL))
type->map=_XkbTypedRealloc(type->map,map_count,XkbKTMapEntryRec);
if (!type->map) {
- if (prev_map)
+ if (prev_map)
_XkbFree(prev_map);
return BadAlloc;
}
@@ -413,7 +415,7 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys;
XkbModsRec);
}
if (!type->preserve) {
- if (prev_preserve)
+ if (prev_preserve)
_XkbFree(prev_preserve);
return BadAlloc;
}
@@ -430,7 +432,7 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys;
type->level_names=_XkbTypedRealloc(type->level_names,new_num_lvls,Atom);
if (!type->level_names) {
- if (prev_level_names)
+ if (prev_level_names)
_XkbFree(prev_level_names);
return BadAlloc;
}
@@ -449,7 +451,7 @@ KeyCode matchingKeys[XkbMaxKeyCount],nMatchingKeys;
* might have to be enlarged.
* If the key type decreased in size:
* - keys that have a group width > the old width don't have to be
- * resized (because they must have some other wider type associated
+ * resized (because they must have some other wider type associated
* with some group).
* + keys that have a group width == the old width might have to be
* shrunk.
diff --git a/nx-X11/lib/X11/XKBMisc.c b/nx-X11/lib/X11/XKBMisc.c
index b3012dc4f..fbd7e6852 100644
--- a/nx-X11/lib/X11/XKBMisc.c
+++ b/nx-X11/lib/X11/XKBMisc.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <nx-X11/keysym.h>
#include "XKBlibint.h"
-#else
+#else
#include <stdio.h>
#include <nx-X11/X.h>
@@ -54,11 +54,11 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
/***====================================================================***/
#define mapSize(m) (sizeof(m)/sizeof(XkbKTMapEntryRec))
-static XkbKTMapEntryRec map2Level[]= {
+static XkbKTMapEntryRec map2Level[]= {
{ True, ShiftMask, {1, ShiftMask, 0} }
};
-static XkbKTMapEntryRec mapAlpha[]= {
+static XkbKTMapEntryRec mapAlpha[]= {
{ True, ShiftMask, { 1, ShiftMask, 0 } },
{ True, LockMask, { 0, LockMask, 0 } }
};
@@ -69,25 +69,25 @@ static XkbModsRec preAlpha[]= {
};
#define NL_VMOD_MASK 0
-static XkbKTMapEntryRec mapKeypad[]= {
+static XkbKTMapEntryRec mapKeypad[]= {
{ True, ShiftMask, { 1, ShiftMask, 0 } },
{ False, 0, { 1, 0, NL_VMOD_MASK } }
};
static XkbKeyTypeRec canonicalTypes[XkbNumRequiredTypes] = {
- { { 0, 0, 0 },
+ { { 0, 0, 0 },
1, /* num_levels */
0, /* map_count */
NULL, NULL,
None, NULL
},
- { { ShiftMask, ShiftMask, 0 },
+ { { ShiftMask, ShiftMask, 0 },
2, /* num_levels */
mapSize(map2Level), /* map_count */
map2Level, NULL,
None, NULL
},
- { { ShiftMask|LockMask, ShiftMask|LockMask, 0 },
+ { { ShiftMask|LockMask, ShiftMask|LockMask, 0 },
2, /* num_levels */
mapSize(mapAlpha), /* map_count */
mapAlpha, preAlpha,
@@ -421,7 +421,7 @@ XkbApplyCompatMapToKey(XkbDescPtr xkb,KeyCode key,XkbChangesPtr changes)
{
KeySym * syms;
unsigned char explicit,mods;
-XkbSymInterpretPtr *interps,ibuf[IBUF_SIZE];
+XkbSymInterpretPtr *interps,ibuf[IBUF_SIZE];
int n,nSyms,found;
unsigned changed,tmp;
@@ -474,8 +474,11 @@ unsigned changed,tmp;
unsigned int new_vmodmask;
changed|= XkbKeyActionsMask;
pActs= XkbResizeKeyActions(xkb,key,nSyms);
- if (!pActs)
+ if (!pActs) {
+ if (nSyms > IBUF_SIZE)
+ Xfree(interps);
return False;
+ }
new_vmodmask= 0;
for (n=0;n<nSyms;n++) {
if (interps[n]) {
diff --git a/nx-X11/lib/X11/XKBNames.c b/nx-X11/lib/X11/XKBNames.c
index ca51b3fd5..04cd6f3e3 100644
--- a/nx-X11/lib/X11/XKBNames.c
+++ b/nx-X11/lib/X11/XKBNames.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -358,7 +358,7 @@ XkbSetNames( Display * dpy,
}
}
}
-
+
nVMods= nLEDs= nRG= nKA= nAtoms= nGroups= 0;
LockDisplay(dpy);
xkbi = dpy->xkb_info;
@@ -403,7 +403,7 @@ XkbSetNames( Display * dpy,
else req->indicators= leds= 0;
if (which&XkbVirtualModNamesMask) {
- vmods= req->virtualMods= (CARD16)
+ vmods= req->virtualMods= (CARD16)
_XkbCountAtoms(names->vmods,XkbNumVirtualMods,&nVMods);
if (nVMods>0)
nAtoms+= nVMods;
@@ -531,7 +531,7 @@ XkbChangeNames(Display *dpy,XkbDescPtr xkb,XkbNameChangesPtr changes)
firstLvlType= changes->first_lvl;;
nLvlTypes= changes->num_lvls;
if (which&XkbKeyTypeNamesMask) {
- if (nTypes<1)
+ if (nTypes<1)
which&= ~XkbKeyTypeNamesMask;
else if (firstType<=XkbLastRequiredType) {
int adjust;
@@ -590,7 +590,7 @@ XkbChangeNames(Display *dpy,XkbDescPtr xkb,XkbNameChangesPtr changes)
changes->changed_groups= 0;
else if (changes->changed_groups==0)
which&= ~XkbGroupNamesMask;
-
+
nVMods= nLEDs= nRG= nKA= nAtoms= nGroups= 0;
LockDisplay(dpy);
xkbi = dpy->xkb_info;
@@ -822,9 +822,9 @@ int first,last,old_last,new_last;
old->changed_groups|= new->changed_groups;
else old->changed_groups= new->changed_groups;
}
- if (wanted&XkbRGNamesMask)
+ if (wanted&XkbRGNamesMask)
old->num_rg= new->num_radio_groups;
- if (wanted&XkbKeyAliasesMask)
+ if (wanted&XkbKeyAliasesMask)
old->num_aliases= new->num_aliases;
old->changed|= wanted;
return;
diff --git a/nx-X11/lib/X11/XKBRdBuf.c b/nx-X11/lib/X11/XKBRdBuf.c
index 43774d4a0..ca8f8e722 100644
--- a/nx-X11/lib/X11/XKBRdBuf.c
+++ b/nx-X11/lib/X11/XKBRdBuf.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -34,7 +34,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
/***====================================================================***/
-int
+int
_XkbInitReadBuffer(Display *dpy,XkbReadBufferPtr buf,int size)
{
if ((dpy!=NULL) && (buf!=NULL) && (size>0)) {
@@ -147,7 +147,7 @@ _XkbPeekAtReadBuffer(XkbReadBufferPtr from,int size)
{
if ((from==NULL)||(from->error)||(size<1)||
(_XkbReadBufferDataLeft(from)<size))
- return 0;
+ return NULL;
return from->data;
}
@@ -157,7 +157,7 @@ _XkbGetReadBufferPtr(XkbReadBufferPtr from,int size)
char *ptr;
if ((from==NULL)||(from->error)||(size<1)||
(_XkbReadBufferDataLeft(from)<size))
- return 0;
+ return NULL;
ptr= from->data;
from->data+= size;
return ptr;
diff --git a/nx-X11/lib/X11/XKBSetGeom.c b/nx-X11/lib/X11/XKBSetGeom.c
index 8f7ba67a2..e951afaeb 100644
--- a/nx-X11/lib/X11/XKBSetGeom.c
+++ b/nx-X11/lib/X11/XKBSetGeom.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -66,7 +66,7 @@ _SizeGeomProperties(XkbGeometryPtr geom)
{
register int i,size;
XkbPropertyPtr prop;
-
+
for (size=i=0,prop=geom->properties;i<geom->num_properties;i++,prop++) {
size+= _SizeCountedString(prop->name);
size+= _SizeCountedString(prop->value);
@@ -170,7 +170,7 @@ _WriteGeomProperties(char *wire,XkbGeometryPtr geom)
{
register int i;
register XkbPropertyPtr prop;
-
+
for (i=0,prop=geom->properties;i<geom->num_properties;i++,prop++) {
wire= _WriteCountedString(wire,prop->name);
wire= _WriteCountedString(wire,prop->value);
@@ -373,7 +373,7 @@ static char *
_WriteGeomKeyAliases(char *wire,XkbGeometryPtr geom)
{
register int sz;
-
+
sz= geom->num_key_aliases*(XkbKeyNameLength*2);
if (sz>0) {
memcpy(wire,(char *)geom->key_aliases,sz);
@@ -440,7 +440,8 @@ Status ret;
if ( (!geom) || (dpy->flags & XlibDisplayNoXkb) ||
(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
return BadAccess;
-
+
+ LockDisplay(dpy);
GetReq(kbSetGeometry, req);
req->reqType = dpy->xkb_info->codes->major_opcode;
req->xkbReqType = X_kbSetGeometry;
diff --git a/nx-X11/lib/X11/XKBSetMap.c b/nx-X11/lib/X11/XKBSetMap.c
index 03ec6dde8..994e401d2 100644
--- a/nx-X11/lib/X11/XKBSetMap.c
+++ b/nx-X11/lib/X11/XKBSetMap.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -320,7 +320,7 @@ CARD8 * wire;
if ((req->present&XkbExplicitComponentsMask)==0)
return;
first= req->firstKeyExplicit;
- last= first+req->nKeyExplicit;
+ last= first+req->nKeyExplicit - 1;
i= XkbPaddedSize((req->totalKeyExplicit*2));
BufAlloc(CARD8 *,wire,i);
for (i=first;i<=last;i++) {
diff --git a/nx-X11/lib/X11/XKBUse.c b/nx-X11/lib/X11/XKBUse.c
index 379388747..9ce60f12c 100644
--- a/nx-X11/lib/X11/XKBUse.c
+++ b/nx-X11/lib/X11/XKBUse.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -228,7 +228,7 @@ wire_to_event(Display *dpy,XEvent *re,xEvent *event)
(xGenericReply *)event);
sev->send_event = ((event->u.u.type & 0x80) != 0);
sev->display = dpy;
- sev->time = sn->time;
+ sev->time = sn->time;
sev->device = sn->deviceID;
sev->keycode = sn->keycode;
sev->event_type = sn->eventType;
@@ -745,7 +745,7 @@ XkbUseExtension(Display *dpy,int *major_rtrn,int *minor_rtrn)
fail= True;
if (debugMsg)
fprintf(stderr,
- "XKEYBOARD version mismatch (want %d.%02d, got %d.%02d)\n",
+ "XKEYBOARD version mismatch (want %d.%02d, got %d.%02d)\n",
XkbMajorVersion,XkbMinorVersion,
rep.serverMajor, rep.serverMinor);
diff --git a/nx-X11/lib/X11/XKBleds.c b/nx-X11/lib/X11/XKBleds.c
index 7585e5bbd..6c1b46140 100644
--- a/nx-X11/lib/X11/XKBleds.c
+++ b/nx-X11/lib/X11/XKBleds.c
@@ -6,19 +6,19 @@ software and its documentation for any purpose and without
fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
-documentation, and that the name of Silicon Graphics not be
-used in advertising or publicity pertaining to distribution
+documentation, and that the name of Silicon Graphics not be
+used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
-Silicon Graphics makes no representation about the suitability
+Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
-GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
-DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -39,7 +39,7 @@ XkbGetIndicatorState(Display *dpy,unsigned deviceSpec,unsigned *pStateRtrn)
xkbGetIndicatorStateReply rep;
XkbInfoPtr xkbi;
Bool ok;
-
+
if ((dpy->flags & XlibDisplayNoXkb) ||
(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
return BadAccess;
@@ -57,7 +57,7 @@ XkbGetIndicatorState(Display *dpy,unsigned deviceSpec,unsigned *pStateRtrn)
return (ok?Success:BadImplementation);
}
-Status
+Status
_XkbReadGetIndicatorMapReply( Display * dpy,
xkbGetIndicatorMapReply * rep,
XkbDescPtr xkb,
@@ -206,7 +206,7 @@ XkbGetNamedDeviceIndicator( Display * dpy,
register xkbGetNamedIndicatorReq *req;
xkbGetNamedIndicatorReply rep;
XkbInfoPtr xkbi;
-
+
if ((dpy->flags & XlibDisplayNoXkb) || (name==None) ||
(!dpy->xkb_info && !XkbUseExtension(dpy,NULL,NULL)))
return False;
@@ -224,6 +224,8 @@ XkbGetNamedDeviceIndicator( Display * dpy,
SyncHandle();
return False;
}
+ UnlockDisplay(dpy);
+ SyncHandle();
if ((!rep.found)||(!rep.supported))
return False;
if (pNdxRtrn!=NULL)
@@ -240,7 +242,7 @@ XkbGetNamedDeviceIndicator( Display * dpy,
pMapRtrn->mods.vmods= rep.virtualMods;
pMapRtrn->ctrls= rep.ctrls;
}
- if (pRealRtrn!=NULL)
+ if (pRealRtrn!=NULL)
*pRealRtrn= rep.realIndicator;
return True;
}