summaryrefslogtreecommitdiff
path: root/listing.c
diff options
context:
space:
mode:
Diffstat (limited to 'listing.c')
-rw-r--r--listing.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/listing.c b/listing.c
index 4c8fe70..92246e2 100644
--- a/listing.c
+++ b/listing.c
@@ -400,13 +400,11 @@ AddMatchingFiles(char *head_in)
static Bool
MapMatches(char *mapToConsider, char *ptrn)
{
- int i;
-
if (ptrn != NULL)
return XkbNameMatchesPattern(mapToConsider, ptrn);
if (nMapOnly < 1)
return True;
- for (i = 0; i < nMapOnly; i++)
+ for (int i = 0; i < nMapOnly; i++)
{
if (XkbNameMatchesPattern(mapToConsider, mapOnly[i]))
return True;
@@ -417,11 +415,8 @@ MapMatches(char *mapToConsider, char *ptrn)
int
GenerateListing(char *out_name)
{
- int i;
- FILE *inputFile, *outFile;
- XkbFile *rtrn, *mapToUse;
- unsigned oldWarningLevel;
- char *mapName;
+ FILE *outFile;
+ XkbFile *rtrn;
if (nFilesListed < 1)
{
@@ -441,8 +436,9 @@ GenerateListing(char *out_name)
if (warningLevel > 9)
fprintf(stderr, "should list:\n");
#endif
- for (i = 0; i < nListed; i++)
+ for (int i = 0; i < nListed; i++)
{
+ unsigned oldWarningLevel;
#ifdef DEBUG
if (warningLevel > 9)
{
@@ -455,6 +451,7 @@ GenerateListing(char *out_name)
warningLevel = 0;
if (list[i].file)
{
+ FILE *inputFile;
struct stat sbuf;
if (stat(list[i].file, &sbuf) < 0)
@@ -480,8 +477,8 @@ GenerateListing(char *out_name)
setScanState(list[i].file, 1);
if (XKBParseFile(inputFile, &rtrn) && (rtrn != NULL))
{
- mapName = list[i].map;
- mapToUse = rtrn;
+ char *mapName = list[i].map;
+ XkbFile *mapToUse = rtrn;
for (; mapToUse; mapToUse = (XkbFile *) mapToUse->common.next)
{
if (!MapMatches(mapToUse->name, mapName))