diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2008-05-16 09:37:22 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2008-05-16 09:37:22 +0000 |
commit | b15a6af3d29ad844bdd44eb6181d069958afab5b (patch) | |
tree | 7c59b84724c59a3f8df76902841f19c36837f5d6 /riscos | |
parent | baca6796eb96fac3cf79400f9cdb588b49f78930 (diff) | |
download | netsurf-b15a6af3d29ad844bdd44eb6181d069958afab5b.tar.gz netsurf-b15a6af3d29ad844bdd44eb6181d069958afab5b.tar.bz2 |
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
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/textarea.c | 3 | ||||
-rw-r--r-- | riscos/url_complete.c | 3 | ||||
-rw-r--r-- | riscos/url_complete.h | 4 | ||||
-rw-r--r-- | riscos/wimp_event.c | 5 | ||||
-rw-r--r-- | riscos/window.c | 5 |
5 files changed, 11 insertions, 9 deletions
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 <inttypes.h> #include <stdbool.h> #include <stdint.h> #include <string.h> @@ -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 <stdio.h> #include <stdlib.h> #include <string.h> -#include <wchar.h> #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 <inttypes.h> #include <stdbool.h> -#include <wchar.h> #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 <assert.h>
+#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
@@ -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 <assert.h> #include <ctype.h> +#include <inttypes.h> #include <math.h> #include <stdio.h> #include <stdbool.h> @@ -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) { |