~cyphermox/ubuntu/lucid/fontconfig/merge-to-2.8.0-2.lp490326.take2

« back to all changes in this revision

Viewing changes to src/fccache.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-05 18:41:16 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070105184116-gyl4grlqfl47ah4v
Tags: 2.4.2-1ubuntu1
* Merge with Debian unstable; remaining changes:
  - see 2.4.1-2ubuntu[12].
* conf.d/60-latin.conf: Prefer DejaVu over Bitstream Vera,
  as done for dapper.

Show diffs side-by-side

added added

removed removed

Lines of Context:
213
213
static FcCacheSkip      *fcCacheChains[FC_CACHE_MAX_LEVEL];
214
214
static int              fcCacheMaxLevel;
215
215
 
 
216
#if HAVE_RANDOM
 
217
# define FcRandom()  random()
 
218
#else
 
219
# if HAVE_LRAND48
 
220
#  define FcRandom()  lrand48()
 
221
# else
 
222
#  if HAVE_RAND
 
223
#   define FcRandom()  rand()
 
224
#  endif
 
225
# endif
 
226
#endif
216
227
/*
217
228
 * Generate a random level number, distributed
218
229
 * so that each level is 1/4 as likely as the one before
223
234
random_level (void)
224
235
{
225
236
    /* tricky bit -- each bit is '1' 75% of the time */
226
 
    long int    bits = random () | random ();
 
237
    long int    bits = FcRandom () | FcRandom ();
227
238
    int level = 0;
228
239
 
229
240
    while (++level < FC_CACHE_MAX_LEVEL)
443
454
                                         PAGE_READONLY, 0, 0, NULL);
444
455
            if (hFileMap != NULL)
445
456
            {
446
 
                cache = MapViewOfFile (hFileMap, FILE_MAP_READ, 0, 0, size);
 
457
                cache = MapViewOfFile (hFileMap, FILE_MAP_READ, 0, 0, 
 
458
                                       fd_stat->st_size);
447
459
                CloseHandle (hFileMap);
448
460
            }
449
461
        }
678
690
    return NULL;
679
691
}
680
692
 
 
693
 
 
694
#ifdef _WIN32
 
695
#define mkdir(path,mode) _mkdir(path)
 
696
#endif
 
697
 
681
698
static FcBool
682
699
FcMakeDirectory (const FcChar8 *dir)
683
700
{
809
826
 * Hokey little macro trick to permit the definitions of C functions
810
827
 * with the same name as CPP macros
811
828
 */
812
 
#define args(x...)          (x)
 
829
#define args1(x)            (x)
 
830
#define args2(x,y)          (x,y)
813
831
 
814
832
const FcChar8 *
815
 
FcCacheDir args(const FcCache *c)
 
833
FcCacheDir args1(const FcCache *c)
816
834
{
817
835
    return FcCacheDir (c);
818
836
}
819
837
 
820
838
FcFontSet *
821
 
FcCacheCopySet args(const FcCache *c)
 
839
FcCacheCopySet args1(const FcCache *c)
822
840
{
823
841
    FcFontSet   *old = FcCacheSet (c);
824
842
    FcFontSet   *new = FcFontSetCreate ();
841
859
}
842
860
 
843
861
const FcChar8 *
844
 
FcCacheSubdir args(const FcCache *c, int i)
 
862
FcCacheSubdir args2(const FcCache *c, int i)
845
863
{
846
864
    return FcCacheSubdir (c, i);
847
865
}
848
866
 
849
867
int
850
 
FcCacheNumSubdir args(const FcCache *c)
 
868
FcCacheNumSubdir args1(const FcCache *c)
851
869
{
852
870
    return c->dirs_count;
853
871
}
854
872
 
855
873
int
856
 
FcCacheNumFont args(const FcCache *c)
 
874
FcCacheNumFont args1(const FcCache *c)
857
875
{
858
876
    return FcCacheSet(c)->nfont;
859
877
}