From 4fcefc68f8cf9c2648c7140a08fa492c29896c3f Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 29 Mar 2016 09:29:51 +0000 Subject: Remove the platform-dependent type xchar File fl_utf8.h defines the xchar type with a platform-dependent value (wchar_t or unsigned short). But it is used exclusively by WIN32 code (0 use in cross-platform code, 0 use in APPLE or in USE_X11 code). Thus, we can just get rid of this type and replace it by wchar_t where it is used. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11459 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx | 8 ++++---- src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx index 58049c562..9de668c69 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx @@ -93,10 +93,10 @@ enumcbw(CONST LOGFONTW *lpelf, if (!p && lpelf->lfCharSet != ANSI_CHARSET) return 1; char *n = NULL; size_t l = wcslen(lpelf->lfFaceName); - unsigned dstlen = fl_utf8fromwc(n, 0, (xchar*)lpelf->lfFaceName, (unsigned) l) + 1; // measure the string + unsigned dstlen = fl_utf8fromwc(n, 0, (wchar_t*)lpelf->lfFaceName, (unsigned) l) + 1; // measure the string n = (char*) malloc(dstlen); -//n[fl_unicode2utf((xchar*)lpelf->lfFaceName, l, n)] = 0; - dstlen = fl_utf8fromwc(n, dstlen, (xchar*)lpelf->lfFaceName, (unsigned) l); // convert the string +//n[fl_unicode2utf((wchar_t*)lpelf->lfFaceName, l, n)] = 0; + dstlen = fl_utf8fromwc(n, dstlen, (wchar_t*)lpelf->lfFaceName, (unsigned) l); // convert the string n[dstlen] = 0; for (int i=0; iname+1, strlen(s->name+1)); // unsigned short *b = (unsigned short*) malloc((l + 1) * sizeof(short)); -// fl_utf2unicode((unsigned char*)s->name+1, l, (xchar*)b); +// fl_utf2unicode((unsigned char*)s->name+1, l, (wchar_t*)b); const char *nm = (const char*)s->name+1; size_t len = strlen(s->name+1); unsigned l = fl_utf8toUtf16(nm, (unsigned) len, NULL, 0); // Pass NULL to query length required diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx index 5c59818a8..d79bc26ae 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx @@ -434,7 +434,7 @@ void Fl_WinAPI_Window_Driver::label(const char *name,const char *iname) { if (!name) name = ""; size_t l = strlen(name); // WCHAR *lab = (WCHAR*) malloc((l + 1) * sizeof(short)); - // l = fl_utf2unicode((unsigned char*)name, l, (xchar*)lab); + // l = fl_utf2unicode((unsigned char*)name, l, (wchar_t*)lab); unsigned wlen = fl_utf8toUtf16(name, (unsigned) l, NULL, 0); // Pass NULL to query length wlen++; unsigned short * lab = (unsigned short*)malloc(sizeof(unsigned short)*wlen); -- cgit v1.2.3