summaryrefslogtreecommitdiff
path: root/amiga/file.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2014-04-05 23:34:51 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2014-04-05 23:34:51 +0100
commit5bb5e2667df7459c288c3484d3539376a74a7c68 (patch)
tree45f10d2608677c890ebcb6b78804de1d423513c9 /amiga/file.c
parent3ea6ca89a0daf4a20ddf9962cc787ed5001f5ab6 (diff)
downloadnetsurf-5bb5e2667df7459c288c3484d3539376a74a7c68.tar.gz
netsurf-5bb5e2667df7459c288c3484d3539376a74a7c68.tar.bz2
Change the scope of some variables picked up by cppcheck, minor reformatting
Diffstat (limited to 'amiga/file.c')
-rw-r--r--amiga/file.c25
1 files changed, 9 insertions, 16 deletions
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