+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):
}
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)
#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)
return line;
}
-char *dir = 0;
+static char *dir = 0;
static FILE *
scanopen (char *file)
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;
*/
if (ncountry)
{
+ int c;
int ncountry_ent = 0;
printf ("\n");
printf ("static const FcChar32 fcLangCountrySets[][NUM_LANG_SET_MAP] = {\n");
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++)
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;
}
}
#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'},
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;
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;
for (dir = cache->dirs; dir; dir = dir->next)
{
+ int i;
const char * d;
off_t off;
current_arch_start += bs;
current_arch_start = FcCacheNextOffset (current_arch_start);
}
-
- return -1;
}
/* Cuts out the segment at the file pointer (moves everything else
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))
* 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;
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;
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);
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;
FcCharSetDestroy (missed);
}
else
- printf ("%s(%d) ", fcLangCharSets[i].lang, missing);
+ printf ("%s(%u) ", fcLangCharSets[i].lang, missing);
}
if (!missing)
FcLangSetBitSet (ls, i);
{
FcStrList *list = FcStrListCreate (ls->extra);
FcChar8 *extra;
- FcLangResult r;
if (list)
{
#include "fcint.h"
#include <dirent.h>
-#if ENABLE_LIBXML2
+#ifdef ENABLE_LIBXML2
#include <libxml/parser.h>
FcConfigMessage (parse, FcSevereError, "invalid doctype \"%s\"", doctypeName);
}
-#if ENABLE_LIBXML2
+#ifdef ENABLE_LIBXML2
static void
FcInternalSubsetDecl (void *userData,
FcConfigParse parse;
FcBool error = FcTrue;
-#if ENABLE_LIBXML2
+#ifdef ENABLE_LIBXML2
xmlSAXHandler sax;
char buf[BUFSIZ];
#else
goto bail0;
}
-#if ENABLE_LIBXML2
+#ifdef ENABLE_LIBXML2
memset(&sax, 0, sizeof(sax));
sax.internalSubset = FcInternalSubsetDecl;
if (!FcConfigInit (&parse, name, config, p))
goto bail2;
-#if !ENABLE_LIBXML2
+#ifndef ENABLE_LIBXML2
XML_SetUserData (p, &parse);
#endif /* ENABLE_LIBXML2 */
do {
-#if !ENABLE_LIBXML2
+#ifndef ENABLE_LIBXML2
buf = XML_GetBuffer (p, BUFSIZ);
if (!buf)
{
goto bail3;
}
-#if ENABLE_LIBXML2
+#ifdef ENABLE_LIBXML2
if (xmlParseChunk (p, buf, len, len == 0))
#else
if (!XML_ParseBuffer (p, len, len == 0))