From 3e4b5c69db90b4226962ebfc7df958e875b94e14 Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Fri, 26 Feb 2010 07:16:32 +0000 Subject: 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 --- firmware/font.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'firmware/font.c') diff --git a/firmware/font.c b/firmware/font.c index 534fa922fd..804d3895b1 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; } -- cgit v1.2.3