Commit a4bd5b7c authored by Behdad Esfahbod's avatar Behdad Esfahbod

[varfonts] Change id argument in FcFreeTypeQuery* to unsigned int

Going to use the top bit to query varfonts.
parent 819d3a55
......@@ -98,7 +98,7 @@ usage (char *program, int error)
int
main (int argc, char **argv)
{
int id = -1;
unsigned int id = (unsigned int) -1;
int ignore_blanks = 0;
FcFontSet *fs;
FcChar8 *format = NULL;
......@@ -119,7 +119,7 @@ main (int argc, char **argv)
ignore_blanks = 1;
break;
case 'i':
id = atoi (optarg);
id = (unsigned int) strtol (optarg, NULL, 0); /* strtol() To handle -1. */
break;
case 'f':
format = (FcChar8 *) strdup (optarg);
......@@ -150,7 +150,7 @@ main (int argc, char **argv)
{
if (!FcFreeTypeQueryAll ((FcChar8*) argv[i], id, blanks, NULL, fs))
{
fprintf (stderr, "Can't query face %d of font file %s\n", id, argv[i]);
fprintf (stderr, "Can't query face %u of font file %s\n", id, argv[i]);
err = 1;
}
}
......
......@@ -51,7 +51,7 @@ FcPatternAddFTFace (FcPattern *p, const char *object, const FT_Face f);
FcPublic FcPattern *
FcFreeTypeQueryFace (const FT_Face face,
const FcChar8 *file,
int id,
unsigned int id,
FcBlanks *blanks);
_FCFUNCPROTOEND
......
......@@ -577,10 +577,10 @@ FcDirCacheUnload (FcCache *cache);
/* fcfreetype.c */
FcPublic FcPattern *
FcFreeTypeQuery (const FcChar8 *file, int id, FcBlanks *blanks, int *count);
FcFreeTypeQuery (const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count);
FcPublic unsigned int
FcFreeTypeQueryAll(const FcChar8 *file, int id, FcBlanks *blanks, int *count, FcFontSet *set);
FcFreeTypeQueryAll(const FcChar8 *file, unsigned int id, FcBlanks *blanks, int *count, FcFontSet *set);
/* fcfs.c */
......
......@@ -1157,7 +1157,7 @@ static const FT_UShort nameid_order[] = {
FcPattern *
FcFreeTypeQueryFace (const FT_Face face,
const FcChar8 *file,
int id,
unsigned int id,
FcBlanks *blanks FC_UNUSED)
{
FcPattern *pat;
......@@ -1972,7 +1972,7 @@ bail0:
FcPattern *
FcFreeTypeQuery(const FcChar8 *file,
int id,
unsigned int id,
FcBlanks *blanks,
int *count)
{
......@@ -1999,20 +1999,20 @@ bail:
unsigned int
FcFreeTypeQueryAll(const FcChar8 *file,
int id,
unsigned int id,
FcBlanks *blanks,
int *count,
FcFontSet *set)
{
FT_Face face;
FT_Library ftLibrary = NULL;
int index_set = id != -1;
int set_face_num = index_set ? id & 0xFFFF : 0;
int set_instance_num = index_set ? id >> 16 : 0;
int face_num = set_face_num;
int instance_num = set_instance_num;
int num_faces = 0;
int num_instances = 0;
FcBool index_set = id != (unsigned int) -1;
unsigned int set_face_num = index_set ? id & 0xFFFF : 0;
unsigned int set_instance_num = index_set ? id >> 16 : 0;
unsigned int face_num = set_face_num;
unsigned int instance_num = set_instance_num;
unsigned int num_faces = 0;
unsigned int num_instances = 0;
unsigned int ret = 0;
int err = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment