forked from len0rd/rockbox
cleanup code for picky compiler warning options
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17060 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f8f1f3e811
commit
afecfe46f3
7 changed files with 54 additions and 46 deletions
|
@ -569,7 +569,7 @@ int bdf_read_bitmaps(FILE *fp, struct font* pf)
|
|||
|
||||
if (padnibbles <= 0)
|
||||
break;
|
||||
if (padnibbles >= BITMAP_NIBBLES)
|
||||
if (padnibbles >= (int)BITMAP_NIBBLES)
|
||||
padnibbles = 0;
|
||||
|
||||
value = bdf_hexval((unsigned char *)buf,
|
||||
|
@ -610,7 +610,7 @@ int bdf_read_bitmaps(FILE *fp, struct font* pf)
|
|||
#ifdef ROTATE
|
||||
l = 0;
|
||||
for (i=0; i<pf->size; ++i) {
|
||||
if (pf->offrot[i] != l) {
|
||||
if ((int)pf->offrot[i] != l) {
|
||||
encodetable = 1;
|
||||
break;
|
||||
}
|
||||
|
@ -785,9 +785,11 @@ int gen_c_source(struct font* pf, char *path)
|
|||
{
|
||||
FILE *ofp;
|
||||
int i, ofr = 0;
|
||||
int did_syncmsg = 0;
|
||||
time_t t = time(0);
|
||||
#ifndef ROTATE
|
||||
int did_syncmsg = 0;
|
||||
bitmap_t *ofs = pf->bits;
|
||||
#endif
|
||||
char buf[256];
|
||||
char obuf[256];
|
||||
char hdr1[] = {
|
||||
|
@ -841,13 +843,13 @@ int gen_c_source(struct font* pf, char *path)
|
|||
int width = pf->width ? pf->width[i] : pf->maxwidth;
|
||||
int height = pf->height;
|
||||
bitmap_t *bits;
|
||||
bitmap_t bitvalue;
|
||||
bitmap_t bitvalue=0;
|
||||
|
||||
/* Skip missing glyphs */
|
||||
if (pf->offset && (pf->offset[i] == (unsigned int)-1))
|
||||
continue;
|
||||
|
||||
bits = pf->bits + (pf->offset? pf->offset[i]: (pf->height * i));
|
||||
bits = pf->bits + (pf->offset? (int)pf->offset[i]: (pf->height * i));
|
||||
|
||||
fprintf(ofp, "\n/* Character %d (0x%02x):\n width %d",
|
||||
i+pf->firstchar, i+pf->firstchar, width);
|
||||
|
@ -885,7 +887,7 @@ int gen_c_source(struct font* pf, char *path)
|
|||
else
|
||||
fprintf(ofp, " */\n");
|
||||
|
||||
bits = pf->bits + (pf->offset? pf->offset[i]: (pf->height * i));
|
||||
bits = pf->bits + (pf->offset? (int)pf->offset[i]: (pf->height * i));
|
||||
#ifdef ROTATE /* pre-rotated into Rockbox bitmap format */
|
||||
{
|
||||
unsigned char bytemap[512];
|
||||
|
@ -929,7 +931,7 @@ int gen_c_source(struct font* pf, char *path)
|
|||
pf->offset[i] = pf->offset[pf->defaultchar - pf->firstchar];
|
||||
pf->offrot[i] = pf->offrot[pf->defaultchar - pf->firstchar];
|
||||
}
|
||||
fprintf(ofp, " %ld,\t/* (0x%02x) */\n",
|
||||
fprintf(ofp, " %d,\t/* (0x%02x) */\n",
|
||||
#ifdef ROTATE
|
||||
pf->offrot[i], i+pf->firstchar);
|
||||
#else
|
||||
|
@ -993,7 +995,7 @@ int gen_h_header(struct font* pf, char *path)
|
|||
FILE *ofp;
|
||||
time_t t = time(0);
|
||||
char buf[256];
|
||||
char hdr1[] = {
|
||||
char *hdr1 =
|
||||
"/* Generated by convbdf on %s. */\n"
|
||||
"#ifdef HAVE_LCD_BITMAP\n"
|
||||
"\n"
|
||||
|
@ -1003,7 +1005,8 @@ int gen_h_header(struct font* pf, char *path)
|
|||
"#define SYSFONT_WIDTH %d\n"
|
||||
"#define SYSFONT_HEIGHT %d\n"
|
||||
"#define SYSFONT_SIZE %d\n"
|
||||
"#define SYSFONT_ASCENT %d\n"
|
||||
"#define SYSFONT_ASCENT %d\n";
|
||||
char *hdr2 =
|
||||
"#define SYSFONT_DESCENT %d\n"
|
||||
"#define SYSFONT_FIRST_CHAR %d\n"
|
||||
"#define SYSFONT_LAST_CHAR %d\n"
|
||||
|
@ -1012,8 +1015,7 @@ int gen_h_header(struct font* pf, char *path)
|
|||
"#define SYSFONT_COPYRIGHT %s\n"
|
||||
"#define SYSFONT_BITS_SIZE %d\n"
|
||||
"\n"
|
||||
"#endif\n"
|
||||
};
|
||||
"#endif\n";
|
||||
|
||||
ofp = fopen(path, "w");
|
||||
if (!ofp) {
|
||||
|
@ -1030,7 +1032,9 @@ int gen_h_header(struct font* pf, char *path)
|
|||
pf->maxwidth,
|
||||
pf->height,
|
||||
pf->size,
|
||||
pf->ascent,
|
||||
pf->ascent);
|
||||
|
||||
fprintf(ofp, hdr2, buf,
|
||||
pf->descent,
|
||||
pf->firstchar,
|
||||
pf->firstchar+pf->size-1,
|
||||
|
@ -1063,9 +1067,10 @@ static int writeint(FILE *fp, unsigned int l)
|
|||
|
||||
static int writestr(FILE *fp, char *str, int count)
|
||||
{
|
||||
return fwrite(str, 1, count, fp) == count;
|
||||
return (int)fwrite(str, 1, count, fp) == count;
|
||||
}
|
||||
|
||||
#ifndef ROTATE
|
||||
static int writestrpad(FILE *fp, char *str, int totlen)
|
||||
{
|
||||
int ret;
|
||||
|
@ -1080,6 +1085,7 @@ static int writestrpad(FILE *fp, char *str, int totlen)
|
|||
ret = putc(' ', fp);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* generate .fnt format file from in-core font*/
|
||||
int gen_fnt_file(struct font* pf, char *path)
|
||||
|
@ -1131,7 +1137,7 @@ int gen_fnt_file(struct font* pf, char *path)
|
|||
if (pf->offset && (pf->offset[i] == (unsigned int)-1))
|
||||
continue;
|
||||
|
||||
bits = pf->bits + (pf->offset? pf->offset[i]: (pf->height * i));
|
||||
bits = pf->bits + (pf->offset? (int)pf->offset[i]: (pf->height * i));
|
||||
|
||||
size = rotleft(bytemap, sizeof(bytemap), bits, width, pf->height);
|
||||
writestr(ofp, (char *)bytemap, size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue