X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=src%2Ffccache.c;h=2d4a4377ba42145cc5ca6b25239db1dc96f1e197;hb=HEAD;hp=571aa6403f1f0ca2d07cbc53c1f9a817e70680d0;hpb=594dcef0f30ca27e27b95a9174087e8c61327e5f;p=fontconfig.git diff --git a/src/fccache.c b/src/fccache.c index 571aa64..2d4a437 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -6,9 +6,9 @@ * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in + * documentation, and that the name of the author(s) not be used in * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no + * specific, written prior permission. The authors make no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * @@ -22,7 +22,7 @@ */ #include "fcint.h" -#include "../fc-arch/fcarch.h" +#include "fcarch.h" #include #include #include @@ -41,6 +41,7 @@ #define O_BINARY 0 #endif + struct MD5Context { FcChar32 buf[4]; FcChar32 bits[2]; @@ -131,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', @@ -233,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); @@ -515,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; } @@ -1157,7 +1167,7 @@ static void MD5Final(unsigned char digest[16], struct MD5Context *ctx) MD5Transform(ctx->buf, (FcChar32 *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ }