From: Behdad Esfahbod Date: Mon, 12 Apr 2010 16:18:50 +0000 (-0400) Subject: Remove all training whitespaces X-Git-Tag: root-2~54 X-Git-Url: https://git.wh0rd.org/?p=fontconfig.git;a=commitdiff_plain;h=594dcef0f30ca27e27b95a9174087e8c61327e5f Remove all training whitespaces --- diff --git a/src/fcatomic.c b/src/fcatomic.c index 89cae61..67c0d15 100644 --- a/src/fcatomic.c +++ b/src/fcatomic.c @@ -79,7 +79,7 @@ FcAtomicCreate (const FcChar8 *file) if (!atomic) return 0; FcMemAlloc (FC_MEM_ATOMIC, total_len); - + atomic->file = (FcChar8 *) (atomic + 1); strcpy ((char *) atomic->file, (char *) file); @@ -206,7 +206,7 @@ FcAtomicDestroy (FcAtomic *atomic) { FcMemFree (FC_MEM_ATOMIC, sizeof (FcAtomic) + strlen ((char *) atomic->file) * 4 + 4 + - sizeof (NEW_NAME) + sizeof (LCK_NAME) + + sizeof (NEW_NAME) + sizeof (LCK_NAME) + sizeof (TMP_NAME)); free (atomic); diff --git a/src/fccache.c b/src/fccache.c index 69e1a6b..571aa64 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -92,10 +92,10 @@ FcStat (const char *file, struct stat *statb) char full_path_name[MAX_PATH]; char *basename; DWORD rc; - + if (!GetFileAttributesEx (file, GetFileExInfoStandard, &wfad)) return -1; - + statb->st_dev = 0; /* Calculate a pseudo inode number as a hash of the full path name. @@ -108,7 +108,7 @@ FcStat (const char *file, struct stat *statb) rc = GetLongPathName (full_path_name, full_path_name, sizeof (full_path_name)); statb->st_ino = FcStringHash (full_path_name); - + statb->st_mode = _S_IREAD | _S_IWRITE; statb->st_mode |= (statb->st_mode >> 3) | (statb->st_mode >> 6); @@ -116,19 +116,19 @@ FcStat (const char *file, struct stat *statb) statb->st_mode |= _S_IFDIR; else statb->st_mode |= _S_IFREG; - + statb->st_nlink = 1; statb->st_uid = statb->st_gid = 0; statb->st_rdev = 0; - + if (wfad.nFileSizeHigh > 0) return -1; statb->st_size = wfad.nFileSizeLow; - + statb->st_atime = (*(INT64 *)&wfad.ftLastAccessTime)/10000000 - EPOCH_OFFSET; statb->st_mtime = (*(INT64 *)&wfad.ftLastWriteTime)/10000000 - EPOCH_OFFSET; statb->st_ctime = statb->st_mtime; - + return 0; } #endif @@ -215,13 +215,13 @@ FcDirCacheOpenFile (const FcChar8 *cache_file, struct stat *file_stat) return fd; } -/* +/* * Look for a cache file for the specified dir. Attempt * to use each one we find, stopping when the callback * indicates success */ static FcBool -FcDirCacheProcess (FcConfig *config, const FcChar8 *dir, +FcDirCacheProcess (FcConfig *config, const FcChar8 *dir, FcBool (*callback) (int fd, struct stat *fd_stat, struct stat *dir_stat, void *closure), void *closure, FcChar8 **cache_file_ret) @@ -263,7 +263,7 @@ FcDirCacheProcess (FcConfig *config, const FcChar8 *dir, FcStrFree (cache_hashed); } FcStrListDone (list); - + return ret; } @@ -362,7 +362,7 @@ FcCacheInsert (FcCache *cache, struct stat *cache_stat) update[fcCacheMaxLevel] = &fcCacheChains[fcCacheMaxLevel]; fcCacheMaxLevel = level; } - + s = malloc (sizeof (FcCacheSkip) + (level - 1) * sizeof (FcCacheSkip *)); if (!s) return FcFalse; @@ -382,7 +382,7 @@ FcCacheInsert (FcCache *cache, struct stat *cache_stat) s->cache_ino = 0; s->cache_mtime = 0; } - + /* * Insert into all fcCacheChains */ @@ -564,7 +564,7 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat) PAGE_READONLY, 0, 0, NULL); if (hFileMap != NULL) { - cache = MapViewOfFile (hFileMap, FILE_MAP_READ, 0, 0, + cache = MapViewOfFile (hFileMap, FILE_MAP_READ, 0, 0, fd_stat->st_size); CloseHandle (hFileMap); } @@ -583,8 +583,8 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat) return NULL; } allocated = FcTrue; - } - if (cache->magic != FC_CACHE_MAGIC_MMAP || + } + if (cache->magic != FC_CACHE_MAGIC_MMAP || cache->version < FC_CACHE_CONTENT_VERSION || cache->size != fd_stat->st_size || !FcCacheTimeValid (cache, dir_stat) || @@ -674,7 +674,7 @@ FcDirCacheValidateHelper (int fd, struct stat *fd_stat, struct stat *dir_stat, v { FcBool ret = FcTrue; FcCache c; - + if (read (fd, &c, sizeof (FcCache)) != sizeof (FcCache)) ret = FcFalse; else if (c.magic != FC_CACHE_MAGIC_MMAP) @@ -691,7 +691,7 @@ FcDirCacheValidateHelper (int fd, struct stat *fd_stat, struct stat *dir_stat, v static FcBool FcDirCacheValidConfig (const FcChar8 *dir, FcConfig *config) { - return FcDirCacheProcess (config, dir, + return FcDirCacheProcess (config, dir, FcDirCacheValidateHelper, NULL, NULL); } @@ -700,7 +700,7 @@ FcBool FcDirCacheValid (const FcChar8 *dir) { FcConfig *config; - + config = FcConfigGetCurrent (); if (!config) return FcFalse; @@ -722,7 +722,7 @@ FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcSt FcChar8 *dir_serialize; intptr_t *dirs_serialize; FcFontSet *set_serialize; - + if (!serialize) return NULL; /* @@ -747,7 +747,7 @@ FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcSt */ if (!FcFontSetSerializeAlloc (serialize, set)) goto bail1; - + /* Serialize layout complete. Now allocate space and fill it */ cache = malloc (serialize->size); if (!cache) @@ -769,7 +769,7 @@ FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcSt if (!dir_serialize) goto bail2; cache->dir = FcPtrToOffset (cache, dir_serialize); - + /* * Serialize sub dirs */ @@ -778,14 +778,14 @@ FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcSt goto bail2; cache->dirs = FcPtrToOffset (cache, dirs_serialize); cache->dirs_count = dirs->num; - for (i = 0; i < dirs->num; i++) + for (i = 0; i < dirs->num; i++) { FcChar8 *d_serialize = FcStrSerialize (serialize, dirs->strs[i]); if (!d_serialize) goto bail2; dirs_serialize[i] = FcPtrToOffset (dirs_serialize, d_serialize); } - + /* * Serialize font set */ @@ -795,7 +795,7 @@ FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcSt cache->set = FcPtrToOffset (cache, set_serialize); FcSerializeDestroy (serialize); - + FcCacheInsert (cache, NULL); return cache; @@ -817,10 +817,10 @@ FcMakeDirectory (const FcChar8 *dir) { FcChar8 *parent; FcBool ret; - + if (strlen ((char *) dir) == 0) return FcFalse; - + parent = FcStrDirname (dir); if (!parent) return FcFalse; @@ -854,7 +854,7 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config) /* * Write it to the first directory in the list which is writable */ - + list = FcStrListCreate (config->cacheDirs); if (!list) return FcFalse; @@ -909,21 +909,21 @@ FcDirCacheWrite (FcCache *cache, FcConfig *config) fd = open((char *)FcAtomicNewFile (atomic), O_RDWR | O_CREAT | O_BINARY, 0666); if (fd == -1) goto bail4; - + /* Temporarily switch magic to MMAP while writing to file */ magic = cache->magic; if (magic != FC_CACHE_MAGIC_MMAP) cache->magic = FC_CACHE_MAGIC_MMAP; - + /* * Write cache contents to file */ written = write (fd, cache, cache->size); - + /* Switch magic back */ if (magic != FC_CACHE_MAGIC_MMAP) cache->magic = magic; - + if (written != cache->size) { perror ("write cache"); @@ -982,7 +982,7 @@ FcCacheCopySet args1(const FcCache *c) FcFontSet *old = FcCacheSet (c); FcFontSet *new = FcFontSetCreate (); int i; - + if (!new) return NULL; for (i = 0; i < old->nfont; i++) @@ -1116,7 +1116,7 @@ static void MD5Update(struct MD5Context *ctx, const unsigned char *buf, unsigned } /* - * Final wrapup - pad to 64-byte boundary with the bit pattern + * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ static void MD5Final(unsigned char digest[16], struct MD5Context *ctx) diff --git a/src/fccfg.c b/src/fccfg.c index 0f89b57..fc06220 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -48,19 +48,19 @@ FcConfigCreate (void) if (!config) goto bail0; FcMemAlloc (FC_MEM_CONFIG, sizeof (FcConfig)); - + config->configDirs = FcStrSetCreate (); if (!config->configDirs) goto bail1; - + config->configFiles = FcStrSetCreate (); if (!config->configFiles) goto bail2; - + config->fontDirs = FcStrSetCreate (); if (!config->fontDirs) goto bail3; - + config->acceptGlobs = FcStrSetCreate (); if (!config->acceptGlobs) goto bail4; @@ -72,7 +72,7 @@ FcConfigCreate (void) config->acceptPatterns = FcFontSetCreate (); if (!config->acceptPatterns) goto bail6; - + config->rejectPatterns = FcFontSetCreate (); if (!config->rejectPatterns) goto bail7; @@ -80,7 +80,7 @@ FcConfigCreate (void) config->cacheDirs = FcStrSetCreate (); if (!config->cacheDirs) goto bail8; - + config->blanks = 0; config->substPattern = 0; @@ -91,12 +91,12 @@ FcConfigCreate (void) config->fonts[set] = 0; config->rescanTime = time(0); - config->rescanInterval = 30; + config->rescanInterval = 30; config->expr_pool = NULL; config->ref = 1; - + return config; bail8: @@ -181,7 +181,7 @@ static void FcSubstDestroy (FcSubst *s) { FcSubst *n; - + while (s) { n = s->next; @@ -279,7 +279,7 @@ FcConfigDestroy (FcConfig *config) */ FcBool -FcConfigAddCache (FcConfig *config, FcCache *cache, +FcConfigAddCache (FcConfig *config, FcCache *cache, FcSetName set, FcStrSet *dirSet) { FcFontSet *fs; @@ -343,7 +343,7 @@ FcConfigAddDirList (FcConfig *config, FcSetName set, FcStrSet *dirSet) FcStrList *dirlist; FcChar8 *dir; FcCache *cache; - + dirlist = FcStrListCreate (dirSet); if (!dirlist) return FcFalse; @@ -382,9 +382,9 @@ FcConfigBuildFonts (FcConfig *config) fonts = FcFontSetCreate (); if (!fonts) return FcFalse; - + FcConfigSetFonts (config, fonts, FcSetSystem); - + if (!FcConfigAddDirList (config, FcSetSystem, config->fontDirs)) return FcFalse; if (FcDebug () & FC_DBG_FONTSET) @@ -447,7 +447,7 @@ FcBool FcConfigAddDir (FcConfig *config, const FcChar8 *d) { - return (FcConfigAddConfigDir (config, d) && + return (FcConfigAddConfigDir (config, d) && FcConfigAddFontDir (config, d)); } @@ -481,17 +481,17 @@ FcConfigGetCacheDirs (FcConfig *config) } return FcStrListCreate (config->cacheDirs); } - + FcBool FcConfigAddConfigFile (FcConfig *config, const FcChar8 *f) { FcBool ret; FcChar8 *file = FcConfigFilename (f); - + if (!file) return FcFalse; - + ret = FcStrSetAdd (config->configFiles, file); FcStrFree (file); return ret; @@ -555,7 +555,7 @@ FcConfigAddBlank (FcConfig *config, FcChar32 blank) { FcBlanks *b, *freeme = 0; - + b = config->blanks; if (!b) { @@ -613,7 +613,7 @@ FcConfigSetRescanInverval (FcConfig *config, int rescanInterval) return FcConfigSetRescanInterval (config, rescanInterval); } - + FcBool FcConfigAddEdit (FcConfig *config, FcTest *test, @@ -697,10 +697,10 @@ FcConfigCompareValue (const FcValue *left_o, FcValue left = FcValueCanonicalize(left_o); FcValue right = FcValueCanonicalize(right_o); FcBool ret = FcFalse; - + left = FcConfigPromote (left, right); right = FcConfigPromote (right, left); - if (left.type == right.type) + if (left.type == right.type) { switch (left.type) { case FcTypeInteger: @@ -716,16 +716,16 @@ FcConfigCompareValue (const FcValue *left_o, case FcOpNotContains: ret = left.u.d != right.u.d; break; - case FcOpLess: + case FcOpLess: ret = left.u.d < right.u.d; break; - case FcOpLessEqual: + case FcOpLessEqual: ret = left.u.d <= right.u.d; break; - case FcOpMore: + case FcOpMore: ret = left.u.d > right.u.d; break; - case FcOpMoreEqual: + case FcOpMoreEqual: ret = left.u.d >= right.u.d; break; default: @@ -734,7 +734,7 @@ FcConfigCompareValue (const FcValue *left_o, break; case FcTypeBool: switch (op) { - case FcOpEqual: + case FcOpEqual: case FcOpContains: case FcOpListing: ret = left.u.b == right.u.b; @@ -749,7 +749,7 @@ FcConfigCompareValue (const FcValue *left_o, break; case FcTypeString: switch (op) { - case FcOpEqual: + case FcOpEqual: case FcOpListing: ret = FcStrCmpIgnoreCase (left.u.s, right.u.s) == 0; break; @@ -872,7 +872,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e) FcResult r; FcMatrix *m; FcChar8 *str; - + switch (e->op) { case FcOpInteger: v.type = FcTypeInteger; @@ -957,24 +957,24 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e) switch (vl.type) { case FcTypeDouble: switch (e->op) { - case FcOpPlus: + case FcOpPlus: v.type = FcTypeDouble; - v.u.d = vl.u.d + vr.u.d; + v.u.d = vl.u.d + vr.u.d; break; case FcOpMinus: v.type = FcTypeDouble; - v.u.d = vl.u.d - vr.u.d; + v.u.d = vl.u.d - vr.u.d; break; case FcOpTimes: v.type = FcTypeDouble; - v.u.d = vl.u.d * vr.u.d; + v.u.d = vl.u.d * vr.u.d; break; case FcOpDivide: v.type = FcTypeDouble; - v.u.d = vl.u.d / vr.u.d; + v.u.d = vl.u.d / vr.u.d; break; default: - v.type = FcTypeVoid; + v.type = FcTypeVoid; break; } if (v.type == FcTypeDouble && @@ -995,7 +995,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e) v.u.b = vl.u.b && vr.u.b; break; default: - v.type = FcTypeVoid; + v.type = FcTypeVoid; break; } break; @@ -1006,7 +1006,7 @@ FcConfigEvaluate (FcPattern *p, FcExpr *e) str = FcStrPlus (vl.u.s, vr.u.s); v.u.s = FcStrStaticName (str); FcStrFree (str); - + if (!v.u.s) v.type = FcTypeVoid; break; @@ -1139,7 +1139,7 @@ FcConfigMatchValueList (FcPattern *p, FcExpr *e = t->expr; FcValue value; FcValueList *v; - + while (e) { /* Compute the value of the match expression */ @@ -1180,7 +1180,7 @@ static FcValueList * FcConfigValues (FcPattern *p, FcExpr *e, FcValueBinding binding) { FcValueList *l; - + if (!e) return 0; l = (FcValueList *) malloc (sizeof (FcValueList)); @@ -1218,7 +1218,7 @@ FcConfigAdd (FcValueListPtr *head, { FcValueListPtr *prev, last, v; FcValueBinding sameBinding; - + if (position) sameBinding = position->binding; else @@ -1231,7 +1231,7 @@ FcConfigAdd (FcValueListPtr *head, if (position) prev = &position->next; else - for (prev = head; *prev != NULL; + for (prev = head; *prev != NULL; prev = &(*prev)->next) ; } @@ -1239,7 +1239,7 @@ FcConfigAdd (FcValueListPtr *head, { if (position) { - for (prev = head; *prev != NULL; + for (prev = head; *prev != NULL; prev = &(*prev)->next) { if (*prev == position) @@ -1262,24 +1262,24 @@ FcConfigAdd (FcValueListPtr *head, FcValueListPrint (*head); printf ("\n"); } - + if (new) { last = new; while (last->next != NULL) last = last->next; - + last->next = *prev; *prev = new; } - + if (FcDebug () & FC_DBG_EDIT) { printf ("%s list after ", append ? "Append" : "Prepend"); FcValueListPrint (*head); printf ("\n"); } - + return FcTrue; } @@ -1310,7 +1310,7 @@ FcConfigPatternAdd (FcPattern *p, if (list) { FcPatternElt *e = FcPatternObjectInsertElt (p, object); - + if (!e) return; FcConfigAdd (&e->values, 0, append, list); @@ -1462,7 +1462,7 @@ FcConfigSubstituteWithPat (FcConfig *config, if ((t->kind == FcMatchFont || kind == FcMatchPattern) && t->object == e->object) { - /* + /* * KLUDGE - the pattern may have been reallocated or * things may have been inserted or deleted above * this element by other edits. Go back and find @@ -1485,7 +1485,7 @@ FcConfigSubstituteWithPat (FcConfig *config, { FcValueList *thisValue = st[i].value; FcValueList *nextValue = thisValue; - + /* * Append the new list of values after the current value */ @@ -1624,7 +1624,7 @@ DllMain (HINSTANCE hinstDLL, } else fontconfig_path[0] = '\0'; - + break; } @@ -1671,7 +1671,7 @@ FcConfigFileExists (const FcChar8 *dir, const FcChar8 *file) FcMemAlloc (FC_MEM_STRING, strlen ((char *) path) + 1); if (access ((char *) path, R_OK) == 0) return path; - + FcStrFree (path); return 0; } @@ -1703,7 +1703,7 @@ FcConfigGetPath (void) if (env) { e = env; - while (*e) + while (*e) { colon = (FcChar8 *) strchr ((char *) e, FC_SEARCH_PATH_SEPARATOR); if (!colon) @@ -1720,7 +1720,7 @@ FcConfigGetPath (void) i++; } } - + #ifdef _WIN32 if (fontconfig_path[0] == '\0') { @@ -1858,7 +1858,7 @@ FcConfigAppFontAddFile (FcConfig *config, subdirs = FcStrSetCreate (); if (!subdirs) return FcFalse; - + set = FcConfigGetFonts (config, FcSetApplication); if (!set) { @@ -1894,7 +1894,7 @@ FcConfigAppFontAddDir (FcConfig *config, { FcFontSet *set; FcStrSet *dirs; - + if (!config) { config = FcConfigGetCurrent (); @@ -1905,7 +1905,7 @@ FcConfigAppFontAddDir (FcConfig *config, dirs = FcStrSetCreate (); if (!dirs) return FcFalse; - + set = FcConfigGetFonts (config, FcSetApplication); if (!set) { @@ -1917,9 +1917,9 @@ FcConfigAppFontAddDir (FcConfig *config, } FcConfigSetFonts (config, set, FcSetApplication); } - + FcStrSetAddFilename (dirs, dir); - + if (!FcConfigAddDirList (config, FcSetApplication, dirs)) { FcStrSetDestroy (dirs); @@ -1962,7 +1962,7 @@ FcConfigGlobMatch (const FcChar8 *glob, { FcChar8 c; - while ((c = *glob++)) + while ((c = *glob++)) { switch (c) { case '*': @@ -2034,7 +2034,7 @@ FcConfigPatternsMatch (const FcFontSet *patterns, const FcPattern *font) { int i; - + for (i = 0; i < patterns->nfont; i++) if (FcListPatternMatchAny (patterns->fonts[i], font)) return FcTrue; diff --git a/src/fccharset.c b/src/fccharset.c index d30e161..9228b09 100644 --- a/src/fccharset.c +++ b/src/fccharset.c @@ -53,7 +53,7 @@ void FcCharSetDestroy (FcCharSet *fcs) { int i; - + if (fcs->ref == FC_REF_CONSTANT) { FcCacheObjectDereference (fcs); @@ -135,9 +135,9 @@ FcCharSetFindLeaf (const FcCharSet *fcs, FcChar32 ucs4) #define FC_IS_ZERO_OR_POWER_OF_TWO(x) (!((x) & ((x)-1))) static FcBool -FcCharSetPutLeaf (FcCharSet *fcs, +FcCharSetPutLeaf (FcCharSet *fcs, FcChar32 ucs4, - FcCharLeaf *leaf, + FcCharLeaf *leaf, int pos) { intptr_t *leaves = FcCharSetLeaves (fcs); @@ -188,8 +188,8 @@ FcCharSetPutLeaf (FcCharSet *fcs, fcs->leaves_offset = FcPtrToOffset (fcs, leaves); fcs->numbers_offset = FcPtrToOffset (fcs, numbers); } - - memmove (leaves + pos + 1, leaves + pos, + + memmove (leaves + pos + 1, leaves + pos, (fcs->num - pos) * sizeof (*leaves)); memmove (numbers + pos + 1, numbers + pos, (fcs->num - pos) * sizeof (*numbers)); @@ -213,11 +213,11 @@ FcCharSetFindLeafCreate (FcCharSet *fcs, FcChar32 ucs4) pos = FcCharSetFindLeafPos (fcs, ucs4); if (pos >= 0) return FcCharSetLeaf(fcs, pos); - + leaf = calloc (1, sizeof (FcCharLeaf)); if (!leaf) return 0; - + pos = -pos - 1; if (!FcCharSetPutLeaf (fcs, ucs4, leaf, pos)) { @@ -251,7 +251,7 @@ FcCharSetAddChar (FcCharSet *fcs, FcChar32 ucs4) { FcCharLeaf *leaf; FcChar32 *b; - + if (fcs->ref == FC_REF_CONSTANT) return FcFalse; leaf = FcCharSetFindLeafCreate (fcs, ucs4); @@ -337,7 +337,7 @@ FcCharSetEqual (const FcCharSet *a, const FcCharSet *b) { FcCharSetIter ai, bi; int i; - + if (a == b) return FcTrue; for (FcCharSetIterStart (a, &ai), FcCharSetIterStart (b, &bi); @@ -568,7 +568,7 @@ FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b) { FcCharSetIter ai, bi; FcChar32 count = 0; - + FcCharSetIterStart (a, &ai); FcCharSetIterStart (b, &bi); while (ai.leaf && bi.leaf) @@ -581,7 +581,7 @@ FcCharSetIntersectCount (const FcCharSet *a, const FcCharSet *b) while (i--) count += FcCharSetPopCount (*am++ & *bm++); FcCharSetIterNext (a, &ai); - } + } else if (ai.ucs4 < bi.ucs4) { ai.ucs4 = bi.ucs4; @@ -601,7 +601,7 @@ FcCharSetCount (const FcCharSet *a) { FcCharSetIter ai; FcChar32 count = 0; - + for (FcCharSetIterStart (a, &ai); ai.leaf; FcCharSetIterNext (a, &ai)) { int i = 256/32; @@ -618,7 +618,7 @@ FcCharSetSubtractCount (const FcCharSet *a, const FcCharSet *b) { FcCharSetIter ai, bi; FcChar32 count = 0; - + FcCharSetIterStart (a, &ai); FcCharSetIterStart (b, &bi); while (ai.leaf) @@ -657,7 +657,7 @@ FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b) { int ai, bi; FcChar16 an, bn; - + if (a == b) return FcTrue; bi = 0; ai = 0; @@ -672,7 +672,7 @@ FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b) { FcChar32 *am = FcCharSetLeaf(a, ai)->map; FcChar32 *bm = FcCharSetLeaf(b, bi)->map; - + if (am != bm) { int i = 256/32; @@ -710,7 +710,7 @@ FcCharSetIsSubset (const FcCharSet *a, const FcCharSet *b) */ FcChar32 -FcCharSetNextPage (const FcCharSet *a, +FcCharSetNextPage (const FcCharSet *a, FcChar32 map[FC_CHARSET_MAP_SIZE], FcChar32 *next) { @@ -721,7 +721,7 @@ FcCharSetNextPage (const FcCharSet *a, FcCharSetIterSet (a, &ai); if (!ai.leaf) return FC_CHARSET_DONE; - + /* * Save current information */ @@ -737,7 +737,7 @@ FcCharSetNextPage (const FcCharSet *a, } FcChar32 -FcCharSetFirstPage (const FcCharSet *a, +FcCharSetFirstPage (const FcCharSet *a, FcChar32 map[FC_CHARSET_MAP_SIZE], FcChar32 *next) { @@ -748,7 +748,7 @@ FcCharSetFirstPage (const FcCharSet *a, /* * old coverage API, rather hard to use correctly */ - + FcChar32 FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result) { @@ -772,7 +772,7 @@ FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result) /* * ASCII representation of charsets. - * + * * Each leaf is represented as 9 32-bit values, the code of the first character followed * by 8 32 bit values for the leaf itself. Each value is encoded as 5 ASCII characters, * only 85 different values are used to avoid control characters as well as the other @@ -781,38 +781,38 @@ FcCharSetCoverage (const FcCharSet *a, FcChar32 page, FcChar32 *result) */ static const unsigned char charToValue[256] = { - /* "" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\b" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\020" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\030" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* " " */ 0xff, 0x00, 0xff, 0x01, 0x02, 0x03, 0x04, 0xff, - /* "(" */ 0x05, 0x06, 0x07, 0x08, 0xff, 0xff, 0x09, 0x0a, - /* "0" */ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, - /* "8" */ 0x13, 0x14, 0xff, 0x15, 0x16, 0xff, 0x17, 0x18, - /* "@" */ 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, - /* "H" */ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, - /* "P" */ 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, - /* "X" */ 0x31, 0x32, 0x33, 0x34, 0xff, 0x35, 0x36, 0xff, - /* "`" */ 0xff, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, - /* "h" */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, - /* "p" */ 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, - /* "x" */ 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0xff, - /* "\200" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\210" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\220" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\230" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\240" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\250" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\260" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\270" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\300" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\310" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\320" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\330" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\340" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\350" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\360" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - /* "\370" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\b" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\020" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\030" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* " " */ 0xff, 0x00, 0xff, 0x01, 0x02, 0x03, 0x04, 0xff, + /* "(" */ 0x05, 0x06, 0x07, 0x08, 0xff, 0xff, 0x09, 0x0a, + /* "0" */ 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, + /* "8" */ 0x13, 0x14, 0xff, 0x15, 0x16, 0xff, 0x17, 0x18, + /* "@" */ 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, + /* "H" */ 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, + /* "P" */ 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, + /* "X" */ 0x31, 0x32, 0x33, 0x34, 0xff, 0x35, 0x36, 0xff, + /* "`" */ 0xff, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, + /* "h" */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, + /* "p" */ 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, + /* "x" */ 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0xff, + /* "\200" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\210" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\220" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\230" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\240" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\250" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\260" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\270" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\300" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\310" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\320" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\330" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\340" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\350" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\360" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + /* "\370" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, }; static const FcChar8 valueToChar[0x55] = { @@ -835,7 +835,7 @@ FcCharSetParseValue (FcChar8 *string, FcChar32 *value) int i; FcChar32 v; FcChar32 c; - + if (*string == ' ') { v = 0; @@ -1006,7 +1006,7 @@ FcNameUnparseCharSet (FcStrBuf *buf, const FcCharSet *c) FcCharSetDestroy (check); } #endif - + return FcTrue; } @@ -1093,7 +1093,7 @@ FcCharSetFreezeLeaf (FcCharSetFreezer *freezer, FcCharLeaf *leaf) FcChar32 hash = FcCharLeafHash (leaf); FcCharLeafEnt **bucket = &freezer->leaf_hash_table[hash % FC_CHAR_LEAF_HASH_SIZE]; FcCharLeafEnt *ent; - + for (ent = *bucket; ent; ent = ent->next) { if (ent->hash == hash && !memcmp (&ent->leaf, leaf, sizeof (FcCharLeaf))) @@ -1130,7 +1130,7 @@ FcCharSetFreezeOrig (FcCharSetFreezer *freezer, const FcCharSet *orig, const FcC { FcCharSetOrigEnt **bucket = &freezer->orig_hash_table[((uintptr_t) orig) & FC_CHAR_SET_HASH_SIZE]; FcCharSetOrigEnt *ent; - + ent = malloc (sizeof (FcCharSetOrigEnt)); if (!ent) return FcFalse; @@ -1154,7 +1154,7 @@ FcCharSetFreezeBase (FcCharSetFreezer *freezer, FcCharSet *fcs, const FcCharSet { if (ent->hash == hash && ent->set.num == fcs->num && - !memcmp (FcCharSetNumbers(&ent->set), + !memcmp (FcCharSetNumbers(&ent->set), FcCharSetNumbers(fcs), fcs->num * sizeof (FcChar16))) { @@ -1176,9 +1176,9 @@ FcCharSetFreezeBase (FcCharSetFreezer *freezer, FcCharSet *fcs, const FcCharSet if (!ent) return 0; FcMemAlloc (FC_MEM_CHARSET, size); - + freezer->charsets_allocated++; - + ent->set.ref = FC_REF_CONSTANT; ent->set.num = fcs->num; if (fcs->num) @@ -1188,13 +1188,13 @@ FcCharSetFreezeBase (FcCharSetFreezer *freezer, FcCharSet *fcs, const FcCharSet ent->set.leaves_offset = sizeof (ent->set); ent->set.numbers_offset = (ent->set.leaves_offset + fcs->num * sizeof (intptr_t)); - + ent_leaves = FcCharSetLeaves (&ent->set); for (i = 0; i < fcs->num; i++) ent_leaves[i] = FcPtrToOffset (ent_leaves, FcCharSetLeaf (fcs, i)); - memcpy (FcCharSetNumbers (&ent->set), - FcCharSetNumbers (fcs), + memcpy (FcCharSetNumbers (&ent->set), + FcCharSetNumbers (fcs), fcs->num * sizeof (FcChar16)); } else @@ -1215,7 +1215,7 @@ FcCharSetFindFrozen (FcCharSetFreezer *freezer, const FcCharSet *orig) { FcCharSetOrigEnt **bucket = &freezer->orig_hash_table[((uintptr_t) orig) & FC_CHAR_SET_HASH_SIZE]; FcCharSetOrigEnt *ent; - + for (ent = *bucket; ent; ent = ent->next) if (ent->orig == orig) return ent->frozen; @@ -1325,7 +1325,7 @@ FcCharSetSerializeAlloc (FcSerialize *serialize, const FcCharSet *cs) intptr_t *leaves; FcChar16 *numbers; int i; - + if (cs->ref != FC_REF_CONSTANT) { if (!serialize->cs_freezer) @@ -1336,13 +1336,13 @@ FcCharSetSerializeAlloc (FcSerialize *serialize, const FcCharSet *cs) } if (FcCharSetFindFrozen (serialize->cs_freezer, cs)) return FcTrue; - + cs = FcCharSetFreeze (serialize->cs_freezer, cs); } - + leaves = FcCharSetLeaves (cs); numbers = FcCharSetNumbers (cs); - + if (!FcSerializeAlloc (serialize, cs, sizeof (FcCharSet))) return FcFalse; if (!FcSerializeAlloc (serialize, leaves, cs->num * sizeof (intptr_t))) @@ -1355,7 +1355,7 @@ FcCharSetSerializeAlloc (FcSerialize *serialize, const FcCharSet *cs) return FcFalse; return FcTrue; } - + FcCharSet * FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs) { @@ -1371,11 +1371,11 @@ FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs) if (!cs) return NULL; } - + cs_serialized = FcSerializePtr (serialize, cs); if (!cs_serialized) return NULL; - + cs_serialized->ref = FC_REF_CONSTANT; cs_serialized->num = cs->num; @@ -1385,7 +1385,7 @@ FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs) leaves_serialized = FcSerializePtr (serialize, leaves); if (!leaves_serialized) return NULL; - + cs_serialized->leaves_offset = FcPtrToOffset (cs_serialized, leaves_serialized); @@ -1393,10 +1393,10 @@ FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs) numbers_serialized = FcSerializePtr (serialize, numbers); if (!numbers) return NULL; - + cs_serialized->numbers_offset = FcPtrToOffset (cs_serialized, numbers_serialized); - + for (i = 0; i < cs->num; i++) { leaf = FcCharSetLeaf (cs, i); @@ -1404,7 +1404,7 @@ FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs) if (!leaf_serialized) return NULL; *leaf_serialized = *leaf; - leaves_serialized[i] = FcPtrToOffset (leaves_serialized, + leaves_serialized[i] = FcPtrToOffset (leaves_serialized, leaf_serialized); numbers_serialized[i] = numbers[i]; } @@ -1414,7 +1414,7 @@ FcCharSetSerialize(FcSerialize *serialize, const FcCharSet *cs) cs_serialized->leaves_offset = 0; cs_serialized->numbers_offset = 0; } - + return cs_serialized; } #define __fccharset__ diff --git a/src/fcdbg.c b/src/fcdbg.c index fd2d55a..bdb8fa2 100644 --- a/src/fcdbg.c +++ b/src/fcdbg.c @@ -87,7 +87,7 @@ FcLangSetPrint (const FcLangSet *ls) { FcStrBuf buf; FcChar8 init_buf[1024]; - + FcStrBufInit (&buf, init_buf, sizeof (init_buf)); if (FcNameUnparseLangSet (&buf, ls) && FcStrBufChar (&buf,'\0')) printf ("%s", buf.buf); @@ -102,16 +102,16 @@ FcCharSetPrint (const FcCharSet *c) int i, j; intptr_t *leaves = FcCharSetLeaves (c); FcChar16 *numbers = FcCharSetNumbers (c); - + #if 0 printf ("CharSet 0x%x\n", (intptr_t) c); printf ("Leaves: +%d = 0x%x\n", c->leaves_offset, (intptr_t) leaves); printf ("Numbers: +%d = 0x%x\n", c->numbers_offset, (intptr_t) numbers); - + for (i = 0; i < c->num; i++) { - printf ("Page %d: %04x +%d = 0x%x\n", - i, numbers[i], leaves[i], + printf ("Page %d: %04x +%d = 0x%x\n", + i, numbers[i], leaves[i], (intptr_t) FcOffsetToPtr (leaves, leaves[i], FcCharLeaf)); } #endif @@ -135,7 +135,7 @@ FcPatternPrint (const FcPattern *p) { int i; FcPatternElt *e; - + if (!p) { printf ("Null pattern\n"); @@ -347,7 +347,7 @@ FcSubstPrint (const FcSubst *subst) { FcEdit *e; FcTest *t; - + printf ("match\n"); for (t = subst->test; t; t = t->next) { diff --git a/src/fcdefault.c b/src/fcdefault.c index 091276b..423f75e 100644 --- a/src/fcdefault.c +++ b/src/fcdefault.c @@ -134,7 +134,7 @@ FcDefaultSubstitute (FcPattern *pattern) for (i = 0; i < NUM_FC_BOOL_DEFAULTS; i++) if (FcPatternObjectGet (pattern, FcBoolDefaults[i].field, 0, &v) == FcResultNoMatch) FcPatternObjectAddBool (pattern, FcBoolDefaults[i].field, FcBoolDefaults[i].value); - + if (FcPatternObjectGet (pattern, FC_PIXEL_SIZE_OBJECT, 0, &v) == FcResultNoMatch) { double dpi, size, scale; diff --git a/src/fcdir.c b/src/fcdir.c index f927c0b..70fd438 100644 --- a/src/fcdir.c +++ b/src/fcdir.c @@ -45,7 +45,7 @@ FcFileScanFontConfig (FcFontSet *set, FcBool ret = FcTrue; int id; int count = 0; - + id = 0; do { @@ -164,7 +164,7 @@ FcDirScanConfig (FcFontSet *set, strcpy ((char *) file, (char *) dir); strcat ((char *) file, "/"); base = file + strlen ((char *) file); - + if (FcDebug () & FC_DBG_SCAN) printf ("\tScanning dir %s\n", dir); @@ -205,7 +205,7 @@ FcDirScanConfig (FcFontSet *set, */ for (i = 0; i < files->num; i++) FcFileScanConfig (set, dirs, blanks, files->strs[i], config); - + bail2: FcStrSetDestroy (files); bail1: @@ -282,12 +282,12 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config) ret = FcFalse; goto bail2; } - + /* * Write out the cache file, ignoring any troubles */ FcDirCacheWrite (cache, config); - + bail2: FcStrSetDestroy (dirs); bail1: @@ -310,11 +310,11 @@ FcDirCacheRead (const FcChar8 *dir, FcBool force, FcConfig *config) /* Try to use existing cache file */ if (!force) cache = FcDirCacheLoad (dir, config, NULL); - + /* Not using existing cache file, construct new cache */ if (!cache) cache = FcDirCacheScan (dir, config); - + return cache; } diff --git a/src/fcfreetype.c b/src/fcfreetype.c index 5a3842b..0eb7710 100644 --- a/src/fcfreetype.c +++ b/src/fcfreetype.c @@ -252,14 +252,14 @@ static const FcFtLanguage fcFtLanguage[] = { { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_DZONGKHA, "dz" }, { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_JAVANESE, "jw" }, { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SUNDANESE, "su" }, - + #if 0 /* these seem to be errors that have been dropped */ { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SCOTTISH_GAELIC }, { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_IRISH_GAELIC }, #endif - + /* The following codes are new as of 2000-03-10 */ { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_GALICIAN, "gl" }, { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_AFRIKAANS, "af" }, @@ -495,7 +495,7 @@ static const FcFtLanguage fcFtLanguage[] = { { TT_PLATFORM_MICROSOFT, TT_MS_LANGID_PASHTO_AFGHANISTAN, "ps" }, { TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FILIPINO_PHILIPPINES, "phi" }, { TT_PLATFORM_MICROSOFT, TT_MS_LANGID_DHIVEHI_MALDIVES, "div" }, - + { TT_PLATFORM_MICROSOFT, TT_MS_LANGID_OROMO_ETHIOPIA, "om" }, { TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TIGRIGNA_ETHIOPIA, "ti" }, { TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TIGRIGNA_ERYTHREA, "ti" }, @@ -744,7 +744,7 @@ FcSfntNameTranscode (FT_SfntName *sname) while (in_bytes_left) { - size_t did = iconv (cd, + size_t did = iconv (cd, &inbuf, &in_bytes_left, &outbuf, &out_bytes_left); if (did == (size_t) (-1)) @@ -786,7 +786,7 @@ FcSfntNameLanguage (FT_SfntName *sname) { language_id = TT_MAC_LANGID_JAPANESE; } - + for (i = 0; i < NUM_FC_FT_LANGUAGE; i++) if (fcFtLanguage[i].platform_id == platform_id && (fcFtLanguage[i].language_id == TT_LANGUAGE_DONT_CARE || @@ -871,7 +871,7 @@ FcVendorMatch(const FT_Char vendor[4], const FT_Char *vendor_string) { /* vendor is not necessarily NUL-terminated. */ int i, len; - + len = strlen((char *) vendor_string); if (memcmp(vendor, vendor_string, len) != 0) return FcFalse; @@ -927,7 +927,7 @@ static const FcChar8 * FcVendorFoundry(const FT_Char vendor[4]) { int i; - + if (vendor) for(i = 0; i < NUM_VENDOR_FOUNDRIES; i++) if (FcVendorMatch (vendor, FcVendorFoundries[i].vendor)) @@ -1140,7 +1140,7 @@ FcFreeTypeQueryFace (const FT_Face face, const FcChar8 *exclusiveLang = 0; FT_SfntName sname; FT_UInt snamei, snamec; - + int nfamily = 0; int nfamily_lang = 0; int nstyle = 0; @@ -1152,7 +1152,7 @@ FcFreeTypeQueryFace (const FT_Face face, FcChar8 *style = 0; int st; - + pat = FcPatternCreate (); if (!pat) goto bail0; @@ -1178,7 +1178,7 @@ FcFreeTypeQueryFace (const FT_Face face, * the Postscript FontInfo dictionary. Finally, the * BDF properties will queried. */ - + if (os2 && os2->version >= 0x0001 && os2->version != 0xffff) foundry = FcVendorFoundry(os2->achVendID); @@ -1248,7 +1248,7 @@ FcFreeTypeQueryFace (const FT_Face face, #endif case TT_NAME_ID_PREFERRED_FAMILY: case TT_NAME_ID_FONT_FAMILY: -#if 0 +#if 0 case TT_NAME_ID_PS_NAME: case TT_NAME_ID_UNIQUE_ID: #endif @@ -1335,7 +1335,7 @@ FcFreeTypeQueryFace (const FT_Face face, } } - if (!nfamily && face->family_name && + if (!nfamily && face->family_name && FcStrCmpIgnoreBlanksAndCase ((FcChar8 *) face->family_name, (FcChar8 *) "") != 0) { if (FcDebug () & FC_DBG_SCANV) @@ -1344,7 +1344,7 @@ FcFreeTypeQueryFace (const FT_Face face, goto bail1; ++nfamily; } - + if (!nstyle && face->style_name && FcStrCmpIgnoreBlanksAndCase ((FcChar8 *) face->style_name, (FcChar8 *) "") != 0) { @@ -1354,7 +1354,7 @@ FcFreeTypeQueryFace (const FT_Face face, goto bail1; ++nstyle; } - + if (!nfamily) { FcChar8 *start, *end; @@ -1433,7 +1433,7 @@ FcFreeTypeQueryFace (const FT_Face face, } if (bits & (1 << bit)) { - /* + /* * If the font advertises support for multiple * "exclusive" languages, then include support * for any language found to have coverage @@ -1505,7 +1505,7 @@ FcFreeTypeQueryFace (const FT_Face face, * Type 1: Check for FontInfo dictionary information * Code from g2@magestudios.net (Gerard Escalante) */ - + #if HAVE_FT_GET_PS_FONT_INFO if (FT_Get_PS_Font_Info(face, &psfontinfo) == 0) { @@ -1516,23 +1516,23 @@ FcFreeTypeQueryFace (const FT_Face face, printf ("\tType1 weight %s maps to %d\n", psfontinfo.weight, weight); } - + #if 0 - /* + /* * Don't bother with italic_angle; FreeType already extracts that * information for us and sticks it into style_flags */ if (psfontinfo.italic_angle) - slant = FC_SLANT_ITALIC; + slant = FC_SLANT_ITALIC; else - slant = FC_SLANT_ROMAN; + slant = FC_SLANT_ROMAN; #endif if(!foundry) foundry = FcNoticeFoundry(psfontinfo.notice); } #endif /* HAVE_FT_GET_PS_FONT_INFO */ - + #if HAVE_FT_GET_BDF_PROPERTY /* * Finally, look for a FOUNDRY BDF property if no other @@ -1554,7 +1554,7 @@ FcFreeTypeQueryFace (const FT_Face face, prop.type == BDF_PROPERTY_TYPE_CARDINAL)) { FT_Int32 value; - + if (prop.type == BDF_PROPERTY_TYPE_INTEGER) value = prop.u.integer; else @@ -1731,7 +1731,7 @@ FcFreeTypeQueryFace (const FT_Face face, * Drop our reference to the charset */ FcCharSetDestroy (cs); - + return pat; bail2: @@ -1751,10 +1751,10 @@ FcFreeTypeQuery(const FcChar8 *file, FT_Face face; FT_Library ftLibrary; FcPattern *pat = NULL; - + if (FT_Init_FreeType (&ftLibrary)) return NULL; - + if (FT_New_Face (ftLibrary, (char *) file, id, &face)) goto bail; @@ -2226,7 +2226,7 @@ static const FcCharMap AdobeSymbol = { AdobeSymbolEnt, sizeof (AdobeSymbolEnt) / sizeof (AdobeSymbolEnt[0]), }; - + static const FcFontDecode fcFontDecoders[] = { { ft_encoding_unicode, 0, (1 << 21) - 1 }, { ft_encoding_symbol, &AdobeSymbol, (1 << 16) - 1 }, @@ -2311,7 +2311,7 @@ static FcBool FcFreeTypeUseNames (FT_Face face) { FT_Int map; - + if (!FT_Has_PS_Glyph_Names (face)) return FcFalse; for (map = 0; map < face->num_charmaps; map++) @@ -2331,7 +2331,7 @@ FcUcs4ToGlyphName (FcChar32 ucs4) { if (_fc_glyph_names[gn].ucs == ucs4) return _fc_glyph_names[gn].name; - if (!r) + if (!r) { r = (int) (ucs4 % FC_GLYPHNAME_REHASH); if (!r) @@ -2356,7 +2356,7 @@ FcGlyphNameToUcs4 (FcChar8 *name) { if (!strcmp ((char *) name, (char *) _fc_glyph_names[gn].name)) return _fc_glyph_names[gn].ucs; - if (!r) + if (!r) { r = (int) (h % FC_GLYPHNAME_REHASH); if (!r) @@ -2479,14 +2479,14 @@ FcFreeTypeCharIndex (FT_Face face, FcChar32 ucs4) } static FcBool -FcFreeTypeCheckGlyph (FT_Face face, FcChar32 ucs4, +FcFreeTypeCheckGlyph (FT_Face face, FcChar32 ucs4, FT_UInt glyph, FcBlanks *blanks, FT_Pos *advance, FcBool using_strike) { FT_Int load_flags = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH | FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING; FT_GlyphSlot slot; - + if (using_strike) load_flags &= ~FT_LOAD_NO_SCALE; @@ -2499,14 +2499,14 @@ FcFreeTypeCheckGlyph (FT_Face face, FcChar32 ucs4, */ if (face->face_flags & FT_FACE_FLAG_SCALABLE) load_flags |= FT_LOAD_NO_BITMAP; - + if (FT_Load_Glyph (face, glyph, load_flags)) return FcFalse; - + slot = face->glyph; if (!glyph) return FcFalse; - + *advance = slot->metrics.horiAdvance; switch (slot->format) { @@ -2560,7 +2560,7 @@ FcFreeTypeCharSetAndSpacingForSize (FT_Face face, FcBlanks *blanks, int *spacing fcs = FcCharSetCreate (); if (!fcs) goto bail0; - + #if HAVE_FT_SELECT_SIZE if (strike_index >= 0) { if (FT_Select_Size (face, strike_index) != FT_Err_Ok) @@ -2587,10 +2587,10 @@ FcFreeTypeCharSetAndSpacingForSize (FT_Face face, FcBlanks *blanks, int *spacing { ucs4 = map->ent[i].bmp; glyph = FT_Get_Char_Index (face, map->ent[i].encode); - if (glyph && + if (glyph && FcFreeTypeCheckGlyph (face, ucs4, glyph, blanks, &advance, using_strike)) { - /* + /* * ignore glyphs with zero advance. They’re * combining characters, and while their behaviour * isn’t well defined for monospaced applications in @@ -2702,7 +2702,7 @@ FcFreeTypeCharSetAndSpacingForSize (FT_Face face, FcBlanks *blanks, int *spacing if (FT_Get_Glyph_Name (face, glyph, name_buf, FC_GLYPHNAME_BUFLEN+1) == 0) { ucs4 = FcGlyphNameToUcs4 (name_buf); - if (ucs4 != 0xffff && + if (ucs4 != 0xffff && FcFreeTypeCheckGlyph (face, ucs4, glyph, blanks, &advance, using_strike)) { if (advance) @@ -2772,13 +2772,13 @@ FcCharSet * FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing) { FcCharSet *cs; - + cs = FcFreeTypeCharSetAndSpacingForSize (face, blanks, spacing, -1); /* * Check for bitmap-only ttf fonts that are missing the glyf table. * In that case, pick a size and look for glyphs in that size instead */ - if (FcCharSetCount (cs) == 0) + if (FcCharSetCount (cs) == 0) { /* Check for non-scalable TT fonts */ if (!(face->face_flags & FT_FACE_FLAG_SCALABLE) && @@ -2790,7 +2790,7 @@ FcFreeTypeCharSetAndSpacing (FT_Face face, FcBlanks *blanks, int *spacing) /* Select the face closest to 16 pixels tall */ for (i = 1; i < face->num_fixed_sizes; i++) { - if (abs (face->available_sizes[i].height - 16) < + if (abs (face->available_sizes[i].height - 16) < abs (face->available_sizes[strike_index].height - 16)) strike_index = i; } @@ -2826,7 +2826,7 @@ FcFreeTypeCharSet (FT_Face face, FcBlanks *blanks) */ #define FcIsSpace(x) (040 == (x)) #define FcIsValidScript(x) (FcIsLower(x) || FcIsUpper (x) || FcIsSpace(x)) - + static void addtag(FcChar8 *complex_, FT_ULong tag) { @@ -2837,7 +2837,7 @@ addtag(FcChar8 *complex_, FT_ULong tag) tagstring[2] = (FcChar8)(tag >> 8), tagstring[3] = (FcChar8)(tag); tagstring[4] = '\0'; - + /* skip tags which aren't alphabetic, under the assumption that * they're probably broken */ @@ -2965,7 +2965,7 @@ FcFontCapabilities(FT_Face face) if (!issilgraphitefont && !gsub_count && !gpos_count) goto bail; - maxsize = (((FT_ULong) gpos_count + (FT_ULong) gsub_count) * OTLAYOUT_LEN + + maxsize = (((FT_ULong) gpos_count + (FT_ULong) gsub_count) * OTLAYOUT_LEN + (issilgraphitefont ? 13 : 0)); complex_ = malloc (sizeof (FcChar8) * maxsize); if (!complex_) diff --git a/src/fcfs.c b/src/fcfs.c index 0e97501..0499406 100644 --- a/src/fcfs.c +++ b/src/fcfs.c @@ -61,7 +61,7 @@ FcFontSetAdd (FcFontSet *s, FcPattern *font) { FcPattern **f; int sfont; - + if (s->nfont == s->sfont) { sfont = s->sfont + 32; @@ -85,7 +85,7 @@ FcBool FcFontSetSerializeAlloc (FcSerialize *serialize, const FcFontSet *s) { int i; - + if (!FcSerializeAlloc (serialize, s, sizeof (FcFontSet))) return FcFalse; if (!FcSerializeAlloc (serialize, s->fonts, s->nfont * sizeof (FcPattern *))) @@ -111,7 +111,7 @@ FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s) return NULL; *s_serialize = *s; s_serialize->sfont = s_serialize->nfont; - + fonts_serialize = FcSerializePtr (serialize, s->fonts); if (!fonts_serialize) return NULL; diff --git a/src/fcftint.h b/src/fcftint.h index f32d87c..a317370 100644 --- a/src/fcftint.h +++ b/src/fcftint.h @@ -50,5 +50,5 @@ FcFreeTypePrivateToUcs4 (FcChar32 private, const FcCharMap *map); FcPrivate const FcCharMap * FcFreeTypeGetPrivateMap (FT_Encoding encoding); - + #endif /* _FCFTINT_H_ */ diff --git a/src/fcinit.c b/src/fcinit.c index 3789d67..9fbb66e 100644 --- a/src/fcinit.c +++ b/src/fcinit.c @@ -58,18 +58,18 @@ FcConfig * FcInitLoadConfig (void) { FcConfig *config; - + FcInitDebug (); config = FcConfigCreate (); if (!config) return FcFalse; - + if (!FcConfigParseAndLoad (config, 0, FcTrue)) { FcConfigDestroy (config); return FcInitFallbackConfig (); } - + if (config->cacheDirs && config->cacheDirs->num == 0) { fprintf (stderr, diff --git a/src/fcint.h b/src/fcint.h index 8e80d1e..46b6ddd 100644 --- a/src/fcint.h +++ b/src/fcint.h @@ -130,7 +130,7 @@ typedef enum _FcValueBinding { * Serialized data structures use only offsets instead of pointers * A low bit of 1 indicates an offset. */ - + /* Is the provided pointer actually an offset? */ #define FcIsEncodedOffset(p) ((((intptr_t) (p)) & 1) != 0) @@ -181,13 +181,13 @@ typedef struct _FcValueList { } FcValueList; #define FcValueListNext(vl) FcPointerMember(vl,next,FcValueList) - + typedef int FcObject; typedef struct _FcPatternElt *FcPatternEltPtr; /* - * Pattern elts are stuck in a structure connected to the pattern, + * Pattern elts are stuck in a structure connected to the pattern, * so they get moved around when the pattern is resized. Hence, the * values field must be a pointer/offset instead of just an offset */ @@ -216,13 +216,13 @@ struct _FcPattern { fs->fonts[i]) typedef enum _FcOp { - FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet, + FcOpInteger, FcOpDouble, FcOpString, FcOpMatrix, FcOpBool, FcOpCharSet, FcOpNil, FcOpField, FcOpConst, - FcOpAssign, FcOpAssignReplace, + FcOpAssign, FcOpAssignReplace, FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast, FcOpQuest, - FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual, + FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual, FcOpContains, FcOpListing, FcOpNotContains, FcOpLess, FcOpLessEqual, FcOpMore, FcOpMoreEqual, FcOpPlus, FcOpMinus, FcOpTimes, FcOpDivide, @@ -373,7 +373,7 @@ typedef struct _FcSerialize { void *linear; FcSerializeBucket *buckets[FC_SERIALIZE_HASH_SIZE]; } FcSerialize; - + /* * To map adobe glyph names to unicode values, a precomputed hash * table is used @@ -387,14 +387,14 @@ typedef struct _FcGlyphName { /* * To perform case-insensitive string comparisons, a table * is used which holds three different kinds of folding data. - * + * * The first is a range of upper case values mapping to a range * of their lower case equivalents. Within each range, the offset * between upper and lower case is constant. * * The second is a range of upper case values which are interleaved * with their lower case equivalents. - * + * * The third is a set of raw unicode values mapping to a list * of unicode values for comparison purposes. This allows conversion * of ß to "ss" so that SS, ss and ß all match. A separate array @@ -448,7 +448,7 @@ struct _FcConfig { FcBlanks *blanks; /* * List of directories containing fonts, - * built by recursively scanning the set + * built by recursively scanning the set * of configured directories */ FcStrSet *fontDirs; @@ -497,7 +497,7 @@ struct _FcConfig { FcExprPage *expr_pool; /* pool of FcExpr's */ }; - + extern FcPrivate FcConfig *_fcConfig; typedef struct _FcFileTime { @@ -519,7 +519,7 @@ FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcSt FcPrivate FcBool FcDirCacheWrite (FcCache *cache, FcConfig *config); - + FcPrivate void FcCacheObjectReference (void *object); @@ -528,7 +528,7 @@ FcCacheObjectDereference (void *object); FcPrivate void FcCacheFini (void); - + FcPrivate void FcDirCacheReference (FcCache *cache, int nref); @@ -606,13 +606,13 @@ FcPrivate FcFileTime FcConfigModifiedTime (FcConfig *config); FcPrivate FcBool -FcConfigAddCache (FcConfig *config, FcCache *cache, +FcConfigAddCache (FcConfig *config, FcCache *cache, FcSetName set, FcStrSet *dirSet); /* fcserialize.c */ FcPrivate intptr_t FcAlignSize (intptr_t size); - + FcPrivate FcSerialize * FcSerializeCreate (void); @@ -702,7 +702,7 @@ FcSubstPrint (const FcSubst *subst); FcPrivate void FcCharSetPrint (const FcCharSet *c); - + extern FcPrivate int FcDebugVal; #define FcDebug() (FcDebugVal) @@ -763,12 +763,12 @@ FcMemFree (int kind, int size); /* fclang.c */ FcPrivate FcLangSet * -FcFreeTypeLangSet (const FcCharSet *charset, +FcFreeTypeLangSet (const FcCharSet *charset, const FcChar8 *exclusiveLang); FcPrivate FcLangResult FcLangCompare (const FcChar8 *s1, const FcChar8 *s2); - + FcPrivate FcLangSet * FcLangSetPromote (const FcChar8 *lang); @@ -885,13 +885,13 @@ FcPatternObjectAddWithBinding (FcPattern *p, FcPrivate FcBool FcPatternObjectAdd (FcPattern *p, FcObject object, FcValue value, FcBool append); - + FcPrivate FcBool FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append); - + FcPrivate FcResult FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v); - + FcPrivate FcBool FcPatternObjectDel (FcPattern *p, FcObject object); diff --git a/src/fclang.c b/src/fclang.c index 1d62c4e..2104033 100644 --- a/src/fclang.c +++ b/src/fclang.c @@ -72,7 +72,7 @@ FcLangSetBitGet (const FcLangSet *ls, } FcLangSet * -FcFreeTypeLangSet (const FcCharSet *charset, +FcFreeTypeLangSet (const FcCharSet *charset, const FcChar8 *exclusiveLang) { int i, j; @@ -85,7 +85,7 @@ FcFreeTypeLangSet (const FcCharSet *charset, ls = FcLangSetCreate (); if (!ls) return 0; - if (FcDebug() & FC_DBG_LANGSET) + if (FcDebug() & FC_DBG_LANGSET) { printf ("font charset"); FcCharSetPrint (charset); @@ -93,7 +93,7 @@ FcFreeTypeLangSet (const FcCharSet *charset, } for (i = 0; i < NUM_LANG_CHAR_SET; i++) { - if (FcDebug() & FC_DBG_LANGSET) + if (FcDebug() & FC_DBG_LANGSET) { printf ("%s charset", fcLangCharSets[i].lang); FcCharSetPrint (&fcLangCharSets[i].charset); @@ -112,7 +112,7 @@ FcFreeTypeLangSet (const FcCharSet *charset, continue; for (j = 0; j < fcLangCharSets[i].charset.num; j++) - if (FcCharSetLeaf(&fcLangCharSets[i].charset, j) != + if (FcCharSetLeaf(&fcLangCharSets[i].charset, j) != FcCharSetLeaf(exclusiveCharset, j)) continue; } @@ -121,7 +121,7 @@ FcFreeTypeLangSet (const FcCharSet *charset, { if (missing && missing < 10) { - FcCharSet *missed = FcCharSetSubtract (&fcLangCharSets[i].charset, + FcCharSet *missed = FcCharSetSubtract (&fcLangCharSets[i].charset, charset); FcChar32 ucs4; FcChar32 map[FC_CHARSET_MAP_SIZE]; @@ -154,8 +154,8 @@ FcFreeTypeLangSet (const FcCharSet *charset, if (FcDebug() & FC_DBG_SCANV) printf ("\n"); - - + + return ls; } @@ -188,7 +188,7 @@ FcLangCompare (const FcChar8 *s1, const FcChar8 *s2) } /* - * Return FcTrue when super contains sub. + * Return FcTrue when super contains sub. * * super contains sub if super and sub have the same * language and either the same country or one @@ -329,9 +329,9 @@ FcLangSetIndex (const FcChar8 *lang) { int low, high, mid = 0; int cmp = 0; - FcChar8 firstChar = FcToLower(lang[0]); + FcChar8 firstChar = FcToLower(lang[0]); FcChar8 secondChar = firstChar ? FcToLower(lang[1]) : '\0'; - + if (firstChar < 'a') { low = 0; @@ -360,11 +360,11 @@ FcLangSetIndex (const FcChar8 *lang) { /* fast path for resolving 2-letter languages (by far the most common) after * finding the first char (probably already true because of the hash table) */ cmp = fcLangCharSets[mid].lang[1] - secondChar; - if (cmp == 0 && - (fcLangCharSets[mid].lang[2] != '\0' || + if (cmp == 0 && + (fcLangCharSets[mid].lang[2] != '\0' || lang[2] != '\0')) { - cmp = FcStrCmpIgnoreCase(fcLangCharSets[mid].lang+2, + cmp = FcStrCmpIgnoreCase(fcLangCharSets[mid].lang+2, lang+2); } } @@ -727,7 +727,7 @@ FcLangSetContains (const FcLangSet *lsa, const FcLangSet *lsb) if (missing) { for (j = 0; j < 32; j++) - if (missing & (1 << j)) + if (missing & (1 << j)) { if (!FcLangSetContainsLang (lsa, fcLangCharSets[fcLangCharSetIndicesInv[i*32 + j]].lang)) diff --git a/src/fclist.c b/src/fclist.c index d804c15..040d0d9 100644 --- a/src/fclist.c +++ b/src/fclist.c @@ -46,7 +46,7 @@ FcObjectSetAdd (FcObjectSet *os, const char *object) int s; const char **objects; int high, low, mid, c; - + if (os->nobject == os->sobject) { s = os->sobject + 4; @@ -81,7 +81,7 @@ FcObjectSetAdd (FcObjectSet *os, const char *object) } if (c < 0) mid++; - memmove (os->objects + mid + 1, os->objects + mid, + memmove (os->objects + mid + 1, os->objects + mid, (os->nobject - mid) * sizeof (const char *)); os->objects[mid] = object; os->nobject++; @@ -140,8 +140,8 @@ FcListValueListMatchAny (FcValueListPtr patOrig, /* pattern */ * where it requires an exact match) */ if (FcConfigCompareValue (&fnt->value, - FcOpListing, - &pat->value)) + FcOpListing, + &pat->value)) break; } if (fnt == NULL) @@ -226,8 +226,8 @@ FcListPatternMatchAny (const FcPattern *p, static FcChar32 FcListMatrixHash (const FcMatrix *m) { - int xx = (int) (m->xx * 100), - xy = (int) (m->xy * 100), + int xx = (int) (m->xx * 100), + xy = (int) (m->xy * 100), yx = (int) (m->yx * 100), yy = (int) (m->yy * 100); @@ -265,7 +265,7 @@ static FcChar32 FcListValueListHash (FcValueListPtr list) { FcChar32 h = 0; - + while (list != NULL) { h = h ^ FcListValueHash (&list->value); @@ -303,7 +303,7 @@ typedef struct _FcListHashTable { int entries; FcListBucket *buckets[FC_LIST_HASH_SIZE]; } FcListHashTable; - + static void FcListHashTableInit (FcListHashTable *table) { @@ -382,7 +382,7 @@ FcListAppend (FcListHashTable *table, for (prev = &table->buckets[hash % FC_LIST_HASH_SIZE]; (bucket = *prev); prev = &(bucket->next)) { - if (bucket->hash == hash && + if (bucket->hash == hash && FcListPatternEqual (bucket->pattern, font, os)) return FcTrue; } @@ -395,7 +395,7 @@ FcListAppend (FcListHashTable *table, bucket->pattern = FcPatternCreate (); if (!bucket->pattern) goto bail1; - + for (o = 0; o < os->nobject; o++) { if (!strcmp (os->objects[o], FC_FAMILY) || !strcmp (os->objects[o], FC_FAMILYLANG)) @@ -425,8 +425,8 @@ FcListAppend (FcListHashTable *table, for (v = FcPatternEltValues(e), idx = 0; v; v = FcValueListNext(v), ++idx) { - if (!FcPatternAdd (bucket->pattern, - os->objects[o], + if (!FcPatternAdd (bucket->pattern, + os->objects[o], FcValueCanonicalize(&v->value), defidx != idx)) goto bail2; } @@ -436,7 +436,7 @@ FcListAppend (FcListHashTable *table, ++table->entries; return FcTrue; - + bail2: FcPatternDestroy (bucket->pattern); bail1: @@ -515,7 +515,7 @@ FcFontSetList (FcConfig *config, full++; } } - printf ("used: %d max: %d avg: %g\n", full, max, + printf ("used: %d max: %d avg: %g\n", full, max, (double) ents / FC_LIST_HASH_SIZE); } #endif @@ -535,7 +535,7 @@ FcFontSetList (FcConfig *config, FcMemFree (FC_MEM_LISTBUCK, sizeof (FcListBucket)); free (bucket); } - + return ret; bail2: diff --git a/src/fcmatch.c b/src/fcmatch.c index aa84eda..594c437 100644 --- a/src/fcmatch.c +++ b/src/fcmatch.c @@ -31,7 +31,7 @@ static double FcCompareNumber (FcValue *value1, FcValue *value2) { double v1, v2, v; - + switch (value1->type) { case FcTypeInteger: v1 = (double) value1->u.i; @@ -84,7 +84,7 @@ FcCompareLang (FcValue *v1, FcValue *v2) { FcLangResult result; FcValue value1 = FcValueCanonicalize(v1), value2 = FcValueCanonicalize(v2); - + switch (value1.type) { case FcTypeLangSet: switch (value2.type) { @@ -92,7 +92,7 @@ FcCompareLang (FcValue *v1, FcValue *v2) result = FcLangSetCompare (value1.u.l, value2.u.l); break; case FcTypeString: - result = FcLangSetHasLang (value1.u.l, + result = FcLangSetHasLang (value1.u.l, value2.u.s); break; default: @@ -105,7 +105,7 @@ FcCompareLang (FcValue *v1, FcValue *v2) result = FcLangSetHasLang (value2.u.l, value1.u.s); break; case FcTypeString: - result = FcLangCompare (value1.u.s, + result = FcLangCompare (value1.u.s, value2.u.s); break; default: @@ -354,10 +354,10 @@ FcCompare (FcPattern *pat, FcResult *result) { int i, i1, i2; - + for (i = 0; i < NUM_MATCH_VALUES; i++) value[i] = 0.0; - + i1 = 0; i2 = 0; while (i1 < pat->num && i2 < fnt->num) @@ -394,7 +394,7 @@ FcFontRenderPrepare (FcConfig *config, FcPatternElt *fe, *pe; FcValue v; FcResult result; - + new = FcPatternCreate (); if (!new) return 0; @@ -404,7 +404,7 @@ FcFontRenderPrepare (FcConfig *config, pe = FcPatternObjectFindElt (pat, fe->object); if (pe) { - if (!FcCompareValueList (pe->object, FcPatternEltValues(pe), + if (!FcCompareValueList (pe->object, FcPatternEltValues(pe), FcPatternEltValues(fe), &v, 0, &result)) { FcPatternDestroy (new); @@ -529,7 +529,7 @@ FcFontSetMatch (FcConfig *config, FcPattern * FcFontMatch (FcConfig *config, - FcPattern *p, + FcPattern *p, FcResult *result) { FcFontSet *sets[2]; @@ -687,21 +687,21 @@ FcFontSetSort (FcConfig *config, } if (!nnodes) goto bail0; - + for (nPatternLang = 0; FcPatternGet (p, FC_LANG, nPatternLang, &patternLang) == FcResultMatch; nPatternLang++) ; /* freed below */ - nodes = malloc (nnodes * sizeof (FcSortNode) + + nodes = malloc (nnodes * sizeof (FcSortNode) + nnodes * sizeof (FcSortNode *) + nPatternLang * sizeof (FcBool)); if (!nodes) goto bail0; nodeps = (FcSortNode **) (nodes + nnodes); patternLangSat = (FcBool *) (nodeps + nnodes); - + new = nodes; nodep = nodeps; for (set = 0; set < nsets; set++) @@ -735,13 +735,13 @@ FcFontSetSort (FcConfig *config, } nnodes = new - nodes; - + qsort (nodeps, nnodes, sizeof (FcSortNode *), FcSortCompare); - + for (i = 0; i < nPatternLang; i++) patternLangSat[i] = FcFalse; - + for (f = 0; f < nnodes; f++) { FcBool satisfies = FcFalse; @@ -814,7 +814,7 @@ bail0: FcFontSet * FcFontSort (FcConfig *config, - FcPattern *p, + FcPattern *p, FcBool trim, FcCharSet **csp, FcResult *result) diff --git a/src/fcmatrix.c b/src/fcmatrix.c index 1d6e2f6..f0c6139 100644 --- a/src/fcmatrix.c +++ b/src/fcmatrix.c @@ -30,10 +30,10 @@ const FcMatrix FcIdentityMatrix = { 1, 0, 0, 1 }; FcMatrix * -FcMatrixCopy (const FcMatrix *mat) +FcMatrixCopy (const FcMatrix *mat) { FcMatrix *r; - if(!mat) + if(!mat) return 0; r = (FcMatrix *) malloc (sizeof (*r) ); if (!r) @@ -58,7 +58,7 @@ FcMatrixEqual (const FcMatrix *mat1, const FcMatrix *mat2) { if(mat1 == mat2) return FcTrue; if(mat1 == 0 || mat2 == 0) return FcFalse; - return mat1->xx == mat2->xx && + return mat1->xx == mat2->xx && mat1->xy == mat2->xy && mat1->yx == mat2->yx && mat1->yy == mat2->yy; diff --git a/src/fcname.c b/src/fcname.c index b4ce944..5b0a932 100644 --- a/src/fcname.c +++ b/src/fcname.c @@ -28,9 +28,9 @@ #include #include -/* +/* * Please do not change this list, it is used to initialize the object - * list in this order to match the FC_foo_OBJECT constants. Those + * list in this order to match the FC_foo_OBJECT constants. Those * constants are written into cache files. */ @@ -169,7 +169,7 @@ FcObjectFindByName (const char *object, FcBool insert) * Hook it into the hash chain */ b = malloc (sizeof(FcObjectBucket)); - if (!b) + if (!b) return NULL; object = (const char *) FcStrCopy ((FcChar8 *) object); if (!object) { @@ -212,7 +212,7 @@ FcObjectHashInsert (const FcObjectType *object, FcBool copy) * Hook it into the hash chain */ b = malloc (sizeof(FcObjectBucket)); - if (!b) + if (!b) return FcFalse; if (copy) { @@ -421,7 +421,7 @@ static const FcConstant _FcBaseConstants[] = { { (FcChar8 *) "expanded", "width", FC_WIDTH_EXPANDED }, { (FcChar8 *) "extraexpanded", "width", FC_WIDTH_EXTRAEXPANDED }, { (FcChar8 *) "ultraexpanded", "width", FC_WIDTH_ULTRAEXPANDED }, - + { (FcChar8 *) "proportional", "spacing", FC_PROPORTIONAL, }, { (FcChar8 *) "dual", "spacing", FC_DUAL, }, { (FcChar8 *) "mono", "spacing", FC_MONO, }, @@ -495,8 +495,8 @@ FcNameUnregisterConstants (const FcConstant *consts, int nconsts) { const FcConstantList *l, **prev; - for (prev = &_FcConstants; - (l = *prev); + for (prev = &_FcConstants; + (l = *prev); prev = (const FcConstantList **) &(l->next)) { if (l->consts == consts && l->nconsts == nconsts) @@ -620,7 +620,7 @@ static const FcChar8 * FcNameFindNext (const FcChar8 *cur, const char *delim, FcChar8 *save, FcChar8 *last) { FcChar8 c; - + while ((c = *cur)) { if (c == '\\') @@ -765,7 +765,7 @@ bail0: return 0; } static FcBool -FcNameUnparseString (FcStrBuf *buf, +FcNameUnparseString (FcStrBuf *buf, const FcChar8 *string, const FcChar8 *escape) { @@ -790,7 +790,7 @@ FcNameUnparseValue (FcStrBuf *buf, { FcChar8 temp[1024]; FcValue v = FcValueCanonicalize(v0); - + switch (v.type) { case FcTypeVoid: return FcTrue; @@ -805,7 +805,7 @@ FcNameUnparseValue (FcStrBuf *buf, case FcTypeBool: return FcNameUnparseString (buf, v.u.b ? (FcChar8 *) "True" : (FcChar8 *) "False", 0); case FcTypeMatrix: - sprintf ((char *) temp, "%g %g %g %g", + sprintf ((char *) temp, "%g %g %g %g", v.u.m->xx, v.u.m->xy, v.u.m->yx, v.u.m->yy); return FcNameUnparseString (buf, temp, 0); case FcTypeCharSet: @@ -873,11 +873,11 @@ FcNameUnparseEscaped (FcPattern *pat, FcBool escape) for (i = 0; i < l->ntypes; i++) { o = &l->types[i]; - if (!strcmp (o->object, FC_FAMILY) || + if (!strcmp (o->object, FC_FAMILY) || !strcmp (o->object, FC_SIZE) || !strcmp (o->object, FC_FILE)) continue; - + e = FcPatternObjectFindElt (pat, FcObjectFromName (o->object)); if (e) { @@ -887,7 +887,7 @@ FcNameUnparseEscaped (FcPattern *pat, FcBool escape) goto bail0; if (!FcNameUnparseString (&buf, (FcChar8 *) "=", 0)) goto bail0; - if (!FcNameUnparseValueList (&buf, FcPatternEltValues(e), escape ? + if (!FcNameUnparseValueList (&buf, FcPatternEltValues(e), escape ? (FcChar8 *) FC_ESCAPE_VARIABLE : 0)) goto bail0; } diff --git a/src/fcpat.c b/src/fcpat.c index 76263b6..06b2f4a 100644 --- a/src/fcpat.c +++ b/src/fcpat.c @@ -138,11 +138,11 @@ FcValueListDestroy (FcValueListPtr l) FcMatrixFree ((FcMatrix *)l->value.u.m); break; case FcTypeCharSet: - FcCharSetDestroy + FcCharSetDestroy ((FcCharSet *) (l->value.u.c)); break; case FcTypeLangSet: - FcLangSetDestroy + FcLangSetDestroy ((FcLangSet *) (l->value.u.l)); break; default: @@ -210,7 +210,7 @@ FcStringHash (const FcChar8 *s) { FcChar8 c; FcChar32 h = 0; - + if (s) while ((c = *s++)) h = ((h << 1) | (h >> 31)) ^ c; @@ -232,9 +232,9 @@ FcValueHash (const FcValue *v) case FcTypeBool: return (FcChar32) v->u.b; case FcTypeMatrix: - return (FcDoubleHash (v->u.m->xx) ^ - FcDoubleHash (v->u.m->xy) ^ - FcDoubleHash (v->u.m->yx) ^ + return (FcDoubleHash (v->u.m->xx) ^ + FcDoubleHash (v->u.m->xy) ^ + FcDoubleHash (v->u.m->yx) ^ FcDoubleHash (v->u.m->yy)); case FcTypeCharSet: return (FcChar32) FcValueCharSet(v)->num; @@ -269,7 +269,7 @@ static FcChar32 FcValueListHash (FcValueListPtr l) { FcChar32 hash = 0; - + for (; l; l = FcValueListNext(l)) { hash = ((hash << 1) | (hash >> 31)) ^ FcValueHash (&l->value); @@ -282,7 +282,7 @@ FcPatternDestroy (FcPattern *p) { int i; FcPatternElt *elts; - + if (p->ref == FC_REF_CONSTANT) { FcCacheObjectDereference (p); @@ -342,12 +342,12 @@ FcPatternObjectInsertElt (FcPattern *p, FcObject object) { int i; FcPatternElt *e; - + i = FcPatternObjectPosition (p, object); if (i < 0) { i = -i - 1; - + /* reallocate array */ if (p->num + 1 >= p->size) { @@ -385,14 +385,14 @@ FcPatternObjectInsertElt (FcPattern *p, FcObject object) e + i, sizeof (FcPatternElt) * (p->num - i)); - + /* bump count */ p->num++; e[i].object = object; e[i].values = NULL; } - + return FcPatternElts(p) + i; } @@ -429,7 +429,7 @@ FcPatternHash (const FcPattern *p) for (i = 0; i < p->num; i++) { - h = (((h << 1) | (h >> 31)) ^ + h = (((h << 1) | (h >> 31)) ^ pe[i].object ^ FcValueListHash (FcPatternEltValues(&pe[i]))); } @@ -441,7 +441,7 @@ FcPatternEqualSubset (const FcPattern *pai, const FcPattern *pbi, const FcObject { FcPatternElt *ea, *eb; int i; - + for (i = 0; i < os->nobject; i++) { FcObject object = FcObjectFromName (os->objects[i]); @@ -503,11 +503,11 @@ FcPatternObjectAddWithBinding (FcPattern *p, new->value = value; new->binding = binding; new->next = NULL; - + e = FcPatternObjectInsertElt (p, object); if (!e) goto bail2; - + if (append) { for (prev = &e->values; *prev; prev = &(*prev)->next) @@ -519,10 +519,10 @@ FcPatternObjectAddWithBinding (FcPattern *p, new->next = e->values; e->values = new; } - + return FcTrue; -bail2: +bail2: FcValueDestroy (value); bail1: FcMemFree (FC_MEM_VALLIST, sizeof (FcValueList)); @@ -563,10 +563,10 @@ FcPatternObjectDel (FcPattern *p, FcObject object) /* destroy value */ FcValueListDestroy (e->values); - + /* shuffle existing ones down */ - memmove (e, e+1, - (FcPatternElts(p) + p->num - (e + 1)) * + memmove (e, e+1, + (FcPatternElts(p) + p->num - (e + 1)) * sizeof (FcPatternElt)); p->num--; e = FcPatternElts(p) + p->num; @@ -580,7 +580,7 @@ FcPatternDel (FcPattern *p, const char *object) { return FcPatternObjectDel (p, FcObjectFromName (object)); } - + FcBool FcPatternRemove (FcPattern *p, const char *object, int id) { @@ -773,8 +773,8 @@ FcPatternGetInteger (const FcPattern *p, const char *object, int id, int *i) { return FcPatternObjectGetInteger (p, FcObjectFromName (object), id, i); } - - + + FcResult FcPatternObjectGetDouble (const FcPattern *p, FcObject object, int id, double *d) { @@ -824,7 +824,7 @@ FcPatternGetString (const FcPattern *p, const char *object, int id, FcChar8 ** s { return FcPatternObjectGetString (p, FcObjectFromName (object), id, s); } - + FcResult FcPatternGetMatrix(const FcPattern *p, const char *object, int id, FcMatrix **m) { @@ -924,7 +924,7 @@ FcPatternDuplicate (const FcPattern *orig) l->binding, FcTrue)) goto bail1; - + } } @@ -949,7 +949,7 @@ FcPattern * FcPatternVaBuild (FcPattern *p, va_list va) { FcPattern *ret; - + FcPatternVapBuild (ret, p, va); return ret; } @@ -958,7 +958,7 @@ FcPattern * FcPatternBuild (FcPattern *p, ...) { va_list va; - + va_start (va, p); FcPatternVapBuild (p, p, va); va_end (va); @@ -974,14 +974,14 @@ FcPatternAppend (FcPattern *p, FcPattern *s) int i; FcPatternElt *e; FcValueListPtr v; - + for (i = 0; i < s->num; i++) { e = FcPatternElts(s)+i; for (v = FcPatternEltValues(e); v; v = FcValueListNext(v)) { if (!FcPatternObjectAddWithBinding (p, e->object, - FcValueCanonicalize(&v->value), + FcValueCanonicalize(&v->value), v->binding, FcTrue)) return FcFalse; } @@ -1102,7 +1102,7 @@ FcPatternSerializeAlloc (FcSerialize *serialize, const FcPattern *pat) { int i; FcPatternElt *elts = FcPatternElts(pat); - + if (!FcSerializeAlloc (serialize, pat, sizeof (FcPattern))) return FcFalse; if (!FcSerializeAlloc (serialize, elts, pat->num * sizeof (FcPatternElt))) @@ -1128,11 +1128,11 @@ FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat) *pat_serialized = *pat; pat_serialized->size = pat->num; pat_serialized->ref = FC_REF_CONSTANT; - + elts_serialized = FcSerializePtr (serialize, elts); if (!elts_serialized) return NULL; - + pat_serialized->elts_offset = FcPtrToOffset (pat_serialized, elts_serialized); @@ -1142,7 +1142,7 @@ FcPatternSerialize (FcSerialize *serialize, const FcPattern *pat) if (!values_serialized) return NULL; elts_serialized[i].object = elts[i].object; - elts_serialized[i].values = FcPtrToEncodedOffset (&elts_serialized[i], + elts_serialized[i].values = FcPtrToEncodedOffset (&elts_serialized[i], values_serialized, FcValueList); } @@ -1199,7 +1199,7 @@ FcValueListSerialize (FcSerialize *serialize, const FcValueList *vl) vl_serialized = FcSerializePtr (serialize, vl); if (!vl_serialized) return NULL; - + if (prev_serialized) prev_serialized->next = FcPtrToEncodedOffset (prev_serialized, vl_serialized, diff --git a/src/fcstr.c b/src/fcstr.c index ea7c376..34115ce 100644 --- a/src/fcstr.c +++ b/src/fcstr.c @@ -109,7 +109,7 @@ FcStrCaseWalkerLong (FcCaseWalker *w, FcChar8 r) int mid = (min + max) >> 1; FcChar32 low = fcCaseFold[mid].upper; FcChar32 high = low + FcCaseFoldUpperCount (&fcCaseFold[mid]); - + if (high <= ucs4) min = mid + 1; else if (ucs4 < low) @@ -158,7 +158,7 @@ FcStrCaseWalkerNext (FcCaseWalker *w) w->read = 0; } r = *w->src++; - + if ((r & 0xc0) == 0xc0) return FcStrCaseWalkerLong (w, r); if ('A' <= r && r <= 'Z') @@ -181,7 +181,7 @@ FcStrCaseWalkerNextIgnoreBlanks (FcCaseWalker *w) { r = *w->src++; } while (r == ' '); - + if ((r & 0xc0) == 0xc0) return FcStrCaseWalkerLong (w, r); if ('A' <= r && r <= 'Z') @@ -215,11 +215,11 @@ FcStrCmpIgnoreCase (const FcChar8 *s1, const FcChar8 *s2) FcChar8 c1, c2; if (s1 == s2) return 0; - + FcStrCaseWalkerInit (s1, &w1); FcStrCaseWalkerInit (s2, &w2); - - for (;;) + + for (;;) { c1 = FcStrCaseWalkerNext (&w1); c2 = FcStrCaseWalkerNext (&w2); @@ -236,11 +236,11 @@ FcStrCmpIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2) FcChar8 c1, c2; if (s1 == s2) return 0; - + FcStrCaseWalkerInit (s1, &w1); FcStrCaseWalkerInit (s2, &w2); - - for (;;) + + for (;;) { c1 = FcStrCaseWalkerNextIgnoreBlanks (&w1); c2 = FcStrCaseWalkerNextIgnoreBlanks (&w2); @@ -254,10 +254,10 @@ int FcStrCmp (const FcChar8 *s1, const FcChar8 *s2) { FcChar8 c1, c2; - + if (s1 == s2) return 0; - for (;;) + for (;;) { c1 = *s1++; c2 = *s2++; @@ -296,8 +296,8 @@ FcStrIsAtIgnoreBlanksAndCase (const FcChar8 *s1, const FcChar8 *s2) FcStrCaseWalkerInit (s1, &w1); FcStrCaseWalkerInit (s2, &w2); - - for (;;) + + for (;;) { c1 = FcStrCaseWalkerNextIgnoreBlanks (&w1); c2 = FcStrCaseWalkerNextIgnoreBlanks (&w2); @@ -355,8 +355,8 @@ FcStrIsAtIgnoreCase (const FcChar8 *s1, const FcChar8 *s2) FcStrCaseWalkerInit (s1, &w1); FcStrCaseWalkerInit (s2, &w2); - - for (;;) + + for (;;) { c1 = FcStrCaseWalkerNext (&w1); c2 = FcStrCaseWalkerNext (&w2); @@ -395,7 +395,7 @@ FcStrContainsWord (const FcChar8 *s1, const FcChar8 *s2) while (s1len >= s2len) { - if (wordStart && + if (wordStart && FcStrIsAtIgnoreCase (s1, s2) && (s1len == s2len || FcCharIsPunct (s1[s2len]))) { @@ -422,12 +422,12 @@ FcStrStrIgnoreCase (const FcChar8 *s1, const FcChar8 *s2) if (s1 == s2) return s1; - + FcStrCaseWalkerInit (s1, &w1); FcStrCaseWalkerInit (s2, &w2); - + c2 = FcStrCaseWalkerNext (&w2); - + for (;;) { cur = w1.src; @@ -474,7 +474,7 @@ again: if (!c2) return 0; - for (;;) + for (;;) { p = s1; c1 = *s1++; @@ -517,15 +517,15 @@ FcUtf8ToUcs4 (const FcChar8 *src_orig, if (len == 0) return 0; - + s = *src++; len--; - + if (!(s & 0x80)) { result = s; extra = 0; - } + } else if (!(s & 0x40)) { return -1; @@ -561,7 +561,7 @@ FcUtf8ToUcs4 (const FcChar8 *src_orig, } if (extra > len) return -1; - + while (extra--) { result <<= 6; @@ -586,7 +586,7 @@ FcUtf8Len (const FcChar8 *string, int clen; FcChar32 c; FcChar32 max; - + n = 0; max = 0; while (len) @@ -616,7 +616,7 @@ FcUcs4ToUtf8 (FcChar32 ucs4, { int bits; FcChar8 *d = dest; - + if (ucs4 < 0x80) { *d++= ucs4; bits= -6; } else if (ucs4 < 0x800) { *d++= ((ucs4 >> 6) & 0x1F) | 0xC0; bits= 0; } else if (ucs4 < 0x10000) { *d++= ((ucs4 >> 12) & 0x0F) | 0xE0; bits= 6; } @@ -647,11 +647,11 @@ FcUtf16ToUcs4 (const FcChar8 *src_orig, if (len < 2) return 0; - + a = GetUtf16 (src, endian); src += 2; len -= 2; - - /* - * Check for surrogate + + /* + * Check for surrogate */ if ((a & 0xfc00) == 0xd800) { @@ -683,7 +683,7 @@ FcUtf16Len (const FcChar8 *string, int clen; FcChar32 c; FcChar32 max; - + n = 0; max = 0; while (len) @@ -835,7 +835,7 @@ FcChar8 * FcStrCopyFilename (const FcChar8 *s) { FcChar8 *new; - + if (*s == '~') { FcChar8 *home = FcConfigHome (); @@ -875,7 +875,7 @@ FcStrLastSlash (const FcChar8 *path) return slash; } - + FcChar8 * FcStrDirname (const FcChar8 *file) { @@ -954,10 +954,10 @@ FcStrCanonAbsoluteFilename (const FcChar8 *s) } return file; } - + #ifdef _WIN32 /* - * Convert '\\' to '/' , remove double '/' + * Convert '\\' to '/' , remove double '/' */ static void FcConvertDosPath (char *str) @@ -1135,7 +1135,7 @@ FcStrSetDel (FcStrSet *set, const FcChar8 *s) * copy remaining string pointers and trailing * NULL */ - memmove (&set->strs[i], &set->strs[i+1], + memmove (&set->strs[i], &set->strs[i+1], (set->num - i) * sizeof (FcChar8 *)); set->num--; return FcTrue; @@ -1149,7 +1149,7 @@ FcStrSetDestroy (FcStrSet *set) if (--set->ref == 0) { int i; - + for (i = 0; i < set->num; i++) FcStrFree (set->strs[i]); if (set->strs) diff --git a/src/ftglue.c b/src/ftglue.c index 1eca304..d5af810 100644 --- a/src/ftglue.c +++ b/src/ftglue.c @@ -18,7 +18,7 @@ static void ftglue_log( const char* format, ... ) { va_list ap; - + va_start( ap, format ); vfprintf( stderr, format, ap ); va_end( ap ); @@ -170,10 +170,10 @@ ftglue_face_goto_table( FT_Face face, FT_Error error; LOG(( "ftglue_face_goto_table( %p, %c%c%c%c, %p )\n", - face, - (int)((the_tag >> 24) & 0xFF), - (int)((the_tag >> 16) & 0xFF), - (int)((the_tag >> 8) & 0xFF), + face, + (int)((the_tag >> 24) & 0xFF), + (int)((the_tag >> 16) & 0xFF), + (int)((the_tag >> 8) & 0xFF), (int)(the_tag & 0xFF), stream )); @@ -235,7 +235,7 @@ ftglue_face_goto_table( FT_Face face, FT_UNUSED(checksum); FT_UNUSED(size); - + if ( tag == the_tag ) { LOG(( "TrueType table (start: %ld) (size: %ld)\n", start, size )); @@ -251,9 +251,9 @@ ftglue_face_goto_table( FT_Face face, Exit: LOG(( "TrueType error=%d\n", error )); - + return error; -} +} #undef QALLOC #define __ftglue__