aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nx-X11/programs/Xserver/xkb/XKBGAlloc.c8
-rw-r--r--nx-X11/programs/Xserver/xkb/XKBMAlloc.c4
-rw-r--r--nx-X11/programs/Xserver/xkb/XKBMisc.c5
-rw-r--r--nx-X11/programs/Xserver/xkb/ddxBeep.c4
-rw-r--r--nx-X11/programs/Xserver/xkb/ddxCtrls.c23
-rw-r--r--nx-X11/programs/Xserver/xkb/ddxList.c13
-rw-r--r--nx-X11/programs/Xserver/xkb/ddxLoad.c80
-rw-r--r--nx-X11/programs/Xserver/xkb/maprules.c86
-rw-r--r--nx-X11/programs/Xserver/xkb/xkb.c2
-rw-r--r--nx-X11/programs/Xserver/xkb/xkbAccessX.c8
-rw-r--r--nx-X11/programs/Xserver/xkb/xkbEvents.c30
-rw-r--r--nx-X11/programs/Xserver/xkb/xkbInit.c17
-rw-r--r--nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c4
-rw-r--r--nx-X11/programs/Xserver/xkb/xkbUtils.c10
-rw-r--r--nx-X11/programs/Xserver/xkb/xkmread.c16
15 files changed, 67 insertions, 243 deletions
diff --git a/nx-X11/programs/Xserver/xkb/XKBGAlloc.c b/nx-X11/programs/Xserver/xkb/XKBGAlloc.c
index b5a7cc317..ac757232e 100644
--- a/nx-X11/programs/Xserver/xkb/XKBGAlloc.c
+++ b/nx-X11/programs/Xserver/xkb/XKBGAlloc.c
@@ -37,12 +37,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <xkbsrv.h>
#include "xkbgeom.h"
-#ifdef X_NOT_POSIX
-#define Size_t unsigned int
-#else
-#define Size_t size_t
-#endif
-
/***====================================================================***/
static void
@@ -463,7 +457,7 @@ _XkbGeomAlloc( XPointer * old,
unsigned short * num,
unsigned short * total,
int num_new,
- Size_t sz_elem)
+ size_t sz_elem)
{
if (num_new<1)
return Success;
diff --git a/nx-X11/programs/Xserver/xkb/XKBMAlloc.c b/nx-X11/programs/Xserver/xkb/XKBMAlloc.c
index 178d4153c..e3d9c9495 100644
--- a/nx-X11/programs/Xserver/xkb/XKBMAlloc.c
+++ b/nx-X11/programs/Xserver/xkb/XKBMAlloc.c
@@ -52,10 +52,8 @@ XkbClientMapPtr map;
((!XkbIsLegalKeycode(xkb->min_key_code))||
(!XkbIsLegalKeycode(xkb->max_key_code))||
(xkb->max_key_code<xkb->min_key_code))) {
-#ifdef DEBUG
-fprintf(stderr,"bad keycode (%d,%d) in XkbAllocClientMap\n",
+ DebugF("bad keycode (%d,%d) in XkbAllocClientMap\n",
xkb->min_key_code,xkb->max_key_code);
-#endif
return BadValue;
}
diff --git a/nx-X11/programs/Xserver/xkb/XKBMisc.c b/nx-X11/programs/Xserver/xkb/XKBMisc.c
index 2c5cf42c7..0c533773d 100644
--- a/nx-X11/programs/Xserver/xkb/XKBMisc.c
+++ b/nx-X11/programs/Xserver/xkb/XKBMisc.c
@@ -413,10 +413,7 @@ unsigned changed,tmp;
if (((explicit&XkbExplicitAutoRepeatMask)==0)&&(xkb->ctrls)) {
CARD8 old;
old= xkb->ctrls->per_key_repeat[key/8];
-#ifdef RETURN_SHOULD_REPEAT
- if (*XkbKeySymsPtr(xkb,key) != XK_Return)
-#endif
- xkb->ctrls->per_key_repeat[key/8]|= (1<<(key%8));
+ xkb->ctrls->per_key_repeat[key/8]|= (1<<(key%8));
if (changes && (old!=xkb->ctrls->per_key_repeat[key/8]))
changes->ctrls.changed_ctrls|= XkbPerKeyRepeatMask;
}
diff --git a/nx-X11/programs/Xserver/xkb/ddxBeep.c b/nx-X11/programs/Xserver/xkb/ddxBeep.c
index 9f55ff3b8..cf5570b58 100644
--- a/nx-X11/programs/Xserver/xkb/ddxBeep.c
+++ b/nx-X11/programs/Xserver/xkb/ddxBeep.c
@@ -142,10 +142,6 @@ Atom name;
next= 0;
pitch= oldPitch= ctrl->bell_pitch;
duration= oldDuration= ctrl->bell_duration;
-#ifdef DEBUG
- if (xkbDebugFlags>1)
- ErrorF("beep: %d (count= %d)\n",xkbInfo->beepType,xkbInfo->beepCount);
-#endif
name= None;
switch (xkbInfo->beepType) {
default:
diff --git a/nx-X11/programs/Xserver/xkb/ddxCtrls.c b/nx-X11/programs/Xserver/xkb/ddxCtrls.c
index 783576a5a..33ae7d2d0 100644
--- a/nx-X11/programs/Xserver/xkb/ddxCtrls.c
+++ b/nx-X11/programs/Xserver/xkb/ddxCtrls.c
@@ -46,12 +46,6 @@ int realRepeat;
realRepeat= ctrl->autoRepeat;
if ((dev->kbdfeed)&&(XkbDDXUsesSoftRepeat(dev)))
ctrl->autoRepeat= 0;
-#ifdef DEBUG
-if (xkbDebugFlags&0x4) {
- ErrorF("XkbDDXKeybdCtrlProc: setting repeat to %d (real repeat is %d)\n",
- ctrl->autoRepeat,realRepeat);
-}
-#endif
if (dev->key && dev->key->xkbInfo && dev->key->xkbInfo->kbdProc)
(*dev->key->xkbInfo->kbdProc)(dev,ctrl);
ctrl->autoRepeat= realRepeat;
@@ -92,23 +86,6 @@ unsigned changed, i;
unsigned char *rep_old, *rep_new, *rep_fb;
changed= new->enabled_ctrls^old->enabled_ctrls;
-#ifdef NOTDEF
- if (changed&XkbRepeatKeysMask) {
- if (dev->kbdfeed) {
- int realRepeat;
-
- if (new->enabled_ctrls&XkbRepeatKeysMask)
- dev->kbdfeed->ctrl.autoRepeat= realRepeat= 1;
- else dev->kbdfeed->ctrl.autoRepeat= realRepeat= 0;
-
- if (XkbDDXUsesSoftRepeat(dev))
- dev->kbdfeed->ctrl.autoRepeat= FALSE;
- if (dev->kbdfeed->CtrlProc)
- (*dev->kbdfeed->CtrlProc)(dev,&dev->kbdfeed->ctrl);
- dev->kbdfeed->ctrl.autoRepeat= realRepeat;
- }
- }
-#endif
for (rep_old = old->per_key_repeat,
rep_new = new->per_key_repeat,
rep_fb = dev->kbdfeed->ctrl.autoRepeats,
diff --git a/nx-X11/programs/Xserver/xkb/ddxList.c b/nx-X11/programs/Xserver/xkb/ddxList.c
index cc95c8603..449828a59 100644
--- a/nx-X11/programs/Xserver/xkb/ddxList.c
+++ b/nx-X11/programs/Xserver/xkb/ddxList.c
@@ -41,14 +41,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <xkbsrv.h>
#include <nx-X11/extensions/XI.h>
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
#ifdef WIN32
/* from ddxLoad.c */
extern const char* Win32TempDir();
@@ -210,9 +202,8 @@ char tmpname[PATH_MAX];
#ifndef WIN32
in= Popen(buf,"r");
#else
-#ifdef DEBUG_CMD
- ErrorF("xkb executes: %s\n",buf);
-#endif
+ if (xkbDebugFlags)
+ DebugF("xkb executes: %s\n",buf);
if (System(buf) < 0)
ErrorF("Could not invoke keymap compiler\n");
else
diff --git a/nx-X11/programs/Xserver/xkb/ddxLoad.c b/nx-X11/programs/Xserver/xkb/ddxLoad.c
index b770ba026..306a3530f 100644
--- a/nx-X11/programs/Xserver/xkb/ddxLoad.c
+++ b/nx-X11/programs/Xserver/xkb/ddxLoad.c
@@ -57,14 +57,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <paths.h>
#endif
-#ifndef PATH_MAX
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
/*
* If XKM_OUTPUT_DIR specifies a path without a leading slash, it is
* relative to the top-level XKB configuration directory.
@@ -166,44 +158,19 @@ Win32System(const char *cmdline)
#define System(x) Win32System(x)
#endif
-#ifdef MAKE_XKM_OUTPUT_DIR
-/* Borrow trans_mkdir from Xtransutil.c to more safely make directories */
-# undef X11_t
-# define TRANS_SERVER
-# define PRMSG(lvl,x,a,b,c) \
- if (lvl <= 1) { LogMessage(X_ERROR,x,a,b,c); } else ((void)0)
-# include <nx-X11/Xtrans/Xtransutil.c>
-# ifndef XKM_OUTPUT_DIR_MODE
-# define XKM_OUTPUT_DIR_MODE 0755
-# endif
-#endif
-
static void
OutputDirectory(
char* outdir,
size_t size)
{
#ifndef WIN32
- if (getuid() == 0 && (strlen(XKM_OUTPUT_DIR) < size)
-#ifdef MAKE_XKM_OUTPUT_DIR
- && (trans_mkdir(XKM_OUTPUT_DIR, XKM_OUTPUT_DIR_MODE) == 0)
-#endif
- )
+ if (getuid() == 0 && (strlen(XKM_OUTPUT_DIR) < size))
{
/* if server running as root it *may* be able to write */
/* FIXME: check whether directory is writable at all */
(void) strcpy (outdir, XKM_OUTPUT_DIR);
} else
-#endif
-#ifdef _PATH_VARTMP
- if ((strlen(_PATH_VARTMP) + 1) < size)
- {
- (void) strcpy (outdir, _PATH_VARTMP);
- if (outdir[strlen(outdir) - 1] != '/') /* Hi IBM, Digital */
- (void) strcat (outdir, "/");
- } else
-#endif
-#ifdef WIN32
+#else
if (strlen(Win32TempDir()) + 1 < size)
{
(void) strcpy(outdir, Win32TempDir());
@@ -264,15 +231,10 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile;
xkm_output_dir,outFile) == -1)
cmd = NULL;
}
-#ifdef DEBUG
if (xkbDebugFlags) {
- ErrorF("XkbDDXCompileNamedKeymap compiling keymap using:\n");
- ErrorF(" \"cmd\"\n");
+ DebugF("XkbDDXCompileNamedKeymap compiling keymap using:\n");
+ DebugF(" \"cmd\"\n");
}
-#endif
-#ifdef DEBUG_CMD
- ErrorF("xkb executes: %s\n",cmd);
-#endif
if (System(cmd)==0) {
if (nameRtrn) {
strncpy(nameRtrn,outFile,nameRtrnLen);
@@ -284,9 +246,7 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile;
free(cmd);
return True;
}
-#ifdef DEBUG
- ErrorF("Error compiling keymap (%s)\n",names->keymap);
-#endif
+ DebugF("Error compiling keymap (%s)\n",names->keymap);
if (outFile!=NULL)
_XkbFree(outFile);
if (cmd!=NULL)
@@ -399,12 +359,8 @@ char tmpname[PATH_MAX];
if (fclose(out)==0 && System(buf) >= 0)
#endif
{
-#ifdef DEBUG_CMD
- ErrorF("xkb executes: %s\n",buf);
- ErrorF("xkbcomp input:\n");
- XkbWriteXKBKeymapForNames(stderr,names,NULL,xkb,want,need);
- ErrorF("end xkbcomp input\n");
-#endif
+ if (xkbDebugFlags)
+ DebugF("xkb executes: %s\n",buf);
if (nameRtrn) {
strncpy(nameRtrn,keymap,nameRtrnLen);
nameRtrn[nameRtrnLen-1]= '\0';
@@ -413,24 +369,20 @@ char tmpname[PATH_MAX];
free (buf);
return True;
}
-#ifdef DEBUG
else
- ErrorF("Error compiling keymap (%s)\n",keymap);
-#endif
+ DebugF("Error compiling keymap (%s)\n",keymap);
#ifdef WIN32
/* remove the temporary file */
unlink(tmpname);
#endif
}
-#ifdef DEBUG
else {
#ifndef WIN32
- ErrorF("Could not invoke keymap compiler\n");
+ DebugF("Could not invoke keymap compiler\n");
#else
- ErrorF("Could not open file %s\n", tmpname);
+ DebugF("Could not open file %s\n", tmpname);
#endif
}
-#endif
if (nameRtrn)
nameRtrn[0]= '\0';
if (buf != NULL)
@@ -505,17 +457,13 @@ unsigned missing;
return 0;
}
else if (!XkbDDXCompileNamedKeymap(xkb,names,nameRtrn,nameRtrnLen)) {
-#ifdef NOISY
- ErrorF("Couldn't compile keymap file\n");
-#endif
+ DebugF("Couldn't compile keymap file\n");
return 0;
}
}
else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need,
nameRtrn,nameRtrnLen)){
-#ifdef NOISY
- ErrorF("Couldn't compile keymap file\n");
-#endif
+ DebugF("Couldn't compile keymap file\n");
return 0;
}
file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX);
@@ -530,11 +478,9 @@ unsigned missing;
(void) unlink (fileName);
return 0;
}
-#ifdef DEBUG
else if (xkbDebugFlags) {
- ErrorF("Loaded %s, defined=0x%x\n",fileName,finfoRtrn->defined);
+ DebugF("Loaded %s, defined=0x%x\n",fileName,finfoRtrn->defined);
}
-#endif
fclose(file);
(void) unlink (fileName);
return (need|want)&(~missing);
diff --git a/nx-X11/programs/Xserver/xkb/maprules.c b/nx-X11/programs/Xserver/xkb/maprules.c
index 295f1acf6..af6c112fe 100644
--- a/nx-X11/programs/Xserver/xkb/maprules.c
+++ b/nx-X11/programs/Xserver/xkb/maprules.c
@@ -48,16 +48,6 @@
#include "xkbstr.h"
#include <xkbsrv.h>
-#ifdef DEBUG
-#define PR_DEBUG(s) fprintf(stderr,s)
-#define PR_DEBUG1(s,a) fprintf(stderr,s,a)
-#define PR_DEBUG2(s,a,b) fprintf(stderr,s,a,b)
-#else
-#define PR_DEBUG(s)
-#define PR_DEBUG1(s,a)
-#define PR_DEBUG2(s,a,b)
-#endif
-
/***====================================================================***/
#define DFLT_LINE_SIZE 128
@@ -169,8 +159,8 @@ Bool endOfFile,spacePending,slashPending,inComment;
}
if (checkbang && ch=='!') {
if (line->num_line!=0) {
- PR_DEBUG("The '!' legal only at start of line\n");
- PR_DEBUG("Line containing '!' ignored\n");
+ DebugF("The '!' legal only at start of line\n");
+ DebugF("Line containing '!' ignored\n");
line->num_line= 0;
inComment= 0;
break;
@@ -271,9 +261,7 @@ unsigned present, l_ndx_present, v_ndx_present;
register int i;
int len, ndx;
_Xstrtokparams strtok_buf;
-#ifdef DEBUG
Bool found;
-#endif
l_ndx_present = v_ndx_present = present= 0;
@@ -282,9 +270,7 @@ Bool found;
bzero((char *)remap,sizeof(RemapSpec));
remap->number = len;
while ((tok=_XStrtok(str," ",strtok_buf))!=NULL) {
-#ifdef DEBUG
found= False;
-#endif
str= NULL;
if (strcmp(tok,"=")==0)
continue;
@@ -297,22 +283,20 @@ Bool found;
*end != '\0' || ndx == -1)
break;
if (ndx < 1 || ndx > XkbNumKbdGroups) {
- PR_DEBUG2("Illegal %s index: %d\n", cname[i], ndx);
- PR_DEBUG1("Index must be in range 1..%d\n",
+ DebugF("Illegal %s index: %d\n", cname[i], ndx);
+ DebugF("Index must be in range 1..%d\n",
XkbNumKbdGroups);
break;
}
} else {
ndx = 0;
}
-#ifdef DEBUG
found= True;
-#endif
if (present&(1<<i)) {
if ((i == LAYOUT && l_ndx_present&(1<<ndx)) ||
(i == VARIANT && v_ndx_present&(1<<ndx)) ) {
- PR_DEBUG1("Component \"%s\" listed twice\n",tok);
- PR_DEBUG("Second definition ignored\n");
+ DebugF("Component \"%s\" listed twice\n",tok);
+ DebugF("Second definition ignored\n");
break;
}
}
@@ -326,38 +310,34 @@ Bool found;
break;
}
}
-#ifdef DEBUG
if (!found) {
fprintf(stderr,"Unknown component \"%s\" ignored\n",tok);
}
-#endif
}
if ((present&PART_MASK)==0) {
-#ifdef DEBUG
unsigned mask= PART_MASK;
- fprintf(stderr,"Mapping needs at least one of ");
+ ErrorF("Mapping needs at least one of ");
for (i=0; (i<MAX_WORDS); i++) {
if ((1L<<i)&mask) {
mask&= ~(1L<<i);
- if (mask) fprintf(stderr,"\"%s,\" ",cname[i]);
- else fprintf(stderr,"or \"%s\"\n",cname[i]);
+ if (mask) DebugF("\"%s,\" ",cname[i]);
+ else DebugF("or \"%s\"\n",cname[i]);
}
}
- fprintf(stderr,"Illegal mapping ignored\n");
-#endif
+ DebugF("Illegal mapping ignored\n");
remap->num_remap= 0;
return;
}
if ((present&COMPONENT_MASK)==0) {
- PR_DEBUG("Mapping needs at least one component\n");
- PR_DEBUG("Illegal mapping ignored\n");
+ DebugF("Mapping needs at least one component\n");
+ DebugF("Illegal mapping ignored\n");
remap->num_remap= 0;
return;
}
if (((present&COMPONENT_MASK)&(1<<KEYMAP))&&
((present&COMPONENT_MASK)!=(1<<KEYMAP))) {
- PR_DEBUG("Keymap cannot appear with other components\n");
- PR_DEBUG("Illegal mapping ignored\n");
+ DebugF("Keymap cannot appear with other components\n");
+ DebugF("Illegal mapping ignored\n");
remap->num_remap= 0;
return;
}
@@ -432,8 +412,8 @@ Bool append = False;
}
if (remap->num_remap==0) {
- PR_DEBUG("Must have a mapping before first line of data\n");
- PR_DEBUG("Illegal line of data ignored\n");
+ DebugF("Must have a mapping before first line of data\n");
+ DebugF("Illegal line of data ignored\n");
return False;
}
bzero((char *)&tmp,sizeof(FileSpec));
@@ -445,8 +425,8 @@ Bool append = False;
continue;
}
if (nread>remap->num_remap) {
- PR_DEBUG("Too many words on a line\n");
- PR_DEBUG1("Extra word \"%s\" ignored\n",tok);
+ DebugF("Too many words on a line\n");
+ DebugF("Extra word \"%s\" ignored\n",tok);
continue;
}
tmp.name[remap->remap[nread].word]= tok;
@@ -454,8 +434,8 @@ Bool append = False;
append = True;
}
if (nread<remap->num_remap) {
- PR_DEBUG1("Too few words on a line: %s\n", line->line);
- PR_DEBUG("line ignored\n");
+ DebugF("Too few words on a line: %s\n", line->line);
+ DebugF("line ignored\n");
return False;
}
@@ -901,9 +881,7 @@ XkbRF_AddRule(XkbRF_RulesPtr rules)
}
if (!rules->rules) {
rules->sz_rules= rules->num_rules= 0;
-#ifdef DEBUG
- fprintf(stderr,"Allocation failure in XkbRF_AddRule\n");
-#endif
+ DebugF("Allocation failure in XkbRF_AddRule\n");
return NULL;
}
bzero((char *)&rules->rules[rules->num_rules],sizeof(XkbRF_RuleRec));
@@ -1020,7 +998,7 @@ XkbRF_AddVarDesc(XkbRF_DescribeVarsPtr vars)
}
if (!vars->desc) {
vars->sz_desc= vars->num_desc= 0;
- PR_DEBUG("Allocation failure in XkbRF_AddVarDesc\n");
+ DebugF("Allocation failure in XkbRF_AddVarDesc\n");
return NULL;
}
vars->desc[vars->num_desc].name= NULL;
@@ -1057,7 +1035,7 @@ XkbRF_AddVarToDescribe(XkbRF_RulesPtr rules,char *name)
XkbRF_DescribeVarsRec);
}
if ((!rules->extra_names)||(!rules->extra)) {
- PR_DEBUG("allocation error in extra parts\n");
+ DebugF("allocation error in extra parts\n");
rules->sz_extra= rules->num_extra= 0;
rules->extra_names= NULL;
rules->extra= NULL;
@@ -1100,7 +1078,7 @@ int len,headingtype,extra_ndx = 0;
}
if (extra_ndx<0) {
XkbRF_DescribeVarsPtr var;
- PR_DEBUG1("Extra heading \"%s\" encountered\n",tok);
+ DebugF("Extra heading \"%s\" encountered\n",tok);
var= XkbRF_AddVarToDescribe(rules,tok);
if (var)
extra_ndx= var-rules->extra;
@@ -1111,20 +1089,20 @@ int len,headingtype,extra_ndx = 0;
}
if (headingtype == HEAD_NONE) {
- PR_DEBUG("Must have a heading before first line of data\n");
- PR_DEBUG("Illegal line of data ignored\n");
+ DebugF("Must have a heading before first line of data\n");
+ DebugF("Illegal line of data ignored\n");
continue;
}
len = strlen(line.line);
if ((tmp.name= strtok(line.line, " \t")) == NULL) {
- PR_DEBUG("Huh? No token on line\n");
- PR_DEBUG("Illegal line of data ignored\n");
+ DebugF("Huh? No token on line\n");
+ DebugF("Illegal line of data ignored\n");
continue;
}
if (strlen(tmp.name) == len) {
- PR_DEBUG("No description found\n");
- PR_DEBUG("Illegal line of data ignored\n");
+ DebugF("No description found\n");
+ DebugF("Illegal line of data ignored\n");
continue;
}
@@ -1132,8 +1110,8 @@ int len,headingtype,extra_ndx = 0;
while ((*tok!='\n')&&isspace(*tok))
tok++;
if (*tok == '\0') {
- PR_DEBUG("No description found\n");
- PR_DEBUG("Illegal line of data ignored\n");
+ DebugF("No description found\n");
+ DebugF("Illegal line of data ignored\n");
continue;
}
tmp.desc= tok;
diff --git a/nx-X11/programs/Xserver/xkb/xkb.c b/nx-X11/programs/Xserver/xkb/xkb.c
index 8d3fc6108..e6521c952 100644
--- a/nx-X11/programs/Xserver/xkb/xkb.c
+++ b/nx-X11/programs/Xserver/xkb/xkb.c
@@ -5677,10 +5677,8 @@ char * str;
return status;
}
else if (length!=0) {
-#ifdef DEBUG
ErrorF("Internal Error! BadLength in ProcXkbGetDeviceInfo\n");
ErrorF(" Wrote %d fewer bytes than expected\n",length);
-#endif
return BadLength;
}
if (stuff->wanted&(~supported)) {
diff --git a/nx-X11/programs/Xserver/xkb/xkbAccessX.c b/nx-X11/programs/Xserver/xkb/xkbAccessX.c
index 5d9917d2b..3eafaa5b7 100644
--- a/nx-X11/programs/Xserver/xkb/xkbAccessX.c
+++ b/nx-X11/programs/Xserver/xkb/xkbAccessX.c
@@ -126,11 +126,9 @@ xEvent xE;
xE.u.u.type = type;
xE.u.u.detail = keyCode;
xE.u.keyButtonPointer.time = GetTimeInMillis();
-#ifdef DEBUG
if (xkbDebugFlags&0x8) {
- ErrorF("AXKE: Key %d %s\n",keyCode,(xE.u.u.type==KeyPress?"down":"up"));
+ DebugF("AXKE: Key %d %s\n",keyCode,(xE.u.u.type==KeyPress?"down":"up"));
}
-#endif
if (!_XkbIsPressEvent(type) && isRepeat)
XkbLastRepeatEvent= (void *)&xE;
@@ -524,10 +522,8 @@ KeySym * sym = XkbKeySymsPtr(xkbi->desc,key);
XkbRepeatKeysMask)) {
if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,key))
{
-#ifdef DEBUG
if (xkbDebugFlags&0x10)
- ErrorF("Starting software autorepeat...\n");
-#endif
+ DebugF("Starting software autorepeat...\n");
xkbi->repeatKey = key;
xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer,
0, ctrls->repeat_delay,
diff --git a/nx-X11/programs/Xserver/xkb/xkbEvents.c b/nx-X11/programs/Xserver/xkb/xkbEvents.c
index c7a0f9e87..6e8df3490 100644
--- a/nx-X11/programs/Xserver/xkb/xkbEvents.c
+++ b/nx-X11/programs/Xserver/xkb/xkbEvents.c
@@ -804,21 +804,19 @@ XkbSrvInfoPtr xkbi;
xkbi= pXDev->key->xkbInfo;
if ( pClient->xkbClientFlags & _XkbClientInitialized ) {
-#ifdef DEBUG
if ((xkbDebugFlags&0x10)&&
((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) {
- ErrorF("XKbFilterWriteEvents:\n");
- ErrorF(" Event state= 0x%04x\n",xE[0].u.keyButtonPointer.state);
- ErrorF(" XkbLastRepeatEvent!=xE (0x%x!=0x%x) %s\n",
+ DebugF("XKbFilterWriteEvents:\n");
+ DebugF(" Event state= 0x%04x\n",xE[0].u.keyButtonPointer.state);
+ DebugF(" XkbLastRepeatEvent!=xE (0x%x!=0x%x) %s\n",
XkbLastRepeatEvent,xE,
((XkbLastRepeatEvent!=(void *)xE)?"True":"False"));
- ErrorF(" (xkbClientEventsFlags&XWDA)==0 (0x%x) %s\n",
+ DebugF(" (xkbClientEventsFlags&XWDA)==0 (0x%x) %s\n",
pClient->xkbClientFlags,
(_XkbWantsDetectableAutoRepeat(pClient)?"True":"False"));
- ErrorF(" !IsRelease(%d) %s\n",xE[0].u.u.type,
+ DebugF(" !IsRelease(%d) %s\n",xE[0].u.u.type,
(!_XkbIsReleaseEvent(xE[0].u.u.type))?"True":"False");
}
-#endif /* DEBUG */
if ( (XkbLastRepeatEvent==(void *)xE) &&
(_XkbWantsDetectableAutoRepeat(pClient)) &&
(_XkbIsReleaseEvent(xE[0].u.u.type)) ) {
@@ -853,13 +851,11 @@ XkbSrvInfoPtr xkbi;
if (xE[0].u.u.type == ButtonPress &&
((xE[0].u.keyButtonPointer.state >> 7) & button_mask) == button_mask &&
(xkbi->lockedPtrButtons & button_mask) == button_mask) {
-#ifdef DEBUG
/* If the MouseKeys is pressed, and the "real" mouse is also pressed
* when the mouse is released, the server does not behave properly.
* Faking a release of the button here solves the problem.
*/
- ErrorF("Faking release of button %d\n", xE[0].u.u.detail);
-#endif
+ DebugF("Faking release of button %d\n", xE[0].u.u.detail);
XkbDDXFakePointerButton(ButtonRelease, xE[0].u.u.detail);
}
}
@@ -868,19 +864,17 @@ XkbSrvInfoPtr xkbi;
for (i=0;i<nEvents;i++) {
type= xE[i].u.u.type;
-#ifdef DEBUG
if ((xkbDebugFlags&0x4)&&
((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) {
XkbStatePtr s= &xkbi->state;
- ErrorF("XKbFilterWriteEvents (non-XKB):\n");
- ErrorF("event= 0x%04x\n",xE[0].u.keyButtonPointer.state);
- ErrorF("lookup= 0x%02x, grab= 0x%02x\n",s->lookup_mods,
+ DebugF("XKbFilterWriteEvents (non-XKB):\n");
+ DebugF("event= 0x%04x\n",xE[0].u.keyButtonPointer.state);
+ DebugF("lookup= 0x%02x, grab= 0x%02x\n",s->lookup_mods,
s->grab_mods);
- ErrorF("compat lookup= 0x%02x, grab= 0x%02x\n",
+ DebugF("compat lookup= 0x%02x, grab= 0x%02x\n",
s->compat_lookup_mods,
s->compat_grab_mods);
}
-#endif
if ( (type>=KeyPress)&&(type<=MotionNotify) ) {
CARD16 old,new;
@@ -900,9 +894,7 @@ XkbSrvInfoPtr xkbi;
if (type == ButtonPress &&
((xE[i].u.keyButtonPointer.state >> 7) & button_mask) == button_mask &&
(xkbi->lockedPtrButtons & button_mask) == button_mask) {
-#ifdef DEBUG
- ErrorF("Faking release of button %d\n", xE[i].u.u.detail);
-#endif
+ DebugF("Faking release of button %d\n", xE[i].u.u.detail);
XkbDDXFakePointerButton(ButtonRelease, xE[i].u.u.detail);
}
}
diff --git a/nx-X11/programs/Xserver/xkb/xkbInit.c b/nx-X11/programs/Xserver/xkb/xkbInit.c
index 2f7fa475d..f37e202d8 100644
--- a/nx-X11/programs/Xserver/xkb/xkbInit.c
+++ b/nx-X11/programs/Xserver/xkb/xkbInit.c
@@ -284,10 +284,6 @@ XkbSetRulesDflts(char *rulesFile,char *model,char *layout,
/***====================================================================***/
-#if defined(luna)
-#define XKB_DDX_PERMANENT_LOCK 1
-#endif
-
#include "xkbDflts.h"
static Bool
@@ -394,15 +390,6 @@ Atom unknown;
names->indicators[LED_COMPOSE-1] = CREATE_ATOM("Compose");
#endif
}
-#ifdef DEBUG_RADIO_GROUPS
- if (names->num_rg<1) {
- names->radio_groups= (Atom *)_XkbCalloc(RG_COUNT, sizeof(Atom));
- if (names->radio_groups) {
- names->num_rg = RG_COUNT;
- names->radio_groups[RG_BOGUS_FUNCTION_GROUP]= CREATE_ATOM("BOGUS");
- }
- }
-#endif
if (xkb->geom!=NULL)
names->geometry= xkb->geom->name;
else names->geometry= unknown;
@@ -773,9 +760,7 @@ XkbSrvLedInfoPtr sli;
sli= XkbFindSrvLedInfo(pXDev,XkbDfltXIClass,XkbDfltXIId,0);
if (sli && xkbi)
XkbCheckIndicatorMaps(xkbi->device,sli,XkbAllIndicatorsMask);
-#ifdef DEBUG
- else ErrorF("No indicator feedback in XkbFinishInit (shouldn't happen)!\n");
-#endif
+ else DebugF("No indicator feedback in XkbFinishInit (shouldn't happen)!\n");
return softRepeat;
}
diff --git a/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c b/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c
index ede23556e..253b4654e 100644
--- a/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c
+++ b/nx-X11/programs/Xserver/xkb/xkbPrKeyEv.c
@@ -52,11 +52,9 @@ unsigned ndx;
xkbi= keyc->xkbInfo;
key= xE->u.u.detail;
-#ifdef DEBUG
if (xkbDebugFlags&0x8) {
- ErrorF("XkbPKE: Key %d %s\n",key,(xE->u.u.type==KeyPress?"down":"up"));
+ DebugF("XkbPKE: Key %d %s\n",key,(xE->u.u.type==KeyPress?"down":"up"));
}
-#endif
if ( (xkbi->repeatKey==key) && (xE->u.u.type==KeyRelease) &&
((xkbi->desc->ctrls->enabled_ctrls&XkbRepeatKeysMask)==0) ) {
diff --git a/nx-X11/programs/Xserver/xkb/xkbUtils.c b/nx-X11/programs/Xserver/xkb/xkbUtils.c
index a545f06eb..941bb4038 100644
--- a/nx-X11/programs/Xserver/xkb/xkbUtils.c
+++ b/nx-X11/programs/Xserver/xkb/xkbUtils.c
@@ -191,16 +191,6 @@ KeySym tsyms[XkbMaxSymsPerKey] = {NoSymbol},*syms;
XkbMapChangesPtr mc;
xkb= pXDev->key->xkbInfo->desc;
-#ifdef NOTYET
- if (first<xkb->min_key_code) {
- if (first>=XkbMinLegalKeyCode) {
- xkb->min_key_code= first;
- /* 1/12/95 (ef) -- XXX! should zero out the new maps */
- changes->map.changed|= XkbKeycodesMask;
-generate a NewKeyboard notify here?
- }
- }
-#endif
if (first+num-1>xkb->max_key_code) {
/* 1/12/95 (ef) -- XXX! should allow XKB structures to grow */
num= xkb->max_key_code-first+1;
diff --git a/nx-X11/programs/Xserver/xkb/xkmread.c b/nx-X11/programs/Xserver/xkb/xkmread.c
index 4871f3a35..c8b2a4591 100644
--- a/nx-X11/programs/Xserver/xkb/xkmread.c
+++ b/nx-X11/programs/Xserver/xkb/xkmread.c
@@ -50,10 +50,6 @@ XkbInternAtom(Display *dpy,char *str,Bool only_if_exists)
return MakeAtom(str,strlen(str),!only_if_exists);
}
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-
/***====================================================================***/
static XPointer
@@ -547,10 +543,8 @@ FindTypeForKey(XkbDescPtr xkb,Atom name,unsigned width,KeySym *syms)
register unsigned i;
for (i=0;i<xkb->map->num_types;i++) {
if (xkb->map->types[i].name==name) {
-#ifdef DEBUG
if (xkb->map->types[i].num_levels!=width)
- fprintf(stderr,"Group width mismatch between key and type\n");
-#endif
+ DebugF("Group width mismatch between key and type\n");
return &xkb->map->types[i];
}
}
@@ -1072,10 +1066,8 @@ unsigned i,size_toc;
ignored_result = fread(file_info,SIZEOF(xkmFileInfo),1,file);
size_toc= file_info->num_toc;
if (size_toc>max_toc) {
-#ifdef DEBUG
- fprintf(stderr,"Warning! Too many TOC entries; last %d ignored\n",
+ DebugF("Warning! Too many TOC entries; last %d ignored\n",
size_toc-max_toc);
-#endif
size_toc= max_toc;
}
for (i=0;i<size_toc;i++) {
@@ -1215,11 +1207,7 @@ unsigned which= need|want;
if (result->xkb==NULL)
result->xkb= XkbAllocKeyboard();
for (i=0;i<fileInfo.num_toc;i++) {
-#ifdef SEEK_SET
fseek(file,toc[i].offset,SEEK_SET);
-#else
- fseek(file,toc[i].offset,0);
-#endif
tmp= fread(&tmpTOC,SIZEOF(xkmSectionInfo),1,file);
nRead= tmp*SIZEOF(xkmSectionInfo);
if ((tmpTOC.type!=toc[i].type)||(tmpTOC.format!=toc[i].format)||