From d67e9ccb73bff691d5e5ae53fab64206558c3069 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 27 Feb 2016 17:27:21 +0000 Subject: Fix compiler warnings (STR #2988) - final commit. This commit includes all fixes from branch-1.3 (svn r 11243) and additional fixes for warnings that crept in during the porting efforts, particularly C++ ("//") comments in C and included header files, and some more. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11246 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Printer.H | 2 +- FL/fl_utf8.h | 12 ++++---- fluid/CodeEditor.cxx | 2 +- fluid/Fl_Type.cxx | 16 +++++------ fluid/Fl_Widget_Type.cxx | 4 +-- fluid/Makefile | 2 +- fluid/file.cxx | 2 +- src/Fl.cxx | 2 +- src/Fl_File_Chooser2.cxx | 2 +- src/Fl_File_Icon.cxx | 2 +- src/Fl_Help_View.cxx | 2 +- src/Fl_Input_.cxx | 2 +- src/Fl_XBM_Image.cxx | 2 +- src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx | 6 ++-- src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx | 8 ++++-- src/filename_absolute.cxx | 2 +- src/filename_expand.cxx | 2 +- src/fl_call_main.c | 4 +-- src/fl_draw.cxx | 2 +- src/fl_utf.c | 34 +++++++++++------------ src/scandir.c | 3 ++ src/vsnprintf.c | 2 +- src/xutf8/case.c | 4 +++ src/xutf8/is_right2left.c | 2 +- src/xutf8/is_spacing.c | 4 +++ src/xutf8/keysym2Ucs.c | 2 +- src/xutf8/lcUniConv/cp936ext.h | 8 +++--- src/xutf8/utf8Input.c | 2 +- src/xutf8/utf8Utils.c | 2 +- src/xutf8/utf8Wrap.c | 10 +++---- test/checkers.cxx | 2 +- 31 files changed, 83 insertions(+), 68 deletions(-) diff --git a/FL/Fl_Printer.H b/FL/Fl_Printer.H index 214165092..cdc4fd319 100644 --- a/FL/Fl_Printer.H +++ b/FL/Fl_Printer.H @@ -103,7 +103,7 @@ protected: #endif -#if defined(FL_DOXYGEN) || !(__APPLE__ || WIN32 || FL_PORTING) +#if defined(FL_DOXYGEN) || !(defined(__APPLE__) || defined(WIN32) || defined(FL_PORTING)) /** Print support under Unix/Linux. diff --git a/FL/fl_utf8.h b/FL/fl_utf8.h index e1dc45bdc..306cf3c58 100644 --- a/FL/fl_utf8.h +++ b/FL/fl_utf8.h @@ -53,7 +53,7 @@ # undef chdir # define chdir _chdir # endif -#elif defined(__APPLE__) // PORTME: should not be in the header +#elif defined(__APPLE__) /* PORTME: should not be in the header */ # include # include # define xchar wchar_t @@ -130,7 +130,7 @@ FL_EXPORT unsigned fl_utf8toa (const char *src, unsigned srclen, char *dst, unsi FL_EXPORT unsigned fl_utf8froma (char *dst, unsigned dstlen, const char *src, unsigned srclen); /* F2: Returns true if the current O/S locale is UTF-8 */ -FL_EXPORT int fl_utf8locale(); +FL_EXPORT int fl_utf8locale(void); /* F2: Examine the first len characters of src, to determine if the input text is UTF-8 or not * NOTE: The value returned is not simply boolean - it contains information about the probable @@ -164,12 +164,12 @@ FL_EXPORT char *fl_utf8_to_locale(const char *s, int len, unsigned int codepage) /* OD: Attempt to convert a string in the current locale to UTF-8 */ FL_EXPORT char *fl_locale_to_utf8(const char *s, int len, unsigned int codepage); -#elif defined(__APPLE__) // PORTME: Fl_Screen_Driver ? - platform text encoding and conversion - // not needed +#elif defined(__APPLE__) /* PORTME: Fl_Screen_Driver ? - platform text encoding and conversion */ + /* not needed */ #elif defined(FL_PORTING) # pragma message "FL_PORTING: do you want to be able to convert from a local charset to utf8?" -#else // X11 - // not needed +#else /* X11 */ + /* not needed */ #endif /***************************************************************************** diff --git a/fluid/CodeEditor.cxx b/fluid/CodeEditor.cxx index 89dbe6bb6..f262f70dd 100644 --- a/fluid/CodeEditor.cxx +++ b/fluid/CodeEditor.cxx @@ -359,7 +359,7 @@ int CodeEditor::auto_indent(int, CodeEditor* e) { char *text = e->buffer()->text_range(start, pos); char *ptr; - for (ptr = text; isspace(*ptr); ptr ++); + for (ptr = text; isspace(*ptr); ptr ++) {/*empty*/} *ptr = '\0'; if (*text) { // use only a single 'insert' call to avoid redraw issues diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx index debe8b2e1..bbeb779af 100644 --- a/fluid/Fl_Type.cxx +++ b/fluid/Fl_Type.cxx @@ -522,7 +522,7 @@ int Widget_Browser::handle(int e) { k->visible = 1; if (k->is_parent() && !k->open_) { Fl_Type *j; - for (j = k->next; j && j->level>k->level; j = j->next); + for (j = k->next; j && j->level>k->level; j = j->next) {/*empty*/} k = j; } else k = k->next; @@ -579,7 +579,7 @@ void Fl_Type::add(Fl_Type *p) { Fl_Type *q; int newlevel; if (p) { - for (q = p->next; q && q->level > p->level; q = q->next); + for (q = p->next; q && q->level > p->level; q = q->next) {/*empty*/} newlevel = p->level+1; } else { q = 0; @@ -774,7 +774,7 @@ void select_all_cb(Fl_Widget *,void *) { Fl_Type *p = Fl_Type::current ? Fl_Type::current->parent : 0; if (in_this_only) { Fl_Type *t = p; - for (; t && t != in_this_only; t = t->parent); + for (; t && t != in_this_only; t = t->parent) {/*empty*/} if (t != in_this_only) p = in_this_only; } for (;;) { @@ -798,7 +798,7 @@ void select_none_cb(Fl_Widget *,void *) { Fl_Type *p = Fl_Type::current ? Fl_Type::current->parent : 0; if (in_this_only) { Fl_Type *t = p; - for (; t && t != in_this_only; t = t->parent); + for (; t && t != in_this_only; t = t->parent) {/*empty*/} if (t != in_this_only) p = in_this_only; } for (;;) { @@ -820,7 +820,7 @@ void select_none_cb(Fl_Widget *,void *) { static void delete_children(Fl_Type *p) { Fl_Type *f; - for (f = p; f && f->next && f->next->level > p->level; f = f->next); + for (f = p; f && f->next && f->next->level > p->level; f = f->next) {/*empty*/} for (; f != p; ) { Fl_Type *g = f->prev; delete f; @@ -851,7 +851,7 @@ void Fl_Type::move_before(Fl_Type* g) { if (level != g->level) printf("move_before levels don't match! %d %d\n", level, g->level); Fl_Type* n; - for (n = next; n && n->level > level; n = n->next); + for (n = next; n && n->level > level; n = n->next) {/*empty*/} if (n == g) return; Fl_Type *l = n ? n->prev : Fl_Type::last; prev->next = n; @@ -875,7 +875,7 @@ void earlier_cb(Fl_Widget*,void*) { Fl_Type* nxt = f->next; if (f->selected) { Fl_Type* g; - for (g = f->prev; g && g->level > f->level; g = g->prev); + for (g = f->prev; g && g->level > f->level; g = g->prev) {/*empty*/} if (g && g->level == f->level && !g->selected) { f->move_before(g); mod = 1; @@ -893,7 +893,7 @@ void later_cb(Fl_Widget*,void*) { Fl_Type* prv = f->prev; if (f->selected) { Fl_Type* g; - for (g = f->next; g && g->level > f->level; g = g->next); + for (g = f->next; g && g->level > f->level; g = g->next) {/*empty*/} if (g && g->level == f->level && !g->selected) { g->move_before(f); mod = 1; diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index d2574921a..2e1ed417b 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -1976,7 +1976,7 @@ const char *array_name(Fl_Widget_Type *o) { Fl_Type *t = o->prev; Fl_Type *tp = o; const char *cn = o->class_name(1); - for (; t && t->class_name(1) == cn; tp = t, t = t->prev); + for (; t && t->class_name(1) == cn; tp = t, t = t->prev) {/*empty*/} for (t = tp; t && t->class_name(1) == cn; t = t->next) { if (t == o) {sawthis=1; continue;} const char *e = t->name(); @@ -2710,7 +2710,7 @@ int Fl_Widget_Type::read_fdesign(const char* propname, const char* value) { if (sscanf(value,"%f %f %f %f",&x,&y,&w,&h) == 4) { if (fdesign_flip) { Fl_Type *p; - for (p = parent; p && !p->is_window(); p = p->parent); + for (p = parent; p && !p->is_window(); p = p->parent) {/*empty*/} if (p && p->is_widget()) y = ((Fl_Widget_Type*)p)->o->h()-(y+h); } x += pasteoffset; diff --git a/fluid/Makefile b/fluid/Makefile index a6ee5716d..f1602587f 100644 --- a/fluid/Makefile +++ b/fluid/Makefile @@ -57,7 +57,7 @@ fluid-shared$(EXEEXT): $(OBJECTS) ../src/$(DSONAME) ../src/$(FLDSONAME) \ $(CXX) $(ARCHFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LINKSHARED) $(LDLIBS) clean: - -$(RM) *.o core.* *~ *.bck *.bck *.bak + -$(RM) *.o core.* *~ *.bck *.bak -$(RM) core fluid$(EXEEXT) fluid-shared$(EXEEXT) -$(RM) fluid.app/Contents/MacOS/fluid$(EXEEXT) diff --git a/fluid/file.cxx b/fluid/file.cxx index 92ab8925a..bc0d049bf 100644 --- a/fluid/file.cxx +++ b/fluid/file.cxx @@ -339,7 +339,7 @@ int write_file(const char *filename, int selected_only) { p->write(); write_string("\n"); int q = p->level; - for (p = p->next; p && p->level > q; p = p->next); + for (p = p->next; p && p->level > q; p = p->next) {/*empty*/} } else { p = p->next; } diff --git a/src/Fl.cxx b/src/Fl.cxx index a27a187fd..c086d63e7 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -870,7 +870,7 @@ void Fl::remove_handler(Fl_Event_Handler ha) { handler_link *l, *p; // Search for the handler in the list... - for (l = handlers, p = 0; l && l->handle != ha; p = l, l = l->next); + for (l = handlers, p = 0; l && l->handle != ha; p = l, l = l->next) {/*empty*/} if (l) { // Found it, so remove it from the list... diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 72ecac18e..fea0b3328 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -1410,7 +1410,7 @@ Fl_File_Chooser::update_preview() if (*ptr || ptr == preview_text_) { for (ptr = preview_text_; *ptr && (isprint(*ptr & 255) || isspace(*ptr & 255)); - ptr ++); + ptr ++) {/*empty*/} } if (*ptr || ptr == preview_text_) { diff --git a/src/Fl_File_Icon.cxx b/src/Fl_File_Icon.cxx index e6cfe76ea..08832a7f3 100644 --- a/src/Fl_File_Icon.cxx +++ b/src/Fl_File_Icon.cxx @@ -125,7 +125,7 @@ Fl_File_Icon::~Fl_File_Icon() { // Find the icon in the list... for (current = first_, prev = (Fl_File_Icon *)0; current != this && current != (Fl_File_Icon *)0; - prev = current, current = current->next_); + prev = current, current = current->next_) {/*empty*/} // Remove the icon from the list as needed... if (current) diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx index 9800cb22c..4ae4f298c 100644 --- a/src/Fl_Help_View.cxx +++ b/src/Fl_Help_View.cxx @@ -1268,7 +1268,7 @@ void Fl_Help_View::format() { // Copy the title in the document... for (s = title_; *ptr != '<' && *ptr && s < (title_ + sizeof(title_) - 1); - *s++ = *ptr++); + *s++ = *ptr++) {/*empty*/} *s = '\0'; s = buf; diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index 085ca80a6..f80b59c8e 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -1220,7 +1220,7 @@ int Fl_Input_::static_value(const char* str, int len) { int i = 0; // find first different character: if (value_) { - for (; i= temp && !isdirsep(*b); b--); + for (b = a-1; b >= temp && !isdirsep(*b); b--) {/*empty*/} if (b < temp) break; a = b; start += 3; diff --git a/src/filename_expand.cxx b/src/filename_expand.cxx index 383e5dcd4..ff687f7d5 100644 --- a/src/filename_expand.cxx +++ b/src/filename_expand.cxx @@ -70,7 +70,7 @@ int fl_filename_expand(char *to,int tolen, const char *from) { int ret = 0; for (char *a=temp; a #include -#if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform unicode +#if defined(WIN32) || defined(__APPLE__) /* PORTME: Fl_Screen_Driver - platform unicode */ #elif defined(FL_PORTING) # pragma message "FL_PORTING: look out for some unicode functions here. Default should be fine though." #else @@ -136,7 +136,7 @@ static unsigned short cp1252[32] = { */ unsigned fl_utf8decode(const char* p, const char* end, int* len) { - unsigned char c = *(unsigned char*)p; + unsigned char c = *(const unsigned char*)p; if (c < 0x80) { if (len) *len = 1; return c; @@ -155,17 +155,17 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len) ((p[0] & 0x1f) << 6) + ((p[1] & 0x3f)); } else if (c == 0xe0) { - if (((unsigned char*)p)[1] < 0xa0) goto FAIL; + if (((const unsigned char*)p)[1] < 0xa0) goto FAIL; goto UTF8_3; #if STRICT_RFC3629 } else if (c == 0xed) { /* RFC 3629 says surrogate chars are illegal. */ - if (((unsigned char*)p)[1] >= 0xa0) goto FAIL; + if (((const unsigned char*)p)[1] >= 0xa0) goto FAIL; goto UTF8_3; } else if (c == 0xef) { /* 0xfffe and 0xffff are also illegal characters */ - if (((unsigned char*)p)[1]==0xbf && - ((unsigned char*)p)[2]>=0xbe) goto FAIL; + if (((const unsigned char*)p)[1]==0xbf && + ((const unsigned char*)p)[2]>=0xbe) goto FAIL; goto UTF8_3; #endif } else if (c < 0xf0) { @@ -177,7 +177,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len) ((p[1] & 0x3f) << 6) + ((p[2] & 0x3f)); } else if (c == 0xf0) { - if (((unsigned char*)p)[1] < 0x90) goto FAIL; + if (((const unsigned char*)p)[1] < 0x90) goto FAIL; goto UTF8_4; } else if (c < 0xf4) { UTF8_4: @@ -186,8 +186,8 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len) #if STRICT_RFC3629 /* RFC 3629 says all codes ending in fffe or ffff are illegal: */ if ((p[1]&0xf)==0xf && - ((unsigned char*)p)[2] == 0xbf && - ((unsigned char*)p)[3] >= 0xbe) goto FAIL; + ((const unsigned char*)p)[2] == 0xbf && + ((const unsigned char*)p)[3] >= 0xbe) goto FAIL; #endif return ((p[0] & 0x07) << 18) + @@ -195,7 +195,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len) ((p[2] & 0x3f) << 6) + ((p[3] & 0x3f)); } else if (c == 0xf4) { - if (((unsigned char*)p)[1] > 0x8f) goto FAIL; /* after 0x10ffff */ + if (((const unsigned char*)p)[1] > 0x8f) goto FAIL; /* after 0x10ffff */ goto UTF8_4; } else { FAIL: @@ -327,9 +327,9 @@ int fl_utf8encode(unsigned ucs, char* buf) { return 4; } else { /* encode 0xfffd: */ - buf[0] = 0xefU; - buf[1] = 0xbfU; - buf[2] = 0xbdU; + buf[0] = (char)0xef; + buf[1] = (char)0xbf; + buf[2] = (char)0xbd; return 3; } } @@ -562,7 +562,7 @@ unsigned fl_utf8toa(const char* src, unsigned srclen, if (dstlen) for (;;) { unsigned char c; if (p >= e) {dst[count] = 0; return count;} - c = *(unsigned char*)p; + c = *(const unsigned char*)p; if (c < 0xC2) { /* ascii or bad code */ dst[count] = c; p++; @@ -710,7 +710,7 @@ unsigned fl_utf8froma(char* dst, unsigned dstlen, if (dstlen) for (;;) { unsigned char ucs; if (p >= e) {dst[count] = 0; return count;} - ucs = *(unsigned char*)p++; + ucs = *(const unsigned char*)p++; if (ucs < 0x80U) { dst[count++] = ucs; if (count >= dstlen) {dst[count-1] = 0; break;} @@ -722,7 +722,7 @@ unsigned fl_utf8froma(char* dst, unsigned dstlen, } /* we filled dst, measure the rest: */ while (p < e) { - unsigned char ucs = *(unsigned char*)p++; + unsigned char ucs = *(const unsigned char*)p++; if (ucs < 0x80U) { count++; } else { @@ -812,7 +812,7 @@ unsigned fl_utf8to_mb(const char* src, unsigned srclen, wchar_t lbuf[1024]; wchar_t* buf = lbuf; unsigned length = fl_utf8towc(src, srclen, buf, 1024); - int ret; // note: wcstombs() returns unsigned(length) or unsigned(-1) + int ret; /* note: wcstombs() returns unsigned(length) or unsigned(-1) */ if (length >= 1024) { buf = (wchar_t*)(malloc((length+1)*sizeof(wchar_t))); fl_utf8towc(src, srclen, buf, length+1); diff --git a/src/scandir.c b/src/scandir.c index c08e48f0c..c3d5d63a0 100644 --- a/src/scandir.c +++ b/src/scandir.c @@ -27,6 +27,9 @@ # endif /* HAVE_SCANDIR */ #endif +/* Avoid "ISO C forbids an empty translation unit" warning */ +typedef int dummy; + /* * End of "$Id$". */ diff --git a/src/vsnprintf.c b/src/vsnprintf.c index 0fae17ca5..a4e5bc9c0 100644 --- a/src/vsnprintf.c +++ b/src/vsnprintf.c @@ -254,7 +254,7 @@ int fl_vsnprintf(char* buffer, size_t bufsize, const char* format, va_list ap) { if (bufptr) *bufptr = '\0'; return (bytes); -#endif //HAVE_VSNPRINTF +#endif /* HAVE_VSNPRINTF */ } int fl_snprintf(char* str, size_t size, const char* fmt, ...) { diff --git a/src/xutf8/case.c b/src/xutf8/case.c index f55d08e36..8efc0e397 100644 --- a/src/xutf8/case.c +++ b/src/xutf8/case.c @@ -19,6 +19,10 @@ * This file is required on all platforms for UTF-8 support */ +#if !defined(WIN32) && !defined(__APPLE__) +# include "../Xutf8.h" +#endif /* !defined(WIN32) && !defined(__APPLE__) */ + #include "headers/case.h" #include diff --git a/src/xutf8/is_right2left.c b/src/xutf8/is_right2left.c index d44f05937..e79a55f25 100644 --- a/src/xutf8/is_right2left.c +++ b/src/xutf8/is_right2left.c @@ -14,7 +14,7 @@ * http://www.fltk.org/str.php */ -#if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform unicode +#if defined(WIN32) || defined(__APPLE__) /* PORTME: Fl_Screen_Driver - platform unicode */ #elif defined(FL_PORTING) # pragma message "FL_PORTING: utf8 functionality" #else diff --git a/src/xutf8/is_spacing.c b/src/xutf8/is_spacing.c index c97222420..6e3d6abd3 100644 --- a/src/xutf8/is_spacing.c +++ b/src/xutf8/is_spacing.c @@ -18,6 +18,10 @@ * This file is required on all platforms for utf8 support */ +#if !defined(WIN32) && !defined(__APPLE__) +# include "../Xutf8.h" +#endif /* !defined(WIN32) && !defined(__APPLE__) */ + #include "headers/spacing.h" unsigned short diff --git a/src/xutf8/keysym2Ucs.c b/src/xutf8/keysym2Ucs.c index b83b5ef8f..b811d4054 100644 --- a/src/xutf8/keysym2Ucs.c +++ b/src/xutf8/keysym2Ucs.c @@ -17,7 +17,7 @@ #define KEYSYM2UCS_INCLUDED #if defined(WIN32) -#elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform unicode +#elif defined(__APPLE__) /* PORTME: Fl_Screen_Driver - platform unicode */ #elif defined(FL_PORTING) # pragma message "FL_PORTING: do you want to include Xutf8.h?" #else diff --git a/src/xutf8/lcUniConv/cp936ext.h b/src/xutf8/lcUniConv/cp936ext.h index 8d0207ff8..64bd0fc97 100644 --- a/src/xutf8/lcUniConv/cp936ext.h +++ b/src/xutf8/lcUniConv/cp936ext.h @@ -3,7 +3,7 @@ * * Character encoding support for the Fast Light Tool Kit (FLTK). * - * Copyright 1998-2010 by Bill Spitzak and others. + * Copyright 1998-2016 by Bill Spitzak and others. * * This library is free software. Distribution and use rights are outlined in * the file "COPYING" which should have been included with this file. If this @@ -16,9 +16,9 @@ * http://www.fltk.org/str.php */ -#if defined(WIN32) || defined(__APPLE__) // PORTME: is this really needed? It's huge! +#if defined(WIN32) || defined(__APPLE__) /* PORTME: is this really needed? It's huge! */ - // not needed + /* not needed */ #elif defined(FL_PORTING) @@ -6251,7 +6251,7 @@ cp936ext_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) #endif /* CP936 */ -#endif /* __APPLE__ WIN32 */ // PORTME: Unicode stuff +#endif /* __APPLE__ WIN32 */ /* PORTME: Unicode stuff */ /* * End of "$Id$". diff --git a/src/xutf8/utf8Input.c b/src/xutf8/utf8Input.c index 2eef627aa..bba400271 100644 --- a/src/xutf8/utf8Input.c +++ b/src/xutf8/utf8Input.c @@ -15,7 +15,7 @@ */ #if defined(WIN32) -#elif defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform unicode +#elif defined(__APPLE__) /* PORTME: Fl_Screen_Driver - platform unicode */ #elif defined(FL_PORTING) # pragma message "FL_PORTING: do you want to include Xutf8.h?" #else diff --git a/src/xutf8/utf8Utils.c b/src/xutf8/utf8Utils.c index 0af7bf48c..41343f459 100644 --- a/src/xutf8/utf8Utils.c +++ b/src/xutf8/utf8Utils.c @@ -14,7 +14,7 @@ * http://www.fltk.org/str.php */ -#if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform unicode +#if defined(WIN32) || defined(__APPLE__) /* PORTME: Fl_Screen_Driver - platform unicode */ #elif defined(FL_PORTING) # pragma message "FL_PORTING: utf8" #else diff --git a/src/xutf8/utf8Wrap.c b/src/xutf8/utf8Wrap.c index cbff3ecb4..27e048cfe 100644 --- a/src/xutf8/utf8Wrap.c +++ b/src/xutf8/utf8Wrap.c @@ -14,7 +14,7 @@ * http://www.fltk.org/str.php */ -#if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform unicode +#if defined(WIN32) || defined(__APPLE__) /* PORTME: Fl_Screen_Driver - platform unicode */ #elif defined(FL_PORTING) # pragma message "FL_PORTING: utf8" #else @@ -389,7 +389,7 @@ XUtf8DrawRtlString(Display *display, ptr = buf + 128; } - ulen = XFastConvertUtf8ToUcs((unsigned char*)string, num_bytes, &ucs); + ulen = XFastConvertUtf8ToUcs((const unsigned char*)string, num_bytes, &ucs); if (ulen < 1) ulen = 1; @@ -506,7 +506,7 @@ XUtf8DrawString(Display *display, i = 0; } - ulen = XFastConvertUtf8ToUcs((unsigned char*)string, num_bytes, &ucs); + ulen = XFastConvertUtf8ToUcs((const unsigned char*)string, num_bytes, &ucs); if (ulen < 1) ulen = 1; @@ -639,7 +639,7 @@ XUtf8_measure_extents( i = 0; } - ulen = XFastConvertUtf8ToUcs((unsigned char*)string, num_bytes, &ucs); + ulen = XFastConvertUtf8ToUcs((const unsigned char*)string, num_bytes, &ucs); if (ulen < 1) ulen = 1; @@ -762,7 +762,7 @@ XUtf8TextWidth(XUtf8FontStruct *font_set, i = 0; } - ulen = XFastConvertUtf8ToUcs((unsigned char*)string, num_bytes, &ucs); + ulen = XFastConvertUtf8ToUcs((const unsigned char*)string, num_bytes, &ucs); if (ulen < 1) ulen = 1; diff --git a/test/checkers.cxx b/test/checkers.cxx index 59c7de134..b9adf95b2 100644 --- a/test/checkers.cxx +++ b/test/checkers.cxx @@ -500,7 +500,7 @@ int fullexpand(node *f, int level) { node* n = f->son; if (!n->jump && n->brother) {if (level<1) return(1); level--;} int i; - node* sons[32]; for (i=0; (sons[i++] = n); n = n->brother); + node* sons[32]; for (i=0; (sons[i++] = n); n = n->brother) {/*empty*/} int ret = 1; for (i=0; ret && (n = sons[i++]);) { makemove(n); -- cgit v1.2.3