]> git.wh0rd.org - fontconfig.git/commitdiff
Always define FcStat as a function
authorBehdad Esfahbod <behdad@behdad.org>
Mon, 14 Mar 2011 21:49:21 +0000 (18:49 -0300)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 14 Mar 2011 21:49:21 +0000 (18:49 -0300)
Such that first arg is const char *.  We also need to make more changes
in that function as part of some other bug.

src/fcatomic.c
src/fccache.c
src/fccfg.c
src/fcdir.c
src/fcint.h

index 81b5f6a283b211dd91755e63a077ced1d1ba53be..33c1cc6287df4282feccde3f2a71dc6f9d9c1568 100644 (file)
@@ -142,7 +142,7 @@ FcAtomicLock (FcAtomic *atomic)
         * machines sharing the same filesystem will have clocks
         * reasonably close to each other.
         */
-       if (FcStat ((char *) atomic->lck, &lck_stat) >= 0)
+       if (FcStat (atomic->lck, &lck_stat) >= 0)
        {
            time_t  now = time (0);
            if ((long int) (now - lck_stat.st_mtime) > 10 * 60)
index 1bbd79975602b1b9ae13c530d3646da592771e7c..d865266230dde92433f0233bc617936bb1f931b7 100644 (file)
@@ -132,6 +132,15 @@ FcStat (const char *file, struct stat *statb)
 
     return 0;
 }
+
+#else
+
+int
+FcStat (const char *file, struct stat *statb)
+{
+  return stat ((char *) file, statb);
+}
+
 #endif
 
 static const char bin2hex[] = { '0', '1', '2', '3',
@@ -234,7 +243,7 @@ FcDirCacheProcess (FcConfig *config, const FcChar8 *dir,
     struct stat file_stat, dir_stat;
     FcBool     ret = FcFalse;
 
-    if (FcStat ((char *) dir, &dir_stat) < 0)
+    if (FcStat (dir, &dir_stat) < 0)
         return FcFalse;
 
     FcDirCacheBasename (dir, cache_base);
@@ -516,7 +525,7 @@ FcCacheTimeValid (FcCache *cache, struct stat *dir_stat)
 
     if (!dir_stat)
     {
-       if (FcStat ((const char *) FcCacheDir (cache), &dir_static) < 0)
+       if (FcStat (FcCacheDir (cache), &dir_static) < 0)
            return FcFalse;
        dir_stat = &dir_static;
     }
index 681278114360f37c2a8ba54a9218c9e0528a68e7..4beb7d23688b8f97a423e60d85de4f34cf873bca 100644 (file)
@@ -131,7 +131,7 @@ FcConfigNewestFile (FcStrSet *files)
     if (list)
     {
        while ((file = FcStrListNext (list)))
-           if (FcStat ((char *) file, &statb) == 0)
+           if (FcStat (file, &statb) == 0)
                if (!newest.set || statb.st_mtime - newest.time > 0)
                {
                    newest.set = FcTrue;
index e6b66ce9c90926148430e2514ed7dcb15d474241..359446c3682772b4446f12ff7c7b4c25bbb2ec09 100644 (file)
@@ -30,7 +30,7 @@ FcFileIsDir (const FcChar8 *file)
 {
     struct stat            statb;
 
-    if (FcStat ((const char *) file, &statb) != 0)
+    if (FcStat (file, &statb) != 0)
        return FcFalse;
     return S_ISDIR(statb.st_mode);
 }
@@ -243,7 +243,7 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
     if (FcDebug () & FC_DBG_FONTSET)
        printf ("cache scan dir %s\n", dir);
 
-    if (FcStat ((char *) dir, &dir_stat) < 0)
+    if (FcStat (dir, &dir_stat) < 0)
     {
        if (errno != ENOENT)
            ret = FcFalse;
index a2313dfe39d05ba2cc802dfba09d0a18ba1d8adf..83a7a435be4984b27e3de80cc5599e602cca966f 100644 (file)
@@ -544,12 +544,8 @@ FcCacheFini (void);
 FcPrivate void
 FcDirCacheReference (FcCache *cache, int nref);
 
-#ifdef _WIN32
 FcPrivate int
 FcStat (const char *file, struct stat *statb);
-#else
-#define FcStat stat
-#endif
 
 /* fccfg.c */