Skip to content

Commit

Permalink
Fixes to help build on SGI.
Browse files Browse the repository at this point in the history
Mainly: problem with C++ style comments that were in C code and headers.
SGI C compiler / pre processor no grok C++ comments.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8347 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
erco77 committed Feb 1, 2011
1 parent 5759f31 commit 9510d1d
Show file tree
Hide file tree
Showing 31 changed files with 98 additions and 97 deletions.
6 changes: 3 additions & 3 deletions src/fl_utf.c
Expand Up @@ -124,10 +124,10 @@ static unsigned short cp1252[32] = {
unexpectedly 1 will work:
\code
if (*p & 0x80) { // what should be a multibyte encoding
if (*p & 0x80) { // what should be a multibyte encoding
code = fl_utf8decode(p,end,&len);
if (len<2) code = 0xFFFD; // Turn errors into REPLACEMENT CHARACTER
} else { // handle the 1-byte utf8 encoding:
if (len<2) code = 0xFFFD; // Turn errors into REPLACEMENT CHARACTER
} else { // handle the 1-byte utf8 encoding:
code = *p;
len = 1;
}
Expand Down
12 changes: 6 additions & 6 deletions src/scandir_win32.c
Expand Up @@ -49,9 +49,9 @@ int fl_scandir(const char *dirname, struct dirent ***namelist,
if (!findIn) return -1;
strcpy(findIn, dirname);

//#if defined(__GNUC__)
//#warning FIXME This probably needs to be MORE UTF8 aware now
//#endif /*__GNUC__*/
/* #if defined(__GNUC__) */
/* #warning FIXME This probably needs to be MORE UTF8 aware now */
/* #endif */
for (d = findIn; *d; d++) if (*d=='/') *d='\\';
if ((len==0)) { strcpy(findIn, ".\\*"); }
if ((len==2)&&findIn[1]==':'&&isalpha(findIn[0])) { *d++ = '\\'; *d = 0; }
Expand All @@ -64,8 +64,8 @@ int fl_scandir(const char *dirname, struct dirent ***namelist,
strcpy(d, "\\*");
}
{ /* Create a block to limit the scope while we find the initial "wide" filename */
// unsigned short * wbuf = (unsigned short*)malloc(sizeof(short) *(len + 10));
// wbuf[fl_utf2unicode(findIn, strlen(findIn), wbuf)] = 0;
/* unsigned short * wbuf = (unsigned short*)malloc(sizeof(short) *(len + 10)); */
/* wbuf[fl_utf2unicode(findIn, strlen(findIn), wbuf)] = 0; */
unsigned short *wbuf = NULL;
unsigned wlen = fl_utf8toUtf16(findIn, strlen(findIn), NULL, 0); /* Pass NULL to query length */
wlen++; /* add a little extra for termination etc. */
Expand All @@ -89,7 +89,7 @@ int fl_scandir(const char *dirname, struct dirent ***namelist,
int dstlen = l * 5 + 1;
selectDir=(struct dirent*)malloc(sizeof(struct dirent)+dstlen);

// l = fl_unicode2utf(findw.cFileName, l, selectDir->d_name);
/* l = fl_unicode2utf(findw.cFileName, l, selectDir->d_name); */
l = fl_utf8fromwc(selectDir->d_name, dstlen, findw.cFileName, l);

selectDir->d_name[l] = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/xutf8/fl_wcwidth.c
Expand Up @@ -44,7 +44,7 @@ static int mk_wcswidth_cjk(const unsigned int *pwcs, size_t n);
#include "mk_wcwidth.c"

int fl_wcwidth(unsigned int ucs) {
// warning: we have problems if sizeof(wchar_t) == 2 and ucs > 0xffff
/* warning: we have problems if sizeof(wchar_t) == 2 and ucs > 0xffff */
return mk_wcwidth(ucs);
}

Expand Down
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/big5.h
Expand Up @@ -1880,7 +1880,7 @@ big5_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned short big5_2charset[13703] = {
Expand Down Expand Up @@ -4142,4 +4142,4 @@ big5_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_TOOSMALL;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/cp1251.h
Expand Up @@ -49,7 +49,7 @@ cp1251_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char cp1251_page00[32] = {
Expand Down Expand Up @@ -114,4 +114,4 @@ cp1251_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */
70 changes: 35 additions & 35 deletions src/xutf8/lcUniConv/cp936ext.h
@@ -1,29 +1,29 @@
//
// "$Id$"
//
// Character encoding support for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
/*
* "$Id$"
*
* Character encoding support for the Fast Light Tool Kit (FLTK).
*
* Copyright 1998-2010 by Bill Spitzak and others.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems on the following page:
*
* http://www.fltk.org/str.php
*/

#if !defined(WIN32) && !defined(__APPLE__)

Expand All @@ -34,15 +34,15 @@ cp936ext_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
{
return 0;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static int
cp936ext_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
{
return 0;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */

#else
/*
Expand Down Expand Up @@ -3206,7 +3206,7 @@ cp936ext_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB

Expand Down Expand Up @@ -6248,12 +6248,12 @@ cp936ext_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_TOOSMALL;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */

#endif // CP936
#endif /* CP936 */

#endif // __APPLE__ WIN32
#endif /* __APPLE__ WIN32 */

//
// End of "$Id$".
//
/*
* End of "$Id$".
*/
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/gb2312.h
Expand Up @@ -1088,7 +1088,7 @@ gb2312_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned short gb2312_2charset[7445] = {
Expand Down Expand Up @@ -2553,4 +2553,4 @@ gb2312_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_TOOSMALL;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */
6 changes: 3 additions & 3 deletions src/xutf8/lcUniConv/gbk_tab_to_h.c
Expand Up @@ -332,9 +332,9 @@ static void output_uni2charset_dense (const char* name, Encoding* enc)
p = -1;
for (t = 0; t < tableno; t++)
if (tables[t].usecount > 1) {
//p = tables[t].minline >> 5;
/* p = tables[t].minline >> 5; */
p = tables[t].minline ;
//printf("static const unsigned short %s_page%02x[%d] = {\n", name, p, 8*(tables[t].maxline-tables[t].minline+1));
/* printf("static const unsigned short %s_page%02x[%d] = {\n", name, p, 8*(tables[t].maxline-tables[t].minline+1)); */
printf("static const unsigned short %s_page%04x[%d] = {\n", name, p, 8*(tables[t].maxline-tables[t].minline+1));
for (j1 = tables[t].minline; j1 <= tables[t].maxline; j1++) {
if ((j1 % 0x20) == 0 && j1 > tables[t].minline)
Expand Down Expand Up @@ -382,7 +382,7 @@ static void output_uni2charset_dense (const char* name, Encoding* enc)
} else {
printf("if (wc >= 0x%04x && wc < 0x%04x)", 8*j1, 8*j2);
}
//printf("\n c = %s_page%02x[wc", name, j1 >> 5);
/* printf("\n c = %s_page%02x[wc", name, j1 >> 5); */
printf("\n c = %s_page%04x[wc", name, j1);
if (tables[t].minline > 0)
printf("-0x%04x", 8*j1);
Expand Down
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/iso8859_10.h
Expand Up @@ -36,7 +36,7 @@ iso8859_10_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
*pwc = (ucs4_t) iso8859_10_2uni[c-0xa0];
return 1;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char iso8859_10_page00[224] = {
Expand Down Expand Up @@ -89,4 +89,4 @@ iso8859_10_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/iso8859_11.h
Expand Up @@ -45,7 +45,7 @@ iso8859_11_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char iso8859_11_page0e[96] = {
Expand Down Expand Up @@ -79,4 +79,4 @@ iso8859_11_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/iso8859_13.h
Expand Up @@ -36,7 +36,7 @@ iso8859_13_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
*pwc = (ucs4_t) iso8859_13_2uni[c-0xa0];
return 1;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char iso8859_13_page00[224] = {
Expand Down Expand Up @@ -92,4 +92,4 @@ iso8859_13_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/iso8859_14.h
Expand Up @@ -36,7 +36,7 @@ iso8859_14_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
*pwc = (ucs4_t) c;
return 1;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char iso8859_14_page00[96] = {
Expand Down Expand Up @@ -110,4 +110,4 @@ iso8859_14_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/iso8859_15.h
Expand Up @@ -24,7 +24,7 @@ iso8859_15_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
*pwc = (ucs4_t) c;
return 1;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char iso8859_15_page00[32] = {
Expand Down Expand Up @@ -64,4 +64,4 @@ iso8859_15_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/iso8859_2.h
Expand Up @@ -36,7 +36,7 @@ iso8859_2_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
*pwc = (ucs4_t) iso8859_2_2uni[c-0xa0];
return 1;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char iso8859_2_page00[224] = {
Expand Down Expand Up @@ -97,4 +97,4 @@ iso8859_2_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
return RET_ILSEQ;
}
*/
#endif // NEED_TOMB
#endif /* NEED_TOMB */
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/iso8859_3.h
Expand Up @@ -43,7 +43,7 @@ iso8859_3_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char iso8859_3_page00[96] = {
Expand Down Expand Up @@ -101,4 +101,4 @@ iso8859_3_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/iso8859_4.h
Expand Up @@ -36,7 +36,7 @@ iso8859_4_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
*pwc = (ucs4_t) iso8859_4_2uni[c-0xa0];
return 1;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char iso8859_4_page00[224] = {
Expand Down Expand Up @@ -95,4 +95,4 @@ iso8859_4_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/iso8859_5.h
Expand Up @@ -36,7 +36,7 @@ iso8859_5_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
*pwc = (ucs4_t) iso8859_5_2uni[c-0xa0];
return 1;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char iso8859_5_page00[16] = {
Expand Down Expand Up @@ -78,4 +78,4 @@ iso8859_5_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/iso8859_6.h
Expand Up @@ -43,7 +43,7 @@ iso8859_6_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char iso8859_6_page00[16] = {
Expand Down Expand Up @@ -81,4 +81,4 @@ iso8859_6_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */
4 changes: 2 additions & 2 deletions src/xutf8/lcUniConv/iso8859_7.h
Expand Up @@ -43,7 +43,7 @@ iso8859_7_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOWC
#endif /* NEED_TOWC */

#ifdef NEED_TOMB
static const unsigned char iso8859_7_page00[32] = {
Expand Down Expand Up @@ -89,4 +89,4 @@ iso8859_7_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n)
}
return RET_ILSEQ;
}
#endif // NEED_TOMB
#endif /* NEED_TOMB */

0 comments on commit 9510d1d

Please sign in to comment.