Skip to content

Commit

Permalink
Get rid of "member X hidden by variable X" warnings...
Browse files Browse the repository at this point in the history
Fix strcasecmp() detection...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1337 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Nov 20, 2000
1 parent a45a630 commit 7d432ff
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 109 deletions.
8 changes: 4 additions & 4 deletions configure.in
@@ -1,7 +1,7 @@
dnl -*- sh -*-
dnl the "configure" script is made from this by running GNU "autoconf"
dnl
dnl "$Id: configure.in,v 1.33.2.19 2000/11/20 15:44:17 easysw Exp $"
dnl "$Id: configure.in,v 1.33.2.20 2000/11/20 19:02:19 easysw Exp $"
dnl
dnl Configuration script for the Fast Light Tool Kit (FLTK).
dnl
Expand Down Expand Up @@ -137,8 +137,8 @@ AC_CHECK_FUNC(snprintf,
else
AC_DEFINE(HAVE_SNPRINTF)
fi)
AC_CHECK_FUNC(vsprintf)
AC_CHECK_FUNC(strcasecmp)
AC_CHECK_FUNCS(vsprintf)
AC_CHECK_FUNCS(strcasecmp)

AC_PATH_XTRA
dnl# echo "Ignoring libraries \"$X_PRE_LIBS\" requested by configure."
Expand Down Expand Up @@ -279,5 +279,5 @@ AC_CONFIG_HEADER(config.h:configh.in)
AC_OUTPUT(makeinclude)

dnl
dnl End of "$Id: configure.in,v 1.33.2.19 2000/11/20 15:44:17 easysw Exp $".
dnl End of "$Id: configure.in,v 1.33.2.20 2000/11/20 19:02:19 easysw Exp $".
dnl
6 changes: 3 additions & 3 deletions src/Fl.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl.cxx,v 1.24.2.33 2000/11/20 02:49:40 easysw Exp $"
// "$Id: Fl.cxx,v 1.24.2.34 2000/11/20 19:02:20 easysw Exp $"
//
// Main event handling code for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -48,7 +48,7 @@ int Fl::damage_,
Fl::e_clicks,
Fl::e_is_click,
Fl::e_keysym;
char *Fl::e_text = "";
char *Fl::e_text = (char *)"";
int Fl::e_length;

//
Expand Down Expand Up @@ -734,5 +734,5 @@ void Fl_Window::flush() {
}

//
// End of "$Id: Fl.cxx,v 1.24.2.33 2000/11/20 02:49:40 easysw Exp $".
// End of "$Id: Fl.cxx,v 1.24.2.34 2000/11/20 19:02:20 easysw Exp $".
//
10 changes: 5 additions & 5 deletions src/Fl_Chart.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Chart.cxx,v 1.5.2.4 2000/06/05 21:20:49 mike Exp $"
// "$Id: Fl_Chart.cxx,v 1.5.2.5 2000/11/20 19:02:20 easysw Exp $"
//
// Forms-compatible chart widget for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -357,9 +357,9 @@ void Fl_Chart::replace(int index,double val, const char *str, uchar col) {
redraw();
}

void Fl_Chart::bounds(double min, double max) {
this->min = min;
this->max = max;
void Fl_Chart::bounds(double mymin, double mymax) {
this->min = mymin;
this->max = mymax;
redraw();
}

Expand All @@ -378,5 +378,5 @@ void Fl_Chart::maxsize(int m) {
}

//
// End of "$Id: Fl_Chart.cxx,v 1.5.2.4 2000/06/05 21:20:49 mike Exp $".
// End of "$Id: Fl_Chart.cxx,v 1.5.2.5 2000/11/20 19:02:20 easysw Exp $".
//
52 changes: 26 additions & 26 deletions src/Fl_Double_Window.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Double_Window.cxx,v 1.12.2.2 2000/06/05 21:20:50 mike Exp $"
// "$Id: Fl_Double_Window.cxx,v 1.12.2.3 2000/11/20 19:02:20 easysw Exp $"
//
// Double-buffered window code for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -104,62 +104,62 @@ void Fl_Double_Window::flush() {flush(0);}

void Fl_Double_Window::flush(int eraseoverlay) {
make_current(); // make sure fl_gc is non-zero
Fl_X *i = Fl_X::i(this);
if (!i->other_xid) {
Fl_X *myi = Fl_X::i(this);
if (!myi->other_xid) {
#if USE_XDBE
if (can_xdbe()) i->other_xid =
if (can_xdbe()) myi->other_xid =
XdbeAllocateBackBufferName(fl_display, fl_xid(this), XdbeUndefined);
else
#endif
i->other_xid = fl_create_offscreen(w(), h());
myi->other_xid = fl_create_offscreen(w(), h());
clear_damage(FL_DAMAGE_ALL);
}
#if USE_XDBE
if (use_xdbe) {
// if this is true, copy rather than swap so back buffer is preserved:
int copy = (i->region || eraseoverlay);
if (i->backbuffer_bad) { // make sure we do a complete redraw...
if (i->region) {XDestroyRegion(i->region); i->region = 0;}
int copy = (myi->region || eraseoverlay);
if (myi->backbuffer_bad) { // make sure we do a complete redraw...
if (myi->region) {XDestroyRegion(myi->region); myi->region = 0;}
clear_damage(FL_DAMAGE_ALL);
}
if (damage()) {
fl_clip_region(i->region); i->region = 0;
fl_window = i->other_xid;
fl_clip_region(myi->region); myi->region = 0;
fl_window = myi->other_xid;
draw();
fl_window = i->xid;
fl_window = myi->xid;
}
if (!copy) {
XdbeSwapInfo s;
s.swap_window = fl_xid(this);
s.swap_action = XdbeUndefined;
XdbeSwapBuffers(fl_display, &s, 1);
i->backbuffer_bad = 1;
myi->backbuffer_bad = 1;
return;
}
// otherwise just use normal copy from back to front:
i->backbuffer_bad = 0; // which won't destroy the back buffer...
myi->backbuffer_bad = 0; // which won't destroy the back buffer...
} else
#endif
if (damage() & ~FL_DAMAGE_EXPOSE) {
fl_clip_region(i->region); i->region = 0;
fl_clip_region(myi->region); myi->region = 0;
#ifdef WIN32
HDC _sgc = fl_gc;
fl_gc = fl_makeDC(i->other_xid);
fl_gc = fl_makeDC(myi->other_xid);
fl_restore_clip(); // duplicate region into new gc
draw();
DeleteDC(fl_gc);
fl_gc = _sgc;
#else // X:
fl_window = i->other_xid;
fl_window = myi->other_xid;
draw();
fl_window = i->xid;
fl_window = myi->xid;
#endif
}
if (eraseoverlay) fl_clip_region(0);
// on Irix (at least) it is faster to reduce the area copied to
// the current clip region:
int X,Y,W,H; fl_clip_box(0,0,w(),h(),X,Y,W,H);
fl_copy_offscreen(X, Y, W, H, i->other_xid, X, Y);
fl_copy_offscreen(X, Y, W, H, myi->other_xid, X, Y);
}

void Fl_Double_Window::resize(int X,int Y,int W,int H) {
Expand All @@ -169,20 +169,20 @@ void Fl_Double_Window::resize(int X,int Y,int W,int H) {
#if USE_XDBE
if (use_xdbe) return;
#endif
Fl_X* i = Fl_X::i(this);
if (i && i->other_xid && (ow != w() || oh != h())) {
fl_delete_offscreen(i->other_xid);
i->other_xid = 0;
Fl_X* myi = Fl_X::i(this);
if (myi && myi->other_xid && (ow != w() || oh != h())) {
fl_delete_offscreen(myi->other_xid);
myi->other_xid = 0;
}
}

void Fl_Double_Window::hide() {
Fl_X* i = Fl_X::i(this);
if (i && i->other_xid) {
Fl_X* myi = Fl_X::i(this);
if (myi && myi->other_xid) {
#if USE_XDBE
if (!use_xdbe)
#endif
fl_delete_offscreen(i->other_xid);
fl_delete_offscreen(myi->other_xid);
}
Fl_Window::hide();
}
Expand All @@ -192,5 +192,5 @@ Fl_Double_Window::~Fl_Double_Window() {
}

//
// End of "$Id: Fl_Double_Window.cxx,v 1.12.2.2 2000/06/05 21:20:50 mike Exp $".
// End of "$Id: Fl_Double_Window.cxx,v 1.12.2.3 2000/11/20 19:02:20 easysw Exp $".
//
70 changes: 35 additions & 35 deletions src/Fl_Menu.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Menu.cxx,v 1.18.2.10 2000/07/30 00:31:44 spitzak Exp $"
// "$Id: Fl_Menu.cxx,v 1.18.2.11 2000/11/20 19:02:20 easysw Exp $"
//
// Menu code for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -208,15 +208,15 @@ menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp,
}
color(button ? button->color() : FL_GRAY);
selected = -1;
{int i = 0;
if (m) for (const Fl_Menu_Item* m1=m; ; m1 = m1->next(), i++) {
{int j = 0;
if (m) for (const Fl_Menu_Item* m1=m; ; m1 = m1->next(), j++) {
if (picked) {
if (m1 == picked) {selected = i; picked = 0;}
else if (m1 > picked) {selected = i-1; picked = 0; Wp = Hp = 0;}
if (m1 == picked) {selected = j; picked = 0;}
else if (m1 > picked) {selected = j-1; picked = 0; Wp = Hp = 0;}
}
if (!m1->text) break;
}
numitems = i;}
numitems = j;}

if (menubar) {
itemheight = 0;
Expand Down Expand Up @@ -276,8 +276,8 @@ void menuwindow::position(int X, int Y) {
}

// scroll so item i is visible on screen
void menuwindow::autoscroll(int i) {
int Y = y()+Fl::box_dx(box())+2+i*itemheight;
void menuwindow::autoscroll(int n) {
int Y = y()+Fl::box_dx(box())+2+n*itemheight;
if (Y <= Fl::y()) Y = Fl::y()-Y+10;
else {
Y = Y+itemheight-Fl::h()-Fl::y();
Expand All @@ -290,22 +290,22 @@ void menuwindow::autoscroll(int i) {

////////////////////////////////////////////////////////////////

void menuwindow::drawentry(const Fl_Menu_Item* m, int i, int erase) {
void menuwindow::drawentry(const Fl_Menu_Item* m, int n, int erase) {
if (!m) return; // this happens if -1 is selected item and redrawn

int BW = Fl::box_dx(box());
int x = BW;
int W = this->w();
int w = W-2*BW-1;
int y = BW+1+i*itemheight;
int y = BW+1+n*itemheight;
int h = itemheight - LEADING;

if (erase && i != selected) {
if (erase && n != selected) {
fl_color(button ? button->color() : FL_GRAY);
fl_rectf(x+1, y-(LEADING-2)/2, w-2, h+(LEADING-2));
}

m->draw(x, y, w, h, button, i==selected);
m->draw(x, y, w, h, button, n==selected);

// the shortcuts and arrows assumme fl_color() was left set by draw():
if (m->submenu()) {
Expand Down Expand Up @@ -337,8 +337,8 @@ void menuwindow::draw() {
if (damage() != FL_DAMAGE_CHILD) { // complete redraw
fl_draw_box(box(), 0, 0, w(), h(), color());
if (menu) {
const Fl_Menu_Item* m; int i;
for (m=menu, i=0; m->text; i++, m = m->next()) drawentry(m, i, 0);
const Fl_Menu_Item* m; int j;
for (m=menu, j=0; m->text; j++, m = m->next()) drawentry(m, j, 0);
}
} else {
if (damage() & FL_DAMAGE_CHILD && selected!=drawn_selected) { // change selection
Expand All @@ -349,8 +349,8 @@ void menuwindow::draw() {
drawn_selected = selected;
}

void menuwindow::set_selected(int i) {
if (i != selected) {selected = i; damage(FL_DAMAGE_CHILD);}
void menuwindow::set_selected(int n) {
if (n != selected) {selected = n; damage(FL_DAMAGE_CHILD);}
}

////////////////////////////////////////////////////////////////
Expand All @@ -361,26 +361,26 @@ int menuwindow::find_selected(int mx, int my) {
my -= y();
if (my < 0 || my >= h()) return -1;
if (!itemheight) { // menubar
int x = 3; int i = 0;
int x = 3; int n = 0;
const Fl_Menu_Item* m = menu;
for (; ; m = m->next(), i++) {
for (; ; m = m->next(), n++) {
if (!m->text) return -1;
x += m->measure(0, button) + 16;
if (x > mx) break;
}
return i;
return n;
}
if (mx < Fl::box_dx(box()) || mx >= w()) return -1;
int i = (my-Fl::box_dx(box())-1)/itemheight;
if (i < 0 || i>=numitems) return -1;
return i;
int n = (my-Fl::box_dx(box())-1)/itemheight;
if (n < 0 || n>=numitems) return -1;
return n;
}

// return horizontal position for item i in a menubar:
int menuwindow::titlex(int i) {
// return horizontal position for item n in a menubar:
int menuwindow::titlex(int n) {
const Fl_Menu_Item* m;
int x = 3;
for (m=menu; i--; m = m->next()) x += m->measure(0, button) + 16;
for (m=menu; n--; m = m->next()) x += m->measure(0, button) + 16;
return x;
}

Expand Down Expand Up @@ -497,11 +497,11 @@ int menuwindow::handle(int e) {
}
break;
case FL_SHORTCUT: {
for (int menu = p.nummenus; menu--;) {
menuwindow &mw = *(p.p[menu]);
for (int mymenu = p.nummenus; mymenu--;) {
menuwindow &mw = *(p.p[mymenu]);
int item; const Fl_Menu_Item* m = mw.menu->find_shortcut(&item);
if (m) {
setitem(m, menu, item);
setitem(m, mymenu, item);
if (!m->submenu()) p.state = DONE_STATE;
return 1;
}
Expand All @@ -511,16 +511,16 @@ int menuwindow::handle(int e) {
case FL_DRAG: {
int mx = Fl::event_x_root();
int my = Fl::event_y_root();
int item=0; int menu;
for (menu = p.nummenus-1; ; menu--) {
item = p.p[menu]->find_selected(mx, my);
int item=0; int mymenu;
for (mymenu = p.nummenus-1; ; mymenu--) {
item = p.p[mymenu]->find_selected(mx, my);
if (item >= 0) break;
if (menu <= 0) break;
if (mymenu <= 0) break;
}
setitem(menu, item);
setitem(mymenu, item);
if (e == FL_PUSH) {
if (p.current_item && p.current_item->submenu() // this is a menu title
&& item != p.p[menu]->selected // and it is not already on
&& item != p.p[mymenu]->selected // and it is not already on
&& !p.current_item->callback_) // and it does not have a callback
p.state = MENU_PUSH_STATE;
else
Expand Down Expand Up @@ -743,5 +743,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
}

//
// End of "$Id: Fl_Menu.cxx,v 1.18.2.10 2000/07/30 00:31:44 spitzak Exp $".
// End of "$Id: Fl_Menu.cxx,v 1.18.2.11 2000/11/20 19:02:20 easysw Exp $".
//
12 changes: 6 additions & 6 deletions src/Fl_Menu_Window.cxx
@@ -1,5 +1,5 @@
//
// "$Id: Fl_Menu_Window.cxx,v 1.8.2.3 2000/06/05 21:20:54 mike Exp $"
// "$Id: Fl_Menu_Window.cxx,v 1.8.2.4 2000/11/20 19:02:20 easysw Exp $"
//
// Menu window code for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -63,12 +63,12 @@ void Fl_Menu_Window::show() {
void Fl_Menu_Window::flush() {
#if HAVE_OVERLAY
if (!fl_overlay_visual || !overlay()) {Fl_Single_Window::flush(); return;}
Fl_X *i = Fl_X::i(this);
fl_window = i->xid;
if (!gc) gc = XCreateGC(fl_display, i->xid, 0, 0);
Fl_X *myi = Fl_X::i(this);
fl_window = myi->xid;
if (!gc) gc = XCreateGC(fl_display, myi->xid, 0, 0);
fl_gc = gc;
fl_overlay = 1;
fl_clip_region(i->region); i->region = 0; current_ = this;
fl_clip_region(myi->region); myi->region = 0; current_ = this;
draw();
fl_overlay = 0;
#else
Expand Down Expand Up @@ -97,5 +97,5 @@ Fl_Menu_Window::~Fl_Menu_Window() {
}

//
// End of "$Id: Fl_Menu_Window.cxx,v 1.8.2.3 2000/06/05 21:20:54 mike Exp $".
// End of "$Id: Fl_Menu_Window.cxx,v 1.8.2.4 2000/11/20 19:02:20 easysw Exp $".
//

0 comments on commit 7d432ff

Please sign in to comment.