mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-09 12:32:21 +03:00
Fix cppcheck variableScope warnings
This commit is contained in:
parent
c1a32d7c6e
commit
975a1d3c5d
@ -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)
|
struct browser_window *ami_find_tab(int window, int tab)
|
||||||
{
|
{
|
||||||
int windows = 0;
|
|
||||||
struct nsObject *node, *nnode;
|
struct nsObject *node, *nnode;
|
||||||
|
|
||||||
if(!IsMinListEmpty(window_list))
|
if(!IsMinListEmpty(window_list))
|
||||||
{
|
{
|
||||||
|
int windows = 0;
|
||||||
|
|
||||||
node = (struct nsObject *)GetHead((struct List *)window_list);
|
node = (struct nsObject *)GetHead((struct List *)window_list);
|
||||||
|
|
||||||
do
|
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)))
|
STATIC VOID rx_active(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unused)))
|
||||||
{
|
{
|
||||||
int windows = 0;
|
|
||||||
int window = 0, tab = 0;
|
int window = 0, tab = 0;
|
||||||
struct browser_window *bw = curbw;
|
struct browser_window *bw = curbw;
|
||||||
struct nsObject *node, *nnode;
|
struct nsObject *node, *nnode;
|
||||||
@ -578,6 +578,8 @@ STATIC VOID rx_active(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((u
|
|||||||
|
|
||||||
if(!IsMinListEmpty(window_list))
|
if(!IsMinListEmpty(window_list))
|
||||||
{
|
{
|
||||||
|
int windows = 0;
|
||||||
|
|
||||||
node = (struct nsObject *)GetHead((struct List *)window_list);
|
node = (struct nsObject *)GetHead((struct List *)window_list);
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -347,7 +347,6 @@ void ami_free_download_list(struct List *dllist)
|
|||||||
void
|
void
|
||||||
gui_window_save_link(struct gui_window *g, const char *url, const char *title)
|
gui_window_save_link(struct gui_window *g, const char *url, const char *title)
|
||||||
{
|
{
|
||||||
BPTR fh = 0;
|
|
||||||
char fname[1024];
|
char fname[1024];
|
||||||
STRPTR openurlstring,linkname;
|
STRPTR openurlstring,linkname;
|
||||||
struct DiskObject *dobj = NULL;
|
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))
|
if(ami_download_check_overwrite(fname, g->shared->win, 0))
|
||||||
{
|
{
|
||||||
|
BPTR fh;
|
||||||
|
|
||||||
if(fh = FOpen(fname,MODE_NEWFILE,0))
|
if(fh = FOpen(fname,MODE_NEWFILE,0))
|
||||||
{
|
{
|
||||||
/* TODO: Should be URLOpen on OS4.1 */
|
/* 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 */
|
/* Return TRUE if file can be (over-)written */
|
||||||
int32 res = 0;
|
int32 res = 0;
|
||||||
BPTR lock = 0;
|
BPTR lock = 0;
|
||||||
BPTR fh = 0;
|
|
||||||
int64 oldsize = 0;
|
|
||||||
char *overwritetext;
|
char *overwritetext;
|
||||||
|
|
||||||
if(nsoption_bool(ask_overwrite) == false) return TRUE;
|
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(lock)
|
||||||
{
|
{
|
||||||
if(size) {
|
if(size) {
|
||||||
|
BPTR fh;
|
||||||
|
int64 oldsize = 0;
|
||||||
|
|
||||||
if(fh = OpenFromLock(lock)) {
|
if(fh = OpenFromLock(lock)) {
|
||||||
oldsize = GetFileSize(fh);
|
oldsize = GetFileSize(fh);
|
||||||
Close(fh);
|
Close(fh);
|
||||||
|
Loading…
Reference in New Issue
Block a user