Fix cppcheck variableScope warnings

This commit is contained in:
Chris Young 2014-04-05 19:56:28 +01:00
parent c1a32d7c6e
commit 975a1d3c5d
2 changed files with 9 additions and 5 deletions

View File

@ -196,11 +196,12 @@ int ami_find_tab_bw(struct gui_window_2 *gwin, struct browser_window *bw)
struct browser_window *ami_find_tab(int window, int tab)
{
int windows = 0;
struct nsObject *node, *nnode;
if(!IsMinListEmpty(window_list))
{
int windows = 0;
node = (struct nsObject *)GetHead((struct List *)window_list);
do
@ -568,7 +569,6 @@ STATIC VOID rx_windows(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((
STATIC VOID rx_active(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused)))
{
int windows = 0;
int window = 0, tab = 0;
struct browser_window *bw = curbw;
struct nsObject *node, *nnode;
@ -578,6 +578,8 @@ STATIC VOID rx_active(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((u
if(!IsMinListEmpty(window_list))
{
int windows = 0;
node = (struct nsObject *)GetHead((struct List *)window_list);
do

View File

@ -347,7 +347,6 @@ void ami_free_download_list(struct List *dllist)
void
gui_window_save_link(struct gui_window *g, const char *url, const char *title)
{
BPTR fh = 0;
char fname[1024];
STRPTR openurlstring,linkname;
struct DiskObject *dobj = NULL;
@ -369,6 +368,8 @@ gui_window_save_link(struct gui_window *g, const char *url, const char *title)
if(ami_download_check_overwrite(fname, g->shared->win, 0))
{
BPTR fh;
if(fh = FOpen(fname,MODE_NEWFILE,0))
{
/* TODO: Should be URLOpen on OS4.1 */
@ -401,8 +402,6 @@ BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG si
/* Return TRUE if file can be (over-)written */
int32 res = 0;
BPTR lock = 0;
BPTR fh = 0;
int64 oldsize = 0;
char *overwritetext;
if(nsoption_bool(ask_overwrite) == false) return TRUE;
@ -412,6 +411,9 @@ BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG si
if(lock)
{
if(size) {
BPTR fh;
int64 oldsize = 0;
if(fh = OpenFromLock(lock)) {
oldsize = GetFileSize(fh);
Close(fh);