netsurf: branch master updated. release/3.0-1210-ge41900b
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/e41900bddc8488ae29f7c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/e41900bddc8488ae29f7c30...
...tree http://git.netsurf-browser.org/netsurf.git/tree/e41900bddc8488ae29f7c3021...
The branch, master has been updated
via e41900bddc8488ae29f7c302103cfea3eef8bbdc (commit)
via b828f6de02393cc47139fa268a5e1f2c2085771e (commit)
via 763825e5972f6ea7f986056f84a68cec451ba7cb (commit)
from cfc75ac6f98ce614cb224ffa243daf68a166c907 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=e41900bddc8488ae29f...
commit e41900bddc8488ae29f7c302103cfea3eef8bbdc
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Implied table rows must increment the row group's row count too.
diff --git a/render/box_normalise.c b/render/box_normalise.c
index a19047c..ecea6ea 100644
--- a/render/box_normalise.c
+++ b/render/box_normalise.c
@@ -650,6 +650,7 @@ bool box_normalise_table_row_group(struct box *row_group,
row_group->last = row;
row->parent = row_group;
+ group_row_count++;
if (box_normalise_table_row(row, col_info,
c) == false)
return false;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=b828f6de02393cc4713...
commit b828f6de02393cc47139fa268a5e1f2c2085771e
Merge: cfc75ac 763825e
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Merge remote-tracking branch 'achal/fix-line-height'
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=763825e5972f6ea7f98...
commit 763825e5972f6ea7f986056f84a68cec451ba7cb
Author: Achal-Aggarwal <theachalaggarwal(a)gmail.com>
Commit: Achal-Aggarwal <theachalaggarwal(a)gmail.com>
Fixes #2101, evaluation of text field and textarea line height.
diff --git a/desktop/textarea.c b/desktop/textarea.c
index bd35a5e..2ba0982 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -1895,9 +1895,9 @@ struct textarea *textarea_create(const textarea_flags flags,
ret->show = &ret->text;
}
- ret->line_height = FIXTOINT(FDIV((FMUL(FLTTOFIX(1.3),
- FMUL(nscss_screen_dpi, INTTOFIX((setup->text.size))))),
- FONT_SIZE_SCALE * F_72));
+ ret->line_height = FIXTOINT(FMUL(FLTTOFIX(1.3), FDIV(FMUL(
+ nscss_screen_dpi, FDIV(INTTOFIX(setup->text.size),
+ INTTOFIX(FONT_SIZE_SCALE))), F_72)));
ret->caret_pos.line = ret->caret_pos.byte_off = -1;
ret->caret_x = 0;
-----------------------------------------------------------------------
Summary of changes:
desktop/textarea.c | 6 +++---
render/box_normalise.c | 1 +
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/desktop/textarea.c b/desktop/textarea.c
index bd35a5e..2ba0982 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -1895,9 +1895,9 @@ struct textarea *textarea_create(const textarea_flags flags,
ret->show = &ret->text;
}
- ret->line_height = FIXTOINT(FDIV((FMUL(FLTTOFIX(1.3),
- FMUL(nscss_screen_dpi, INTTOFIX((setup->text.size))))),
- FONT_SIZE_SCALE * F_72));
+ ret->line_height = FIXTOINT(FMUL(FLTTOFIX(1.3), FDIV(FMUL(
+ nscss_screen_dpi, FDIV(INTTOFIX(setup->text.size),
+ INTTOFIX(FONT_SIZE_SCALE))), F_72)));
ret->caret_pos.line = ret->caret_pos.byte_off = -1;
ret->caret_x = 0;
diff --git a/render/box_normalise.c b/render/box_normalise.c
index a19047c..ecea6ea 100644
--- a/render/box_normalise.c
+++ b/render/box_normalise.c
@@ -650,6 +650,7 @@ bool box_normalise_table_row_group(struct box *row_group,
row_group->last = row;
row->parent = row_group;
+ group_row_count++;
if (box_normalise_table_row(row, col_info,
c) == false)
return false;
--
NetSurf Browser
9 years, 1 month
netsurf: branch master updated. release/3.0-1207-gcfc75ac
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/cfc75ac6f98ce614cb224...
...commit http://git.netsurf-browser.org/netsurf.git/commit/cfc75ac6f98ce614cb224ff...
...tree http://git.netsurf-browser.org/netsurf.git/tree/cfc75ac6f98ce614cb224ffa2...
The branch, master has been updated
via cfc75ac6f98ce614cb224ffa243daf68a166c907 (commit)
from 263118c50179c897654a85d7067d9a02f9f528a6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=cfc75ac6f98ce614cb2...
commit cfc75ac6f98ce614cb224ffa243daf68a166c907
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
fix table normalisation to not allow rowspan entries to leak beyond their grouping
diff --git a/render/box_normalise.c b/render/box_normalise.c
index 5a4b625..a19047c 100644
--- a/render/box_normalise.c
+++ b/render/box_normalise.c
@@ -419,6 +419,7 @@ bool box_normalise_table_spans(struct box *table, struct span_info *spans,
struct box *table_row;
struct box *table_cell;
unsigned int rows_left = table->rows;
+ unsigned int group_rows_left;
unsigned int col;
nscss_select_ctx ctx;
@@ -427,20 +428,37 @@ bool box_normalise_table_spans(struct box *table, struct span_info *spans,
/* Scan table, filling in width and height of table cells with
* colspan = 0 and rowspan = 0. Also generate empty cells */
- for (table_row_group = table->children; table_row_group != NULL;
- table_row_group = table_row_group->next) {
- for (table_row = table_row_group->children; table_row != NULL;
- table_row = table_row->next){
- for (table_cell = table_row->children;
- table_cell != NULL;
- table_cell = table_cell->next) {
+ for (table_row_group = table->children;
+ table_row_group != NULL;
+ table_row_group = table_row_group->next) {
+
+ group_rows_left = table_row_group->rows;
+
+ for (table_row = table_row_group->children;
+ table_row != NULL;
+ table_row = table_row->next) {
+
+ for (table_cell = table_row->children;
+ table_cell != NULL;
+ table_cell = table_cell->next) {
+
/* colspan = 0 -> colspan = 1 */
- if (table_cell->columns == 0)
+ if (table_cell->columns == 0) {
table_cell->columns = 1;
+ }
- /* rowspan = 0 -> rowspan = rows_left */
- if (table_cell->rows == 0)
- table_cell->rows = rows_left;
+ /* if rowspan is 0 it is expanded to
+ * the number of rows left in the row
+ * group
+ */
+ if (table_cell->rows == 0) {
+ table_cell->rows = group_rows_left;
+ }
+
+ /* limit rowspans within group */
+ if (table_cell->rows > group_rows_left) {
+ table_cell->rows = group_rows_left;
+ }
/* Record span information */
for (col = table_cell->start_column;
@@ -540,6 +558,8 @@ bool box_normalise_table_spans(struct box *table, struct span_info *spans,
rows_left--;
}
+
+ group_rows_left--;
}
return true;
@@ -555,6 +575,7 @@ bool box_normalise_table_row_group(struct box *row_group,
struct box *row;
css_computed_style *style;
nscss_select_ctx ctx;
+ unsigned int group_row_count = 0;
assert(row_group != 0);
assert(row_group->type == BOX_TABLE_ROW_GROUP);
@@ -569,6 +590,7 @@ bool box_normalise_table_row_group(struct box *row_group,
switch (child->type) {
case BOX_TABLE_ROW:
/* ok */
+ group_row_count++;
if (box_normalise_table_row(child, col_info,
c) == false)
return false;
@@ -676,10 +698,14 @@ bool box_normalise_table_row_group(struct box *row_group,
row->parent = row_group;
row_group->children = row_group->last = row;
+ group_row_count = 1;
+
/* Keep table's row count in sync */
col_info->num_rows++;
}
+ row_group->rows = group_row_count;
+
#ifdef BOX_NORMALISE_DEBUG
LOG(("row_group %p done", row_group));
#endif
-----------------------------------------------------------------------
Summary of changes:
render/box_normalise.c | 48 +++++++++++++++++++++++++++++++++++++-----------
1 files changed, 37 insertions(+), 11 deletions(-)
diff --git a/render/box_normalise.c b/render/box_normalise.c
index 5a4b625..a19047c 100644
--- a/render/box_normalise.c
+++ b/render/box_normalise.c
@@ -419,6 +419,7 @@ bool box_normalise_table_spans(struct box *table, struct span_info *spans,
struct box *table_row;
struct box *table_cell;
unsigned int rows_left = table->rows;
+ unsigned int group_rows_left;
unsigned int col;
nscss_select_ctx ctx;
@@ -427,20 +428,37 @@ bool box_normalise_table_spans(struct box *table, struct span_info *spans,
/* Scan table, filling in width and height of table cells with
* colspan = 0 and rowspan = 0. Also generate empty cells */
- for (table_row_group = table->children; table_row_group != NULL;
- table_row_group = table_row_group->next) {
- for (table_row = table_row_group->children; table_row != NULL;
- table_row = table_row->next){
- for (table_cell = table_row->children;
- table_cell != NULL;
- table_cell = table_cell->next) {
+ for (table_row_group = table->children;
+ table_row_group != NULL;
+ table_row_group = table_row_group->next) {
+
+ group_rows_left = table_row_group->rows;
+
+ for (table_row = table_row_group->children;
+ table_row != NULL;
+ table_row = table_row->next) {
+
+ for (table_cell = table_row->children;
+ table_cell != NULL;
+ table_cell = table_cell->next) {
+
/* colspan = 0 -> colspan = 1 */
- if (table_cell->columns == 0)
+ if (table_cell->columns == 0) {
table_cell->columns = 1;
+ }
- /* rowspan = 0 -> rowspan = rows_left */
- if (table_cell->rows == 0)
- table_cell->rows = rows_left;
+ /* if rowspan is 0 it is expanded to
+ * the number of rows left in the row
+ * group
+ */
+ if (table_cell->rows == 0) {
+ table_cell->rows = group_rows_left;
+ }
+
+ /* limit rowspans within group */
+ if (table_cell->rows > group_rows_left) {
+ table_cell->rows = group_rows_left;
+ }
/* Record span information */
for (col = table_cell->start_column;
@@ -540,6 +558,8 @@ bool box_normalise_table_spans(struct box *table, struct span_info *spans,
rows_left--;
}
+
+ group_rows_left--;
}
return true;
@@ -555,6 +575,7 @@ bool box_normalise_table_row_group(struct box *row_group,
struct box *row;
css_computed_style *style;
nscss_select_ctx ctx;
+ unsigned int group_row_count = 0;
assert(row_group != 0);
assert(row_group->type == BOX_TABLE_ROW_GROUP);
@@ -569,6 +590,7 @@ bool box_normalise_table_row_group(struct box *row_group,
switch (child->type) {
case BOX_TABLE_ROW:
/* ok */
+ group_row_count++;
if (box_normalise_table_row(child, col_info,
c) == false)
return false;
@@ -676,10 +698,14 @@ bool box_normalise_table_row_group(struct box *row_group,
row->parent = row_group;
row_group->children = row_group->last = row;
+ group_row_count = 1;
+
/* Keep table's row count in sync */
col_info->num_rows++;
}
+ row_group->rows = group_row_count;
+
#ifdef BOX_NORMALISE_DEBUG
LOG(("row_group %p done", row_group));
#endif
--
NetSurf Browser
9 years, 1 month
netsurf: branch master updated. release/3.0-1206-g263118c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/263118c50179c897654a8...
...commit http://git.netsurf-browser.org/netsurf.git/commit/263118c50179c897654a85d...
...tree http://git.netsurf-browser.org/netsurf.git/tree/263118c50179c897654a85d70...
The branch, master has been updated
via 263118c50179c897654a85d7067d9a02f9f528a6 (commit)
from c36078db73ba4a5e7ad5fa0019dfa3fffdead59d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=263118c50179c897654...
commit 263118c50179c897654a85d7067d9a02f9f528a6
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Try to fix Amiga build failure.
diff --git a/amiga/version.c b/amiga/version.c
index 8bc1fbc..dbddbb0 100644
--- a/amiga/version.c
+++ b/amiga/version.c
@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "utils/testament.h"
+#include "testament.h"
/* NB: AmigaOS revision numbers start at 1 (not 0) and are monotonically
* incremental (v1.20 is higher than v1.3 and not the same as v1.2).
-----------------------------------------------------------------------
Summary of changes:
amiga/version.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/amiga/version.c b/amiga/version.c
index 8bc1fbc..dbddbb0 100644
--- a/amiga/version.c
+++ b/amiga/version.c
@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "utils/testament.h"
+#include "testament.h"
/* NB: AmigaOS revision numbers start at 1 (not 0) and are monotonically
* incremental (v1.20 is higher than v1.3 and not the same as v1.2).
--
NetSurf Browser
9 years, 1 month
netsurf: branch master updated. release/3.0-1205-gc36078d
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/c36078db73ba4a5e7ad5f...
...commit http://git.netsurf-browser.org/netsurf.git/commit/c36078db73ba4a5e7ad5fa0...
...tree http://git.netsurf-browser.org/netsurf.git/tree/c36078db73ba4a5e7ad5fa001...
The branch, master has been updated
via c36078db73ba4a5e7ad5fa0019dfa3fffdead59d (commit)
from b7b3496a78fd08197899f588a4abc026c8636e74 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c36078db73ba4a5e7ad...
commit c36078db73ba4a5e7ad5fa0019dfa3fffdead59d
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Fix collapsing borders with rowspan from previous row group.
Mantis #0002102
diff --git a/render/table.c b/render/table.c
index 5eba544..1dd179d 100644
--- a/render/table.c
+++ b/render/table.c
@@ -336,8 +336,9 @@ void table_used_left_border_for_cell(struct box *cell)
if (cell->prev == NULL) {
struct box *row;
+ struct box *rowg;
- /* Spanned from a previous row */
+ /* Spanned from a previous row in current row group */
for (row = cell->parent; row != NULL; row = row->prev) {
for (prev = row->children; prev != NULL;
prev = prev->next) {
@@ -351,6 +352,25 @@ void table_used_left_border_for_cell(struct box *cell)
break;
}
+ for (rowg = cell->parent->parent;
+ rowg != NULL && prev == NULL;
+ rowg = rowg->prev) {
+ /* Spanned from a previous row in
+ * previous row group */
+ for (row = rowg->last; row != NULL;
+ row = row->prev) {
+ for (prev = row->children;
+ prev != NULL;
+ prev = prev->next) {
+ if (prev->start_column +
+ prev->columns ==
+ cell->
+ start_column)
+ break;
+ }
+ }
+ }
+
assert(prev != NULL);
} else {
prev = cell->prev;
-----------------------------------------------------------------------
Summary of changes:
render/table.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/render/table.c b/render/table.c
index 5eba544..1dd179d 100644
--- a/render/table.c
+++ b/render/table.c
@@ -336,8 +336,9 @@ void table_used_left_border_for_cell(struct box *cell)
if (cell->prev == NULL) {
struct box *row;
+ struct box *rowg;
- /* Spanned from a previous row */
+ /* Spanned from a previous row in current row group */
for (row = cell->parent; row != NULL; row = row->prev) {
for (prev = row->children; prev != NULL;
prev = prev->next) {
@@ -351,6 +352,25 @@ void table_used_left_border_for_cell(struct box *cell)
break;
}
+ for (rowg = cell->parent->parent;
+ rowg != NULL && prev == NULL;
+ rowg = rowg->prev) {
+ /* Spanned from a previous row in
+ * previous row group */
+ for (row = rowg->last; row != NULL;
+ row = row->prev) {
+ for (prev = row->children;
+ prev != NULL;
+ prev = prev->next) {
+ if (prev->start_column +
+ prev->columns ==
+ cell->
+ start_column)
+ break;
+ }
+ }
+ }
+
assert(prev != NULL);
} else {
prev = cell->prev;
--
NetSurf Browser
9 years, 1 month
netsurf: branch master updated. release/3.0-1204-gb7b3496
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/b7b3496a78fd08197899f...
...commit http://git.netsurf-browser.org/netsurf.git/commit/b7b3496a78fd08197899f58...
...tree http://git.netsurf-browser.org/netsurf.git/tree/b7b3496a78fd08197899f588a...
The branch, master has been updated
via b7b3496a78fd08197899f588a4abc026c8636e74 (commit)
from 9ba0d66c6d8b248a1889a98b2e2850a728f7f3c0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=b7b3496a78fd0819789...
commit b7b3496a78fd08197899f588a4abc026c8636e74
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
move testament output to object directory instead of modifying source
diff --git a/.gitignore b/.gitignore
index 82d6b6c..7088130 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,7 +16,6 @@ test/nsoption
test/nsurl
test/urldbtest
test/llcache
-utils/testament.h
codedocs
nsgtk
nsfb
diff --git a/Makefile b/Makefile
index 1638f32..4f9380a 100644
--- a/Makefile
+++ b/Makefile
@@ -609,8 +609,8 @@ clean-target:
$(call clean_install_messages, !NetSurf/Resources)
clean-testament:
- $(VQ)echo " CLEAN: utils/testament.h"
- $(Q)$(RM) utils/testament.h
+ $(VQ)echo " CLEAN: testament.h"
+ $(Q)$(RM) $(OBJROOT)/testament.h
clean-builddir:
$(VQ)echo " CLEAN: $(OBJROOT)"
@@ -621,12 +621,8 @@ all-program: $(EXETARGET) post-exe
$(call split_install_messages, any, !NetSurf/Resources)
.PHONY: testament
-testament utils/testament.h:
- $(Q)if test -d .svn; then \
- $(PERL) utils/svn-testament.pl $(CURDIR) utils/testament.h; \
- else \
- $(PERL) utils/git-testament.pl $(CURDIR) utils/testament.h; \
- fi
+testament $(OBJROOT)/testament.h:
+ $(Q)$(PERL) utils/git-testament.pl $(CURDIR) $(OBJROOT)/testament.h
post-exe: $(POSTEXES)
diff --git a/content/fetchers/Makefile b/content/fetchers/Makefile
index 06e38e4..8551542 100644
--- a/content/fetchers/Makefile
+++ b/content/fetchers/Makefile
@@ -5,4 +5,4 @@ S_FETCHERS := curl.c data.c file.c about.c resource.c
S_FETCHERS := $(addprefix content/fetchers/,$(S_FETCHERS))
# The following files depend on the testament
-content/fetchers/about.c: testament utils/testament.h
+content/fetchers/about.c: testament $(OBJROOT)/testament.h
diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index 8e973a9..f0244a9 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -41,6 +41,8 @@
#include <libwapcaplet/libwapcaplet.h>
+#include "testament.h"
+
#include "utils/config.h"
#include "content/dirlist.h"
#include "content/fetch.h"
@@ -54,7 +56,6 @@
#include "utils/url.h"
#include "utils/utils.h"
#include "utils/ring.h"
-#include "utils/testament.h"
#include "image/image_cache.h"
struct fetch_about_context;
diff --git a/desktop/Makefile b/desktop/Makefile
index a914eb3..218f60e 100644
--- a/desktop/Makefile
+++ b/desktop/Makefile
@@ -8,7 +8,7 @@ S_DESKTOP := cookie_manager.c knockout.c hotlist.c mouse.c \
S_DESKTOP := $(addprefix desktop/,$(S_DESKTOP))
# version.c needs the testament
-desktop/version.c: testament utils/testament.h
+desktop/version.c: testament $(OBJROOT)/testament.h
# S_BROWSER are sources related to full browsers but are common
# between RISC OS, GTK, BeOS and AmigaOS builds
diff --git a/desktop/version.c b/desktop/version.c
index 11544c0..4a92a5b 100644
--- a/desktop/version.c
+++ b/desktop/version.c
@@ -1,4 +1,4 @@
-#include "utils/testament.h"
+#include "testament.h"
const char * const netsurf_version = "3.1 (Dev"
#if defined(CI_BUILD)
-----------------------------------------------------------------------
Summary of changes:
.gitignore | 1 -
Makefile | 12 ++++--------
content/fetchers/Makefile | 2 +-
content/fetchers/about.c | 3 ++-
desktop/Makefile | 2 +-
desktop/version.c | 2 +-
6 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/.gitignore b/.gitignore
index 82d6b6c..7088130 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,7 +16,6 @@ test/nsoption
test/nsurl
test/urldbtest
test/llcache
-utils/testament.h
codedocs
nsgtk
nsfb
diff --git a/Makefile b/Makefile
index 1638f32..4f9380a 100644
--- a/Makefile
+++ b/Makefile
@@ -609,8 +609,8 @@ clean-target:
$(call clean_install_messages, !NetSurf/Resources)
clean-testament:
- $(VQ)echo " CLEAN: utils/testament.h"
- $(Q)$(RM) utils/testament.h
+ $(VQ)echo " CLEAN: testament.h"
+ $(Q)$(RM) $(OBJROOT)/testament.h
clean-builddir:
$(VQ)echo " CLEAN: $(OBJROOT)"
@@ -621,12 +621,8 @@ all-program: $(EXETARGET) post-exe
$(call split_install_messages, any, !NetSurf/Resources)
.PHONY: testament
-testament utils/testament.h:
- $(Q)if test -d .svn; then \
- $(PERL) utils/svn-testament.pl $(CURDIR) utils/testament.h; \
- else \
- $(PERL) utils/git-testament.pl $(CURDIR) utils/testament.h; \
- fi
+testament $(OBJROOT)/testament.h:
+ $(Q)$(PERL) utils/git-testament.pl $(CURDIR) $(OBJROOT)/testament.h
post-exe: $(POSTEXES)
diff --git a/content/fetchers/Makefile b/content/fetchers/Makefile
index 06e38e4..8551542 100644
--- a/content/fetchers/Makefile
+++ b/content/fetchers/Makefile
@@ -5,4 +5,4 @@ S_FETCHERS := curl.c data.c file.c about.c resource.c
S_FETCHERS := $(addprefix content/fetchers/,$(S_FETCHERS))
# The following files depend on the testament
-content/fetchers/about.c: testament utils/testament.h
+content/fetchers/about.c: testament $(OBJROOT)/testament.h
diff --git a/content/fetchers/about.c b/content/fetchers/about.c
index 8e973a9..f0244a9 100644
--- a/content/fetchers/about.c
+++ b/content/fetchers/about.c
@@ -41,6 +41,8 @@
#include <libwapcaplet/libwapcaplet.h>
+#include "testament.h"
+
#include "utils/config.h"
#include "content/dirlist.h"
#include "content/fetch.h"
@@ -54,7 +56,6 @@
#include "utils/url.h"
#include "utils/utils.h"
#include "utils/ring.h"
-#include "utils/testament.h"
#include "image/image_cache.h"
struct fetch_about_context;
diff --git a/desktop/Makefile b/desktop/Makefile
index a914eb3..218f60e 100644
--- a/desktop/Makefile
+++ b/desktop/Makefile
@@ -8,7 +8,7 @@ S_DESKTOP := cookie_manager.c knockout.c hotlist.c mouse.c \
S_DESKTOP := $(addprefix desktop/,$(S_DESKTOP))
# version.c needs the testament
-desktop/version.c: testament utils/testament.h
+desktop/version.c: testament $(OBJROOT)/testament.h
# S_BROWSER are sources related to full browsers but are common
# between RISC OS, GTK, BeOS and AmigaOS builds
diff --git a/desktop/version.c b/desktop/version.c
index 11544c0..4a92a5b 100644
--- a/desktop/version.c
+++ b/desktop/version.c
@@ -1,4 +1,4 @@
-#include "utils/testament.h"
+#include "testament.h"
const char * const netsurf_version = "3.1 (Dev"
#if defined(CI_BUILD)
--
NetSurf Browser
9 years, 1 month
netsurf: branch master updated. release/3.0-1203-g9ba0d66
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/9ba0d66c6d8b248a1889a...
...commit http://git.netsurf-browser.org/netsurf.git/commit/9ba0d66c6d8b248a1889a98...
...tree http://git.netsurf-browser.org/netsurf.git/tree/9ba0d66c6d8b248a1889a98b2...
The branch, master has been updated
via 9ba0d66c6d8b248a1889a98b2e2850a728f7f3c0 (commit)
from 1ecd56bd716916af845b956326601e9bae92885d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9ba0d66c6d8b248a188...
commit 9ba0d66c6d8b248a1889a98b2e2850a728f7f3c0
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Ensure we don't get extraneous signals allocated
diff --git a/amiga/gui.c b/amiga/gui.c
index 1d89bc5..ed96676 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -763,7 +763,7 @@ void ami_openscreen(void)
}
}
- screen_signal = AllocSignal(-1);
+ if(screen_signal == -1) screen_signal = AllocSignal(-1);
LOG(("Screen signal %d", screen_signal));
scrn = OpenScreenTags(NULL,
SA_DisplayID, id,
@@ -783,6 +783,7 @@ void ami_openscreen(void)
else
{
FreeSignal(screen_signal);
+ screen_signal = -1;
if(scrn = LockPubScreen("NetSurf"))
{
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index 1d89bc5..ed96676 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -763,7 +763,7 @@ void ami_openscreen(void)
}
}
- screen_signal = AllocSignal(-1);
+ if(screen_signal == -1) screen_signal = AllocSignal(-1);
LOG(("Screen signal %d", screen_signal));
scrn = OpenScreenTags(NULL,
SA_DisplayID, id,
@@ -783,6 +783,7 @@ void ami_openscreen(void)
else
{
FreeSignal(screen_signal);
+ screen_signal = -1;
if(scrn = LockPubScreen("NetSurf"))
{
--
NetSurf Browser
9 years, 1 month
netsurf: branch master updated. release/3.0-1202-g1ecd56b
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/1ecd56bd716916af845b9...
...commit http://git.netsurf-browser.org/netsurf.git/commit/1ecd56bd716916af845b956...
...tree http://git.netsurf-browser.org/netsurf.git/tree/1ecd56bd716916af845b95632...
The branch, master has been updated
via 1ecd56bd716916af845b956326601e9bae92885d (commit)
from 4ec70fd3a2e75a3295799a685bbeb4dbffcdc05d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=1ecd56bd716916af845...
commit 1ecd56bd716916af845b956326601e9bae92885d
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix a case where the screen wouldn't close if NetSurf had been launched from Workbench
diff --git a/amiga/gui.c b/amiga/gui.c
index c538525..1d89bc5 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -782,6 +782,8 @@ void ami_openscreen(void)
}
else
{
+ FreeSignal(screen_signal);
+
if(scrn = LockPubScreen("NetSurf"))
{
locked_screen = TRUE;
@@ -931,10 +933,6 @@ static void gui_init2(int argc, char** argv)
int first=0,i=0;
char fullpath[1024];
- if (notalreadyrunning &&
- (nsoption_bool(startup_no_window) == false))
- ami_openscreenfirst();
-
for(i=0,wbarg=WBenchMsg->sm_ArgList;i<WBenchMsg->sm_NumArgs;i++,wbarg++)
{
if(i==0) continue;
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index c538525..1d89bc5 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -782,6 +782,8 @@ void ami_openscreen(void)
}
else
{
+ FreeSignal(screen_signal);
+
if(scrn = LockPubScreen("NetSurf"))
{
locked_screen = TRUE;
@@ -931,10 +933,6 @@ static void gui_init2(int argc, char** argv)
int first=0,i=0;
char fullpath[1024];
- if (notalreadyrunning &&
- (nsoption_bool(startup_no_window) == false))
- ami_openscreenfirst();
-
for(i=0,wbarg=WBenchMsg->sm_ArgList;i<WBenchMsg->sm_NumArgs;i++,wbarg++)
{
if(i==0) continue;
--
NetSurf Browser
9 years, 1 month
netsurf: branch master updated. release/3.0-1201-g4ec70fd
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/4ec70fd3a2e75a3295799...
...commit http://git.netsurf-browser.org/netsurf.git/commit/4ec70fd3a2e75a3295799a6...
...tree http://git.netsurf-browser.org/netsurf.git/tree/4ec70fd3a2e75a3295799a685...
The branch, master has been updated
via 4ec70fd3a2e75a3295799a685bbeb4dbffcdc05d (commit)
via 5bb5e2667df7459c288c3484d3539376a74a7c68 (commit)
via 3ea6ca89a0daf4a20ddf9962cc787ed5001f5ab6 (commit)
via a36e7aaeb304f688de2f1e01cebf3e295273d633 (commit)
via d9d0b1d3aa9ec463cd6110cdfcc7fb67c1baef47 (commit)
from ba5bae389b9bfed07e94fc8ec3191f4dcfa714f0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=4ec70fd3a2e75a32957...
commit 4ec70fd3a2e75a3295799a685bbeb4dbffcdc05d
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix some more cppcheck unread/unusedVariable warnings
diff --git a/amiga/gui.c b/amiga/gui.c
index ab55bcf..c538525 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -4290,7 +4290,6 @@ static void ami_do_redraw(struct gui_window_2 *gwin)
struct IBox *bbox;
ULONG oldh = gwin->oldh, oldv=gwin->oldv;
struct RastPort *temprp;
- hlcache_handle *c;
if(browser_window_redraw_ready(gwin->bw) == false) return;
@@ -4301,8 +4300,6 @@ static void ami_do_redraw(struct gui_window_2 *gwin)
gwin->bw->window->scrollx = hcurrent;
gwin->bw->window->scrolly = vcurrent;
- c = gwin->bw->current_content;
-
width=bbox->Width;
height=bbox->Height;
xoffset=bbox->Left;
diff --git a/amiga/print.c b/amiga/print.c
index 93dde35..66e5a55 100644
--- a/amiga/print.c
+++ b/amiga/print.c
@@ -375,7 +375,7 @@ BOOL ami_print_event(struct ami_print_window *pw)
void ami_print(struct hlcache_handle *c, int copies)
{
- double height, print_height;
+ double height;
float scale = nsoption_int(print_scale) / 100.0;
if(ami_print_info.msgport == NULL)
diff --git a/amiga/theme.c b/amiga/theme.c
index 054d465..1e9640f 100644
--- a/amiga/theme.c
+++ b/amiga/theme.c
@@ -156,7 +156,6 @@ void ami_theme_init(void)
void ami_theme_throbber_setup(void)
{
char throbberfile[1024];
- Object *dto;
struct bitmap *bm;
ami_get_theme_filename(throbberfile,"theme_throbber",false);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=5bb5e2667df7459c288...
commit 5bb5e2667df7459c288c3484d3539376a74a7c68
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Change the scope of some variables picked up by cppcheck, minor reformatting
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 0f3a33d..fa1d189 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -189,7 +189,6 @@ void gui_get_clipboard(char **buffer, size_t *length)
struct StoredProperty *sp = NULL;
ULONG rlen=0,error;
struct CSet *cset;
- LONG codeset = 0;
if(OpenIFF(iffh,IFFF_READ)) return;
@@ -203,6 +202,7 @@ void gui_get_clipboard(char **buffer, size_t *length)
if(ci = FindCollection(iffh, ID_FTXT, ID_UTF8)) {
*buffer = ami_clipboard_cat_collection(ci, 106, length);
} else if(ci = FindCollection(iffh, ID_FTXT, ID_CHRS)) {
+ LONG codeset = 0;
if(sp = FindProp(iffh, ID_FTXT, ID_CSET)) {
cset = (struct CSet *)sp->sp_Data;
codeset = cset->CodeSet;
diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c
index 1d30928..779e1bc 100644
--- a/amiga/dt_picture.c
+++ b/amiga/dt_picture.c
@@ -174,7 +174,6 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
UBYTE *bm_buffer;
Object *dto;
struct bitmap *bitmap;
- unsigned int bm_flags = BITMAP_NEW;
#ifdef __amigaos4__
int bm_format = PBPAFMT_RGBA;
#else
@@ -184,7 +183,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
if(dto = amiga_dt_picture_newdtobject(adt))
{
- bitmap = bitmap_create(c->width, c->height, bm_flags);
+ bitmap = bitmap_create(c->width, c->height, BITMAP_NEW);
if (!bitmap) {
msg_data.error = messages_get("NoMemory");
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
diff --git a/amiga/file.c b/amiga/file.c
index 5d16ceb..008141c 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
diff --git a/amiga/filetype.c b/amiga/filetype.c
index bcb6b7e..2d55e1f 100644
--- a/amiga/filetype.c
+++ b/amiga/filetype.c
@@ -55,9 +55,7 @@ enum
const char *fetch_filetype(const char *unix_path)
{
static char mimetype[50];
- STRPTR ttype = NULL;
struct DiskObject *dobj = NULL;
- BPTR lock = 0;
struct DataType *dtn;
BOOL found = FALSE;
lwc_string *lwc_mimetype;
@@ -66,8 +64,7 @@ const char *fetch_filetype(const char *unix_path)
We'll just do a filename check here for quickness, although the
first word ought to be checked against WB_DISKMAGIC really. */
- if(strncmp(unix_path + strlen(unix_path) - 5, ".info", 5) == 0)
- {
+ if(strncmp(unix_path + strlen(unix_path) - 5, ".info", 5) == 0) {
strcpy(mimetype,"image/x-amiga-icon");
found = TRUE;
}
@@ -76,32 +73,26 @@ const char *fetch_filetype(const char *unix_path)
/* Secondly try getting a tooltype "MIMETYPE" and use that as the MIME type.
Will fail over to default icons if the file doesn't have a real icon. */
- if(!found)
- {
+ if(!found) {
if(dobj = GetIconTags(unix_path,ICONGETA_FailIfUnavailable,FALSE,
- TAG_DONE))
- {
+ TAG_DONE)) {
+ STRPTR ttype = NULL;
ttype = FindToolType(dobj->do_ToolTypes, "MIMETYPE");
- if(ttype)
- {
+ if(ttype) {
strcpy(mimetype,ttype);
found = TRUE;
}
-
FreeDiskObject(dobj);
}
}
/* If that didn't work, use the MIME file and DataTypes */
- if(!found)
- {
- if (lock = Lock (unix_path, ACCESS_READ))
- {
- if (dtn = ObtainDataTypeA (DTST_FILE, (APTR)lock, NULL))
- {
- if(ami_mime_from_datatype(dtn, &lwc_mimetype, NULL))
- {
+ if(!found) {
+ BPTR lock;
+ if (lock = Lock (unix_path, ACCESS_READ)) {
+ if (dtn = ObtainDataTypeA (DTST_FILE, (APTR)lock, NULL)) {
+ if(ami_mime_from_datatype(dtn, &lwc_mimetype, NULL)) {
strcpy(mimetype, lwc_string_data(lwc_mimetype));
found = TRUE;
ReleaseDataType(dtn);
diff --git a/amiga/font_scan.c b/amiga/font_scan.c
index f3ad36e..a2738f2 100644
--- a/amiga/font_scan.c
+++ b/amiga/font_scan.c
@@ -294,7 +294,7 @@ ULONG ami_font_scan_fonts(struct MinList *list,
*/
ULONG ami_font_scan_list(struct MinList *list)
{
- int afShortage, afSize = 100, i;
+ int afShortage, afSize = 100;
struct AvailFontsHeader *afh;
struct AvailFonts *af;
ULONG found = 0;
@@ -315,7 +315,7 @@ ULONG ami_font_scan_list(struct MinList *list)
if(afh) {
af = (struct AvailFonts *)&(afh[1]);
- for(i = 0; i < afh->afh_NumEntries; i++) {
+ for(int i = 0; i < afh->afh_NumEntries; i++) {
if(af[i].af_Attr.ta_Style == FS_NORMAL) {
if(af[i].af_Attr.ta_Name != NULL) {
node = (struct nsObject *)FindIName((struct List *)list,
diff --git a/amiga/launch.c b/amiga/launch.c
index 0d25bcf..1ccc520 100755
--- a/amiga/launch.c
+++ b/amiga/launch.c
@@ -126,7 +126,6 @@ void gui_launch_url(const char *url)
{
APTR procwin = SetProcWindow((APTR)-1L);
char *launchurl = NULL;
- BPTR fptr = 0;
if(ami_openurl_check_list(&ami_unsupportedprotocols, url) == FALSE)
{
@@ -135,7 +134,7 @@ void gui_launch_url(const char *url)
URL_OpenA((STRPTR)url,NULL);
} else {
if(launchurl = ASPrintf("URL:%s",url)) {
- fptr = Open(launchurl,MODE_OLDFILE);
+ BPTR fptr = Open(launchurl,MODE_OLDFILE);
if(fptr) Close(fptr);
else ami_openurl_add_protocol(url);
FreeVec(launchurl);
diff --git a/amiga/menu.c b/amiga/menu.c
index 234a958..b2e2334 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -1093,13 +1093,13 @@ static void ami_menu_item_arexx_entries(struct Hook *hook, APTR window, struct I
char *script = hook->h_Data;
char *temp;
struct gui_window_2 *gwin;
- BPTR lock = 0;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
if(script)
{
if(temp = AllocVecTagList(1024, NULL))
{
+ BPTR lock;
if(lock = Lock(nsoption_charp(arexx_dir), SHARED_LOCK)) {
DevNameFromLock(lock, temp, 1024, DN_FULLPATH);
AddPart(temp, script, 1024);
@@ -1110,3 +1110,4 @@ static void ami_menu_item_arexx_entries(struct Hook *hook, APTR window, struct I
}
}
}
+
diff --git a/amiga/misc.c b/amiga/misc.c
index c25c5d5..3f69834 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -43,7 +43,6 @@ void warn_user(const char *warning, const char *detail)
Object *req = NULL;
char *utf8warning = ami_utf8_easy(messages_get(warning));
STRPTR bodytext = NULL;
- LONG result = 0;
LOG(("%s %s", warning, detail));
@@ -63,7 +62,7 @@ void warn_user(const char *warning, const char *detail)
TAG_DONE);
if (req) {
- result = IDoMethod(req, RM_OPENREQ, NULL, NULL, scrn);
+ LONG result = IDoMethod(req, RM_OPENREQ, NULL, NULL, scrn);
DisposeObject(req);
}
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 0893c55..de90755 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -473,8 +473,6 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
LOG(("[ami_plotter] Entered ami_polygon()"));
#endif
- int k;
-
if((nsoption_int(cairo_renderer) < 1) || (palette_mapped == true))
{
ULONG cx,cy;
@@ -484,7 +482,7 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
if(AreaMove(glob->rp,p[0],p[1]) == -1)
LOG(("AreaMove: vector list full"));
- for(k=1;k<n;k++)
+ for(int k = 1; k < n; k++)
{
if(AreaDraw(glob->rp,p[k*2],p[(k*2)+1]) == -1)
LOG(("AreaDraw: vector list full"));
@@ -501,7 +499,7 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
cairo_set_line_width(glob->cr, 0);
cairo_move_to(glob->cr, p[0], p[1]);
- for (k = 1; k != n; k++) {
+ for (int k = 1; k != n; k++) {
cairo_line_to(glob->cr, p[k * 2], p[k * 2 + 1]);
}
cairo_fill(glob->cr);
diff --git a/amiga/theme.c b/amiga/theme.c
index e00e080..054d465 100644
--- a/amiga/theme.c
+++ b/amiga/theme.c
@@ -289,7 +289,7 @@ void ami_init_mouse_pointers(void)
for(i=0;i<=AMI_LASTPOINTER;i++)
{
- BPTR ptrfile = 0;
+ BPTR ptrfile;
mouseptrbm[i] = NULL;
mouseptrobj[i] = NULL;
char ptrfname[1024];
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=3ea6ca89a0daf4a20dd...
commit 3ea6ca89a0daf4a20ddf9962cc787ed5001f5ab6
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix cppcheck constStatement warning
diff --git a/amiga/gui.c b/amiga/gui.c
index ad452a6..ab55bcf 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -5178,7 +5178,7 @@ int main(int argc, char** argv)
ami_schedule_create();
amiga_plugin_hack_init();
- amiga_datatypes_init();
+ ret = amiga_datatypes_init();
/* initialise logging. Not fatal if it fails but not much we
* can do about it either.
@@ -5200,7 +5200,7 @@ int main(int argc, char** argv)
die("NetSurf failed to initialise");
}
- amiga_icon_init();
+ ret = amiga_icon_init();
gui_init(argc, argv);
gui_init2(argc, argv);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=a36e7aaeb304f688de2...
commit a36e7aaeb304f688de2f1e01cebf3e295273d633
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix cppcheck syntaxError
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index cb350de..e1ce551 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -364,7 +364,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
PMIA_UserData, userdata,
PMIA_Disabled, !browser_window_stop_available(userdata),
TAG_DONE),
- TAG_DONE),
+ PMEND,
TAG_DONE),
~0);
break;
@@ -410,7 +410,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
PMIA_ID, CMID_SAVEURL,
PMIA_UserData, userdata,
TAG_DONE),
- TAG_DONE),
+ PMEND,
TAG_DONE),
~0);
break;
@@ -467,7 +467,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
PMIA_UserData, userdata,
PMIA_Disabled, !ami_mime_content_to_cmd(userdata),
TAG_DONE),
- TAG_DONE),
+ PMEND,
TAG_DONE),
~0);
break;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=d9d0b1d3aa9ec463cd6...
commit d9d0b1d3aa9ec463cd6110cdfcc7fb67c1baef47
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Add missing include
diff --git a/amiga/icon.c b/amiga/icon.c
index a6b61a2..66a008f 100644
--- a/amiga/icon.c
+++ b/amiga/icon.c
@@ -39,6 +39,7 @@
#include "amiga/os3support.h"
#include "amiga/bitmap.h"
#include "amiga/icon.h"
+#include "amiga/misc.h"
#include "desktop/plotters.h"
#include "image/bitmap.h"
#include "content/content_protected.h"
-----------------------------------------------------------------------
Summary of changes:
amiga/clipboard.c | 2 +-
amiga/context_menu.c | 6 +++---
amiga/dt_picture.c | 3 +--
amiga/file.c | 25 +++++++++----------------
amiga/filetype.c | 29 ++++++++++-------------------
amiga/font_scan.c | 4 ++--
amiga/gui.c | 7 ++-----
amiga/icon.c | 1 +
amiga/launch.c | 3 +--
amiga/menu.c | 3 ++-
amiga/misc.c | 3 +--
amiga/plotters.c | 6 ++----
amiga/print.c | 2 +-
amiga/theme.c | 3 +--
14 files changed, 37 insertions(+), 60 deletions(-)
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 0f3a33d..fa1d189 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -189,7 +189,6 @@ void gui_get_clipboard(char **buffer, size_t *length)
struct StoredProperty *sp = NULL;
ULONG rlen=0,error;
struct CSet *cset;
- LONG codeset = 0;
if(OpenIFF(iffh,IFFF_READ)) return;
@@ -203,6 +202,7 @@ void gui_get_clipboard(char **buffer, size_t *length)
if(ci = FindCollection(iffh, ID_FTXT, ID_UTF8)) {
*buffer = ami_clipboard_cat_collection(ci, 106, length);
} else if(ci = FindCollection(iffh, ID_FTXT, ID_CHRS)) {
+ LONG codeset = 0;
if(sp = FindProp(iffh, ID_FTXT, ID_CSET)) {
cset = (struct CSet *)sp->sp_Data;
codeset = cset->CodeSet;
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index cb350de..e1ce551 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -364,7 +364,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
PMIA_UserData, userdata,
PMIA_Disabled, !browser_window_stop_available(userdata),
TAG_DONE),
- TAG_DONE),
+ PMEND,
TAG_DONE),
~0);
break;
@@ -410,7 +410,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
PMIA_ID, CMID_SAVEURL,
PMIA_UserData, userdata,
TAG_DONE),
- TAG_DONE),
+ PMEND,
TAG_DONE),
~0);
break;
@@ -467,7 +467,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
PMIA_UserData, userdata,
PMIA_Disabled, !ami_mime_content_to_cmd(userdata),
TAG_DONE),
- TAG_DONE),
+ PMEND,
TAG_DONE),
~0);
break;
diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c
index 1d30928..779e1bc 100644
--- a/amiga/dt_picture.c
+++ b/amiga/dt_picture.c
@@ -174,7 +174,6 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
UBYTE *bm_buffer;
Object *dto;
struct bitmap *bitmap;
- unsigned int bm_flags = BITMAP_NEW;
#ifdef __amigaos4__
int bm_format = PBPAFMT_RGBA;
#else
@@ -184,7 +183,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c)
if(dto = amiga_dt_picture_newdtobject(adt))
{
- bitmap = bitmap_create(c->width, c->height, bm_flags);
+ bitmap = bitmap_create(c->width, c->height, BITMAP_NEW);
if (!bitmap) {
msg_data.error = messages_get("NoMemory");
content_broadcast(c, CONTENT_MSG_ERROR, msg_data);
diff --git a/amiga/file.c b/amiga/file.c
index 5d16ceb..008141c 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
diff --git a/amiga/filetype.c b/amiga/filetype.c
index bcb6b7e..2d55e1f 100644
--- a/amiga/filetype.c
+++ b/amiga/filetype.c
@@ -55,9 +55,7 @@ enum
const char *fetch_filetype(const char *unix_path)
{
static char mimetype[50];
- STRPTR ttype = NULL;
struct DiskObject *dobj = NULL;
- BPTR lock = 0;
struct DataType *dtn;
BOOL found = FALSE;
lwc_string *lwc_mimetype;
@@ -66,8 +64,7 @@ const char *fetch_filetype(const char *unix_path)
We'll just do a filename check here for quickness, although the
first word ought to be checked against WB_DISKMAGIC really. */
- if(strncmp(unix_path + strlen(unix_path) - 5, ".info", 5) == 0)
- {
+ if(strncmp(unix_path + strlen(unix_path) - 5, ".info", 5) == 0) {
strcpy(mimetype,"image/x-amiga-icon");
found = TRUE;
}
@@ -76,32 +73,26 @@ const char *fetch_filetype(const char *unix_path)
/* Secondly try getting a tooltype "MIMETYPE" and use that as the MIME type.
Will fail over to default icons if the file doesn't have a real icon. */
- if(!found)
- {
+ if(!found) {
if(dobj = GetIconTags(unix_path,ICONGETA_FailIfUnavailable,FALSE,
- TAG_DONE))
- {
+ TAG_DONE)) {
+ STRPTR ttype = NULL;
ttype = FindToolType(dobj->do_ToolTypes, "MIMETYPE");
- if(ttype)
- {
+ if(ttype) {
strcpy(mimetype,ttype);
found = TRUE;
}
-
FreeDiskObject(dobj);
}
}
/* If that didn't work, use the MIME file and DataTypes */
- if(!found)
- {
- if (lock = Lock (unix_path, ACCESS_READ))
- {
- if (dtn = ObtainDataTypeA (DTST_FILE, (APTR)lock, NULL))
- {
- if(ami_mime_from_datatype(dtn, &lwc_mimetype, NULL))
- {
+ if(!found) {
+ BPTR lock;
+ if (lock = Lock (unix_path, ACCESS_READ)) {
+ if (dtn = ObtainDataTypeA (DTST_FILE, (APTR)lock, NULL)) {
+ if(ami_mime_from_datatype(dtn, &lwc_mimetype, NULL)) {
strcpy(mimetype, lwc_string_data(lwc_mimetype));
found = TRUE;
ReleaseDataType(dtn);
diff --git a/amiga/font_scan.c b/amiga/font_scan.c
index f3ad36e..a2738f2 100644
--- a/amiga/font_scan.c
+++ b/amiga/font_scan.c
@@ -294,7 +294,7 @@ ULONG ami_font_scan_fonts(struct MinList *list,
*/
ULONG ami_font_scan_list(struct MinList *list)
{
- int afShortage, afSize = 100, i;
+ int afShortage, afSize = 100;
struct AvailFontsHeader *afh;
struct AvailFonts *af;
ULONG found = 0;
@@ -315,7 +315,7 @@ ULONG ami_font_scan_list(struct MinList *list)
if(afh) {
af = (struct AvailFonts *)&(afh[1]);
- for(i = 0; i < afh->afh_NumEntries; i++) {
+ for(int i = 0; i < afh->afh_NumEntries; i++) {
if(af[i].af_Attr.ta_Style == FS_NORMAL) {
if(af[i].af_Attr.ta_Name != NULL) {
node = (struct nsObject *)FindIName((struct List *)list,
diff --git a/amiga/gui.c b/amiga/gui.c
index ad452a6..c538525 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -4290,7 +4290,6 @@ static void ami_do_redraw(struct gui_window_2 *gwin)
struct IBox *bbox;
ULONG oldh = gwin->oldh, oldv=gwin->oldv;
struct RastPort *temprp;
- hlcache_handle *c;
if(browser_window_redraw_ready(gwin->bw) == false) return;
@@ -4301,8 +4300,6 @@ static void ami_do_redraw(struct gui_window_2 *gwin)
gwin->bw->window->scrollx = hcurrent;
gwin->bw->window->scrolly = vcurrent;
- c = gwin->bw->current_content;
-
width=bbox->Width;
height=bbox->Height;
xoffset=bbox->Left;
@@ -5178,7 +5175,7 @@ int main(int argc, char** argv)
ami_schedule_create();
amiga_plugin_hack_init();
- amiga_datatypes_init();
+ ret = amiga_datatypes_init();
/* initialise logging. Not fatal if it fails but not much we
* can do about it either.
@@ -5200,7 +5197,7 @@ int main(int argc, char** argv)
die("NetSurf failed to initialise");
}
- amiga_icon_init();
+ ret = amiga_icon_init();
gui_init(argc, argv);
gui_init2(argc, argv);
diff --git a/amiga/icon.c b/amiga/icon.c
index a6b61a2..66a008f 100644
--- a/amiga/icon.c
+++ b/amiga/icon.c
@@ -39,6 +39,7 @@
#include "amiga/os3support.h"
#include "amiga/bitmap.h"
#include "amiga/icon.h"
+#include "amiga/misc.h"
#include "desktop/plotters.h"
#include "image/bitmap.h"
#include "content/content_protected.h"
diff --git a/amiga/launch.c b/amiga/launch.c
index 0d25bcf..1ccc520 100755
--- a/amiga/launch.c
+++ b/amiga/launch.c
@@ -126,7 +126,6 @@ void gui_launch_url(const char *url)
{
APTR procwin = SetProcWindow((APTR)-1L);
char *launchurl = NULL;
- BPTR fptr = 0;
if(ami_openurl_check_list(&ami_unsupportedprotocols, url) == FALSE)
{
@@ -135,7 +134,7 @@ void gui_launch_url(const char *url)
URL_OpenA((STRPTR)url,NULL);
} else {
if(launchurl = ASPrintf("URL:%s",url)) {
- fptr = Open(launchurl,MODE_OLDFILE);
+ BPTR fptr = Open(launchurl,MODE_OLDFILE);
if(fptr) Close(fptr);
else ami_openurl_add_protocol(url);
FreeVec(launchurl);
diff --git a/amiga/menu.c b/amiga/menu.c
index 234a958..b2e2334 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -1093,13 +1093,13 @@ static void ami_menu_item_arexx_entries(struct Hook *hook, APTR window, struct I
char *script = hook->h_Data;
char *temp;
struct gui_window_2 *gwin;
- BPTR lock = 0;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
if(script)
{
if(temp = AllocVecTagList(1024, NULL))
{
+ BPTR lock;
if(lock = Lock(nsoption_charp(arexx_dir), SHARED_LOCK)) {
DevNameFromLock(lock, temp, 1024, DN_FULLPATH);
AddPart(temp, script, 1024);
@@ -1110,3 +1110,4 @@ static void ami_menu_item_arexx_entries(struct Hook *hook, APTR window, struct I
}
}
}
+
diff --git a/amiga/misc.c b/amiga/misc.c
index c25c5d5..3f69834 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -43,7 +43,6 @@ void warn_user(const char *warning, const char *detail)
Object *req = NULL;
char *utf8warning = ami_utf8_easy(messages_get(warning));
STRPTR bodytext = NULL;
- LONG result = 0;
LOG(("%s %s", warning, detail));
@@ -63,7 +62,7 @@ void warn_user(const char *warning, const char *detail)
TAG_DONE);
if (req) {
- result = IDoMethod(req, RM_OPENREQ, NULL, NULL, scrn);
+ LONG result = IDoMethod(req, RM_OPENREQ, NULL, NULL, scrn);
DisposeObject(req);
}
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 0893c55..de90755 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -473,8 +473,6 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
LOG(("[ami_plotter] Entered ami_polygon()"));
#endif
- int k;
-
if((nsoption_int(cairo_renderer) < 1) || (palette_mapped == true))
{
ULONG cx,cy;
@@ -484,7 +482,7 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
if(AreaMove(glob->rp,p[0],p[1]) == -1)
LOG(("AreaMove: vector list full"));
- for(k=1;k<n;k++)
+ for(int k = 1; k < n; k++)
{
if(AreaDraw(glob->rp,p[k*2],p[(k*2)+1]) == -1)
LOG(("AreaDraw: vector list full"));
@@ -501,7 +499,7 @@ bool ami_polygon(const int *p, unsigned int n, const plot_style_t *style)
cairo_set_line_width(glob->cr, 0);
cairo_move_to(glob->cr, p[0], p[1]);
- for (k = 1; k != n; k++) {
+ for (int k = 1; k != n; k++) {
cairo_line_to(glob->cr, p[k * 2], p[k * 2 + 1]);
}
cairo_fill(glob->cr);
diff --git a/amiga/print.c b/amiga/print.c
index 93dde35..66e5a55 100644
--- a/amiga/print.c
+++ b/amiga/print.c
@@ -375,7 +375,7 @@ BOOL ami_print_event(struct ami_print_window *pw)
void ami_print(struct hlcache_handle *c, int copies)
{
- double height, print_height;
+ double height;
float scale = nsoption_int(print_scale) / 100.0;
if(ami_print_info.msgport == NULL)
diff --git a/amiga/theme.c b/amiga/theme.c
index e00e080..1e9640f 100644
--- a/amiga/theme.c
+++ b/amiga/theme.c
@@ -156,7 +156,6 @@ void ami_theme_init(void)
void ami_theme_throbber_setup(void)
{
char throbberfile[1024];
- Object *dto;
struct bitmap *bm;
ami_get_theme_filename(throbberfile,"theme_throbber",false);
@@ -289,7 +288,7 @@ void ami_init_mouse_pointers(void)
for(i=0;i<=AMI_LASTPOINTER;i++)
{
- BPTR ptrfile = 0;
+ BPTR ptrfile;
mouseptrbm[i] = NULL;
mouseptrobj[i] = NULL;
char ptrfname[1024];
--
NetSurf Browser
9 years, 1 month
netsurf: branch master updated. release/3.0-1196-gba5bae3
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/ba5bae389b9bfed07e94f...
...commit http://git.netsurf-browser.org/netsurf.git/commit/ba5bae389b9bfed07e94fc8...
...tree http://git.netsurf-browser.org/netsurf.git/tree/ba5bae389b9bfed07e94fc8ec...
The branch, master has been updated
via ba5bae389b9bfed07e94fc8ec3191f4dcfa714f0 (commit)
via 65adc1712123f81847a85ce0374acc5a741368ec (commit)
via 975a1d3c5db0dc11a4f5ada68d5d424850858161 (commit)
via c1a32d7c6e87f3d81fa095e7e7fe11fa8d88fe5f (commit)
via b301a111405f0f5e5df7b6204e6c2bf4bee2fce5 (commit)
via 0f6859864911270c65caea459637d35cf1bba14a (commit)
via c2f9a399664faa1248eb5a043e697a7d94558c0c (commit)
via f991abc53cb5eeb874542cf8a40f4dbecef32296 (commit)
via 268cda0f560ffdacf6186b923f5540ed5da52ef9 (commit)
via d907ec9b0614e5c178720429dee7a8ef96df6aad (commit)
via 412df342987f754958a9756817ccacaebe07f764 (commit)
from 99c47eb99be4309e996f4cb038916260fd2bcb44 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=ba5bae389b9bfed07e9...
commit ba5bae389b9bfed07e94fc8ec3191f4dcfa714f0
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix some cppcheck variableHidingTypedef warnings
diff --git a/amiga/dt_anim.c b/amiga/dt_anim.c
index d6e5c10..4722d2d 100644
--- a/amiga/dt_anim.c
+++ b/amiga/dt_anim.c
@@ -337,20 +337,20 @@ APTR ami_colormap_to_clut(struct ColorMap *cmap)
{
int i;
UBYTE *clut = AllocVecTags(256 * 4, AVT_ClearWithValue, 0, TAG_DONE); /* NB: Was not MEMF_PRIVATE */
- ULONG colour[256 * 4];
+ ULONG colr[256 * 4];
if(!clut) return NULL;
/* Get the palette from the ColorMap */
- GetRGB32(cmap, 0, 256, (ULONG *)&colour);
+ GetRGB32(cmap, 0, 256, (ULONG *)&colr);
/* convert it to a table of ARGB values */
for(i = 0; i < 1024; i += 4)
{
clut[i] = (0xff << 24) |
- ((colour[i] & 0xff000000) >> 8) |
- ((colour[i + 1] & 0xff000000) >> 16) |
- ((colour[i + 2] & 0xff000000) >> 24);
+ ((colr[i] & 0xff000000) >> 8) |
+ ((colr[i + 1] & 0xff000000) >> 16) |
+ ((colr[i + 2] & 0xff000000) >> 24);
}
return clut;
diff --git a/amiga/iff_dr2d.c b/amiga/iff_dr2d.c
index 6cced5b..5709d41 100644
--- a/amiga/iff_dr2d.c
+++ b/amiga/iff_dr2d.c
@@ -31,7 +31,7 @@ ULONG numcols;
ULONG findcolour(ULONG newcol)
{
ULONG i;
- ULONG colour = 0xFFFFFFFF;
+ ULONG colr = 0xFFFFFFFF;
UBYTE red,grn,blu;
red = svgtiny_RED(newcol);
@@ -41,20 +41,20 @@ ULONG findcolour(ULONG newcol)
for(i=0;i<numcols;i++)
{
if((cm[i].red == red) && (cm[i].green == grn) && (cm[i].blue == blu))
- colour = i;
+ colr = i;
}
- return colour;
+ return colr;
}
void addcolour(ULONG newcol)
{
- ULONG colour;
+ ULONG colr;
UBYTE red,grn,blu;
- colour = findcolour(newcol);
+ colr = findcolour(newcol);
- if(colour == 0xFFFFFFFF)
+ if(colr == 0xFFFFFFFF)
{
cm[numcols].red = svgtiny_RED(newcol);
cm[numcols].green = svgtiny_GREEN(newcol);
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 7b8ad12..0893c55 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -239,16 +239,16 @@ void ami_clearclipreg(struct gui_globals *gg)
gg->rect.MaxY = scrn->Height-1;
}
-static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colour)
+static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colr)
{
struct ami_plot_pen *node;
ULONG pen = ObtainBestPenA(scrn->ViewPort.ColorMap,
- (colour & 0x000000ff) << 24,
- (colour & 0x0000ff00) << 16,
- (colour & 0x00ff0000) << 8,
+ (colr & 0x000000ff) << 24,
+ (colr & 0x0000ff00) << 16,
+ (colr & 0x00ff0000) << 8,
NULL);
- if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colour));
+ if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colr));
if(shared_pens != NULL) {
if(node = (struct ami_plot_pen *)AllocVecTagList(sizeof(struct ami_plot_pen), NULL)) {
@@ -278,26 +278,26 @@ void ami_plot_release_pens(struct MinList *shared_pens)
}while(node = nnode);
}
-static void ami_plot_setapen(ULONG colour)
+static void ami_plot_setapen(ULONG colr)
{
if(palette_mapped == false) {
SetRPAttrs(glob->rp, RPTAG_APenColor,
- ns_color_to_nscss(colour),
+ ns_color_to_nscss(colr),
TAG_DONE);
} else {
- ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour);
+ ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
if(pen != -1) SetAPen(glob->rp, pen);
}
}
-static void ami_plot_setopen(ULONG colour)
+static void ami_plot_setopen(ULONG colr)
{
if(palette_mapped == false) {
SetRPAttrs(glob->rp, RPTAG_OPenColor,
- ns_color_to_nscss(colour),
+ ns_color_to_nscss(colr),
TAG_DONE);
} else {
- ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour);
+ ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
if(pen != -1) SetOPen(glob->rp, pen);
}
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=65adc1712123f81847a...
commit 65adc1712123f81847a85ce0374acc5a741368ec
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix a bunch of cppcheck unused/unreadVariable warnings
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 6768dde..0f3a33d 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -185,7 +185,6 @@ char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codeset, size
void gui_get_clipboard(char **buffer, size_t *length)
{
- struct ContextNode *cn;
struct CollectionItem *ci = NULL;
struct StoredProperty *sp = NULL;
ULONG rlen=0,error;
diff --git a/amiga/download.c b/amiga/download.c
index 74cb51f..7ce47a3 100644
--- a/amiga/download.c
+++ b/amiga/download.c
@@ -89,7 +89,6 @@ static struct gui_download_window *gui_download_window_create(download_context *
struct gui_window *gui)
{
const char *url = download_context_get_url(ctx);
- const char *mime_type = download_context_get_mime_type(ctx);
unsigned long total_size = download_context_get_total_length(ctx);
struct gui_download_window *dw;
char *dl_filename = ami_utf8_easy(download_context_get_filename(ctx));
diff --git a/amiga/drag.c b/amiga/drag.c
index f8944d3..09df0d0 100644
--- a/amiga/drag.c
+++ b/amiga/drag.c
@@ -98,9 +98,8 @@ void gui_drag_save_selection(struct gui_window *g, const char *selection)
void ami_drag_save(struct Window *win)
{
- ULONG which = WBO_NONE,type;
- char path[1025],dpath[1025];
- const char *source_data;
+ ULONG which = WBO_NONE, type;
+ char path[1025], dpath[1025];
ULONG source_size;
ami_drag_icon_close(NULL);
@@ -195,10 +194,8 @@ void ami_drag_save(struct Window *win)
void ami_drag_icon_show(struct Window *win, const char *type)
{
struct DiskObject *dobj = NULL;
- ULONG *icondata1;
ULONG width, height;
- long format = 0;
- int err = 0;
+ int err;
int deftype = WBPROJECT;
drag_in_progress = TRUE;
diff --git a/amiga/dt_anim.c b/amiga/dt_anim.c
index f2b0f76..d6e5c10 100644
--- a/amiga/dt_anim.c
+++ b/amiga/dt_anim.c
@@ -92,7 +92,6 @@ static const content_handler amiga_dt_anim_content_handler = {
nserror amiga_dt_anim_init(void)
{
- char dt_mime[50];
struct DataType *dt, *prevdt = NULL;
lwc_string *type;
lwc_error lerror;
@@ -161,14 +160,11 @@ bool amiga_dt_anim_convert(struct content *c)
amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c;
union content_msg_data msg_data;
int width, height;
- char title[100];
const uint8 *data;
UBYTE *bm_buffer;
ULONG size;
- Object *dto;
struct BitMapHeader *bmh;
unsigned int bm_flags = BITMAP_NEW | BITMAP_OPAQUE;
- int bm_format = PBPAFMT_RGBA;
struct adtFrame adt_frame;
APTR clut;
diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c
index 211d221..1d30928 100644
--- a/amiga/dt_picture.c
+++ b/amiga/dt_picture.c
@@ -62,7 +62,6 @@ struct amiga_dt_picture_content {
nserror amiga_dt_picture_init(void)
{
- char dt_mime[50];
struct DataType *dt, *prevdt = NULL;
lwc_string *type;
lwc_error lerror;
@@ -214,14 +213,10 @@ bool amiga_dt_picture_convert(struct content *c)
{
LOG(("amiga_dt_picture_convert"));
- union content_msg_data msg_data;
int width, height;
char *title;
- UBYTE *bm_buffer;
Object *dto;
struct BitMapHeader *bmh;
- unsigned int bm_flags = BITMAP_NEW;
- int bm_format = PBPAFMT_RGBA;
char *filetype;
if(dto = amiga_dt_picture_newdtobject((struct amiga_dt_picture_content *)c))
diff --git a/amiga/dt_sound.c b/amiga/dt_sound.c
index 3f82169..a1daf03 100644
--- a/amiga/dt_sound.c
+++ b/amiga/dt_sound.c
@@ -77,7 +77,6 @@ void amiga_dt_sound_play(Object *dto)
nserror amiga_dt_sound_init(void)
{
- char dt_mime[50];
struct DataType *dt, *prevdt = NULL;
lwc_string *type;
lwc_error lerror;
@@ -146,12 +145,9 @@ bool amiga_dt_sound_convert(struct content *c)
LOG(("amiga_dt_sound_convert"));
amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c;
- union content_msg_data msg_data;
int width = 50, height = 50;
- char title[100];
const uint8 *data;
ULONG size;
- Object *dto;
data = (uint8 *)content__get_source_data(c, &size);
diff --git a/amiga/file.c b/amiga/file.c
index 91d3755..5d16ceb 100644
--- a/amiga/file.c
+++ b/amiga/file.c
@@ -49,8 +49,6 @@ static struct Hook aslhookfunc;
static const ULONG ami_file_asl_mime_hook(struct Hook *mh,
struct FileRequester *fr, struct AnchorPathOld *ap)
{
- BPTR file = 0;
- char buffer[10];
char fname[1024];
BOOL ret = FALSE;
char *mt = NULL;
diff --git a/amiga/filetype.c b/amiga/filetype.c
index 0cb4ac4..bcb6b7e 100644
--- a/amiga/filetype.c
+++ b/amiga/filetype.c
@@ -173,9 +173,7 @@ const char *ami_content_type_to_file_type(content_type type)
nserror ami_mime_init(const char *mimefile)
{
- lwc_string *type;
lwc_error lerror;
- nserror error;
char buffer[256];
BPTR fh = 0;
struct RDArgs *rargs = NULL;
diff --git a/amiga/font.c b/amiga/font.c
index df4a188..148d860 100755
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -204,8 +204,6 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
FIXED kern = 0;
struct OutlineFont *ofont, *ufont = NULL;
uint32 tx=0,i=0;
- size_t len, utf8len = 0;
- uint8 *utf8;
int utf8_pos = 0;
uint32 co = 0;
int utf16charlen;
diff --git a/amiga/history_local.c b/amiga/history_local.c
index 1f710b2..4849c65 100755
--- a/amiga/history_local.c
+++ b/amiga/history_local.c
@@ -74,7 +74,6 @@ static void ami_history_scroller_hook(struct Hook *hook,Object *object,struct In
void ami_history_open(struct browser_window *bw, struct history *history)
{
int width, height;
- struct IBox *bbox;
assert(history);
@@ -239,7 +238,6 @@ BOOL ami_history_event(struct history_window *hw)
/* return TRUE if window destroyed */
ULONG class,result,relevent = 0;
uint16 code;
- struct MenuItem *item;
const char *url;
struct IBox *bbox;
ULONG xs, ys;
diff --git a/amiga/icon.c b/amiga/icon.c
index c5bc6ae..a6b61a2 100644
--- a/amiga/icon.c
+++ b/amiga/icon.c
@@ -139,7 +139,7 @@ bool amiga_icon_convert(struct content *c)
ULONG size;
int width = 0, height = 0;
long format = 0;
- int err = 0;
+ int err;
uint8 r, g, b, a;
ULONG offset;
const char *url;
@@ -365,7 +365,7 @@ void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct
ULONG *icondata1, *icondata2;
ULONG width, height;
long format = 0;
- int err = 0;
+ int err;
if(dobj == NULL) return;
@@ -420,11 +420,10 @@ void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct
void amiga_icon_superimpose_favicon(char *path, struct hlcache_handle *icon, char *type)
{
struct DiskObject *dobj = NULL;
- struct BitMap *bm = NULL;
ULONG *icondata1, *icondata2;
ULONG width, height;
long format = 0;
- int err = 0;
+ int err;
ULONG trans1, pals1;
ULONG trans2, pals2;
struct ColorRegister *pal1;
diff --git a/amiga/iff_dr2d.c b/amiga/iff_dr2d.c
index 0638b94..6cced5b 100644
--- a/amiga/iff_dr2d.c
+++ b/amiga/iff_dr2d.c
@@ -49,7 +49,6 @@ ULONG findcolour(ULONG newcol)
void addcolour(ULONG newcol)
{
- int i;
ULONG colour;
UBYTE red,grn,blu;
@@ -342,7 +341,6 @@ int main(int argc, char **argv)
{
BPTR fh = 0;
char *buffer;
- size_t n;
struct IFFHandle *iffh = NULL;
int64 size;
LONG rarray[] = {0,0};
diff --git a/amiga/launch.c b/amiga/launch.c
index ebd8229..0d25bcf 100755
--- a/amiga/launch.c
+++ b/amiga/launch.c
@@ -105,8 +105,6 @@ BOOL ami_openurl_check_list(struct MinList *list, const char *url)
void ami_openurl_open(void)
{
- struct ami_protocol *ami_p;
-
if(nsoption_bool(use_openurl_lib)) {
if(OpenURLBase = OpenLibrary("openurl.library",0))
IOpenURL = (struct OpenURLIFace *)GetInterface(OpenURLBase,"main",1,NULL);
diff --git a/amiga/menu.c b/amiga/menu.c
index 13b9c9c..234a958 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -456,8 +456,6 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
{
- int i;
-
gwin->menu = AllocVecTags(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1),
AVT_ClearWithValue, 0, TAG_DONE);
ami_init_menulabs(gwin);
@@ -1029,7 +1027,6 @@ static void ami_menu_item_hotlist_show(struct Hook *hook, APTR window, struct In
static void ami_menu_item_hotlist_entries(struct Hook *hook, APTR window, struct IntuiMessage *msg)
{
nsurl *url = hook->h_Data;
- nserror error;
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
diff --git a/amiga/misc.c b/amiga/misc.c
index ac9d245..c25c5d5 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -108,7 +108,7 @@ void die(const char *error)
char *url_to_path(const char *url)
{
- char *tmps, *unesc, *slash, *colon, *url2;
+ char *unesc, *slash, *colon, *url2;
if (strncmp(url, "file://", SLEN("file://")) != 0)
return NULL;
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 05db67f..7b8ad12 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -945,7 +945,6 @@ bool ami_path(const float *p, unsigned int n, colour fill, float width,
colour c, const float transform[6])
{
unsigned int i;
- struct bez_point *old_p;
struct bez_point start_p, cur_p, p_a, p_b, p_c, p_r;
#ifdef AMI_PLOTTER_DEBUG
diff --git a/amiga/plugin_hack.c b/amiga/plugin_hack.c
index f78a67e..9bfd7a3 100644
--- a/amiga/plugin_hack.c
+++ b/amiga/plugin_hack.c
@@ -132,7 +132,7 @@ void amiga_plugin_hack_destroy(struct content *c)
{
amiga_plugin_hack_content *plugin = (amiga_plugin_hack_content *) c;
- LOG(("amiga_plugin_hack_destroy"));
+ LOG(("amiga_plugin_hack_destroy %p", plugin));
return;
}
diff --git a/amiga/stringview/stringview.c b/amiga/stringview/stringview.c
index 5aea939..9aa110a 100755
--- a/amiga/stringview/stringview.c
+++ b/amiga/stringview/stringview.c
@@ -859,7 +859,6 @@ Class *MakeStringClass( void )
void FreeStringClass(Class *cl)
{
- struct Library *libbase;
URLHistory_Free();
FreeClass(cl);
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=975a1d3c5db0dc11a4f...
commit 975a1d3c5db0dc11a4f5ada68d5d424850858161
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix cppcheck variableScope warnings
diff --git a/amiga/arexx.c b/amiga/arexx.c
index 7fc58ef..3bac0c2 100644
--- a/amiga/arexx.c
+++ b/amiga/arexx.c
@@ -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
diff --git a/amiga/download.c b/amiga/download.c
index fb5c109..74cb51f 100644
--- a/amiga/download.c
+++ b/amiga/download.c
@@ -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);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c1a32d7c6e87f3d81fa...
commit c1a32d7c6e87f3d81fa095e7e7fe11fa8d88fe5f
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix some cppcheck unused/unreadVariables
diff --git a/amiga/arexx.c b/amiga/arexx.c
index 240aafe..7fc58ef 100644
--- a/amiga/arexx.c
+++ b/amiga/arexx.c
@@ -196,9 +196,8 @@ 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, tabs = 0;
+ int windows = 0;
struct nsObject *node, *nnode;
- struct gui_window_2 *gwin;
if(!IsMinListEmpty(window_list))
{
@@ -569,7 +568,7 @@ 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, tabs = 0;
+ int windows = 0;
int window = 0, tab = 0;
struct browser_window *bw = curbw;
struct nsObject *node, *nnode;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=b301a111405f0f5e5df...
commit b301a111405f0f5e5df7b6204e6c2bf4bee2fce5
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix cppcheck arrayIndexOutOfBounds
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 400ced8..877ff09 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -198,7 +198,7 @@ enum
#define OPTS_MAX_TABS 10
#define OPTS_MAX_SCREEN 4
#define OPTS_MAX_PROXY 5
-#define OPTS_MAX_NATIVEBM 3
+#define OPTS_MAX_NATIVEBM 4
#define OPTS_MAX_DITHER 4
struct ami_gui_opts_window {
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=0f6859864911270c65c...
commit 0f6859864911270c65caea459637d35cf1bba14a
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix cppcheck syntaxError
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index dde283b..cb350de 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -324,7 +324,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
PMIA_UserData, userdata,
PMIA_Disabled, (content_get_type(userdata) != CONTENT_HTML),
TAG_DONE),
- TAG_DONE),
+ PMEND,
TAG_DONE),
~0);
break;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c2f9a399664faa1248e...
commit c2f9a399664faa1248eb5a043e697a7d94558c0c
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix some cppcheck variableScope warnings
diff --git a/amiga/gui.c b/amiga/gui.c
index c6ab633..ad452a6 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -547,7 +547,6 @@ static void ami_set_screen_defaults(struct Screen *screen)
static nserror ami_set_options(struct nsoption_s *defaults)
{
STRPTR tempacceptlangs;
- BPTR lock = 0;
char temp[1024];
/* The following line disables the popupmenu.class select menu
@@ -605,15 +604,16 @@ static nserror ami_set_options(struct nsoption_s *defaults)
if (nsoption_charp(font_unicode) == NULL)
{
+ BPTR lock = 0;
/* Search for some likely candidates */
- if(lock=Lock("FONTS:Code2000.font",ACCESS_READ))
+ if(lock = Lock("FONTS:Code2000.font", ACCESS_READ))
{
UnLock(lock);
nsoption_set_charp(font_unicode,
(char *)strdup("Code2000"));
}
- else if(lock=Lock("FONTS:Bitstream Cyberbit.font",ACCESS_READ))
+ else if(lock = Lock("FONTS:Bitstream Cyberbit.font", ACCESS_READ))
{
UnLock(lock);
nsoption_set_charp(font_unicode,
@@ -637,7 +637,7 @@ void ami_amiupdate(void)
{
/* Create AppPath location for AmiUpdate use */
- BPTR lock = 0, amiupdatefh = 0;
+ BPTR lock = 0;
if(((lock = Lock("ENVARC:AppPaths",SHARED_LOCK)) == 0))
{
@@ -649,6 +649,7 @@ void ami_amiupdate(void)
if(lock = Lock("PROGDIR:", ACCESS_READ))
{
char filename[1024];
+ BPTR amiupdatefh;
DevNameFromLock(lock,(STRPTR)&filename,1024L,DN_FULLPATH);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=f991abc53cb5eeb8745...
commit f991abc53cb5eeb874542cf8a40f4dbecef32296
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix a bunch of cppcheck unusedVariable/unreadVariable warnings
diff --git a/amiga/gui.c b/amiga/gui.c
index 3949271..c6ab633 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -328,7 +328,6 @@ bool ami_gui_map_filename(char **remapped, const char *path, const char *file, c
bool ami_gui_check_resource(char *fullpath, const char *file)
{
- bool free_rmap = false;
bool found = false;
char *remapped;
BPTR lock = 0;
@@ -1225,7 +1224,6 @@ bool ami_spacebox_to_ns_coords(struct gui_window_2 *gwin, int *x, int *y,
bool ami_mouse_to_ns_coords(struct gui_window_2 *gwin, int *x, int *y,
int mouse_x, int mouse_y)
{
- int xs, ys;
int ns_x, ns_y;
struct IBox *bbox;
@@ -1447,17 +1445,15 @@ static void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
void ami_handle_msg(void)
{
- struct IntuiMessage *message = NULL;
ULONG class,result,storage = 0,x,y,xs,ys,width=800,height=600;
uint16 code,quals;
struct IBox *bbox;
struct nsObject *node;
struct nsObject *nnode;
struct gui_window_2 *gwin = NULL;
- struct MenuItem *item;
struct InputEvent *ie;
struct Node *tabnode;
- int i, nskey;
+ int nskey;
struct browser_window *closedbw;
struct timeval curtime;
static int drag_x_move = 0, drag_y_move = 0;
@@ -2163,7 +2159,6 @@ void ami_handle_msg(void)
case WMHI_ICONIFY:
{
- struct DiskObject *dobj;
struct bitmap *bm;
bm = urldb_get_thumbnail(hlcache_handle_get_url(gwin->bw->current_content));
@@ -2747,8 +2742,6 @@ void ami_try_quit(void)
static void gui_quit(void)
{
- int i;
-
ami_theme_throbber_free();
urldb_save(nsoption_charp(url_file));
@@ -3169,8 +3162,6 @@ gui_window_create(struct browser_window *bw,
gui_window_create_flags flags)
{
struct gui_window *g = NULL;
- bool closegadg=TRUE;
- struct Node *node;
ULONG curx=nsoption_int(window_x),cury=nsoption_int(window_y),curw=nsoption_int(window_width),curh=nsoption_int(window_height);
char nav_west[100],nav_west_s[100],nav_west_g[100];
char nav_east[100],nav_east_s[100],nav_east_g[100];
@@ -4170,9 +4161,7 @@ static void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw
struct IBox *bbox;
ULONG cur_tab = 0;
ULONG sx, sy;
- struct rect clip;
- struct RastPort *temprp;
- int posx, posy;
+
struct redraw_context ctx = {
.interactive = true,
.background_images = true,
@@ -4295,14 +4284,12 @@ static void gui_window_update_box(struct gui_window *g, const struct rect *rect)
static void ami_do_redraw(struct gui_window_2 *gwin)
{
- struct Region *reg = NULL;
struct Rectangle rect;
- hlcache_handle *c;
ULONG hcurrent,vcurrent,xoffset,yoffset,width=800,height=600,x0=0,y0=0;
struct IBox *bbox;
ULONG oldh = gwin->oldh, oldv=gwin->oldv;
- bool morescroll = false;
struct RastPort *temprp;
+ hlcache_handle *c;
if(browser_window_redraw_ready(gwin->bw) == false) return;
@@ -4339,7 +4326,6 @@ static void ami_do_redraw(struct gui_window_2 *gwin)
if(gwin->redraw_scroll)
{
struct rect rect;
- int x0, y0, x1, y1;
gwin->bw->window->c_h_temp = gwin->bw->window->c_h;
gui_window_remove_caret(gwin->bw->window);
@@ -4430,7 +4416,7 @@ void ami_refresh_window(struct gui_window_2 *gwin)
struct IBox *bbox;
int x0, x1, y0, y1, sx, sy;
- struct RegionRectangle *regrect, *nregrect;
+ struct RegionRectangle *regrect;
sx = gwin->bw->window->scrollx;
sy = gwin->bw->window->scrolly;
@@ -4704,7 +4690,6 @@ static void gui_set_search_ico(hlcache_handle *ico)
struct nsObject *node;
struct nsObject *nnode;
struct gui_window_2 *gwin;
- char fname[100];
struct bitmap *ico_bitmap;
if(IsMinListEmpty(window_list)) return;
@@ -4818,9 +4803,6 @@ static void gui_window_place_caret(struct gui_window *g, int x, int y, int heigh
static void gui_window_remove_caret(struct gui_window *g)
{
- struct IBox *bbox;
- int xs,ys;
-
if(!g) return;
if(g->c_h == 0) return;
@@ -4879,9 +4861,7 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
ULONG gid;
struct gui_window_2 *gwin = hook->h_Data;
struct IntuiWheelData *wheel;
- Object *reqrefresh = NULL;
struct Node *node = NULL;
- char *urltxt;
nsurl *url;
switch(msg->Class)
@@ -4954,8 +4934,7 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y)
{
struct IBox *bbox;
- ULONG xs,ys,width,height;
- int box_x=0,box_y=0;
+ ULONG xs, ys, width, height;
struct contextual_content data;
GetAttr(SPACE_AreaBox, (Object *)gwin->objects[GID_BROWSER],
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=268cda0f560ffdacf61...
commit 268cda0f560ffdacf6186b923f5540ed5da52ef9
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix cppcheck variableHidingTypedef
diff --git a/amiga/gui.c b/amiga/gui.c
index b893b6f..3949271 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -463,7 +463,7 @@ colour_option_from_pen(UWORD pen,
struct Screen *screen,
colour def_colour)
{
- ULONG colour[3];
+ ULONG colr[3];
struct DrawInfo *drinfo;
if((option < NSOPTION_SYS_COLOUR_START) ||
@@ -479,12 +479,12 @@ colour_option_from_pen(UWORD pen,
if(pen == AMINS_SCROLLERPEN) pen = ami_system_colour_scrollbar_fgpen(drinfo);
/* Get the colour of the pen being used for "pen" */
- GetRGB32(screen->ViewPort.ColorMap, drinfo->dri_Pens[pen], 1, (ULONG *)&colour);
+ GetRGB32(screen->ViewPort.ColorMap, drinfo->dri_Pens[pen], 1, (ULONG *)&colr);
/* convert it to a color */
- def_colour = ((colour[0] & 0xff000000) >> 24) |
- ((colour[1] & 0xff000000) >> 16) |
- ((colour[2] & 0xff000000) >> 8);
+ def_colour = ((colr[0] & 0xff000000) >> 24) |
+ ((colr[1] & 0xff000000) >> 16) |
+ ((colr[2] & 0xff000000) >> 8);
FreeScreenDrawInfo(screen, drinfo);
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=d907ec9b0614e5c1787...
commit d907ec9b0614e5c178720429dee7a8ef96df6aad
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Remove cppcheck unnecessaryForwardDeclaration
diff --git a/amiga/plugin_hack.h b/amiga/plugin_hack.h
index ae79a1f..3d644ae 100644
--- a/amiga/plugin_hack.h
+++ b/amiga/plugin_hack.h
@@ -22,8 +22,6 @@
#include "utils/config.h"
#include "utils/errors.h"
-struct hlcache_handle;
-
nserror amiga_plugin_hack_init(void);
void amiga_plugin_hack_execute(struct hlcache_handle *c);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=412df342987f754958a...
commit 412df342987f754958a9756817ccacaebe07f764
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix some cppcheck variableScope warnings
diff --git a/amiga/gui.c b/amiga/gui.c
index 5c707c5..b893b6f 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -251,13 +251,12 @@ static bool path_add_part(char *path, int length, const char *newpart)
STRPTR ami_locale_langs(void)
{
struct Locale *locale;
- STRPTR acceptlangs = NULL, acceptlangs2 = NULL;
- int i;
+ STRPTR acceptlangs = NULL;
char *remapped;
if(locale = OpenLocale(NULL))
{
- for(i=0;i<10;i++)
+ for(int i = 0; i < 10; i++)
{
if(locale->loc_PrefLanguages[i])
{
@@ -266,7 +265,7 @@ STRPTR ami_locale_langs(void)
{
if(acceptlangs)
{
- acceptlangs2 = acceptlangs;
+ STRPTR acceptlangs2 = acceptlangs;
acceptlangs = ASPrintf("%s, %s",acceptlangs2, remapped);
FreeVec(acceptlangs2);
acceptlangs2 = NULL;
-----------------------------------------------------------------------
Summary of changes:
amiga/arexx.c | 7 +++--
amiga/clipboard.c | 1 -
amiga/context_menu.c | 2 +-
amiga/download.c | 9 +++---
amiga/drag.c | 9 ++----
amiga/dt_anim.c | 14 +++------
amiga/dt_picture.c | 5 ---
amiga/dt_sound.c | 4 ---
amiga/file.c | 2 -
amiga/filetype.c | 2 -
amiga/font.c | 2 -
amiga/gui.c | 57 +++++++++++++----------------------------
amiga/gui_options.c | 2 +-
amiga/history_local.c | 2 -
amiga/icon.c | 7 ++---
amiga/iff_dr2d.c | 14 ++++------
amiga/launch.c | 2 -
amiga/menu.c | 3 --
amiga/misc.c | 2 +-
amiga/plotters.c | 23 ++++++++--------
amiga/plugin_hack.c | 2 +-
amiga/plugin_hack.h | 2 -
amiga/stringview/stringview.c | 1 -
23 files changed, 59 insertions(+), 115 deletions(-)
diff --git a/amiga/arexx.c b/amiga/arexx.c
index 240aafe..3bac0c2 100644
--- a/amiga/arexx.c
+++ b/amiga/arexx.c
@@ -196,12 +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, tabs = 0;
struct nsObject *node, *nnode;
- struct gui_window_2 *gwin;
if(!IsMinListEmpty(window_list))
{
+ int windows = 0;
+
node = (struct nsObject *)GetHead((struct List *)window_list);
do
@@ -569,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, tabs = 0;
int window = 0, tab = 0;
struct browser_window *bw = curbw;
struct nsObject *node, *nnode;
@@ -579,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
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 6768dde..0f3a33d 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -185,7 +185,6 @@ char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codeset, size
void gui_get_clipboard(char **buffer, size_t *length)
{
- struct ContextNode *cn;
struct CollectionItem *ci = NULL;
struct StoredProperty *sp = NULL;
ULONG rlen=0,error;
diff --git a/amiga/context_menu.c b/amiga/context_menu.c
index dde283b..cb350de 100644
--- a/amiga/context_menu.c
+++ b/amiga/context_menu.c
@@ -324,7 +324,7 @@ void ami_context_menu_add_submenu(Object *ctxmenuobj, ULONG cmsub, void *userdat
PMIA_UserData, userdata,
PMIA_Disabled, (content_get_type(userdata) != CONTENT_HTML),
TAG_DONE),
- TAG_DONE),
+ PMEND,
TAG_DONE),
~0);
break;
diff --git a/amiga/download.c b/amiga/download.c
index fb5c109..7ce47a3 100644
--- a/amiga/download.c
+++ b/amiga/download.c
@@ -89,7 +89,6 @@ static struct gui_download_window *gui_download_window_create(download_context *
struct gui_window *gui)
{
const char *url = download_context_get_url(ctx);
- const char *mime_type = download_context_get_mime_type(ctx);
unsigned long total_size = download_context_get_total_length(ctx);
struct gui_download_window *dw;
char *dl_filename = ami_utf8_easy(download_context_get_filename(ctx));
@@ -347,7 +346,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 +367,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 +401,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 +410,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);
diff --git a/amiga/drag.c b/amiga/drag.c
index f8944d3..09df0d0 100644
--- a/amiga/drag.c
+++ b/amiga/drag.c
@@ -98,9 +98,8 @@ void gui_drag_save_selection(struct gui_window *g, const char *selection)
void ami_drag_save(struct Window *win)
{
- ULONG which = WBO_NONE,type;
- char path[1025],dpath[1025];
- const char *source_data;
+ ULONG which = WBO_NONE, type;
+ char path[1025], dpath[1025];
ULONG source_size;
ami_drag_icon_close(NULL);
@@ -195,10 +194,8 @@ void ami_drag_save(struct Window *win)
void ami_drag_icon_show(struct Window *win, const char *type)
{
struct DiskObject *dobj = NULL;
- ULONG *icondata1;
ULONG width, height;
- long format = 0;
- int err = 0;
+ int err;
int deftype = WBPROJECT;
drag_in_progress = TRUE;
diff --git a/amiga/dt_anim.c b/amiga/dt_anim.c
index f2b0f76..4722d2d 100644
--- a/amiga/dt_anim.c
+++ b/amiga/dt_anim.c
@@ -92,7 +92,6 @@ static const content_handler amiga_dt_anim_content_handler = {
nserror amiga_dt_anim_init(void)
{
- char dt_mime[50];
struct DataType *dt, *prevdt = NULL;
lwc_string *type;
lwc_error lerror;
@@ -161,14 +160,11 @@ bool amiga_dt_anim_convert(struct content *c)
amiga_dt_anim_content *plugin = (amiga_dt_anim_content *) c;
union content_msg_data msg_data;
int width, height;
- char title[100];
const uint8 *data;
UBYTE *bm_buffer;
ULONG size;
- Object *dto;
struct BitMapHeader *bmh;
unsigned int bm_flags = BITMAP_NEW | BITMAP_OPAQUE;
- int bm_format = PBPAFMT_RGBA;
struct adtFrame adt_frame;
APTR clut;
@@ -341,20 +337,20 @@ APTR ami_colormap_to_clut(struct ColorMap *cmap)
{
int i;
UBYTE *clut = AllocVecTags(256 * 4, AVT_ClearWithValue, 0, TAG_DONE); /* NB: Was not MEMF_PRIVATE */
- ULONG colour[256 * 4];
+ ULONG colr[256 * 4];
if(!clut) return NULL;
/* Get the palette from the ColorMap */
- GetRGB32(cmap, 0, 256, (ULONG *)&colour);
+ GetRGB32(cmap, 0, 256, (ULONG *)&colr);
/* convert it to a table of ARGB values */
for(i = 0; i < 1024; i += 4)
{
clut[i] = (0xff << 24) |
- ((colour[i] & 0xff000000) >> 8) |
- ((colour[i + 1] & 0xff000000) >> 16) |
- ((colour[i + 2] & 0xff000000) >> 24);
+ ((colr[i] & 0xff000000) >> 8) |
+ ((colr[i + 1] & 0xff000000) >> 16) |
+ ((colr[i + 2] & 0xff000000) >> 24);
}
return clut;
diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c
index 211d221..1d30928 100644
--- a/amiga/dt_picture.c
+++ b/amiga/dt_picture.c
@@ -62,7 +62,6 @@ struct amiga_dt_picture_content {
nserror amiga_dt_picture_init(void)
{
- char dt_mime[50];
struct DataType *dt, *prevdt = NULL;
lwc_string *type;
lwc_error lerror;
@@ -214,14 +213,10 @@ bool amiga_dt_picture_convert(struct content *c)
{
LOG(("amiga_dt_picture_convert"));
- union content_msg_data msg_data;
int width, height;
char *title;
- UBYTE *bm_buffer;
Object *dto;
struct BitMapHeader *bmh;
- unsigned int bm_flags = BITMAP_NEW;
- int bm_format = PBPAFMT_RGBA;
char *filetype;
if(dto = amiga_dt_picture_newdtobject((struct amiga_dt_picture_content *)c))
diff --git a/amiga/dt_sound.c b/amiga/dt_sound.c
index 3f82169..a1daf03 100644
--- a/amiga/dt_sound.c
+++ b/amiga/dt_sound.c
@@ -77,7 +77,6 @@ void amiga_dt_sound_play(Object *dto)
nserror amiga_dt_sound_init(void)
{
- char dt_mime[50];
struct DataType *dt, *prevdt = NULL;
lwc_string *type;
lwc_error lerror;
@@ -146,12 +145,9 @@ bool amiga_dt_sound_convert(struct content *c)
LOG(("amiga_dt_sound_convert"));
amiga_dt_sound_content *plugin = (amiga_dt_sound_content *) c;
- union content_msg_data msg_data;
int width = 50, height = 50;
- char title[100];
const uint8 *data;
ULONG size;
- Object *dto;
data = (uint8 *)content__get_source_data(c, &size);
diff --git a/amiga/file.c b/amiga/file.c
index 91d3755..5d16ceb 100644
--- a/amiga/file.c
+++ b/amiga/file.c
@@ -49,8 +49,6 @@ static struct Hook aslhookfunc;
static const ULONG ami_file_asl_mime_hook(struct Hook *mh,
struct FileRequester *fr, struct AnchorPathOld *ap)
{
- BPTR file = 0;
- char buffer[10];
char fname[1024];
BOOL ret = FALSE;
char *mt = NULL;
diff --git a/amiga/filetype.c b/amiga/filetype.c
index 0cb4ac4..bcb6b7e 100644
--- a/amiga/filetype.c
+++ b/amiga/filetype.c
@@ -173,9 +173,7 @@ const char *ami_content_type_to_file_type(content_type type)
nserror ami_mime_init(const char *mimefile)
{
- lwc_string *type;
lwc_error lerror;
- nserror error;
char buffer[256];
BPTR fh = 0;
struct RDArgs *rargs = NULL;
diff --git a/amiga/font.c b/amiga/font.c
index df4a188..148d860 100755
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -204,8 +204,6 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
FIXED kern = 0;
struct OutlineFont *ofont, *ufont = NULL;
uint32 tx=0,i=0;
- size_t len, utf8len = 0;
- uint8 *utf8;
int utf8_pos = 0;
uint32 co = 0;
int utf16charlen;
diff --git a/amiga/gui.c b/amiga/gui.c
index 5c707c5..ad452a6 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -251,13 +251,12 @@ static bool path_add_part(char *path, int length, const char *newpart)
STRPTR ami_locale_langs(void)
{
struct Locale *locale;
- STRPTR acceptlangs = NULL, acceptlangs2 = NULL;
- int i;
+ STRPTR acceptlangs = NULL;
char *remapped;
if(locale = OpenLocale(NULL))
{
- for(i=0;i<10;i++)
+ for(int i = 0; i < 10; i++)
{
if(locale->loc_PrefLanguages[i])
{
@@ -266,7 +265,7 @@ STRPTR ami_locale_langs(void)
{
if(acceptlangs)
{
- acceptlangs2 = acceptlangs;
+ STRPTR acceptlangs2 = acceptlangs;
acceptlangs = ASPrintf("%s, %s",acceptlangs2, remapped);
FreeVec(acceptlangs2);
acceptlangs2 = NULL;
@@ -329,7 +328,6 @@ bool ami_gui_map_filename(char **remapped, const char *path, const char *file, c
bool ami_gui_check_resource(char *fullpath, const char *file)
{
- bool free_rmap = false;
bool found = false;
char *remapped;
BPTR lock = 0;
@@ -464,7 +462,7 @@ colour_option_from_pen(UWORD pen,
struct Screen *screen,
colour def_colour)
{
- ULONG colour[3];
+ ULONG colr[3];
struct DrawInfo *drinfo;
if((option < NSOPTION_SYS_COLOUR_START) ||
@@ -480,12 +478,12 @@ colour_option_from_pen(UWORD pen,
if(pen == AMINS_SCROLLERPEN) pen = ami_system_colour_scrollbar_fgpen(drinfo);
/* Get the colour of the pen being used for "pen" */
- GetRGB32(screen->ViewPort.ColorMap, drinfo->dri_Pens[pen], 1, (ULONG *)&colour);
+ GetRGB32(screen->ViewPort.ColorMap, drinfo->dri_Pens[pen], 1, (ULONG *)&colr);
/* convert it to a color */
- def_colour = ((colour[0] & 0xff000000) >> 24) |
- ((colour[1] & 0xff000000) >> 16) |
- ((colour[2] & 0xff000000) >> 8);
+ def_colour = ((colr[0] & 0xff000000) >> 24) |
+ ((colr[1] & 0xff000000) >> 16) |
+ ((colr[2] & 0xff000000) >> 8);
FreeScreenDrawInfo(screen, drinfo);
}
@@ -549,7 +547,6 @@ static void ami_set_screen_defaults(struct Screen *screen)
static nserror ami_set_options(struct nsoption_s *defaults)
{
STRPTR tempacceptlangs;
- BPTR lock = 0;
char temp[1024];
/* The following line disables the popupmenu.class select menu
@@ -607,15 +604,16 @@ static nserror ami_set_options(struct nsoption_s *defaults)
if (nsoption_charp(font_unicode) == NULL)
{
+ BPTR lock = 0;
/* Search for some likely candidates */
- if(lock=Lock("FONTS:Code2000.font",ACCESS_READ))
+ if(lock = Lock("FONTS:Code2000.font", ACCESS_READ))
{
UnLock(lock);
nsoption_set_charp(font_unicode,
(char *)strdup("Code2000"));
}
- else if(lock=Lock("FONTS:Bitstream Cyberbit.font",ACCESS_READ))
+ else if(lock = Lock("FONTS:Bitstream Cyberbit.font", ACCESS_READ))
{
UnLock(lock);
nsoption_set_charp(font_unicode,
@@ -639,7 +637,7 @@ void ami_amiupdate(void)
{
/* Create AppPath location for AmiUpdate use */
- BPTR lock = 0, amiupdatefh = 0;
+ BPTR lock = 0;
if(((lock = Lock("ENVARC:AppPaths",SHARED_LOCK)) == 0))
{
@@ -651,6 +649,7 @@ void ami_amiupdate(void)
if(lock = Lock("PROGDIR:", ACCESS_READ))
{
char filename[1024];
+ BPTR amiupdatefh;
DevNameFromLock(lock,(STRPTR)&filename,1024L,DN_FULLPATH);
@@ -1226,7 +1225,6 @@ bool ami_spacebox_to_ns_coords(struct gui_window_2 *gwin, int *x, int *y,
bool ami_mouse_to_ns_coords(struct gui_window_2 *gwin, int *x, int *y,
int mouse_x, int mouse_y)
{
- int xs, ys;
int ns_x, ns_y;
struct IBox *bbox;
@@ -1448,17 +1446,15 @@ static void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
void ami_handle_msg(void)
{
- struct IntuiMessage *message = NULL;
ULONG class,result,storage = 0,x,y,xs,ys,width=800,height=600;
uint16 code,quals;
struct IBox *bbox;
struct nsObject *node;
struct nsObject *nnode;
struct gui_window_2 *gwin = NULL;
- struct MenuItem *item;
struct InputEvent *ie;
struct Node *tabnode;
- int i, nskey;
+ int nskey;
struct browser_window *closedbw;
struct timeval curtime;
static int drag_x_move = 0, drag_y_move = 0;
@@ -2164,7 +2160,6 @@ void ami_handle_msg(void)
case WMHI_ICONIFY:
{
- struct DiskObject *dobj;
struct bitmap *bm;
bm = urldb_get_thumbnail(hlcache_handle_get_url(gwin->bw->current_content));
@@ -2748,8 +2743,6 @@ void ami_try_quit(void)
static void gui_quit(void)
{
- int i;
-
ami_theme_throbber_free();
urldb_save(nsoption_charp(url_file));
@@ -3170,8 +3163,6 @@ gui_window_create(struct browser_window *bw,
gui_window_create_flags flags)
{
struct gui_window *g = NULL;
- bool closegadg=TRUE;
- struct Node *node;
ULONG curx=nsoption_int(window_x),cury=nsoption_int(window_y),curw=nsoption_int(window_width),curh=nsoption_int(window_height);
char nav_west[100],nav_west_s[100],nav_west_g[100];
char nav_east[100],nav_east_s[100],nav_east_g[100];
@@ -4171,9 +4162,7 @@ static void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw
struct IBox *bbox;
ULONG cur_tab = 0;
ULONG sx, sy;
- struct rect clip;
- struct RastPort *temprp;
- int posx, posy;
+
struct redraw_context ctx = {
.interactive = true,
.background_images = true,
@@ -4296,14 +4285,12 @@ static void gui_window_update_box(struct gui_window *g, const struct rect *rect)
static void ami_do_redraw(struct gui_window_2 *gwin)
{
- struct Region *reg = NULL;
struct Rectangle rect;
- hlcache_handle *c;
ULONG hcurrent,vcurrent,xoffset,yoffset,width=800,height=600,x0=0,y0=0;
struct IBox *bbox;
ULONG oldh = gwin->oldh, oldv=gwin->oldv;
- bool morescroll = false;
struct RastPort *temprp;
+ hlcache_handle *c;
if(browser_window_redraw_ready(gwin->bw) == false) return;
@@ -4340,7 +4327,6 @@ static void ami_do_redraw(struct gui_window_2 *gwin)
if(gwin->redraw_scroll)
{
struct rect rect;
- int x0, y0, x1, y1;
gwin->bw->window->c_h_temp = gwin->bw->window->c_h;
gui_window_remove_caret(gwin->bw->window);
@@ -4431,7 +4417,7 @@ void ami_refresh_window(struct gui_window_2 *gwin)
struct IBox *bbox;
int x0, x1, y0, y1, sx, sy;
- struct RegionRectangle *regrect, *nregrect;
+ struct RegionRectangle *regrect;
sx = gwin->bw->window->scrollx;
sy = gwin->bw->window->scrolly;
@@ -4705,7 +4691,6 @@ static void gui_set_search_ico(hlcache_handle *ico)
struct nsObject *node;
struct nsObject *nnode;
struct gui_window_2 *gwin;
- char fname[100];
struct bitmap *ico_bitmap;
if(IsMinListEmpty(window_list)) return;
@@ -4819,9 +4804,6 @@ static void gui_window_place_caret(struct gui_window *g, int x, int y, int heigh
static void gui_window_remove_caret(struct gui_window *g)
{
- struct IBox *bbox;
- int xs,ys;
-
if(!g) return;
if(g->c_h == 0) return;
@@ -4880,9 +4862,7 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
ULONG gid;
struct gui_window_2 *gwin = hook->h_Data;
struct IntuiWheelData *wheel;
- Object *reqrefresh = NULL;
struct Node *node = NULL;
- char *urltxt;
nsurl *url;
switch(msg->Class)
@@ -4955,8 +4935,7 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y)
{
struct IBox *bbox;
- ULONG xs,ys,width,height;
- int box_x=0,box_y=0;
+ ULONG xs, ys, width, height;
struct contextual_content data;
GetAttr(SPACE_AreaBox, (Object *)gwin->objects[GID_BROWSER],
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 400ced8..877ff09 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -198,7 +198,7 @@ enum
#define OPTS_MAX_TABS 10
#define OPTS_MAX_SCREEN 4
#define OPTS_MAX_PROXY 5
-#define OPTS_MAX_NATIVEBM 3
+#define OPTS_MAX_NATIVEBM 4
#define OPTS_MAX_DITHER 4
struct ami_gui_opts_window {
diff --git a/amiga/history_local.c b/amiga/history_local.c
index 1f710b2..4849c65 100755
--- a/amiga/history_local.c
+++ b/amiga/history_local.c
@@ -74,7 +74,6 @@ static void ami_history_scroller_hook(struct Hook *hook,Object *object,struct In
void ami_history_open(struct browser_window *bw, struct history *history)
{
int width, height;
- struct IBox *bbox;
assert(history);
@@ -239,7 +238,6 @@ BOOL ami_history_event(struct history_window *hw)
/* return TRUE if window destroyed */
ULONG class,result,relevent = 0;
uint16 code;
- struct MenuItem *item;
const char *url;
struct IBox *bbox;
ULONG xs, ys;
diff --git a/amiga/icon.c b/amiga/icon.c
index c5bc6ae..a6b61a2 100644
--- a/amiga/icon.c
+++ b/amiga/icon.c
@@ -139,7 +139,7 @@ bool amiga_icon_convert(struct content *c)
ULONG size;
int width = 0, height = 0;
long format = 0;
- int err = 0;
+ int err;
uint8 r, g, b, a;
ULONG offset;
const char *url;
@@ -365,7 +365,7 @@ void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct
ULONG *icondata1, *icondata2;
ULONG width, height;
long format = 0;
- int err = 0;
+ int err;
if(dobj == NULL) return;
@@ -420,11 +420,10 @@ void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct
void amiga_icon_superimpose_favicon(char *path, struct hlcache_handle *icon, char *type)
{
struct DiskObject *dobj = NULL;
- struct BitMap *bm = NULL;
ULONG *icondata1, *icondata2;
ULONG width, height;
long format = 0;
- int err = 0;
+ int err;
ULONG trans1, pals1;
ULONG trans2, pals2;
struct ColorRegister *pal1;
diff --git a/amiga/iff_dr2d.c b/amiga/iff_dr2d.c
index 0638b94..5709d41 100644
--- a/amiga/iff_dr2d.c
+++ b/amiga/iff_dr2d.c
@@ -31,7 +31,7 @@ ULONG numcols;
ULONG findcolour(ULONG newcol)
{
ULONG i;
- ULONG colour = 0xFFFFFFFF;
+ ULONG colr = 0xFFFFFFFF;
UBYTE red,grn,blu;
red = svgtiny_RED(newcol);
@@ -41,21 +41,20 @@ ULONG findcolour(ULONG newcol)
for(i=0;i<numcols;i++)
{
if((cm[i].red == red) && (cm[i].green == grn) && (cm[i].blue == blu))
- colour = i;
+ colr = i;
}
- return colour;
+ return colr;
}
void addcolour(ULONG newcol)
{
- int i;
- ULONG colour;
+ ULONG colr;
UBYTE red,grn,blu;
- colour = findcolour(newcol);
+ colr = findcolour(newcol);
- if(colour == 0xFFFFFFFF)
+ if(colr == 0xFFFFFFFF)
{
cm[numcols].red = svgtiny_RED(newcol);
cm[numcols].green = svgtiny_GREEN(newcol);
@@ -342,7 +341,6 @@ int main(int argc, char **argv)
{
BPTR fh = 0;
char *buffer;
- size_t n;
struct IFFHandle *iffh = NULL;
int64 size;
LONG rarray[] = {0,0};
diff --git a/amiga/launch.c b/amiga/launch.c
index ebd8229..0d25bcf 100755
--- a/amiga/launch.c
+++ b/amiga/launch.c
@@ -105,8 +105,6 @@ BOOL ami_openurl_check_list(struct MinList *list, const char *url)
void ami_openurl_open(void)
{
- struct ami_protocol *ami_p;
-
if(nsoption_bool(use_openurl_lib)) {
if(OpenURLBase = OpenLibrary("openurl.library",0))
IOpenURL = (struct OpenURLIFace *)GetInterface(OpenURLBase,"main",1,NULL);
diff --git a/amiga/menu.c b/amiga/menu.c
index 13b9c9c..234a958 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -456,8 +456,6 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
{
- int i;
-
gwin->menu = AllocVecTags(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1),
AVT_ClearWithValue, 0, TAG_DONE);
ami_init_menulabs(gwin);
@@ -1029,7 +1027,6 @@ static void ami_menu_item_hotlist_show(struct Hook *hook, APTR window, struct In
static void ami_menu_item_hotlist_entries(struct Hook *hook, APTR window, struct IntuiMessage *msg)
{
nsurl *url = hook->h_Data;
- nserror error;
struct gui_window_2 *gwin;
GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin);
diff --git a/amiga/misc.c b/amiga/misc.c
index ac9d245..c25c5d5 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -108,7 +108,7 @@ void die(const char *error)
char *url_to_path(const char *url)
{
- char *tmps, *unesc, *slash, *colon, *url2;
+ char *unesc, *slash, *colon, *url2;
if (strncmp(url, "file://", SLEN("file://")) != 0)
return NULL;
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 05db67f..0893c55 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -239,16 +239,16 @@ void ami_clearclipreg(struct gui_globals *gg)
gg->rect.MaxY = scrn->Height-1;
}
-static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colour)
+static ULONG ami_plot_obtain_pen(struct MinList *shared_pens, ULONG colr)
{
struct ami_plot_pen *node;
ULONG pen = ObtainBestPenA(scrn->ViewPort.ColorMap,
- (colour & 0x000000ff) << 24,
- (colour & 0x0000ff00) << 16,
- (colour & 0x00ff0000) << 8,
+ (colr & 0x000000ff) << 24,
+ (colr & 0x0000ff00) << 16,
+ (colr & 0x00ff0000) << 8,
NULL);
- if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colour));
+ if(pen == -1) LOG(("WARNING: Cannot allocate pen for ABGR:%lx", colr));
if(shared_pens != NULL) {
if(node = (struct ami_plot_pen *)AllocVecTagList(sizeof(struct ami_plot_pen), NULL)) {
@@ -278,26 +278,26 @@ void ami_plot_release_pens(struct MinList *shared_pens)
}while(node = nnode);
}
-static void ami_plot_setapen(ULONG colour)
+static void ami_plot_setapen(ULONG colr)
{
if(palette_mapped == false) {
SetRPAttrs(glob->rp, RPTAG_APenColor,
- ns_color_to_nscss(colour),
+ ns_color_to_nscss(colr),
TAG_DONE);
} else {
- ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour);
+ ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
if(pen != -1) SetAPen(glob->rp, pen);
}
}
-static void ami_plot_setopen(ULONG colour)
+static void ami_plot_setopen(ULONG colr)
{
if(palette_mapped == false) {
SetRPAttrs(glob->rp, RPTAG_OPenColor,
- ns_color_to_nscss(colour),
+ ns_color_to_nscss(colr),
TAG_DONE);
} else {
- ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour);
+ ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
if(pen != -1) SetOPen(glob->rp, pen);
}
}
@@ -945,7 +945,6 @@ bool ami_path(const float *p, unsigned int n, colour fill, float width,
colour c, const float transform[6])
{
unsigned int i;
- struct bez_point *old_p;
struct bez_point start_p, cur_p, p_a, p_b, p_c, p_r;
#ifdef AMI_PLOTTER_DEBUG
diff --git a/amiga/plugin_hack.c b/amiga/plugin_hack.c
index f78a67e..9bfd7a3 100644
--- a/amiga/plugin_hack.c
+++ b/amiga/plugin_hack.c
@@ -132,7 +132,7 @@ void amiga_plugin_hack_destroy(struct content *c)
{
amiga_plugin_hack_content *plugin = (amiga_plugin_hack_content *) c;
- LOG(("amiga_plugin_hack_destroy"));
+ LOG(("amiga_plugin_hack_destroy %p", plugin));
return;
}
diff --git a/amiga/plugin_hack.h b/amiga/plugin_hack.h
index ae79a1f..3d644ae 100644
--- a/amiga/plugin_hack.h
+++ b/amiga/plugin_hack.h
@@ -22,8 +22,6 @@
#include "utils/config.h"
#include "utils/errors.h"
-struct hlcache_handle;
-
nserror amiga_plugin_hack_init(void);
void amiga_plugin_hack_execute(struct hlcache_handle *c);
diff --git a/amiga/stringview/stringview.c b/amiga/stringview/stringview.c
index 5aea939..9aa110a 100755
--- a/amiga/stringview/stringview.c
+++ b/amiga/stringview/stringview.c
@@ -859,7 +859,6 @@ Class *MakeStringClass( void )
void FreeStringClass(Class *cl)
{
- struct Library *libbase;
URLHistory_Free();
FreeClass(cl);
}
--
NetSurf Browser
9 years, 1 month
netsurf: branch master updated. release/3.0-1185-g99c47eb
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/99c47eb99be4309e996f4...
...commit http://git.netsurf-browser.org/netsurf.git/commit/99c47eb99be4309e996f4cb...
...tree http://git.netsurf-browser.org/netsurf.git/tree/99c47eb99be4309e996f4cb03...
The branch, master has been updated
via 99c47eb99be4309e996f4cb038916260fd2bcb44 (commit)
from f0f05d691ba748314e57da754518dfbad6a7a339 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=99c47eb99be4309e996...
commit 99c47eb99be4309e996f4cb038916260fd2bcb44
Author: Steve Fryatt <stevef(a)netsurf-browser.org>
Commit: Steve Fryatt <stevef(a)netsurf-browser.org>
Allow mouse tracking events to terminate without a PointerLeaving event being received.
This change should handle the situation where a PointerEntering event is received without a corresponding PointerLeaving event, which appears to be caused by some third-party OS addons. This could cause unexpected consequences, so all such terminations are currently logged.
diff --git a/riscos/mouse.c b/riscos/mouse.c
index a20965e..e934c1c 100644
--- a/riscos/mouse.c
+++ b/riscos/mouse.c
@@ -163,9 +163,11 @@ void ro_mouse_drag_end(wimp_dragged *dragged)
* Start tracking the mouse in a window, providing a function to be called on
* null polls and optionally one to be called when it leaves the window.
*
- * \param *drag_end Callback for when the pointer leaves the window, or
- * NULL for none.
- * \param *drag_track Callback for mouse tracking while the pointer remains
+ * \param *poll_end Callback for when the pointer leaves the window, or
+ * NULL for none. Claimants can receive *leaving==NULL if
+ * a new tracker is started before a PointerLeaving event
+ * is received.
+ * \param *poll_track Callback for mouse tracking while the pointer remains
* in the window, or NULL for none.
* \param *data Data to be passed to the callback functions, or NULL.
*/
@@ -175,12 +177,31 @@ void ro_mouse_track_start(void (*poll_end)(wimp_leaving *leaving, void *data),
void *data)
{
/* It should never be possible for the mouse to be in two windows
- * at the same time!
+ * at the same time! However, some third-party extensions to RISC OS
+ * appear to make this possible (MouseAxess being one), so in the
+ * event that there's still a claimant we tidy them up first and then
+ * log the fact in case there are any unexpected consequences.
+ *
+ * NB: The Poll End callback will get called with *leaving == NULL in
+ * this situation, as there's no PointerLeaving event to pass on.
*/
- assert(ro_mouse_poll_end_callback == NULL &&
- ro_mouse_poll_track_callback == NULL &&
- ro_mouse_poll_data == NULL);
+ if (ro_mouse_poll_end_callback != NULL ||
+ ro_mouse_poll_track_callback != NULL ||
+ ro_mouse_poll_data != NULL) {
+ if (ro_mouse_poll_end_callback != NULL &&
+ ro_mouse_ignore_leaving_event == false)
+ ro_mouse_poll_end_callback(NULL, ro_mouse_poll_data);
+
+ LOG(("Unexpected mouse track termination."));
+
+ ro_mouse_ignore_leaving_event = false;
+ ro_mouse_poll_end_callback = NULL;
+ ro_mouse_poll_track_callback = NULL;
+ ro_mouse_poll_data = NULL;
+ }
+
+ /* Now record details of the new claimant. */
ro_mouse_poll_end_callback = poll_end;
ro_mouse_poll_track_callback = poll_track;
diff --git a/riscos/mouse.h b/riscos/mouse.h
index bcb3b50..8a7405a 100644
--- a/riscos/mouse.h
+++ b/riscos/mouse.h
@@ -65,9 +65,11 @@ void ro_mouse_drag_end(wimp_dragged *dragged);
* Start tracking the mouse in a window, providing a function to be called on
* null polls and optionally one to be called when it leaves the window.
*
- * \param *drag_end Callback for when the pointer leaves the window, or
- * NULL for none.
- * \param *drag_track Callback for mouse tracking while the pointer remains
+ * \param *poll_end Callback for when the pointer leaves the window, or
+ * NULL for none. Claimants can receive *leaving==NULL if
+ * a new tracker is started before a PointerLeaving event
+ * is received.
+ * \param *poll_track Callback for mouse tracking while the pointer remains
* in the window, or NULL for none.
* \param *data Data to be passed to the callback functions, or NULL.
*/
-----------------------------------------------------------------------
Summary of changes:
riscos/mouse.c | 35 ++++++++++++++++++++++++++++-------
riscos/mouse.h | 8 +++++---
2 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/riscos/mouse.c b/riscos/mouse.c
index a20965e..e934c1c 100644
--- a/riscos/mouse.c
+++ b/riscos/mouse.c
@@ -163,9 +163,11 @@ void ro_mouse_drag_end(wimp_dragged *dragged)
* Start tracking the mouse in a window, providing a function to be called on
* null polls and optionally one to be called when it leaves the window.
*
- * \param *drag_end Callback for when the pointer leaves the window, or
- * NULL for none.
- * \param *drag_track Callback for mouse tracking while the pointer remains
+ * \param *poll_end Callback for when the pointer leaves the window, or
+ * NULL for none. Claimants can receive *leaving==NULL if
+ * a new tracker is started before a PointerLeaving event
+ * is received.
+ * \param *poll_track Callback for mouse tracking while the pointer remains
* in the window, or NULL for none.
* \param *data Data to be passed to the callback functions, or NULL.
*/
@@ -175,12 +177,31 @@ void ro_mouse_track_start(void (*poll_end)(wimp_leaving *leaving, void *data),
void *data)
{
/* It should never be possible for the mouse to be in two windows
- * at the same time!
+ * at the same time! However, some third-party extensions to RISC OS
+ * appear to make this possible (MouseAxess being one), so in the
+ * event that there's still a claimant we tidy them up first and then
+ * log the fact in case there are any unexpected consequences.
+ *
+ * NB: The Poll End callback will get called with *leaving == NULL in
+ * this situation, as there's no PointerLeaving event to pass on.
*/
- assert(ro_mouse_poll_end_callback == NULL &&
- ro_mouse_poll_track_callback == NULL &&
- ro_mouse_poll_data == NULL);
+ if (ro_mouse_poll_end_callback != NULL ||
+ ro_mouse_poll_track_callback != NULL ||
+ ro_mouse_poll_data != NULL) {
+ if (ro_mouse_poll_end_callback != NULL &&
+ ro_mouse_ignore_leaving_event == false)
+ ro_mouse_poll_end_callback(NULL, ro_mouse_poll_data);
+
+ LOG(("Unexpected mouse track termination."));
+
+ ro_mouse_ignore_leaving_event = false;
+ ro_mouse_poll_end_callback = NULL;
+ ro_mouse_poll_track_callback = NULL;
+ ro_mouse_poll_data = NULL;
+ }
+
+ /* Now record details of the new claimant. */
ro_mouse_poll_end_callback = poll_end;
ro_mouse_poll_track_callback = poll_track;
diff --git a/riscos/mouse.h b/riscos/mouse.h
index bcb3b50..8a7405a 100644
--- a/riscos/mouse.h
+++ b/riscos/mouse.h
@@ -65,9 +65,11 @@ void ro_mouse_drag_end(wimp_dragged *dragged);
* Start tracking the mouse in a window, providing a function to be called on
* null polls and optionally one to be called when it leaves the window.
*
- * \param *drag_end Callback for when the pointer leaves the window, or
- * NULL for none.
- * \param *drag_track Callback for mouse tracking while the pointer remains
+ * \param *poll_end Callback for when the pointer leaves the window, or
+ * NULL for none. Claimants can receive *leaving==NULL if
+ * a new tracker is started before a PointerLeaving event
+ * is received.
+ * \param *poll_track Callback for mouse tracking while the pointer remains
* in the window, or NULL for none.
* \param *data Data to be passed to the callback functions, or NULL.
*/
--
NetSurf Browser
9 years, 1 month