diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | compat.c | 1 | ||||
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | expr.c | 4 | ||||
-rw-r--r-- | indicators.c | 6 | ||||
-rw-r--r-- | keycodes.c | 2 | ||||
-rw-r--r-- | keymap.c | 2 | ||||
-rw-r--r-- | keytypes.c | 4 | ||||
-rw-r--r-- | listing.c | 3 | ||||
-rw-r--r-- | misc.c | 2 | ||||
-rw-r--r-- | parseutils.c | 1 | ||||
-rw-r--r-- | tokens.h | 5 | ||||
-rw-r--r-- | utils.h | 4 | ||||
-rw-r--r-- | vmod.c | 1 | ||||
-rw-r--r-- | xkbcomp.c | 9 | ||||
-rw-r--r-- | xkbcomp.h | 1 | ||||
-rw-r--r-- | xkbparse.y | 1 | ||||
-rw-r--r-- | xkbpath.c | 1 | ||||
-rw-r--r-- | xkbscan.c | 13 |
20 files changed, 42 insertions, 31 deletions
@@ -22,3 +22,6 @@ xkbparse.h *~ *.o ylwrap +xkbcomp-*.tar.* +ChangeLog +tags diff --git a/Makefile.am b/Makefile.am index ffcbcbd..e5234d1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -105,6 +105,6 @@ MAINTAINERCLEANFILES += ChangeLog .PHONY: ChangeLog ChangeLog: - (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2) + $(CHANGELOG_CMD) dist-hook: ChangeLog @@ -32,6 +32,7 @@ #include "misc.h" #include "indicators.h" #include "action.h" +#include "compat.h" typedef struct _SymInterpInfo { diff --git a/configure.ac b/configure.ac index c11850b..0470334 100644 --- a/configure.ac +++ b/configure.ac @@ -25,20 +25,28 @@ AC_INIT(xkbcomp,[1.0.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=xor AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE +# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG +m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.2) + AM_CONFIG_HEADER(config.h) AC_PROG_CC AC_PROG_YACC AC_PROG_INSTALL +XORG_CWARNFLAGS + AC_CHECK_FUNCS([strdup strcasecmp]) # Checks for pkg-config packages PKG_CHECK_MODULES(XKBCOMP, x11 xkbfile) +XKBCOMP_CFLAGS="$CWARNFLAGS $XKBCOMP_CFLAGS" AC_SUBST(XKBCOMP_CFLAGS) AC_SUBST(XKBCOMP_LIBS) XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION +XORG_CHANGELOG AC_OUTPUT([Makefile]) @@ -488,7 +488,7 @@ ExprResolveFloat(ExprDef * expr, { register char *str; str = XkbAtomGetString(NULL, expr->value.str); - if ((str != None) && (strlen(str) == 1)) + if ((str != NULL) && (strlen(str) == 1)) { val_rtrn->uval = str[0] * XkbGeomPtsPerMM; return True; @@ -601,7 +601,7 @@ ExprResolveInteger(ExprDef * expr, { register char *str; str = XkbAtomGetString(NULL, expr->value.str); - if (str != None) + if (str != NULL) switch (strlen(str)) { case 0: diff --git a/indicators.c b/indicators.c index 080ae8e..d4a362f 100644 --- a/indicators.c +++ b/indicators.c @@ -152,7 +152,7 @@ AddIndicatorMap(LEDInfo * oldLEDs, LEDInfo * new) WSGO("Couldn't allocate indicator map\n"); ACTION1("Map for indicator %s not compiled\n", XkbAtomText(NULL, new->name, XkbMessage)); - return False; + return NULL; } *old = *new; old->defs.next = NULL; @@ -164,7 +164,7 @@ AddIndicatorMap(LEDInfo * oldLEDs, LEDInfo * new) return old; } -LookupEntry modComponentNames[] = { +static LookupEntry modComponentNames[] = { {"base", XkbIM_UseBase} , {"latched", XkbIM_UseLatched} @@ -181,7 +181,7 @@ LookupEntry modComponentNames[] = { , {NULL, 0} }; -LookupEntry groupComponentNames[] = { +static LookupEntry groupComponentNames[] = { {"base", XkbIM_UseBase} , {"latched", XkbIM_UseLatched} @@ -500,7 +500,7 @@ HandleIncludeKeycodes(IncludeStmt * stmt, XkbDescPtr xkb, KeyNamesInfo * info) { unsigned newMerge; XkbFile *rtrn; - KeyNamesInfo included = {0}; + KeyNamesInfo included = {NULL}; Bool haveSelf; haveSelf = False; @@ -39,7 +39,7 @@ #define SYMBOLS 4 #define MAX_SECTIONS 5 -XkbFile *sections[MAX_SECTIONS]; +static XkbFile *sections[MAX_SECTIONS]; /** * Compile the given file and store the output in result. @@ -1001,7 +1001,7 @@ HandleKeyTypeDef(KeyTypeDef * def, type.defs.defined = 0; type.defs.fileID = info->fileID; type.defs.merge = merge; - type.defs.next = 0; + type.defs.next = NULL; type.dpy = info->dpy; type.name = def->name; type.mask = info->dflt.mask; @@ -1221,7 +1221,7 @@ CompileKeyTypes(XkbFile * file, XkbFileInfo * result, unsigned merge) register KeyTypeInfo *def; register XkbKeyTypePtr type, next; - if (info.name != None) + if (info.name != NULL) { if (XkbAllocNames(xkb, XkbTypesNameMask, 0, 0) == Success) xkb->names->types = XkbInternAtom(xkb->dpy, info.name, False); @@ -80,7 +80,6 @@ SOFTWARE. #include <malloc.h> #endif -#define DEBUG_VAR_NOT_LOCAL #define DEBUG_VAR listingDebug #include "xkbcomp.h" #include <stdlib.h> @@ -126,6 +125,8 @@ SOFTWARE. #define lowbit(x) ((x) & (-(x))) +unsigned int listingDebug; + static int szListing = 0; static int nListed = 0; static int nFilesListed = 0; @@ -267,7 +267,7 @@ typedef struct _KeyNameDesc Bool used; } KeyNameDesc; -KeyNameDesc dfltKeys[] = { +static KeyNameDesc dfltKeys[] = { {XK_Escape, NoSymbol, "ESC\0"}, {XK_quoteleft, XK_asciitilde, "TLDE"}, {XK_1, XK_exclam, "AE01"}, diff --git a/parseutils.c b/parseutils.c index 6adcdfd..ad1b0d1 100644 --- a/parseutils.c +++ b/parseutils.c @@ -24,7 +24,6 @@ ********************************************************/ -#define DEBUG_VAR_NOT_LOCAL #define DEBUG_VAR parseDebug #include "parseutils.h" #include "xkbpath.h" @@ -96,4 +96,9 @@ #define FUNCTION_KEYS 76 #define ALTERNATE_GROUP 77 +extern Atom tok_ONE_LEVEL; +extern Atom tok_TWO_LEVEL; +extern Atom tok_ALPHABETIC; +extern Atom tok_KEYPAD; + #endif @@ -258,9 +258,7 @@ uInformation(const char * /* s */ , ... #define DEBUG_VAR debugFlags #endif -#ifdef DEBUG_VAR_NOT_LOCAL - extern -#endif +extern unsigned int DEBUG_VAR; extern void uDebug(char * /* s */ , ... @@ -24,7 +24,6 @@ ********************************************************/ -#define DEBUG_VAR_NOT_LOCAL #define DEBUG_VAR debugFlags #include <stdio.h> #include "xkbcomp.h" @@ -38,7 +38,6 @@ #include <malloc.h> #endif -#define DEBUG_VAR_NOT_LOCAL #define DEBUG_VAR debugFlags #include "xkbcomp.h" #include <stdlib.h> @@ -74,6 +73,8 @@ #define INPUT_XKB 1 #define INPUT_XKM 2 +unsigned int debugFlags; + static const char *fileTypeExt[] = { "XXX", "xkm", @@ -633,10 +634,10 @@ parseArgs(int argc, char *argv[]) inputFormat = INPUT_XKB; } #ifndef WIN32 - else if (strchr(inputFile, ':') == 0) + else if (strchr(inputFile, ':') == NULL) { #else - else if ((strchr(inputFile, ':') == 0) || (strlen(inputFile) > 2 && + else if ((strchr(inputFile, ':') == NULL) || (strlen(inputFile) > 2 && isalpha(inputFile[0]) && inputFile[1] == ':' && strchr(inputFile + 2, @@ -648,7 +649,7 @@ parseArgs(int argc, char *argv[]) if (inputFile[len - 1] == ')') { char *tmp; - if ((tmp = strchr(inputFile, '(')) != 0) + if ((tmp = strchr(inputFile, '(')) != NULL) { *tmp = '\0'; inputFile[len - 1] = '\0'; @@ -28,7 +28,6 @@ #define XKBCOMP_H 1 #ifndef DEBUG_VAR -#define DEBUG_VAR_NOT_LOCAL #define DEBUG_VAR debugFlags #endif @@ -98,6 +98,7 @@ #include <X11/extensions/XKBgeom.h> #include <stdlib.h> +static unsigned int parseDebug; %} %right EQUALS @@ -27,7 +27,6 @@ #include <X11/Xlib.h> #include <X11/XKBlib.h> -#define DEBUG_VAR_NOT_LOCAL #define DEBUG_VAR debugFlags #include "utils.h" #include <stdlib.h> @@ -35,6 +35,8 @@ #include "utils.h" #include "parseutils.h" +unsigned int scanDebug; + FILE *yyin = NULL; static char scanFileBuf[1024] = {0}; @@ -42,20 +44,15 @@ char *scanFile = scanFileBuf; int lineNum = 0; int scanInt; -char *scanIntStr; -int scanIntClass; char *scanStr = NULL; -int scanStrLine = 0; +static int scanStrLine = 0; #define BUFSIZE 512 static int nInBuf = 0; static char buf[BUFSIZE]; #ifdef DEBUG - -extern unsigned debugFlags; - static char * tokText(int tok) { @@ -446,7 +443,7 @@ yyGetKeyName(void) return ERROR_TOK; } -struct _Keyword +static struct _Keyword { const char *keyword; int token; @@ -543,7 +540,7 @@ struct _Keyword { "alternate_group", ALTERNATE_GROUP} }; -int numKeywords = sizeof(keywords) / sizeof(struct _Keyword); +static int numKeywords = sizeof(keywords) / sizeof(struct _Keyword); static int yyGetIdent(int first) |