summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-11 09:50:55 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-03 11:02:11 -0800
commit0493c7216dd39baeb420583be71af095576dbf74 (patch)
tree0d41116a388b4af4bcf821b994eebe62110a7b2c
parent4119707089b5c14f53bd5ff0b86ee7e575ac9316 (diff)
Mark more functions and variables static
Stop exporting things that aren't used outside the file that defines them. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--action.c4
-rw-r--r--action.h2
-rw-r--r--expr.c6
-rw-r--r--expr.h17
-rw-r--r--keytypes.c27
-rw-r--r--listing.c2
-rw-r--r--misc.c2
-rw-r--r--misc.h6
-rw-r--r--utils.c4
-rw-r--r--utils.h3
-rw-r--r--vmod.c2
-rw-r--r--vmod.h7
-rw-r--r--xkbcomp.c4
-rw-r--r--xkbcomp.h6
-rw-r--r--xkbpath.c2
-rw-r--r--xkbpath.h2
16 files changed, 18 insertions, 78 deletions
diff --git a/action.c b/action.c
index 7c8074a..b921f0d 100644
--- a/action.c
+++ b/action.c
@@ -38,6 +38,8 @@ static Bool actionsInitialized;
static ExprDef constTrue;
static ExprDef constFalse;
+static void ActionsInit(void);
+
/***====================================================================***/
static Bool
@@ -1488,7 +1490,7 @@ SetActionField(XkbDescPtr xkb,
/***====================================================================***/
-void
+static void
ActionsInit(void)
{
if (!actionsInitialized)
diff --git a/action.h b/action.h
index bd9273d..a431122 100644
--- a/action.h
+++ b/action.h
@@ -79,8 +79,6 @@ extern int SetActionField(XkbDescPtr /* xkb */ ,
ActionInfo ** /* info_rtrn */
);
-extern void ActionsInit(void);
-
extern LookupEntry ctrlNames[];
#endif /* ACTION_H */
diff --git a/expr.c b/expr.c
index 4af45c3..b22bb66 100644
--- a/expr.c
+++ b/expr.c
@@ -94,7 +94,7 @@ exprOpText(unsigned type)
return buf;
}
-char *
+static char *
exprTypeText(unsigned type)
{
static char buf[20];
@@ -208,7 +208,7 @@ RadioLookup(XPointer priv,
return True;
}
-int
+static int
TableLookup(XPointer priv,
Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
{
@@ -255,7 +255,7 @@ LookupModIndex(XPointer priv,
val_rtrn);
}
-int
+static int
LookupModMask(XPointer priv,
Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
{
diff --git a/expr.h b/expr.h
index 163d474..b0b79dc 100644
--- a/expr.h
+++ b/expr.h
@@ -42,9 +42,6 @@ typedef Bool(*IdentLookupFunc) (XPointer /* priv */ ,
ExprResult * /* val_rtrn */
);
-extern char *exprTypeText(unsigned /* type */
- );
-
extern int ExprResolveLhs(ExprDef * /* expr */ ,
ExprResult * /* elem_rtrn */ ,
ExprResult * /* field_rtrn */ ,
@@ -89,13 +86,6 @@ extern int SimpleLookup(XPointer /* priv */ ,
ExprResult * /* val_rtrn */
);
-extern int TableLookup(XPointer /* priv */ ,
- Atom /* elem */ ,
- Atom /* field */ ,
- unsigned /* type */ ,
- ExprResult * /* val_rtrn */
- );
-
extern int LookupModIndex(XPointer /* priv */ ,
Atom /* elem */ ,
Atom /* field */ ,
@@ -103,13 +93,6 @@ extern int LookupModIndex(XPointer /* priv */ ,
ExprResult * /* val_rtrn */
);
-extern int LookupModMask(XPointer /* priv */ ,
- Atom /* elem */ ,
- Atom /* field */ ,
- unsigned /* type */ ,
- ExprResult * /* val_rtrn */
- );
-
extern int ExprResolveModIndex(ExprDef * /* expr */ ,
ExprResult * /* val_rtrn */ ,
IdentLookupFunc /* lookup */ ,
diff --git a/keytypes.c b/keytypes.c
index 2dba53a..24ad6b1 100644
--- a/keytypes.c
+++ b/keytypes.c
@@ -92,27 +92,6 @@ Atom tok_KEYPAD;
/***====================================================================***/
-extern Bool AddMapEntry(XkbDescPtr /* xkb */ ,
- KeyTypeInfo * /* type */ ,
- XkbKTMapEntryPtr /* new */ ,
- Bool /* clobber */ ,
- Bool /* report */
- );
-
-extern Bool AddPreserve(XkbDescPtr /* xkb */ ,
- KeyTypeInfo * /* type */ ,
- PreserveInfo * /* new */ ,
- Bool /* clobber */ ,
- Bool /* report */
- );
-
-extern Bool AddLevelName(KeyTypeInfo * /* type */ ,
- unsigned /* level */ ,
- Atom /* name */ ,
- Bool /* clobber */ ,
- Bool /* report */
- );
-
#define MapEntryTxt(t,x,e) \
XkbVModMaskText((t)->dpy,(x),(e)->mods.real_mods,(e)->mods.vmods,XkbMessage)
#define PreserveIndexTxt(t,x,p) \
@@ -531,7 +510,7 @@ NextMapEntry(KeyTypeInfo * type)
return &type->entries[type->nEntries++];
}
-Bool
+static Bool
AddPreserve(XkbDescPtr xkb,
KeyTypeInfo * type, PreserveInfo * new, Bool clobber, Bool report)
{
@@ -603,7 +582,7 @@ AddPreserve(XkbDescPtr xkb,
* @param clobber Overwrite existing entry.
* @param report True if a warning is to be printed on.
*/
-Bool
+static Bool
AddMapEntry(XkbDescPtr xkb,
KeyTypeInfo * type,
XkbKTMapEntryPtr new, Bool clobber, Bool report)
@@ -774,7 +753,7 @@ SetPreserve(KeyTypeInfo * type,
/***====================================================================***/
-Bool
+static Bool
AddLevelName(KeyTypeInfo * type,
unsigned level, Atom name, Bool clobber, Bool report)
{
diff --git a/listing.c b/listing.c
index 6a2115a..663c652 100644
--- a/listing.c
+++ b/listing.c
@@ -163,7 +163,7 @@ AddMapOnly(char *map)
return 1;
}
-int
+static int
AddListing(char *file, char *map)
{
if (nListed >= szListing)
diff --git a/misc.c b/misc.c
index f41c04c..b41a64c 100644
--- a/misc.c
+++ b/misc.c
@@ -226,7 +226,7 @@ UseNewField(unsigned field,
return useNew;
}
-Bool
+static Bool
MergeNewField(unsigned field,
CommonInfo * oldDefs, CommonInfo * newDefs, unsigned *pCollide)
{
diff --git a/misc.h b/misc.h
index b6a5288..5c26d68 100644
--- a/misc.h
+++ b/misc.h
@@ -41,12 +41,6 @@ extern Bool UseNewField(unsigned /* field */ ,
unsigned * /* pCollide */
);
-extern Bool MergeNewField(unsigned /* field */ ,
- CommonInfo * /* oldDefs */ ,
- CommonInfo * /* newDefs */ ,
- unsigned * /* pCollide */
- );
-
extern XPointer ClearCommonInfo(CommonInfo * /* cmn */
);
diff --git a/utils.c b/utils.c
index fcf7a8c..31be8e7 100644
--- a/utils.c
+++ b/utils.c
@@ -58,9 +58,9 @@ uRecalloc(void *old, size_t nOld, size_t nNew, size_t itemSize)
/*** PRINT FUNCTIONS ***/
/***====================================================================***/
-FILE *uDebugFile = NULL;
+static FILE *uDebugFile = NULL;
int uDebugIndentLevel = 0;
-int uDebugIndentSize = 4;
+static const int uDebugIndentSize = 4;
Boolean
uSetDebugFile(char *name)
diff --git a/utils.h b/utils.h
index 0a4484b..afa43e7 100644
--- a/utils.h
+++ b/utils.h
@@ -180,9 +180,8 @@ extern
extern Boolean uSetDebugFile(char *name);
- extern FILE *uDebugFile;
extern int uDebugIndentLevel;
- extern int uDebugIndentSize;
+
#define uDebugIndent(l) (uDebugIndentLevel+=(l))
#define uDebugOutdent(l) (uDebugIndentLevel-=(l))
#ifdef DEBUG
diff --git a/vmod.c b/vmod.c
index 97448c0..17aa7a7 100644
--- a/vmod.c
+++ b/vmod.c
@@ -165,7 +165,7 @@ HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info)
* @return True on success, False otherwise. If False is returned, val_rtrn is
* undefined.
*/
-int
+static int
LookupVModIndex(XPointer priv,
Atom elem, Atom field, unsigned type, ExprResult * val_rtrn)
{
diff --git a/vmod.h b/vmod.h
index 75f9fb4..66683b5 100644
--- a/vmod.h
+++ b/vmod.h
@@ -53,13 +53,6 @@ extern Bool ApplyVModDefs(VModInfo * /* info */ ,
XkbDescPtr /* xkb */
);
-extern int LookupVModIndex(XPointer /* priv */ ,
- Atom /* elem */ ,
- Atom /* field */ ,
- unsigned /* type */ ,
- ExprResult * /* val_rtrn */
- );
-
extern int LookupVModMask(XPointer /* priv */ ,
Atom /* elem */ ,
Atom /* field */ ,
diff --git a/xkbcomp.c b/xkbcomp.c
index c7079ae..98e0d26 100644
--- a/xkbcomp.c
+++ b/xkbcomp.c
@@ -78,7 +78,7 @@ static const char *fileTypeExt[] = {
};
static unsigned inputFormat, outputFormat;
-char *rootDir;
+static char *rootDir;
static char *inputFile;
static char *inputMap;
static char *outputFile;
@@ -93,7 +93,7 @@ static Bool xkblist = False;
unsigned warningLevel = 5;
unsigned verboseLevel = 0;
unsigned dirsToStrip = 0;
-unsigned optionalParts = 0;
+static unsigned optionalParts = 0;
static char *preErrorMsg = NULL;
static char *postErrorMsg = NULL;
static char *errorPrefix = NULL;
diff --git a/xkbcomp.h b/xkbcomp.h
index cd077ca..423a2cf 100644
--- a/xkbcomp.h
+++ b/xkbcomp.h
@@ -110,7 +110,6 @@ typedef struct _ParseCommon
#define CreateKeyNames(x) ((x)->flags&AutoKeyNames)
extern unsigned warningLevel;
-extern unsigned optionalParts;
typedef struct _IncludeStmt
{
@@ -377,14 +376,9 @@ extern Bool CompileSymbols(XkbFile * /* file */ ,
#define WantFullNames (1<<3)
#define ListRecursive (1<<4)
-extern char *rootDir;
extern unsigned verboseLevel;
extern unsigned dirsToStrip;
-extern Bool AddListing(char * /* file */ ,
- char * /* map */
- );
-
extern Bool AddMatchingFiles(char * /* head_in */
);
diff --git a/xkbpath.c b/xkbpath.c
index b5405de..3c44d9c 100644
--- a/xkbpath.c
+++ b/xkbpath.c
@@ -175,7 +175,7 @@ XkbAddDefaultDirectoriesToPath(void)
/**
* Remove all entries from the global includePath.
*/
-void
+static void
XkbClearIncludePath(void)
{
if (szPath > 0)
diff --git a/xkbpath.h b/xkbpath.h
index 66c3ab7..65e9dee 100644
--- a/xkbpath.h
+++ b/xkbpath.h
@@ -29,8 +29,6 @@
extern Bool XkbInitIncludePath(void);
-extern void XkbClearIncludePath(void);
-
extern void XkbAddDefaultDirectoriesToPath(void);
extern Bool XkbAddDirectoryToPath(const char * /* dir */