diff options
| author | Teruaki Kawashima <teru@rockbox.org> | 2010-02-26 07:16:32 +0000 |
|---|---|---|
| committer | Teruaki Kawashima <teru@rockbox.org> | 2010-02-26 07:16:32 +0000 |
| commit | 3e4b5c69db90b4226962ebfc7df958e875b94e14 (patch) | |
| tree | 568a9ffa1f19e615e2b4c8684686a8ea12634ef8 /firmware/font.c | |
| parent | 321148124a8c23c61c0784dac858e78e1c9e0ff2 (diff) | |
| download | rockbox-3e4b5c69db90b4226962ebfc7df958e875b94e14.zip rockbox-3e4b5c69db90b4226962ebfc7df958e875b94e14.tar.gz rockbox-3e4b5c69db90b4226962ebfc7df958e875b94e14.tar.bz2 rockbox-3e4b5c69db90b4226962ebfc7df958e875b94e14.tar.xz | |
font.c: correct checking cache_fd. remove some trailing spaces.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24920 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/font.c')
| -rw-r--r-- | firmware/font.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/firmware/font.c b/firmware/font.c index 534fa92..804d389 100644 --- a/firmware/font.c +++ b/firmware/font.c @@ -380,7 +380,7 @@ static bool internal_load_font(struct font* pf, const char *path, } return true; } - + #ifdef HAVE_REMOTE_LCD /* Load a font into the special remote ui font slot */ int font_load_remoteui(const char* path) @@ -484,7 +484,7 @@ load_cache_entry(struct font_cache_entry* p, void* callback_data) struct font* pf = callback_data; unsigned short char_code = p->_char_code; unsigned char tmp[2]; - + if (pf->file_width_offset) { int width_offset = pf->file_width_offset + char_code; @@ -495,7 +495,7 @@ load_cache_entry(struct font_cache_entry* p, void* callback_data) { p->width = pf->maxwidth; } - + int32_t bitmap_offset = 0; if (pf->file_offset_offset) @@ -547,7 +547,7 @@ int font_get_width(struct font* pf, unsigned short char_code) font_cache_get(&pf->cache,char_code,load_cache_entry,pf)->width: pf->width? pf->width[char_code]: pf->maxwidth; } - + const unsigned char* font_get_bits(struct font* pf, unsigned short char_code) { const unsigned char* bits; @@ -614,8 +614,8 @@ void glyph_cache_save(struct font* pf) if (cache_fd < 0) return; lru_traverse(&pf->cache._lru, glyph_file_write); - - if (cache_fd < 0) + + if (cache_fd >= 0) { close(cache_fd); cache_fd = -1; @@ -677,7 +677,7 @@ int font_get_width(struct font* pf, unsigned short char_code) return pf->width? pf->width[char_code]: pf->maxwidth; } - + const unsigned char* font_get_bits(struct font* pf, unsigned short char_code) { const unsigned char* bits; @@ -691,7 +691,7 @@ const unsigned char* font_get_bits(struct font* pf, unsigned short char_code) bits = pf->bits + (pf->offset? ((uint16_t*)(pf->offset))[char_code]: (((pf->height + 7) / 8) * pf->maxwidth * char_code)); - + return bits; } |