Author: spitzak
Date: 2010-04-15 10:19:27 -0700 (Thu, 15 Apr 2010)
New Revision: 7513
Log:
Fixed warning messages from modern gcc compilers
Modified:
trunk/fluid/FunctionType.cxx
trunk/fluid/MenuType.cxx
trunk/fluid/WidgetType.cxx
trunk/fluid/WindowType.cxx
trunk/fluid/code.cxx
trunk/fluid/coding_style_func.cxx
trunk/src/Adjuster.cxx
trunk/src/Browser.cxx
trunk/src/Choice.cxx
trunk/src/CycleButton.cxx
trunk/src/FileBrowser.cxx
trunk/src/FloatInput.cxx
trunk/src/Input.cxx
trunk/src/InputBrowser.cxx
trunk/src/Menu_popup.cxx
trunk/src/NumericInput.cxx
trunk/src/PackedGroup.cxx
trunk/src/Preferences.cxx
trunk/src/Scrollbar.cxx
trunk/src/ShortcutAssignment.cxx
trunk/src/TabGroup.cxx
trunk/src/TiledGroup.cxx
trunk/src/ValueInput.cxx
trunk/src/Widget.cxx
trunk/src/Widget_draw.cxx
trunk/src/compose.cxx
trunk/src/default_glyph.cxx
trunk/src/drawtext.cxx
trunk/src/run.cxx
trunk/src/xpmImage.cxx
trunk/test/checkers.cxx
trunk/test/navigation.cxx
trunk/test/utf.cxx
Modified: trunk/fluid/FunctionType.cxx
===================================================================
--- trunk/fluid/FunctionType.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/fluid/FunctionType.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -29,7 +29,7 @@
#include <fltk/ask.h>
#include <fltk/Preferences.h>
#include <fltk/Browser.h>
-#include <string.h>
+#include <fltk/string.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
@@ -253,8 +253,8 @@
FluidType *child;
char attr[256];
if (attributes) {
- strncpy(attr, attributes, 255);
- strcat(attr, " ");
+ strlcpy(attr, attributes, sizeof(attr));
+ strlcat(attr, " ", sizeof(attr));
} else
attr[0] = 0;
for (child = first_child; child; child = child->next_brother)
@@ -531,11 +531,11 @@
const char* c = name();
if (!c) return;
// handle putting #include or extern or typedef into decl:
- if (!isalpha(*c) && *c != '~'
- || !strncmp(c,"extern",6) && isspace(c[6])
- || !strncmp(c,"class",5) && isspace(c[5])
- || !strncmp(c,"typedef",7) && isspace(c[7])
- // || !strncmp(c,"struct",6) && isspace(c[6])
+ if ((!isalpha(*c) && *c != '~')
+ || (!strncmp(c,"extern",6) && isspace(c[6]))
+ || (!strncmp(c,"class",5) && isspace(c[5]))
+ || (!strncmp(c,"typedef",7) && isspace(c[7]))
+ // || (!strncmp(c,"struct",6) && isspace(c[6]))
) {
if (public_) {
char * s = strdup(c);
@@ -1029,10 +1029,10 @@
parent=parent->parent_namespace;
} while (parent);
- strncpy(sFull,list[nlist-1],sizeof(sFull));
+ strlcpy(sFull, list[nlist-1], sizeof(sFull));
for (i=nlist-2; i>=0;i--) {
- if (i<nlist-1) strncat(sFull,"::",sizeof(sFull));
- strncat(sFull,list[i],sizeof(sFull));
+ if (i<nlist-1) strlcat(sFull, "::", sizeof(sFull));
+ strlcat(sFull, list[i], sizeof(sFull));
}
}
return sFull;
Modified: trunk/fluid/MenuType.cxx
===================================================================
--- trunk/fluid/MenuType.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/fluid/MenuType.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -134,10 +134,10 @@
if (e == fltk::KEY) {
if (!value()) return 0;
unsigned v = fltk::event_text()[0];
- if (v > 32 && v < 0x7f || v > 0xa0 && v <= 0xff) {
- v = v | fltk::event_state()&(fltk::META|fltk::ALT|fltk::CTRL);
+ if ((v > 32 && v < 0x7f) || (v > 0xa0 && v <= 0xff)) {
+ v = v | (fltk::event_state()&(fltk::META|fltk::ALT|fltk::CTRL));
} else {
- v = fltk::event_state()&(fltk::META|fltk::ALT|fltk::CTRL|fltk::SHIFT) |
fltk::event_key();
+ v = (fltk::event_state()&(fltk::META|fltk::ALT|fltk::CTRL|fltk::SHIFT))
| fltk::event_key();
if (v == fltk::BackSpaceKey && svalue) v = 0;
}
if (v != svalue) {svalue = v; do_callback(); redraw();}
Modified: trunk/fluid/WidgetType.cxx
===================================================================
--- trunk/fluid/WidgetType.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/fluid/WidgetType.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -1531,7 +1531,7 @@
if (!e) continue;
if (strncmp(c,e,d-c)) continue;
int n1 = strtol(e+(d-c)+1,0,0);
- if (n1 > num || n1==num && sawthis) return 0;
+ if (n1 > num || (n1 == num && sawthis)) return 0;
}
static char buffer[128];
strncpy(buffer,c,d-c+1);
Modified: trunk/fluid/WindowType.cxx
===================================================================
--- trunk/fluid/WindowType.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/fluid/WindowType.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -366,10 +366,10 @@
int ox = 0; int oy = 0;
fltk::Group* p = o->o->parent();
while (p->parent()) {ox += p->x(); oy += p->y(); p = p->parent();}
- if (drag&LEFT) if (X+ox==bx) X += dx; else if (X<bx+dx-ox) X = bx+dx-ox;
- if (drag&BOTTOM) if (Y+oy==by) Y += dy; else if (Y<by+dy-oy) Y = by+dy-oy;
- if (drag&RIGHT) if (R+ox==br) R += dx; else if (R>br+dx-ox) R = br+dx-ox;
- if (drag&TOP) if (T+oy==bt) T += dy; else if (T>bt+dx-oy) T = bt+dx-oy;
+ if (drag&LEFT) {if (X+ox==bx) X += dx; else if (X<bx+dx-ox) X = bx+dx-ox;}
+ if (drag&BOTTOM) {if (Y+oy==by) Y += dy; else if (Y<by+dy-oy) Y =
by+dy-oy;}
+ if (drag&RIGHT) {if (R+ox==br) R += dx; else if (R>br+dx-ox) R = br+dx-ox;}
+ if (drag&TOP) {if (T+oy==bt) T += dy; else if (T>bt+dx-oy) T = bt+dx-oy;}
}
if (R<X) {int n = X; X = R; R = n;}
if (T<Y) {int n = Y; Y = T; T = n;}
Modified: trunk/fluid/code.cxx
===================================================================
--- trunk/fluid/code.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/fluid/code.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -42,7 +42,7 @@
// return true if c can be in a C identifier. I needed this so
// it is not messed up by locale settings:
int is_id(char c) {
- return c>='a' && c<='z' || c>='A' && c<='Z' || c>='0' && c<='9' || c=='_';
+ return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9') ||
c=='_';
}
////////////////////////////////////////////////////////////////
@@ -205,7 +205,7 @@
// consume them as part of the quoted sequence. Use string constant
// pasting to avoid this:
c = *w;
- if (w < e && (c>='0'&&c<='9' || c>='a'&&c<='f' || c>='A'&&c<='F')) {
+ if (w < e && ((c>='0'&&c<='9') || (c>='a'&&c<='f') || (c>='A'&&c<='F')))
{
putc('\"', code_file); linelength++;
if (linelength >= 79) {fputs("\n",code_file); linelength = 0;}
putc('\"', code_file); linelength++;
Modified: trunk/fluid/coding_style_func.cxx
===================================================================
--- trunk/fluid/coding_style_func.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/fluid/coding_style_func.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -102,25 +102,25 @@
const char *get_opening_brace(int isfunction)
{
- static char buffer[256];
- if(isfunction && !gbrace_functions)
- return " {\n";
- if(gbrace_style == 1)
- if(isfunction)
- return " {\n";
- else
- return " {";
- if(gbrace_style == 2)
- {
- sprintf(buffer, "\n%s{\n", indent());
- return buffer;
- }
- if(gbrace_style == 3) {
- static char buffer[20];
- sprintf(buffer, "\n%s{\n", get_indent_string(1));
- return(buffer);
- }
- return " {\n";
+ static char buffer[256];
+ if (isfunction && !gbrace_functions)
+ return " {\n";
+ if (gbrace_style == 1) {
+ if(isfunction)
+ return " {\n";
+ else
+ return " {";
+ }
+ if (gbrace_style == 2) {
+ sprintf(buffer, "\n%s{\n", indent());
+ return buffer;
+ }
+ if (gbrace_style == 3) {
+ static char buffer[20];
+ sprintf(buffer, "\n%s{\n", get_indent_string(1));
+ return(buffer);
+ }
+ return " {\n";
}
void show_coding_style_cb(fltk::Widget *, void *)
Modified: trunk/src/Adjuster.cxx
===================================================================
--- trunk/src/Adjuster.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/Adjuster.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -80,7 +80,7 @@
}
Rectangle r(W,H);
- Flags flags = this->flags() & ~(STATE|PUSHED|HIGHLIGHT) | OUTPUT;
+ Flags flags = (this->flags() & ~(STATE|PUSHED|HIGHLIGHT)) | OUTPUT;
for (int i = 1; i < 4; i++) {
Flags f = flags;
if (drag == i) f |= PUSHED;
Modified: trunk/src/Browser.cxx
===================================================================
--- trunk/src/Browser.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/Browser.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -1407,7 +1407,7 @@
case RELEASE:
goto_mark(FOCUS);
if (!item()) goto RELEASE;
- if (openclose_drag == 1 || event_clicks() && item_is_parent()) {
+ if (openclose_drag == 1 || (event_clicks() && item_is_parent())) {
// toggle the open/close state of this item:
set_item_opened(!item_is_open());
event_is_click(0); // make next click not be double
@@ -1523,7 +1523,7 @@
return 0;
}
// go to the 0'th item if needed (otherwise go to the focus):
- if (!indexes[0] && !level || layout_damage() || !goto_mark(FOCUS)) {
+ if (!(indexes[0] || level) || layout_damage() || !goto_mark(FOCUS)) {
HERE.level = 0;
HERE.open_level = 0;
HERE.position = 0;
Modified: trunk/src/Choice.cxx
===================================================================
--- trunk/src/Choice.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/Choice.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -81,7 +81,7 @@
r.move_r(-w1);
// draw the little mark at the right:
if (damage() & (DAMAGE_ALL|DAMAGE_HIGHLIGHT)) {
- drawstyle(style(), flags() & ~FOCUSED | OUTPUT);
+ drawstyle(style(), (flags() & ~FOCUSED) | OUTPUT);
Rectangle gr(r.r(), r.y(), w1, r.h());
draw_glyph(ALIGN_BOTTOM|ALIGN_INSIDE, gr);
}
Modified: trunk/src/CycleButton.cxx
===================================================================
--- trunk/src/CycleButton.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/CycleButton.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -81,7 +81,7 @@
setcolor(bg);
fillrect(r);
} else if (damage()&DAMAGE_EXPOSE ||
- bg && (damage()&DAMAGE_HIGHLIGHT)) {
+ (bg && (damage()&DAMAGE_HIGHLIGHT))) {
draw_background();
}
}
Modified: trunk/src/FileBrowser.cxx
===================================================================
--- trunk/src/FileBrowser.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/FileBrowser.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -291,8 +291,8 @@
icon = FileIcon::find(filename);
//printf("%s\n",files[i]->d_name);
- if (!strcmp(files[i]->d_name, ".") || !strcmp(files[i]->d_name, "./")
||
- !show_hidden_ && files[i]->d_name[0]=='.' &&
strncmp(files[i]->d_name,"../",2))
+ if (!strcmp(files[i]->d_name, ".") || !strcmp(files[i]->d_name, "./") ||
+ (!show_hidden_ && files[i]->d_name[0]=='.' &&
strncmp(files[i]->d_name,"../",2)))
continue;
if ((icon && icon->type() == FileIcon::DIRECTORY) ||
fltk::filename_isdir(filename)) {
Modified: trunk/src/FloatInput.cxx
===================================================================
--- trunk/src/FloatInput.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/FloatInput.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -62,12 +62,12 @@
continue;
} else
// This is complex to allow "0xff12" hex to be typed:
- if (b+n==0 && (ascii == '+' || ascii == '-') ||
+ if ((b+n==0 && (ascii == '+' || ascii == '-')) ||
(ascii >= '0' && ascii <= '9') ||
(b+n==1 && (at(0)=='0'||text[0]=='0') && (ascii=='x' || ascii == 'X'))
||
(b+n>1 && (at(0)=='0'||text[0]=='0') &&
((at(1)=='x'||text[1]=='x')||(at(1)=='X'||text[1]=='X'))
- && (ascii>='A'&& ascii<='F' || ascii>='a'&& ascii<='f')) ||
- type()==FLOAT && ascii && strchr(".eE+-", ascii))
+ && ((ascii>='A'&& ascii<='F') || (ascii>='a'&& ascii<='f'))) ||
+ (type()==FLOAT && ascii && strchr(".eE+-", ascii)))
continue; // it's ok;
return false;
}
Modified: trunk/src/Input.cxx
===================================================================
--- trunk/src/Input.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/Input.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -440,7 +440,7 @@
CONTINUE2:
// draw the cursor:
- if ((this==dnd_target || focused() && selstart == selend) &&
+ if ((this==dnd_target || (focused() && selstart == selend)) &&
cursor_position >= p-text_ && cursor_position <= e-text_) {
setcolor(textcolor);
fillrect(xpos+curx-1, r.y()+ypos, 2, height);
@@ -868,7 +868,7 @@
was probably many calls to replace()). Returns true if any change
was made. */
bool Input::undo() {
- if (undowidget != this || !undocut && !undoinsert) return false;
+ if (undowidget != this || !(undocut || undoinsert)) return false;
was_up_down = false;
int ilen = undocut;
@@ -1475,8 +1475,8 @@
// to see if they hold it long enough to start dragging:
if (!event_state(ALT|META|CTRL|SHIFT) &&
focused() && type()!=SECRET &&
- (newpos >= mark() && newpos < position() ||
- newpos >= position() && newpos < mark())) {
+ ((newpos >= mark() && newpos < position()) ||
+ (newpos >= position() && newpos < mark()))) {
drag_start = newpos;
add_timeout(.25);
return 1;
Modified: trunk/src/InputBrowser.cxx
===================================================================
--- trunk/src/InputBrowser.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/InputBrowser.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -345,7 +345,7 @@
m_input.set_damage(0);
}
if (damage()&(DAMAGE_ALL|DAMAGE_VALUE|DAMAGE_HIGHLIGHT)) {
- Flags f = flags() & ~FOCUSED | OUTPUT;
+ Flags f = (flags() & ~FOCUSED) | OUTPUT;
if (over_now) f |= HIGHLIGHT;
drawstyle(style(),f);
Modified: trunk/src/Menu_popup.cxx
===================================================================
--- trunk/src/Menu_popup.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/Menu_popup.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -296,7 +296,7 @@
Item::set_style(widget, widget->parent()!=0);
if (!widget->shortcut() ||
- widget->style()->hide_underscore() && !event_state(ACCELERATOR) )
+ (widget->style()->hide_underscore() && !event_state(ACCELERATOR)))
fl_hide_underscore = true;
const bool horizontal = widget->horizontal();
@@ -714,7 +714,7 @@
else if (p.level+1 < p.nummenus) forward(p, p.level+1);
return 1;
case RightKey:
- if (p.hmenubar && (p.level<=0 || p.level==1 && p.nummenus==2))
+ if (p.hmenubar && (p.level<=0 || (p.level==1 && p.nummenus==2)))
forward(p, 0);
else if (p.level+1 < p.nummenus) forward(p, p.level+1);
return 1;
Modified: trunk/src/NumericInput.cxx
===================================================================
--- trunk/src/NumericInput.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/NumericInput.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -201,7 +201,7 @@
// down to a smaller absolute value:
// first check if all the digits are zero, if so we reverse the sign:
for (p = q; ; p--) {
- if (p < 0 || (at(p) < '0' || at(p) > '9') && at(p) != '.') {
+ if (p < 0 || ((at(p) < '0' || at(p) > '9') && at(p) != '.')) {
if (p >= 0 && at(p) == '-') {
Input::replace(p, p+1, 0,0);
q--;
@@ -222,7 +222,7 @@
// delete leading zeros:
int g = p;
while (g > 0 && at(g-1)=='0') g--;
- if (!(g > 0 && (at(g-1)>='0' && at(g-1)<='9' || at(g-1)=='.'))) {
+ if (!(g > 0 && ((at(g-1)>='0' && at(g-1)<='9') || at(g-1)=='.'))) {
if (p < q) {
Input::replace(g, p+1, 0, 0);
q -= p-g+1;
Modified: trunk/src/PackedGroup.cxx
===================================================================
--- trunk/src/PackedGroup.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/PackedGroup.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -150,11 +150,11 @@
// A non-resizable widget will become the size of its items:
int W = w();
- if (r.w()<0 || !resizable() && !saw_horizontal) {
+ if (r.w()<0 || !(resizable() || saw_horizontal)) {
W -= r.w()+(saw_vertical?spacing_:0);
}
int H = h();
- if (r.h()<0 || !resizable() && !saw_vertical) {
+ if (r.h()<0 || !(resizable() || saw_vertical)) {
H -= r.h()+(saw_horizontal?spacing_:0);
}
Widget::resize(W,H);
Modified: trunk/src/Preferences.cxx
===================================================================
--- trunk/src/Preferences.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/Preferences.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -331,8 +331,12 @@
const char *s = src;
for ( ; *s; s++, len++ )
{
- if ( *s == '\\' )
- if ( isdigit( s[1] ) ) s+=3; else s+=1;
+ if ( *s == '\\' ) {
+ if ( isdigit( s[1] ) )
+ s+=3;
+ else
+ s+=1;
+ }
}
char *dst = new char[len+1];
char *d = dst;
Modified: trunk/src/Scrollbar.cxx
===================================================================
--- trunk/src/Scrollbar.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/Scrollbar.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -170,7 +170,7 @@
// Clicking on the slider or middle or right click on the trough
// gives us normal slider behavior:
if (which_part == SLIDER ||
- event_button() > 1 && which_part > DOWN_ARROW) {
+ (event_button() > 1 && which_part > DOWN_ARROW)) {
which_pushed = SLIDER;
return Slider::handle(event, r);
}
Modified: trunk/src/ShortcutAssignment.cxx
===================================================================
--- trunk/src/ShortcutAssignment.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/ShortcutAssignment.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -211,7 +211,7 @@
// turn letters into lower-case to match event_key()
if (!(shortcut & 0xff00u))
- shortcut = shortcut&0xffff0000u|tolower(shortcut&0xffu);
+ shortcut = (shortcut & 0xffff0000u) | tolower(shortcut & 0xffu);
// we must match all bits in the keysym, all shift keys that
// must be held down, and the main shift keys must match if off:
Modified: trunk/src/TabGroup.cxx
===================================================================
--- trunk/src/TabGroup.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/TabGroup.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -244,7 +244,7 @@
int TabGroup::push(Widget *o) {
if (push_ == o) return 0;
- if (push_ && !push_->visible() || o && !o->visible())
+ if ((push_ && !push_->visible()) || (o && !o->visible()))
redraw(DAMAGE_VALUE);
push_ = o;
return 1;
Modified: trunk/src/TiledGroup.cxx
===================================================================
--- trunk/src/TiledGroup.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/TiledGroup.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -49,17 +49,17 @@
int R = X+o->w();
if (oix) {
int t = p[0];
- if (t == oix || t>oix && X<newx || t<oix && X>newx) X = newx;
+ if (t == oix || (t>oix && X<newx) || (t<oix && X>newx)) X = newx;
t = p[1];
- if (t == oix || t>oix && R<newx || t<oix && R>newx) R = newx;
+ if (t == oix || (t>oix && R<newx) || (t<oix && R>newx)) R = newx;
}
int Y = o->y();
int B = Y+o->h();
if (oiy) {
int t = p[2];
- if (t == oiy || t>oiy && Y<newy || t<oiy && Y>newy) Y = newy;
+ if (t == oiy || (t>oiy && Y<newy) || (t<oiy && Y>newy)) Y = newy;
t = p[3];
- if (t == oiy || t>oiy && B<newy || t<oiy && B>newy) B = newy;
+ if (t == oiy || (t>oiy && B<newy) || (t<oiy && B>newy)) B = newy;
}
if (o->resize(X,Y,R-X,B-Y)) o->redraw();
}
Modified: trunk/src/ValueInput.cxx
===================================================================
--- trunk/src/ValueInput.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/ValueInput.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -104,7 +104,7 @@
}
if (damage() & (DAMAGE_ALL | DAMAGE_HIGHLIGHT)) {
Flags f[2];
- f[0] = f[1] = flags() & ~(HIGHLIGHT|FOCUSED) | OUTPUT;
+ f[0] = f[1] = (flags() & ~(HIGHLIGHT|FOCUSED)) | OUTPUT;
if (which_highlight && flag(HIGHLIGHT))
f[which_highlight-1] |= HIGHLIGHT;
if (which_pushed && pushed())
Modified: trunk/src/Widget.cxx
===================================================================
--- trunk/src/Widget.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/Widget.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -635,8 +635,8 @@
// check for completely blank widgets. We must not clip to their
// area because it will break lots of programs that assumme these
// can overlap any other widgets:
- if (!image() && (!label() ||
- align() != ALIGN_CENTER && !(align()&ALIGN_INSIDE))) {
+ if (!image() &&
+ (!label() || (align() != ALIGN_CENTER && !(align()&ALIGN_INSIDE)))) {
fl_did_clipping = this;
return;
}
Modified: trunk/src/Widget_draw.cxx
===================================================================
--- trunk/src/Widget_draw.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/Widget_draw.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -102,7 +102,7 @@
redrawing them anyway (ie anything displaying text).
*/
void Widget::draw_frame() const {
- drawstyle(style(), flags_ & ~OUTPUT | INVISIBLE);
+ drawstyle(style(), (flags_ & ~OUTPUT) | INVISIBLE);
box()->draw(Rectangle(w(),h()));
setdrawflags(flags_);
}
@@ -116,7 +116,7 @@
Flags flags = this->flags();
// Do a quick test to see if we don't want to draw anything:
if (!image() && (!label() || !*label() ||
- (flags&15) && !(flags & ALIGN_INSIDE))) return;
+ ((flags&15) && !(flags & ALIGN_INSIDE)))) return;
// figure out the inside of the box():
Rectangle r(w(),h()); box()->inset(r);
// and draw it:
@@ -274,7 +274,7 @@
if (flags & ALIGN_RIGHT) {
r.x(r.r()+3);
r.set_r(this->w());
- flags = flags&~ALIGN_RIGHT | ALIGN_LEFT;
+ flags = (flags & ~ALIGN_RIGHT) | ALIGN_LEFT;
} else {
r.x(0);
r.w(w.x()-3);
@@ -298,7 +298,7 @@
r.x(r.r()+3);
r.set_r(this->w());
}
- flags = flags & ~(HIGHLIGHT|PUSHED) | OUTPUT;
+ flags = (flags & ~(HIGHLIGHT|PUSHED)) | OUTPUT;
drawstyle(w.style(), flags);
//push_clip(X, Y, W, H); // this will break some old fltk programs
w.labeltype()->draw(w.label(), r, flags);
Modified: trunk/src/compose.cxx
===================================================================
--- trunk/src/compose.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/compose.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -377,7 +377,7 @@
char c1 = char(compose_state); // retrieve first character
// now search for the pair in either order:
for (const char *p = compose_pairs; *p; p += 2) {
- if (p[0] == ascii && p[1] == c1 || p[1] == ascii && p[0] == c1) {
+ if ((p[0] == ascii && p[1] == c1) || (p[1] == ascii && p[0] == c1)) {
int code = (p-compose_pairs)/2+0xA0;
// convert code to utf8:
e_text = textbuffer;
Modified: trunk/src/default_glyph.cxx
===================================================================
--- trunk/src/default_glyph.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/default_glyph.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -126,7 +126,7 @@
*/
void Widget::draw_glyph(int which, const Rectangle& rectangle) const {
int savedflags = drawflags_;
- drawflags_ = savedflags&~ALIGN_MASK | which;
+ drawflags_ = (savedflags&~ALIGN_MASK) | which;
glyph()->draw(rectangle);
drawflags_ = savedflags;
}
Modified: trunk/src/drawtext.cxx
===================================================================
--- trunk/src/drawtext.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/drawtext.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -194,7 +194,7 @@
LeftSymbol() : Symbol("l") {}
void _draw(const Rectangle&) const {}
void _measure(int& w, int& h) const {
- flags = flags&(~ALIGN_RIGHT)|ALIGN_LEFT;
+ flags = (flags & ~ALIGN_RIGHT) | ALIGN_LEFT;
w = h = 0;
}
};
@@ -216,7 +216,7 @@
RightSymbol() : Symbol("r") {}
void _draw(const Rectangle&) const {}
void _measure(int& w, int& h) const {
- flags = flags&(~ALIGN_LEFT)|ALIGN_RIGHT;
+ flags = (flags & ~ALIGN_LEFT) | ALIGN_RIGHT;
w = h = 0;
}
};
Modified: trunk/src/run.cxx
===================================================================
--- trunk/src/run.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/run.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -96,7 +96,7 @@
static void fix_focus() {
Widget* w = xfocus;
// Modal overrides whatever the system says the focus is:
- if (grab_ || w && modal_) w = modal_;
+ if (grab_ || (w && modal_)) w = modal_;
if (w) {
if (w->contains(focus())) return; // already has it
unsigned saved = e_keysym;
@@ -459,7 +459,7 @@
}
// run the system-specific part that waits for sockets & events:
- if (time_to_wait <= 0 || idle && !in_idle) time_to_wait = 0;
+ if (time_to_wait <= 0 || (idle && !in_idle)) time_to_wait = 0;
int ret = fl_wait(time_to_wait);
if (first_timeout) {
Modified: trunk/src/xpmImage.cxx
===================================================================
--- trunk/src/xpmImage.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/src/xpmImage.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -55,10 +55,10 @@
bool xpmImage::fetch(Image& i, const char * const * array) {
int n, ncolors, chars_per_pixel, width, height;
- n = sscanf(array[0],"%d %d %d %d",&width,&height,&ncolors,&chars_per_pixel);
- if (n<4 || chars_per_pixel!=1 && chars_per_pixel!=2) return false;
- i.setsize(width,height);
- if (width<=0 || height<=0) return false;
+ n = sscanf(array[0], "%d %d %d %d", &width, &height, &ncolors,
&chars_per_pixel);
+ if (n < 4 || (chars_per_pixel != 1 && chars_per_pixel != 2)) return false;
+ i.setsize(width, height);
+ if (width <= 0 || height <= 0) return false;
// note that this array is unsigned char and skips the first line:
const uchar*const* data = (const uchar*const*)(array+1);
Modified: trunk/test/checkers.cxx
===================================================================
--- trunk/test/checkers.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/test/checkers.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -190,14 +190,14 @@
piece a = tb[target]; piece b = tb[src];
tb[target] = EMPTY; tb[src] = EMPTY;
int safe =
- (tb[src-4]&FRIEND && tb[src-8]&ENEMY
- ||tb[src-5]&FRIEND && tb[src-10]&ENEMY
- ||tb[dst-4]&ENEMY && !tb[dst+4]
- ||tb[dst-5]&ENEMY && !tb[dst+5]
- ||tb[src+4]&FRIEND && tb[src+8]==ENEMYKING
- ||tb[src+5]&FRIEND && tb[src+10]==ENEMYKING
- ||tb[dst+4]==ENEMYKING && !tb[dst-4]
- ||tb[dst+5]==ENEMYKING && !tb[dst-5]);
+ ((tb[src-4]&FRIEND && tb[src-8]&ENEMY)
+ || (tb[src-5]&FRIEND && tb[src-10]&ENEMY)
+ || (tb[dst-4]&ENEMY && !tb[dst+4])
+ || (tb[dst-5]&ENEMY && !tb[dst+5])
+ || (tb[src+4]&FRIEND && tb[src+8]==ENEMYKING)
+ || (tb[src+5]&FRIEND && tb[src+10]==ENEMYKING)
+ || (tb[dst+4]==ENEMYKING && !tb[dst-4])
+ || (tb[dst+5]==ENEMYKING && !tb[dst-5]));
tb[target] = a; tb[src] = b;
return(safe);
}
@@ -285,7 +285,7 @@
for (i=9; i<40; i++) {
int x = (gradient[i-4]+gradient[i-5])/2;
if (tb[i]==FRIEND) total += x;
- gradient[i] = (tb[i]&FRIEND || !tb[i] && !is_protected[i]) ? x : 0;
+ gradient[i] = ((tb[i]&FRIEND) || !(tb[i] || is_protected[i])) ? x : 0;
}
n->gradient = total;
@@ -1016,7 +1016,7 @@
// drag the piece on square i to dx dy, or undo drag if i is zero:
void Board::drag_piece(int i, int dx, int dy) {
- dy = (dy&-2) | dx&1; // make halftone shadows line up
+ dy = (dy&-2) | (dx&1); // make halftone shadows line up
if (i != erase_this) drop_piece(erase_this); // should not happen
if (!erase_this) { // pick up old piece
dragx = squarex(i); dragy = squarey(i);
Modified: trunk/test/navigation.cxx
===================================================================
--- trunk/test/navigation.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/test/navigation.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -57,7 +57,7 @@
Widget *o = window.child(n);
if (x<o->x()+o->w() && x+w>o->x() &&
y<o->y()+o->h() && y+h>o->y()) break;
- if (!j && (y < o->y() || y == o->y() && x < o->x())) j = o;
+ if (!j && (y < o->y() || (y == o->y() && x < o->x()))) j = o;
}
// skip if intersection:
if (n < window.children()) continue;
Modified: trunk/test/utf.cxx
===================================================================
--- trunk/test/utf.cxx 2010-04-15 16:35:00 UTC (rev 7512)
+++ trunk/test/utf.cxx 2010-04-15 17:19:27 UTC (rev 7513)
@@ -30,9 +30,9 @@
// Return color to draw behind given code
Color code_color(unsigned ucs) {
if (ucs < 32 || ucs==127 // ascii control characters
- // || ucs >= 0x80 && ucs <= 0x9f // C1 control characters
- || ucs >= 0xd800 && ucs <= 0xdfff // surrogate pairs
- || ucs >= 0xfdd0 && ucs <= 0xfdef // noncharacters
+ || (ucs >= 0x80 && ucs <= 0x9f) // C1 control characters
+ || (ucs >= 0xd800 && ucs <= 0xdfff) // surrogate pairs
+ || (ucs >= 0xfdd0 && ucs <= 0xfdef) // noncharacters
|| (ucs&0xffff) >= 0xfffe // noncharacters
) return GRAY50;
if (ucs & 0x100) return GRAY80;
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit