From 5bb5e2667df7459c288c3484d3539376a74a7c68 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 5 Apr 2014 23:34:51 +0100 Subject: Change the scope of some variables picked up by cppcheck, minor reformatting --- amiga/file.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'amiga/file.c') diff --git a/amiga/file.c b/amiga/file.c index 5d16ceb13..008141c42 100644 --- a/amiga/file.c +++ b/amiga/file.c @@ -149,23 +149,19 @@ void ami_file_save(int type, char *fname, struct Window *win, struct hlcache_handle *object, struct hlcache_handle *favicon, struct browser_window *bw) { - BPTR lock = 0; + BPTR lock, fh; const char *source_data; ULONG source_size; struct bitmap *bm; - BPTR fh=0; ami_update_pointer(win, GUI_POINTER_WAIT); - if(ami_download_check_overwrite(fname, win, 0)) - { - switch(type) - { + if(ami_download_check_overwrite(fname, win, 0)) { + switch(type) { case AMINS_SAVE_SOURCE: - if((source_data = content_get_source_data(object, &source_size))) - { - if(fh = FOpen(fname, MODE_NEWFILE,0)) - { + if((source_data = content_get_source_data(object, &source_size))) { + BPTR fh; + if(fh = FOpen(fname, MODE_NEWFILE,0)) { FWrite(fh, source_data, 1, source_size); FClose(fh); } @@ -177,8 +173,7 @@ void ami_file_save(int type, char *fname, struct Window *win, break; case AMINS_SAVE_COMPLETE: - if(lock = CreateDir(fname)) - { + if(lock = CreateDir(fname)) { UnLock(lock); save_complete(object, fname, ami_file_set_type); amiga_icon_superimpose_favicon(fname, favicon, NULL); @@ -193,15 +188,13 @@ void ami_file_save(int type, char *fname, struct Window *win, break; case AMINS_SAVE_IFF: - if((bm = content_get_bitmap(object))) - { + if((bm = content_get_bitmap(object))) { bm->url = (char *)nsurl_access(hlcache_handle_get_url(object)); bm->title = (char *)content_get_title(object); bitmap_save(bm, fname, 0); } #ifdef WITH_NS_SVG - else if(ami_mime_compare(object, "svg") == true) - { + else if(ami_mime_compare(object, "svg") == true) { ami_save_svg(object, fname); } #endif -- cgit v1.2.3