summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--Makefile.am2
-rw-r--r--compat.c1
-rw-r--r--configure.ac8
-rw-r--r--expr.c4
-rw-r--r--indicators.c6
-rw-r--r--keycodes.c2
-rw-r--r--keymap.c2
-rw-r--r--keytypes.c4
-rw-r--r--listing.c3
-rw-r--r--misc.c2
-rw-r--r--parseutils.c1
-rw-r--r--tokens.h5
-rw-r--r--utils.h4
-rw-r--r--vmod.c1
-rw-r--r--xkbcomp.c9
-rw-r--r--xkbcomp.h1
-rw-r--r--xkbparse.y1
-rw-r--r--xkbpath.c1
-rw-r--r--xkbscan.c13
20 files changed, 42 insertions, 31 deletions
diff --git a/.gitignore b/.gitignore
index 9321cd0..e685f5a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/compat.c b/compat.c
index f2f3f90..03c29ef 100644
--- a/compat.c
+++ b/compat.c
@@ -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])
diff --git a/expr.c b/expr.c
index e116688..96fd956 100644
--- a/expr.c
+++ b/expr.c
@@ -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}
diff --git a/keycodes.c b/keycodes.c
index a2f4396..1bff7fa 100644
--- a/keycodes.c
+++ b/keycodes.c
@@ -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;
diff --git a/keymap.c b/keymap.c
index 4736eb8..a419d8c 100644
--- a/keymap.c
+++ b/keymap.c
@@ -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.
diff --git a/keytypes.c b/keytypes.c
index 3065d29..da55d75 100644
--- a/keytypes.c
+++ b/keytypes.c
@@ -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);
diff --git a/listing.c b/listing.c
index 996fdf2..146ecba 100644
--- a/listing.c
+++ b/listing.c
@@ -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;
diff --git a/misc.c b/misc.c
index c7b41dd..0e4f61d 100644
--- a/misc.c
+++ b/misc.c
@@ -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"
diff --git a/tokens.h b/tokens.h
index 026032e..970f3d4 100644
--- a/tokens.h
+++ b/tokens.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
diff --git a/utils.h b/utils.h
index e773dea..65e37c8 100644
--- a/utils.h
+++ b/utils.h
@@ -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 */ , ...
diff --git a/vmod.c b/vmod.c
index 4ade0a8..5578fd0 100644
--- a/vmod.c
+++ b/vmod.c
@@ -24,7 +24,6 @@
********************************************************/
-#define DEBUG_VAR_NOT_LOCAL
#define DEBUG_VAR debugFlags
#include <stdio.h>
#include "xkbcomp.h"
diff --git a/xkbcomp.c b/xkbcomp.c
index ae5145d..988b5c5 100644
--- a/xkbcomp.c
+++ b/xkbcomp.c
@@ -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';
diff --git a/xkbcomp.h b/xkbcomp.h
index cbd19b5..6e02ed5 100644
--- a/xkbcomp.h
+++ b/xkbcomp.h
@@ -28,7 +28,6 @@
#define XKBCOMP_H 1
#ifndef DEBUG_VAR
-#define DEBUG_VAR_NOT_LOCAL
#define DEBUG_VAR debugFlags
#endif
diff --git a/xkbparse.y b/xkbparse.y
index 7a73e89..bee7bc6 100644
--- a/xkbparse.y
+++ b/xkbparse.y
@@ -98,6 +98,7 @@
#include <X11/extensions/XKBgeom.h>
#include <stdlib.h>
+static unsigned int parseDebug;
%}
%right EQUALS
diff --git a/xkbpath.c b/xkbpath.c
index 10a6136..6802012 100644
--- a/xkbpath.c
+++ b/xkbpath.c
@@ -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>
diff --git a/xkbscan.c b/xkbscan.c
index bc7e230..31cafd4 100644
--- a/xkbscan.c
+++ b/xkbscan.c
@@ -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)