summaryrefslogtreecommitdiff
path: root/desktop/browser.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-02-25 17:58:00 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-02-25 17:58:00 +0000
commit1cf46a6792a9e243edb857e131e44338bcbbd341 (patch)
tree9d145155307f4bc19746e486c7cd49ef897a49a1 /desktop/browser.c
parent674591f63df9c9b1e8e02aef4992a24b39cda0fc (diff)
downloadnetsurf-1cf46a6792a9e243edb857e131e44338bcbbd341.tar.gz
netsurf-1cf46a6792a9e243edb857e131e44338bcbbd341.tar.bz2
SignednessWarnings.squash()
Aside from a number of instances of const being cast away (mostly relating to the urldb, which is correct to only export const data) this now builds warning-free with GCC 4 on x86, which is nice. svn path=/trunk/netsurf/; revision=3868
Diffstat (limited to 'desktop/browser.c')
-rw-r--r--desktop/browser.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index 3cfcd0352..27fcd6ad1 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -1422,7 +1422,7 @@ void browser_window_mouse_action_html(struct browser_window *bw,
if (text_box) {
int pixel_offset;
- int idx;
+ size_t idx;
nsfont_position_in_string(text_box->style,
text_box->text,
@@ -1431,7 +1431,8 @@ void browser_window_mouse_action_html(struct browser_window *bw,
&idx,
&pixel_offset);
- selection_click(bw->sel, mouse, text_box->byte_offset + idx);
+ selection_click(bw->sel, mouse,
+ text_box->byte_offset + idx);
if (selection_dragging(bw->sel)) {
bw->drag_type = DRAGGING_SELECTION;
@@ -1456,9 +1457,10 @@ void browser_window_mouse_action_html(struct browser_window *bw,
}
else if (text_box) {
int pixel_offset;
- int idx;
+ size_t idx;
- if (mouse & (BROWSER_MOUSE_DRAG_1 | BROWSER_MOUSE_DRAG_2))
+ if (mouse & (BROWSER_MOUSE_DRAG_1 |
+ BROWSER_MOUSE_DRAG_2))
selection_init(bw->sel, gadget_box);
nsfont_position_in_string(text_box->style,
@@ -1468,7 +1470,8 @@ void browser_window_mouse_action_html(struct browser_window *bw,
&idx,
&pixel_offset);
- selection_click(bw->sel, mouse, text_box->byte_offset + idx);
+ selection_click(bw->sel, mouse,
+ text_box->byte_offset + idx);
if (selection_dragging(bw->sel))
bw->drag_type = DRAGGING_SELECTION;
@@ -1546,7 +1549,7 @@ void browser_window_mouse_action_html(struct browser_window *bw,
if (text_box) {
int pixel_offset;
- int idx;
+ size_t idx;
nsfont_position_in_string(text_box->style,
text_box->text,
@@ -1555,14 +1558,18 @@ void browser_window_mouse_action_html(struct browser_window *bw,
&idx,
&pixel_offset);
- if (selection_click(bw->sel, mouse, text_box->byte_offset + idx)) {
- /* key presses must be directed at the main browser
- * window, paste text operations ignored */
+ if (selection_click(bw->sel, mouse,
+ text_box->byte_offset + idx)) {
+ /* key presses must be directed at the
+ * main browser window, paste text
+ * operations ignored */
browser_window_remove_caret(bw);
if (selection_dragging(bw->sel)) {
- bw->drag_type = DRAGGING_SELECTION;
- status = messages_get("Selecting");
+ bw->drag_type =
+ DRAGGING_SELECTION;
+ status =
+ messages_get("Selecting");
} else
status = c->status_message;
@@ -1805,7 +1812,7 @@ void browser_window_mouse_track_html(struct browser_window *bw,
&dx, &dy, dir);
if (box) {
int pixel_offset;
- int idx;
+ size_t idx;
nsfont_position_in_string(box->style,
box->text,
@@ -1814,7 +1821,8 @@ void browser_window_mouse_track_html(struct browser_window *bw,
&idx,
&pixel_offset);
- selection_track(bw->sel, mouse, box->byte_offset + idx);
+ selection_track(bw->sel, mouse,
+ box->byte_offset + idx);
}
}
break;
@@ -1877,7 +1885,7 @@ void browser_window_mouse_drag_end(struct browser_window *bw,
if (c) {
bool found = true;
int dir = -1;
- int idx;
+ size_t idx;
if (selection_dragging_start(bw->sel)) dir = 1;
@@ -1889,7 +1897,8 @@ void browser_window_mouse_drag_end(struct browser_window *bw,
box = browser_window_pick_text_box(bw, mouse, x, y,
&dx, &dy, dir);
if (box) {
- nsfont_position_in_string(box->style,
+ nsfont_position_in_string(
+ box->style,
box->text,
box->length,
dx,
@@ -1897,7 +1906,8 @@ void browser_window_mouse_drag_end(struct browser_window *bw,
&pixel_offset);
idx += box->byte_offset;
- selection_track(bw->sel, mouse, idx);
+ selection_track(bw->sel, mouse,
+ idx);
}
else
found = false;