I was looking at Fl_Help_View to use it to generate reports and possibly 
print then through the new printing functionality on fltk 1.3, I had 
some old code from fltk-utf8 1.1.4 and for my surprise the html 
rendering isn't the same in respect to tables, on fltk-utf8 1.1.4 tables 
have only a line betwen rows but now they have a gape between rows, 
looking at the source code I found a lot of copy and paste repeated 
code, I tried to cleanup it a bit but after an evening fighting 
duplication I decided to ask my friend google if there is any other html 
parser/render availlable and I found 
http://www.netsurf-browser.org/projects/hubbub/ it seems to be small and 
well coded, and also I found DILLO (I knew it before but didn't rember).

Dillo is interesting because the 2.2 already uses fltk2 but it doesn't 
compile on win32, so I played a bit with it's source code and managed to 
compile on win32 with mingw gcc 4.4.1 although the sockets didn't work 
as expected, but it comes up an shoes it's presentation page, but when I 
try to open anything on my computer only garbage appear on the 
filebrowser, this happen with fluid too when compiled with mingw gcc 
4.4.1, so I compiled fltk2 with vc2008 and the filebrowser works fine, 
dillo doesn't compile with vc2008 yet.

Then I thought should be something intrinsic to mingw gcc 4.4.1, I 
recompiled all and looked at the compiler output to find any possible 
light to why I'm getting garbage on filebrowser.

For my surprise there is several warnings that normally I don't bother 
look at then as long the final program/lib works, but since this time 
it's not working I've got shocked with lot's of really hardy to 
understand ambiguitys (they exist on fltk 1.1.3 too).

What follow is the output from the compiler and some possible solutions 
(at least when I could guess what is intended), I invite anyone to 
exercise his/her knowledge of c++ and try find what should be done:

Adjuster.cxx: In member function 'virtual void fltk::Adjuster::draw()':
Adjuster.cxx:83: warning: suggest parentheses around arithmetic in 
operand of '|'

!!!!!!!!!!!! what's intended here !!!!!!!!!!!!!!!
from: Flags flags = this->flags() & ~(STATE|PUSHED|HIGHLIGHT) | OUTPUT;
to: Flags flags = this->flags() & ( (~(STATE|PUSHED|HIGHLIGHT)) | OUTPUT );

...
Browser.cxx: In member function 'virtual int fltk::Browser::handle(int)':
Browser.cxx:1410: warning: suggest parentheses around '&&' within '||'

!!!!!!!!!!!! what's intended here !!!!!!!!!!!!!!!
from: if (openclose_drag == 1 || event_clicks() && item_is_parent()) {
to: if ( (openclose_drag == 1) || (event_clicks() && item_is_parent()) ) {

Browser.cxx: In member function 'fltk::Widget* 
fltk::Browser::goto_index(const int*, unsigned int)':
Browser.cxx:1526: warning: suggest parentheses around '&&' within '||'

!!!!!!!!!!!! what's intended here 2 options !!!!!!!!!!!!!!!
from:if (!indexes[0] && !level || layout_damage() || !goto_mark(FOCUS)) {
to1: if ( (!indexes[0] && !level) || layout_damage() || !goto_mark(FOCUS)) {

to2: if ( !indexes[0] && (!level || layout_damage() || !goto_mark(FOCUS)) {

...
Choice.cxx: In member function 'virtual void fltk::Choice::draw()':
Choice.cxx:84: warning: suggest parentheses around arithmetic in operand 
of '|'

from: drawstyle(style(), flags() & ~FOCUSED | OUTPUT);
to: drawstyle(style(), flags() & ((~FOCUSED) | OUTPUT));
...
compose.cxx: In function 'bool fltk::compose(int&)':
compose.cxx:380: warning: suggest parentheses around '&&' within '||'

!!!!!!!!!!!! what's intended here !!!!!!!!!!!!!!!
from: if (p[0] == ascii && p[1] == c1 || p[1] == ascii && p[0] == c1) {
to: if ( ( (p[0] == ascii) && (p[1] == c1) ) || ( (p[1] == ascii) && 
(p[0] == c1) ) ) {
...
Cursor.cxx:282:2: warning: #warning we assume PixelType = 6 ARGB32 in 
test it is true for color images
Cursor.cxx: In function 'HICON__* create_cursor_from_image(fltk::Image*, 
int, int)':
Cursor.cxx:316: warning: unused variable 'h'

!!!!!! or there is an error in the code that follow it ????
from: int w = img->w() , h = img->h();
to: int w = img->w();
...
CycleButton.cxx: In member function 'virtual void 
fltk::CycleButton::draw()':
CycleButton.cxx:84: warning: suggest parentheses around '&&' within '||'

from:    } else if (damage()&DAMAGE_EXPOSE ||
               bg && (damage()&DAMAGE_HIGHLIGHT)) {

to:    } else if ( (damage()& (DAMAGE_EXPOSE ||
               bg)) && (damage()&DAMAGE_HIGHLIGHT)) {
...
default_glyph.cxx: In member function 'void 
fltk::Widget::draw_glyph(int, const fltk::Rectangle&) const':
default_glyph.cxx:129: warning: suggest parentheses around arithmetic in 
operand of '|'

from: drawflags_ = savedflags&~ALIGN_MASK | which;
to: drawflags_ = savedflags & ((~ALIGN_MASK) | which);
to2: drawflags_ = savedflags & (~ (ALIGN_MASK | which));

...
drawtext.cxx: In member function 'virtual void 
LeftSymbol::_measure(int&, int&) const':
drawtext.cxx:197: warning: suggest parentheses around arithmetic in 
operand of '|'

from: flags = flags&(~ALIGN_RIGHT)|ALIGN_LEFT;
to: flags = flags & ((~ALIGN_RIGHT)|ALIGN_LEFT);
to2: flags = (flags & (~ALIGN_RIGHT)) | ALIGN_LEFT;

drawtext.cxx: In member function 'virtual void 
RightSymbol::_measure(int&, int&) const':
drawtext.cxx:219: warning: suggest parentheses around arithmetic in 
operand of '|'

from: flags = flags&(~ALIGN_LEFT)|ALIGN_RIGHT;
to: flags = flags & ((~ALIGN_LEFT)|ALIGN_RIGHT);
to2: flags = (flags & (~ALIGN_LEFT)) | ALIGN_RIGHT;
...
FileBrowser.cxx: In member function 'int fltk::FileBrowser::load(const 
char*, int (*)(const dirent* const*, const dirent* const*))':
FileBrowser.cxx:295: warning: suggest parentheses around '&&' within '||'

from:   if (!strcmp(files[i]->d_name, ".") || !strcmp(files[i]->d_name, 
"./") || !show_hidden_ &&  files[i]->d_name[0]=='.' && 
strncmp(files[i]->d_name,"../",2))

to: really don't know
...
FileChooser2.cxx: In member function 'void fltk::FileChooser::fileNameCB()':
FileChooser2.cxx:539: warning: suggest parentheses around '&&' within '||'

from: if ((isalpha(pathname[0] & 255) && pathname[1] == ':' && 
!pathname[2]) || fltk::filename_isdir(pathname) &&
        compare_dirnames(pathname, directory_)) {

to: really don't know
...
filename_absolute.cxx: In function 'int fltk::filename_absolute(char*, 
int, const char*, const char*)':
filename_absolute.cxx:97: warning: suggest parentheses around '&&' 
within '||'

from:   } else if (isdirsep(input[0]) /*|| input[0] == '|' // for tcl 
pipes? */
#if defined(_WIN32) || defined(__EMX__) && !defined(__CYGWIN__)
             || input[0] && input[1]==':'
#endif

to: really don't know
...
FloatInput.cxx: In member function 'virtual bool 
fltk::FloatInput::replace(int, int, const char*, int)':
FloatInput.cxx:66: warning: suggest parentheses around '&&' within '||'
FloatInput.cxx:69: warning: suggest parentheses around '&&' within '||'
FloatInput.cxx:70: warning: suggest parentheses around '&&' within '||'

from:     // This is complex to allow "0xff12" hex to be typed:
     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))

to: really complex, maybe crazy !
...
In file included from Image.cxx:467:
win32/Image.cxx: In member function 'void fltk::Image::fetch_if_needed() 
const':
win32/Image.cxx:263: warning: comparison between signed and unsigned 
integer expressions
...
Input.cxx: In member function 'void fltk::Input::draw(const 
fltk::Rectangle&)':
Input.cxx:443: warning: suggest parentheses around '&&' within '||'

from: if ((this==dnd_target || focused() && selstart == selend) &&
        cursor_position >= p-text_ && cursor_position <= e-text_) {
to: guesses are welcome

Input.cxx: In member function 'bool fltk::Input::undo()':
Input.cxx:871: warning: suggest parentheses around '&&' within '||'

from: if (undowidget != this || !undocut && !undoinsert) return false;
to: guesses are welcome

Input.cxx: In member function 'int fltk::Input::handle(int, const 
fltk::Rectangle&)':
Input.cxx:1479: warning: suggest parentheses around '&&' within '||'

from:  if (!event_state(ALT|META|CTRL|SHIFT) &&
        focused() && type()!=SECRET &&
        (newpos >= mark() && newpos < position() ||
        newpos >= position() && newpos < mark())) {
to: guesses are welcome
...
InputBrowser.cxx: In member function 'virtual void 
fltk::InputBrowser::draw()':
InputBrowser.cxx:348: warning: suggest parentheses around arithmetic in 
operand of '|'

from: Flags f = flags() & ~FOCUSED | OUTPUT;
to: Flags f = flags() & ((~FOCUSED) | OUTPUT);
...
Menu_popup.cxx: In member function 'void 
fltk::Menu::draw_in(fltk::Widget*, const int*, int, int, int) const':
Menu_popup.cxx:299: warning: suggest parentheses around '&&' within '||'

from: if (!widget->shortcut() ||
       widget->style()->hide_underscore() && !event_state(ACCELERATOR) )
to: guesses are welcome

Menu_popup.cxx: In member function 'virtual int MWindow::handle(int)':
Menu_popup.cxx:717: warning: suggest parentheses around '&&' within '||'

from: if (p.hmenubar && (p.level<=0 || p.level==1 && p.nummenus==2))
to: guesses are welcome
...
NumericInput.cxx: In member function 'int 
fltk::NumericInput::handle_arrow(int)':
NumericInput.cxx:204: warning: suggest parentheses around '&&' within '||'

from: if (p < 0 || (at(p) < '0' || at(p) > '9') && at(p) != '.') {
to: guesses are welcome

NumericInput.cxx:225: warning: suggest parentheses around '&&' within '||'

from: if (!(g > 0 && (at(g-1)>='0' && at(g-1)<='9' || at(g-1)=='.'))) {
to: guesses are welcome
...
PackedGroup.cxx: In member function 'virtual void 
fltk::PackedGroup::layout()':
PackedGroup.cxx:153: warning: suggest parentheses around '&&' within '||'

from: if (r.w()<0 || !resizable() && !saw_horizontal) {
to: guesses are welcome

PackedGroup.cxx:157: warning: suggest parentheses around '&&' within '||'

from: if (r.h()<0 || !resizable() && !saw_vertical) {
to: guesses are welcome
...
Preferences.cxx: In function 'char* decodeText(const char*)':
Preferences.cxx:334: warning: suggest explicit braces to avoid ambiguous 
'else'

from:     if ( *s == '\\' )
       if ( isdigit( s[1] ) ) s+=3; else s+=1;

to:     if ( *s == '\\' ) {
       if ( isdigit( s[1] ) ) s+=3; else s+=1;
}

...
run.cxx: In function 'void fix_focus()':
run.cxx:99: warning: suggest parentheses around '&&' within '||'

from: if (grab_ || w && modal_) w = modal_;
to: guesses are welcome

In file included from run.cxx:160:
win32/run.cxx: In function 'bool fl_load_imm32()':
win32/run.cxx:181: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
win32/run.cxx:183: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
win32/run.cxx:185: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
win32/run.cxx:187: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
win32/run.cxx:189: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
run.cxx: In function 'int fltk::wait(float)':
run.cxx:462: warning: suggest parentheses around '&&' within '||'

from: if (time_to_wait <= 0 || idle && !in_idle) time_to_wait = 0;
to: guesses are welcome

In file included from run.cxx:160:
win32/run.cxx: In static member function 'static void 
fltk::CreatedWindow::create(fltk::Window*)':
win32/run.cxx:182: warning: dereferencing pointer 'pfnImmGetContext.84' 
does break strict-aliasing rules
win32/run.cxx:182: note: initialized from here
win32/run.cxx:184: warning: dereferencing pointer 
'pfnImmReleaseContext.85' does break strict-aliasing rules
win32/run.cxx:184: note: initialized from here
win32/run.cxx:186: warning: dereferencing pointer 
'pfnImmSetCompositionFontW.86' does break strict-aliasing rules
win32/run.cxx:186: note: initialized from here
win32/run.cxx:188: warning: dereferencing pointer 
'pfnImmSetCompositionWindow.87' does break strict-aliasing rules
win32/run.cxx:188: note: initialized from here
win32/run.cxx:190: warning: dereferencing pointer 
'pfnImmAssociateContext.88' does break strict-aliasing rules
win32/run.cxx:190: note: initialized from here
...
Scrollbar.cxx: In member function 'virtual int 
fltk::Scrollbar::handle(int)':
Scrollbar.cxx:173: warning: suggest parentheses around '&&' within '||'

from: if (which_part == SLIDER ||
        event_button() > 1 && which_part > DOWN_ARROW) {
to:  guesses are welcome
...
win32/setcolor.cxx: In function 'void fltk::line_style(int, float, const 
char*)':
win32/setcolor.cxx:98: warning: suggest parentheses around arithmetic in 
operand of '|'
win32/setcolor.cxx: In function 'HPALETTE__* fl_select_palette(HDC__*)':
win32/setcolor.cxx:245: warning: dereferencing pointer 'pPal' does break 
strict-aliasing rules
win32/setcolor.cxx:244: warning: dereferencing pointer 'pPal' does break 
strict-aliasing rules
win32/setcolor.cxx:250: warning: dereferencing pointer 'pPal' does break 
strict-aliasing rules
win32/setcolor.cxx:251: warning: dereferencing pointer 'pPal' does break 
strict-aliasing rules
win32/setcolor.cxx:252: warning: dereferencing pointer 'pPal' does break 
strict-aliasing rules
win32/setcolor.cxx:253: warning: dereferencing pointer 'pPal' does break 
strict-aliasing rules
win32/setcolor.cxx:242: note: initialized from here
...
ShortcutAssignment.cxx: In member function 'virtual bool 
keyCompareFunctor::handle(const fltk::AssociationType&, const 
fltk::Widget*, void*)':
ShortcutAssignment.cxx:214: warning: suggest parentheses around 
arithmetic in operand of '|'
...
TabGroup.cxx: In member function 'int fltk::TabGroup::push(fltk::Widget*)':
TabGroup.cxx:247: warning: suggest parentheses around '&&' within '||'
...
TextBuffer.cxx: In member function 'int fltk::TextBuffer::undo(int*)':
TextBuffer.cxx:358: warning: suggest parentheses around '&&' within '||'
TextBuffer.cxx: In member function 'char* 
fltk::TextBuffer::selection_text_(fltk::TextSelection*)':
TextBuffer.cxx:1802: warning: 'rectstart' may be used uninitialized in 
this function
TextBuffer.cxx:1802: warning: 'rectend' may be used uninitialized in 
this function
TextBuffer.cxx: In member function 'void 
fltk::TextBuffer::remove_selection_(fltk::TextSelection*)':
TextBuffer.cxx:1821: warning: 'rectstart' may be used uninitialized in 
this function
TextBuffer.cxx:1821: warning: 'rectend' may be used uninitialized in 
this function
TextBuffer.cxx: In member function 'void 
fltk::TextBuffer::replace_selection_(fltk::TextSelection*, const char*)':
TextBuffer.cxx:1834: warning: 'rectstart' may be used uninitialized in 
this function
TextBuffer.cxx:1834: warning: 'rectend' may be used uninitialized in 
this function
...
TiledGroup.cxx: In member function 'void fltk::TiledGroup::position(int, 
int, int, int)':
TiledGroup.cxx:52: warning: suggest parentheses around '&&' within '||'
TiledGroup.cxx:52: warning: suggest parentheses around '&&' within '||'
TiledGroup.cxx:54: warning: suggest parentheses around '&&' within '||'
TiledGroup.cxx:54: warning: suggest parentheses around '&&' within '||'
TiledGroup.cxx:60: warning: suggest parentheses around '&&' within '||'
TiledGroup.cxx:60: warning: suggest parentheses around '&&' within '||'
TiledGroup.cxx:62: warning: suggest parentheses around '&&' within '||'
TiledGroup.cxx:62: warning: suggest parentheses around '&&' within '||'
...
ValueInput.cxx: In member function 'virtual void fltk::ValueInput::draw()':
ValueInput.cxx:107: warning: suggest parentheses around arithmetic in 
operand of '|'
...
Widget.cxx: In member function 'virtual void fltk::Widget::draw()':
Widget.cxx:639: warning: suggest parentheses around '&&' within '||'
...
Widget_draw.cxx: In member function 'void fltk::Widget::draw_frame() const':
Widget_draw.cxx:105: warning: suggest parentheses around arithmetic in 
operand of '|'
Widget_draw.cxx: In member function 'void fltk::Widget::draw_label() const':
Widget_draw.cxx:119: warning: suggest parentheses around '&&' within '||'
Widget_draw.cxx: In member function 'void 
fltk::Group::draw_outside_label(fltk::Widget&) const':
Widget_draw.cxx:277: warning: suggest parentheses around arithmetic in 
operand of '|'
Widget_draw.cxx:301: warning: suggest parentheses around arithmetic in 
operand of '|'
...
xpmImage.cxx: In static member function 'static bool 
fltk::xpmImage::fetch(fltk::Image&, const char* const*)':
xpmImage.cxx:59: warning: suggest parentheses around '&&' within '||'
...
win32/scandir.c: In function 'scandir':
win32/scandir.c:48: warning: implicit declaration of function 'strlcpy'
...

FLUID

code.cxx: In function 'int is_id(char)':
code.cxx:45: warning: suggest parentheses around '&&' within '||'
code.cxx:45: warning: suggest parentheses around '&&' within '||'
code.cxx: In function 'void write_cstring(const char*, int)':
code.cxx:208: warning: suggest parentheses around '&&' within '||'
code.cxx:208: warning: suggest parentheses around '&&' within '||'
...
coding_style_func.cxx: In function 'const char* get_opening_brace(int)':
coding_style_func.cxx:108: warning: suggest explicit braces to avoid 
ambiguous 'else'
...
fluid.cxx: In function 'void fix_images_dir()':
fluid.cxx:148: warning: suggest parentheses around '&&' within '||'
...
FunctionType.cxx: In member function 'virtual void DeclType::write_code()':
FunctionType.cxx:535: warning: suggest parentheses around '&&' within '||'
FunctionType.cxx:536: warning: suggest parentheses around '&&' within '||'
FunctionType.cxx:537: warning: suggest parentheses around '&&' within '||'
...
MenuType.cxx: In member function 'virtual int Shortcut_Button::handle(int)':
MenuType.cxx:137: warning: suggest parentheses around '&&' within '||'
MenuType.cxx:138: warning: suggest parentheses around arithmetic in 
operand of '|'
MenuType.cxx:140: warning: suggest parentheses around arithmetic in 
operand of '|'
...
WidgetType.cxx: In member function 'const char* WidgetType::array_name() 
const':
WidgetType.cxx:1534: warning: suggest parentheses around '&&' within '||'
...
WindowType.cxx: In member function 'void 
WindowType::newposition(WidgetType*, int&, int&, int&, int&)':
WindowType.cxx:369: warning: suggest explicit braces to avoid ambiguous 
'else'
WindowType.cxx:370: warning: suggest explicit braces to avoid ambiguous 
'else'
WindowType.cxx:371: warning: suggest explicit braces to avoid ambiguous 
'else'
WindowType.cxx:372: warning: suggest explicit braces to avoid ambiguous 
'else'
...


_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to