diff options
author | Daniel Stone <daniel@fooishbar.org> | 2008-02-03 23:30:22 +1100 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2008-02-17 22:52:07 +0200 |
commit | 534fc5140b039a8c98ab715d0a6740d513b41209 (patch) | |
tree | 69b0b6a9ac233f59c70627a79ca55eefefb37635 /xkb/xkmread.c | |
parent | 0f12a448dcbbbf1f40aa98d09c9d25ee511c5bbf (diff) |
XKB: Remove a bunch of mad ifdefs
We have SEEK_SET and size_t, seriously. Also use DebugF instead of
ifdef DEBUG, and ditch a couple of random bits that were never used.
Diffstat (limited to 'xkb/xkmread.c')
-rw-r--r-- | xkb/xkmread.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/xkb/xkmread.c b/xkb/xkmread.c index 88296188a..2bb02896b 100644 --- a/xkb/xkmread.c +++ b/xkb/xkmread.c @@ -40,8 +40,7 @@ #include "misc.h" #include "inputstr.h" #include "xkbstr.h" -#define XKBSRV_NEED_FILE_FUNCS -#include <xkbsrv.h> +#include "xkbsrv.h" #include "xkbgeom.h" Atom @@ -52,10 +51,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 - char * _XkbDupString(char *str) { @@ -562,10 +557,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]; } } @@ -1086,10 +1079,8 @@ unsigned i,size_toc; 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++) { @@ -1227,11 +1218,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)|| |