From 36a2a77a8e09fd56dfaea0efb1af627e14b4ceae Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 9 Jul 2016 23:43:17 +0100 Subject: tidy-up --- frontends/amiga/font_bullet.c | 2 +- frontends/amiga/font_cache.c | 2 +- frontends/amiga/gui.c | 9 ++++----- frontends/amiga/iff_dr2d.c | 8 +++----- frontends/amiga/schedule.c | 8 ++++---- 5 files changed, 13 insertions(+), 16 deletions(-) (limited to 'frontends/amiga') diff --git a/frontends/amiga/font_bullet.c b/frontends/amiga/font_bullet.c index 5542ed9f0..48e49f345 100644 --- a/frontends/amiga/font_bullet.c +++ b/frontends/amiga/font_bullet.c @@ -643,7 +643,6 @@ static inline int32 ami_font_width_glyph(struct OutlineFont *ofont, int32 char_advance = 0; FIXED kern = 0; struct MinList *gwlist = NULL; - FIXED char1w = 0; struct GlyphWidthEntry *gwnode; bool skip_c2 = false; uint32 long_char_1 = 0; @@ -678,6 +677,7 @@ static inline int32 ami_font_width_glyph(struct OutlineFont *ofont, OT_WidthList, &gwlist, TAG_END) == 0) { + FIXED char1w = 0; gwnode = (struct GlyphWidthEntry *)GetHead((struct List *)gwlist); if(gwnode) char1w = gwnode->gwe_Width; diff --git a/frontends/amiga/font_cache.c b/frontends/amiga/font_cache.c index ea285730a..08c2fe196 100644 --- a/frontends/amiga/font_cache.c +++ b/frontends/amiga/font_cache.c @@ -130,7 +130,7 @@ static void ami_font_cache_del_skiplist(struct SkipList *skiplist) struct ami_font_cache_node *ami_font_cache_locate(const char *font) { - struct ami_font_cache_node *nodedata; + struct ami_font_cache_node *nodedata = NULL; uint32 hash = 0; #ifdef __amigaos4__ diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c index ed4ce61fd..508fde914 100644 --- a/frontends/amiga/gui.c +++ b/frontends/amiga/gui.c @@ -935,13 +935,12 @@ static void ami_gui_read_all_tooltypes(int argc, char **argv) { struct WBStartup *WBenchMsg; struct WBArg *wbarg; - char i; - LONG olddir = -1; + char i = 0; if(argc == 0) { /* Started from WB */ WBenchMsg = (struct WBStartup *)argv; for(i = 0, wbarg = WBenchMsg->sm_ArgList; i < WBenchMsg->sm_NumArgs; i++,wbarg++) { - olddir =-1; + LONG olddir =-1; if((wbarg->wa_Lock) && (*wbarg->wa_Name)) olddir = SetCurrentDir(wbarg->wa_Lock); @@ -3080,12 +3079,12 @@ static void gui_quit(void) char *ami_gui_get_cache_favicon_name(nsurl *url, bool only_if_avail) { STRPTR filename = NULL; - BPTR lock = 0; if ((filename = ASPrintf("%s/%x", current_user_faviconcache, nsurl_hash(url)))) { LOG("favicon cache location: %s", filename); if (only_if_avail == true) { + BPTR lock = 0; if((lock = Lock(filename, ACCESS_READ))) { UnLock(lock); return filename; @@ -5563,7 +5562,7 @@ int main(int argc, char** argv) LOG("WARNING: JSIMD_FORCENONE NOT SET"); SetVar("JSIMD_FORCENONE", "1", 1, GVF_GLOBAL_ONLY | GVF_SAVE_VAR); } else { - LOG("JSIMDFORCENONE = %s (NB: Should be '1' for this architecture)", jsimd_forcenone); + LOG("JSIMD_FORCENONE = %s (NB: Should be '1' for this architecture)", jsimd_forcenone); } } #endif diff --git a/frontends/amiga/iff_dr2d.c b/frontends/amiga/iff_dr2d.c index 966d2a6e3..aea7738d3 100644 --- a/frontends/amiga/iff_dr2d.c +++ b/frontends/amiga/iff_dr2d.c @@ -78,8 +78,6 @@ bool ami_svg_to_dr2d(struct IFFHandle *iffh, const char *buffer, { struct svgtiny_diagram *diagram; svgtiny_code code; - unsigned int i; - unsigned int j; BOOL fons_written = FALSE; struct fons_struct *fons; struct stxt_struct *stxt; @@ -156,7 +154,7 @@ bool ami_svg_to_dr2d(struct IFFHandle *iffh, const char *buffer, if(!(PushChunk(iffh,0,ID_CMAP,IFFSIZE_UNKNOWN))) { - for (i = 0; i != diagram->shape_count; i++) { + for (unsigned int i = 0; i != diagram->shape_count; i++) { if(diagram->shape[i].fill != svgtiny_TRANSPARENT) { addcolour(diagram->shape[i].fill); @@ -172,7 +170,7 @@ bool ami_svg_to_dr2d(struct IFFHandle *iffh, const char *buffer, PopChunk(iffh); } - for (i = 0; i != diagram->shape_count; i++) { + for (unsigned int i = 0; i != diagram->shape_count; i++) { attr = ami_misc_allocvec_clear(sizeof(struct attr_struct), 0); if (diagram->shape[i].fill == svgtiny_TRANSPARENT) attr->FillType = FT_NONE; @@ -212,7 +210,7 @@ bool ami_svg_to_dr2d(struct IFFHandle *iffh, const char *buffer, NumPoints = 0; type = ID_OPLY; - for (j = 0; + for (unsigned int j = 0; j != diagram->shape[i].path_length; ) { switch ((int) diagram->shape[i].path[j]) { case svgtiny_PATH_MOVE: diff --git a/frontends/amiga/schedule.c b/frontends/amiga/schedule.c index e34c00017..2d6346533 100755 --- a/frontends/amiga/schedule.c +++ b/frontends/amiga/schedule.c @@ -38,14 +38,14 @@ struct Device *TimerBase; struct TimerIFace *ITimer; #endif -static APTR pool_nscb = NULL; -static APTR pool_timereq = NULL; +static APTR restrict pool_nscb = NULL; +static APTR restrict pool_timereq = NULL; struct nscallback { struct TimeVal tv; - void *callback; - void *p; + void *restrict callback; + void *restrict p; struct TimeRequest *treq; }; -- cgit v1.2.3