From b15a6af3d29ad844bdd44eb6181d069958afab5b Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 16 May 2008 09:37:22 +0000 Subject: s/wchar_t/uint32_t/g We always assumed that the keycode type was 32bits wide, anyway. wchar_t isn't guaranteed to be that big, so isn't remotely portable. svn path=/trunk/netsurf/; revision=4165 --- riscos/textarea.c | 3 ++- riscos/url_complete.c | 3 +-- riscos/url_complete.h | 4 ++-- riscos/wimp_event.c | 5 +++-- riscos/window.c | 5 +++-- 5 files changed, 11 insertions(+), 9 deletions(-) (limited to 'riscos') diff --git a/riscos/textarea.c b/riscos/textarea.c index 63a2356c0..49b31b704 100644 --- a/riscos/textarea.c +++ b/riscos/textarea.c @@ -20,6 +20,7 @@ * Single/Multi-line UTF-8 text area (implementation) */ +#include #include #include #include @@ -907,7 +908,7 @@ bool textarea_mouse_click(wimp_pointer *pointer) */ bool textarea_key_press(wimp_key *key) { - wchar_t c = (wchar_t)key->c; + uint32_t c = (uint32_t) key->c; wimp_key keypress; struct text_area *ta; char utf8[7]; diff --git a/riscos/url_complete.c b/riscos/url_complete.c index 9085ba85c..144ceba3c 100644 --- a/riscos/url_complete.c +++ b/riscos/url_complete.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "oslib/wimp.h" #include "content/urldb.h" #include "utils/log.h" @@ -92,7 +91,7 @@ void ro_gui_url_complete_start(struct gui_window *g) * \param key the key pressed (as UTF32 code or wimp key + bit31 set) * \return true to indicate keypress handled, false otherwise */ -bool ro_gui_url_complete_keypress(struct gui_window *g, wchar_t key) +bool ro_gui_url_complete_keypress(struct gui_window *g, uint32_t key) { wimp_window_state state; char *match_url; diff --git a/riscos/url_complete.h b/riscos/url_complete.h index 1c0849efa..299135791 100644 --- a/riscos/url_complete.h +++ b/riscos/url_complete.h @@ -23,14 +23,14 @@ #ifndef _NETSURF_RISCOS_URLCOMPLETE_H_ #define _NETSURF_RISCOS_URLCOMPLETE_H_ +#include #include -#include #include "oslib/wimp.h" struct gui_window; void ro_gui_url_complete_start(struct gui_window *g); -bool ro_gui_url_complete_keypress(struct gui_window *g, wchar_t key); +bool ro_gui_url_complete_keypress(struct gui_window *g, uint32_t key); void ro_gui_url_complete_resize(struct gui_window *g, wimp_open *open); bool ro_gui_url_complete_close(struct gui_window *g, wimp_i i); void ro_gui_url_complete_redraw(wimp_draw *redraw); diff --git a/riscos/wimp_event.c b/riscos/wimp_event.c index 243df6829..951c8e96b 100644 --- a/riscos/wimp_event.c +++ b/riscos/wimp_event.c @@ -21,6 +21,7 @@ */ #include +#include #include #include #include @@ -653,13 +654,13 @@ void ro_gui_wimp_event_ok_click(struct event_window *window, wimp_mouse_state st bool ro_gui_wimp_event_keypress(wimp_key *key) { static int *ucstable = NULL; static int alphabet = 0; - static wchar_t wc = 0; /* buffer for UTF8 alphabet */ + static uint32_t wc = 0; /* buffer for UTF8 alphabet */ static int shift = 0; struct event_window *window; struct icon_event *event; wimp_pointer pointer; wimp_key k; - wchar_t c = (wchar_t)key->c; + uint32_t c = (uint32_t) key->c; int t_alphabet; os_error *error; diff --git a/riscos/window.c b/riscos/window.c index a50e7b4c4..0ae8aa077 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -2288,7 +2289,7 @@ bool ro_gui_window_keypress(wimp_key *key) os_error *error; wimp_pointer pointer; float scale; - wchar_t c = (wchar_t)key->c; + uint32_t c = (uint32_t) key->c; /* Find gui window */ if ((g = ro_gui_window_lookup(key->w)) != NULL) { @@ -2367,7 +2368,7 @@ bool ro_gui_window_keypress(wimp_key *key) /* Reset c to incoming character / key code * as we may have corrupted it above */ - c = (wchar_t)key->c; + c = (uint32_t) key->c; } switch (c) { -- cgit v1.2.3