summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-01-01 19:12:20 +0000
committerVincent Sanders <vince@kyllikki.org>2014-01-01 19:12:20 +0000
commitad3f3590e455213543678adda014af0281e2e98d (patch)
tree508637471bf39ea7007aac5fb13583f96e2e5bc2
parent62047c923443415c59ec75b70e788e7d702c39b2 (diff)
parent375ee78d1c99d04427c7d96096d85e983333fa5d (diff)
downloadnetsurf-ad3f3590e455213543678adda014af0281e2e98d.tar.gz
netsurf-ad3f3590e455213543678adda014af0281e2e98d.tar.bz2
Merge branch 'mmu_man/haiku-fixes'
-rw-r--r--beos/gui.cpp52
-rw-r--r--beos/scaffolding.cpp3
-rw-r--r--beos/window.cpp3
-rw-r--r--css/select.c4
-rw-r--r--desktop/treeview.c2
-rw-r--r--utils/bloom.c3
6 files changed, 45 insertions, 22 deletions
diff --git a/beos/gui.cpp b/beos/gui.cpp
index ffaccc83b..04a52bbd7 100644
--- a/beos/gui.cpp
+++ b/beos/gui.cpp
@@ -38,6 +38,7 @@
#include <Mime.h>
#include <Path.h>
#include <Roster.h>
+#include <Screen.h>
#include <String.h>
extern "C" {
@@ -440,20 +441,23 @@ set_colour_from_ui(struct nsoption_s *opts,
enum nsoption_e option,
colour def_colour)
{
- if (ui != NOCOL) {
- rgb_color c;
- if (ui == B_DESKTOP_COLOR) {
+ if (ui != NOCOL) {
+ rgb_color c;
+ if (ui == B_DESKTOP_COLOR) {
BScreen s;
c = s.DesktopColor();
- } else {
- c = ui_color(ui);
- }
+ } else {
+ c = ui_color(ui);
+ }
- def_colour = ((((uint32_t)c.blue << 16) & 0xff0000) |
- ((c.green << 8) & 0x00ff00) |
- ((c.red) & 0x0000ff));
- }
- return def_colour;
+ def_colour = ((((uint32_t)c.blue << 16) & 0xff0000) |
+ ((c.green << 8) & 0x00ff00) |
+ ((c.red) & 0x0000ff));
+ }
+
+ opts[option].value.c = def_colour;
+
+ return NSERROR_OK;
}
/**
@@ -544,8 +548,8 @@ int main(int argc, char** argv)
die("NetSurf failed to initialise");
}
- gui_init(argc, argv);
- gui_init2(argc, argv);
+ gui_init(argc, argv);
+ gui_init2(argc, argv);
netsurf_main_loop();
@@ -557,6 +561,7 @@ int main(int argc, char** argv)
/** called when replicated from NSBaseView::Instantiate() */
int gui_init_replicant(int argc, char** argv)
{
+ nserror ret;
BPath options;
if (find_directory(B_USER_SETTINGS_DIRECTORY, &options, true) == B_OK) {
options.Append("x-vnd.NetSurf");
@@ -569,8 +574,22 @@ int gui_init_replicant(int argc, char** argv)
*/
nslog_init(nslog_stream_configure, &argc, argv);
- /* initialise netsurf */
- netsurf_init(&argc, &argv, options.Path(), messages);
+ // FIXME: use options as readonly for replicants
+ /* user options setup */
+ ret = nsoption_init(set_defaults, &nsoptions, &nsoptions_default);
+ if (ret != NSERROR_OK) {
+ // FIXME: must not die when in replicant!
+ die("Options failed to initialise");
+ }
+ nsoption_read(options.Path(), NULL);
+ nsoption_commandline(&argc, argv, NULL);
+
+ /* common initialisation */
+ ret = netsurf_init(messages);
+ if (ret != NSERROR_OK) {
+ // FIXME: must not die when in replicant!
+ die("NetSurf failed to initialise");
+ }
gui_init(argc, argv);
gui_init2(argc, argv);
@@ -593,7 +612,8 @@ void gui_init(int argc, char** argv)
}
// ui_color() gives hardcoded values before BApplication is created.
- nsbeos_update_system_ui_colors();
+ //FIXME:
+ //nsbeos_update_system_ui_colors();
fetch_rsrc_register();
diff --git a/beos/scaffolding.cpp b/beos/scaffolding.cpp
index 7834db419..252a816dc 100644
--- a/beos/scaffolding.cpp
+++ b/beos/scaffolding.cpp
@@ -702,7 +702,8 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
break;
}
case B_UI_SETTINGS_CHANGED:
- nsbeos_update_system_ui_colors();
+ //FIXME:
+ //nsbeos_update_system_ui_colors();
nsbeos_scaffolding_update_colors(scaffold);
break;
case B_NETPOSITIVE_OPEN_URL:
diff --git a/beos/window.cpp b/beos/window.cpp
index 64ef616bb..5c5df96b3 100644
--- a/beos/window.cpp
+++ b/beos/window.cpp
@@ -650,7 +650,8 @@ void nsbeos_dispatch_event(BMessage *message)
case B_MOUSE_WHEEL_CHANGED:
break;
case B_UI_SETTINGS_CHANGED:
- nsbeos_update_system_ui_colors();
+ //FIXME:
+ //nsbeos_update_system_ui_colors();
break;
case 'nsLO': // login
{
diff --git a/css/select.c b/css/select.c
index a69c77033..ee0e7dacd 100644
--- a/css/select.c
+++ b/css/select.c
@@ -1637,8 +1637,6 @@ css_error node_is_link(void *pw, void *n, bool *match)
*/
css_error node_is_visited(void *pw, void *node, bool *match)
{
- *match = false;
-
nscss_select_ctx *ctx = pw;
nsurl *url;
nserror error;
@@ -1648,6 +1646,8 @@ css_error node_is_visited(void *pw, void *node, bool *match)
dom_node *n = node;
dom_string *s = NULL;
+ *match = false;
+
exc = dom_node_get_node_name(n, &s);
if ((exc != DOM_NO_ERR) || (s == NULL)) {
return CSS_NOMEM;
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 0681b95ec..a137c46c5 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -96,7 +96,7 @@ struct treeview_node {
struct treeview_node_entry {
treeview_node base;
- struct treeview_field fields[];
+ struct treeview_field fields[FLEX_ARRAY_LEN_DECL];
}; /**< Entry class inherits node base class */
struct treeview_pos {
diff --git a/utils/bloom.c b/utils/bloom.c
index 1b07d6f1b..df9e76e1c 100644
--- a/utils/bloom.c
+++ b/utils/bloom.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include "utils/bloom.h"
+#include "utils/utils.h"
/**
* Hash a string, returning a 32bit value. The hash algorithm used is
@@ -50,7 +51,7 @@ static inline uint32_t fnv(const char *datum, size_t len)
struct bloom_filter {
size_t size;
uint32_t items;
- uint8_t filter[];
+ uint8_t filter[FLEX_ARRAY_LEN_DECL];
};
struct bloom_filter *bloom_create(size_t size)