Commit 0d745819 authored by Patrick Lam's avatar Patrick Lam

Fix intel compiler warnings: make many variables static, eliminate

    duplicate names, reduce variable scopes, unsigned/signed printf
    formatting.
reviewed by: plam
parent b17cf498
2006-04-06 Kjartan Maraas <kmaraas@gnome.org>
reviewed by: plam
* fc-case/fc-case.c:
* fc-glyphname/fc-glyphname.c:
* fc-lang/fc-lang.c (main):
* fc-match/fc-match.c:
* src/fccache.c (FcGlobalCacheSave, FcCacheSkipToArch,
FcDirCacheWrite):
* src/fcfreetype.c (FcFreeTypeQuery):
* src/fclang.c (FcFreeTypeLangSet):
* src/fcxml.c:
Fix intel compiler warnings: make many variables static,
eliminate duplicate names, reduce variable scopes, unsigned/signed
printf formatting.
2006-03-24 Mike Fabian <mfabian@suse.de>
reviewed by: plam
* src/fccache.c (FcGlobalCacheLoad, FcCacheSkipToArch):
......
......@@ -112,10 +112,10 @@ utf8_size (FcChar32 ucs4)
}
static FcChar8 *foldChars;
int nfoldChars;
int maxFoldChars;
FcChar32 minFoldChar;
FcChar32 maxFoldChar;
static int nfoldChars;
static int maxFoldChars;
static FcChar32 minFoldChar;
static FcChar32 maxFoldChar;
static void
addChar (FcChar32 c)
......
......@@ -83,12 +83,12 @@ fatal (const char *file, int lineno, const char *msg)
#define MAX_GLYPHNAME 10240
#define MAX_NAMELEN 1024
FcGlyphName *raw[MAX_GLYPHNAME];
int nraw;
int max_name_len;
FcGlyphName *name_to_ucs[MAX_GLYPHNAME*2];
FcGlyphName *ucs_to_name[MAX_GLYPHNAME*2];
int hash, rehash;
static FcGlyphName *raw[MAX_GLYPHNAME];
static int nraw;
static int max_name_len;
static FcGlyphName *name_to_ucs[MAX_GLYPHNAME*2];
static FcGlyphName *ucs_to_name[MAX_GLYPHNAME*2];
static unsigned int hash, rehash;
static int
rawindex (const FcGlyphName *gn)
......
......@@ -97,7 +97,7 @@ get_line (FILE *f, char *line, int *lineno)
return line;
}
char *dir = 0;
static char *dir = 0;
static FILE *
scanopen (char *file)
......@@ -246,7 +246,6 @@ main (int argc, char **argv)
int total_leaves = 0;
int offset_count = 0;
int l, sl, tl;
int c;
static char line[1024];
static FcChar32 map[MAX_LANG_SET_MAP];
int num_lang_set_map;
......@@ -463,6 +462,7 @@ main (int argc, char **argv)
*/
if (ncountry)
{
int c;
int ncountry_ent = 0;
printf ("\n");
printf ("static const FcChar32 fcLangCountrySets[][NUM_LANG_SET_MAP] = {\n");
......@@ -471,7 +471,7 @@ main (int argc, char **argv)
i = country[c];
if (i >= 0)
{
int l = strchr (langs[i], '-') - langs[i];
int lang = strchr (langs[i], '-') - langs[i];
int d, k;
for (k = 0; k < num_lang_set_map; k++)
......@@ -491,7 +491,7 @@ main (int argc, char **argv)
for (k = 0; k < num_lang_set_map; k++)
printf (" 0x%08x,", map[k]);
printf (" }, /* %*.*s */\n",
l, l, langs[i]);
lang, lang, langs[i]);
++ncountry_ent;
}
}
......
......@@ -47,7 +47,7 @@
#undef _GNU_SOURCE
#define _GNU_SOURCE
#include <getopt.h>
const struct option longopts[] = {
static const struct option longopts[] = {
{"sort", 0, 0, 's'},
{"version", 0, 0, 'V'},
{"verbose", 0, 0, 'v'},
......
......@@ -410,7 +410,7 @@ FcGlobalCacheSave (FcGlobalCache *cache,
const FcChar8 *cache_file,
FcConfig *config)
{
int fd, fd_orig, i;
int fd, fd_orig;
FcGlobalCacheDir *dir;
FcAtomic *atomic;
off_t current_arch_start = 0, truncate_to;
......@@ -468,6 +468,8 @@ FcGlobalCacheSave (FcGlobalCache *cache,
truncate_to = current_arch_start + strlen(current_arch_machine_name) + 11;
for (dir = cache->dirs; dir; dir = dir->next)
{
int i;
if (dir->state == FcGCDirDisabled)
continue;
truncate_to += strlen(dir->name) + 1;
......@@ -488,6 +490,7 @@ FcGlobalCacheSave (FcGlobalCache *cache,
for (dir = cache->dirs; dir; dir = dir->next)
{
int i;
const char * d;
off_t off;
......@@ -645,8 +648,6 @@ FcCacheSkipToArch (int fd, const char * arch)
current_arch_start += bs;
current_arch_start = FcCacheNextOffset (current_arch_start);
}
return -1;
}
/* Cuts out the segment at the file pointer (moves everything else
......@@ -1324,8 +1325,8 @@ FcDirCacheWrite (FcFontSet *set, FcStrSet *dirs, const FcChar8 *dir)
if (current_arch_start < 0)
{
off_t i = lseek(fd_orig, 0, SEEK_END);
current_arch_start = FcCacheNextOffset (i);
off_t offset = lseek(fd_orig, 0, SEEK_END);
current_arch_start = FcCacheNextOffset (offset);
}
if (fd_orig != -1 && !FcCacheCopyOld(fd, fd_orig, current_arch_start))
......
......@@ -1221,7 +1221,7 @@ FcFreeTypeQuery (const FcChar8 *file,
* or which are simply a FC_FAMILY and FC_STYLE glued together
*/
{
int fn, fa, st;
int fn, fa;
FcChar8 *full;
FcChar8 *fam;
FcChar8 *style;
......@@ -1438,7 +1438,6 @@ FcFreeTypeQuery (const FcChar8 *file,
if (!foundry)
{
int rc;
BDF_PropertyRec prop;
rc = FT_Get_BDF_Property(face, "FOUNDRY", &prop);
if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM)
foundry = (FcChar8 *) prop.u.atom;
......@@ -1606,7 +1605,6 @@ FcFreeTypeQuery (const FcChar8 *file,
if(face->num_fixed_sizes == 1) {
int rc;
int value;
BDF_PropertyRec prop;
/* skip bitmap fonts which do not even have a family name */
rc = FT_Get_BDF_Property(face, "FAMILY_NAME", &prop);
......
......@@ -95,7 +95,7 @@ FcFreeTypeLangSet (const FcCharSet *charset,
FcChar32 map[FC_CHARSET_MAP_SIZE];
FcChar32 next;
printf ("\n%s(%d) ", fcLangCharSets[i].lang, missing);
printf ("\n%s(%u) ", fcLangCharSets[i].lang, missing);
printf ("{");
for (ucs4 = FcCharSetFirstPage (missed, map, &next);
ucs4 != FC_CHARSET_DONE;
......@@ -114,7 +114,7 @@ FcFreeTypeLangSet (const FcCharSet *charset,
FcCharSetDestroy (missed);
}
else
printf ("%s(%d) ", fcLangCharSets[i].lang, missing);
printf ("%s(%u) ", fcLangCharSets[i].lang, missing);
}
if (!missing)
FcLangSetBitSet (ls, i);
......@@ -388,7 +388,6 @@ FcLangSetHasLang (const FcLangSet *ls, const FcChar8 *lang)
{
FcStrList *list = FcStrListCreate (ls->extra);
FcChar8 *extra;
FcLangResult r;
if (list)
{
......
......@@ -27,7 +27,7 @@
#include "fcint.h"
#include <dirent.h>
#if ENABLE_LIBXML2
#ifdef ENABLE_LIBXML2
#include <libxml/parser.h>
......@@ -2234,7 +2234,7 @@ FcStartDoctypeDecl (void *userData,
FcConfigMessage (parse, FcSevereError, "invalid doctype \"%s\"", doctypeName);
}
#if ENABLE_LIBXML2
#ifdef ENABLE_LIBXML2
static void
FcInternalSubsetDecl (void *userData,
......@@ -2359,7 +2359,7 @@ FcConfigParseAndLoad (FcConfig *config,
FcConfigParse parse;
FcBool error = FcTrue;
#if ENABLE_LIBXML2
#ifdef ENABLE_LIBXML2
xmlSAXHandler sax;
char buf[BUFSIZ];
#else
......@@ -2398,7 +2398,7 @@ FcConfigParseAndLoad (FcConfig *config,
goto bail0;
}
#if ENABLE_LIBXML2
#ifdef ENABLE_LIBXML2
memset(&sax, 0, sizeof(sax));
sax.internalSubset = FcInternalSubsetDecl;
......@@ -2419,7 +2419,7 @@ FcConfigParseAndLoad (FcConfig *config,
if (!FcConfigInit (&parse, name, config, p))
goto bail2;
#if !ENABLE_LIBXML2
#ifndef ENABLE_LIBXML2
XML_SetUserData (p, &parse);
......@@ -2430,7 +2430,7 @@ FcConfigParseAndLoad (FcConfig *config,
#endif /* ENABLE_LIBXML2 */
do {
#if !ENABLE_LIBXML2
#ifndef ENABLE_LIBXML2
buf = XML_GetBuffer (p, BUFSIZ);
if (!buf)
{
......@@ -2445,7 +2445,7 @@ FcConfigParseAndLoad (FcConfig *config,
goto bail3;
}
#if ENABLE_LIBXML2
#ifdef ENABLE_LIBXML2
if (xmlParseChunk (p, buf, len, len == 0))
#else
if (!XML_ParseBuffer (p, len, len == 0))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment