mirror of
https://github.com/fltk/fltk.git
synced 2026-05-24 08:16:04 +08:00
Fix compiler warning [-Wsign-compare], remove dead (commented) code.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10831 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+13
-28
@@ -229,11 +229,7 @@ static void
|
||||
load_fonts(Display *dpy,
|
||||
XUtf8FontStruct *font_set) {
|
||||
|
||||
int i;
|
||||
/* char **list; */
|
||||
|
||||
i = 0;
|
||||
/* list = NULL; */
|
||||
int i = 0;
|
||||
|
||||
font_set->fonts = (XFontStruct**) malloc(sizeof(XFontStruct*) *
|
||||
font_set->nb_font);
|
||||
@@ -398,7 +394,7 @@ XUtf8DrawRtlString(Display *display,
|
||||
while (fnum < nb_font) {
|
||||
if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
|
||||
if (encodings[fnum] != 0 ||
|
||||
(ucs >= ranges[fnum * 2] && ucs <= ranges[fnum * 2 + 1])) {
|
||||
((int)ucs >= ranges[fnum * 2] && (int)ucs <= ranges[fnum * 2 + 1])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -515,8 +511,8 @@ XUtf8DrawString(Display *display,
|
||||
while (fnum < nb_font) {
|
||||
if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
|
||||
if (encodings[fnum] != 0 ||
|
||||
(ucs >= ranges[fnum * 2] &&
|
||||
ucs <= ranges[fnum * 2 + 1])) {
|
||||
((int)ucs >= ranges[fnum * 2] &&
|
||||
(int)ucs <= ranges[fnum * 2 + 1])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -648,8 +644,8 @@ XUtf8_measure_extents(
|
||||
while (fnum < nb_font) {
|
||||
if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
|
||||
if (encodings[fnum] != 0 ||
|
||||
(ucs >= ranges[fnum * 2] &&
|
||||
ucs <= ranges[fnum * 2 + 1])) {
|
||||
((int)ucs >= ranges[fnum * 2] &&
|
||||
(int)ucs <= ranges[fnum * 2 + 1])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -773,8 +769,8 @@ XUtf8TextWidth(XUtf8FontStruct *font_set,
|
||||
while (fnum < nb_font) {
|
||||
if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
|
||||
if (encodings[fnum] != 0 ||
|
||||
(ucs >= ranges[fnum * 2] &&
|
||||
ucs <= ranges[fnum * 2 + 1])) {
|
||||
((int)ucs >= ranges[fnum * 2] &&
|
||||
(int)ucs <= ranges[fnum * 2 + 1])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -821,19 +817,15 @@ fl_XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set,
|
||||
XFontStruct **fnt,
|
||||
unsigned short *id) {
|
||||
|
||||
/* int x; */
|
||||
int *encodings; /* encodings array */
|
||||
XFontStruct **fonts; /* fonts array */
|
||||
int fnum; /* index of the current font in the fonts array*/
|
||||
/* int i; */ /* current byte in the XChar2b buffer */
|
||||
int first; /* first valid font index */
|
||||
/* int last_fnum; */ /* font index of the previous char */
|
||||
int nb_font; /* quantity of fonts in the font array */
|
||||
char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */
|
||||
int *ranges; /* sub range of iso10646 */
|
||||
|
||||
nb_font = font_set->nb_font;
|
||||
/* x = 0; */
|
||||
|
||||
if (nb_font < 1) {
|
||||
/* there is no font in the font_set :-( */
|
||||
@@ -843,7 +835,6 @@ fl_XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set,
|
||||
ranges = font_set->ranges;
|
||||
fonts = font_set->fonts;
|
||||
encodings = font_set->encodings;
|
||||
/* i = 0; */
|
||||
fnum = 0;
|
||||
|
||||
while(fnum < nb_font && !fonts[fnum]) fnum++;
|
||||
@@ -853,18 +844,16 @@ fl_XGetUtf8FontAndGlyph(XUtf8FontStruct *font_set,
|
||||
}
|
||||
|
||||
first = fnum;
|
||||
/* last_fnum = fnum; */
|
||||
|
||||
/*
|
||||
* find the first encoding which can be used to
|
||||
* draw the glyph
|
||||
* find the first encoding which can be used to draw the glyph
|
||||
*/
|
||||
fnum = first;
|
||||
while (fnum < nb_font) {
|
||||
if (fonts[fnum] && ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
|
||||
if (encodings[fnum] != 0 ||
|
||||
(ucs >= ranges[fnum * 2] &&
|
||||
ucs <= ranges[fnum * 2 + 1])) {
|
||||
((int)ucs >= ranges[fnum * 2] &&
|
||||
(int)ucs <= ranges[fnum * 2 + 1])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -895,9 +884,7 @@ XUtf8UcsWidth(XUtf8FontStruct *font_set,
|
||||
XFontStruct **fonts; /* fonts array */
|
||||
Fl_XChar2b buf[8]; /* drawing buffer */
|
||||
int fnum; /* index of the current font in the fonts array*/
|
||||
/*int i;*/ /* current byte in the XChar2b buffer */
|
||||
int first; /* first valid font index */
|
||||
/*int last_fnum;*/ /* font index of the previous char */
|
||||
int nb_font; /* quantity of fonts in the font array */
|
||||
char glyph[2]; /* byte1 and byte2 value of the UTF-8 char */
|
||||
int *ranges; /* sub range of iso10646 */
|
||||
@@ -914,7 +901,6 @@ XUtf8UcsWidth(XUtf8FontStruct *font_set,
|
||||
ranges = font_set->ranges;
|
||||
fonts = font_set->fonts;
|
||||
encodings = font_set->encodings;
|
||||
/* i = 0; */
|
||||
fnum = 0;
|
||||
|
||||
while(fnum < nb_font && !fonts[fnum]) fnum++;
|
||||
@@ -924,7 +910,6 @@ XUtf8UcsWidth(XUtf8FontStruct *font_set,
|
||||
}
|
||||
|
||||
first = fnum;
|
||||
/* last_fnum = fnum; */
|
||||
|
||||
no_spc = XUtf8IsNonSpacing(ucs);
|
||||
if (no_spc) ucs = no_spc;
|
||||
@@ -937,8 +922,8 @@ XUtf8UcsWidth(XUtf8FontStruct *font_set,
|
||||
while (fnum < nb_font) {
|
||||
if (fonts[fnum] &&
|
||||
ucs2fontmap(glyph, ucs, encodings[fnum]) >= 0) {
|
||||
if (encodings[fnum] != 0 || (ucs >= ranges[fnum * 2] &&
|
||||
ucs <= ranges[fnum * 2 + 1])) {
|
||||
if (encodings[fnum] != 0 || ((int)ucs >= ranges[fnum * 2] &&
|
||||
(int)ucs <= ranges[fnum * 2 + 1])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user