Fix compiler warnings/errors.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5848 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
2007-05-20 16:18:31 +00:00
parent 56a50b9f0e
commit d8c288df3e
7 changed files with 47 additions and 47 deletions
+4 -4
View File
@@ -212,11 +212,11 @@ public:
// multi-head support: // multi-head support:
static int screen_count(); static int screen_count();
static void screen_xywh(int &x, int &y, int &w, int &h) { static void screen_xywh(int &X, int &Y, int &W, int &H) {
screen_xywh(x, y, w, h, e_x_root, e_y_root); screen_xywh(X, Y, W, H, e_x_root, e_y_root);
} }
static void screen_xywh(int &x, int &y, int &w, int &h, int mx, int my); static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my);
static void screen_xywh(int &x, int &y, int &w, int &h, int n); static void screen_xywh(int &X, int &Y, int &W, int &H, int n);
// color map: // color map:
static void set_color(Fl_Color, uchar, uchar, uchar); static void set_color(Fl_Color, uchar, uchar, uchar);
+1 -1
View File
@@ -887,7 +887,7 @@ if test -n "$GCC"; then
OPTIM="-Wall -Wunused -Wno-format-y2k $OPTIM" OPTIM="-Wall -Wunused -Wno-format-y2k $OPTIM"
# The following additional warnings are useful for tracking down problems... # The following additional warnings are useful for tracking down problems...
OPTIM="-Wshadow -Wconversion $OPTIM" #OPTIM="-Wshadow -Wconversion $OPTIM"
# Set the default compiler optimizations... # Set the default compiler optimizations...
if test -z "$DEBUGFLAG"; then if test -z "$DEBUGFLAG"; then
+3 -6
View File
@@ -2571,7 +2571,7 @@ void Fl_Text_Display::measure_deleted_lines(int pos, int nDeleted) {
int nVisLines = mNVisibleLines; int nVisLines = mNVisibleLines;
int *lineStarts = mLineStarts; int *lineStarts = mLineStarts;
int countFrom, lineStart; int countFrom, lineStart;
int visLineNum = 0, nLines = 0, i; int nLines = 0, i;
/* /*
** Determine where to begin searching: either the previous newline, or ** Determine where to begin searching: either the previous newline, or
** if possible, limit to the start of the (original) previous displayed ** if possible, limit to the start of the (original) previous displayed
@@ -2581,11 +2581,8 @@ void Fl_Text_Display::measure_deleted_lines(int pos, int nDeleted) {
for (i=nVisLines-1; i>0; i--) for (i=nVisLines-1; i>0; i--)
if (lineStarts[i] != -1 && pos >= lineStarts[i]) if (lineStarts[i] != -1 && pos >= lineStarts[i])
break; break;
if (i > 0) { if (i > 0) countFrom = lineStarts[i-1];
countFrom = lineStarts[i-1]; else countFrom = buf->line_start(pos);
visLineNum = i-1;
} else
countFrom = buf->line_start(pos);
} else } else
countFrom = buf->line_start(pos); countFrom = buf->line_start(pos);
+3
View File
@@ -206,6 +206,9 @@ Fl_Tooltip::exit_(Fl_Widget *w) {
void void
Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t) Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t)
{ {
(void)x;
(void)w;
#ifdef DEBUG #ifdef DEBUG
printf("Fl_Tooltip::enter_area(wid=%p, x=%d, y=%d, w=%d, h=%d, t=\"%s\")\n", printf("Fl_Tooltip::enter_area(wid=%p, x=%d, y=%d, w=%d, h=%d, t=\"%s\")\n",
wid, x, y, w, h, t ? t : "(null)"); wid, x, y, w, h, t ? t : "(null)");
+1 -1
View File
@@ -96,7 +96,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
return rc; return rc;
} }
#elif defined(__future_compiler_test) #elif defined(__hpux)
/* This code to prevent "empty translation unit" or similar warnings... */ /* This code to prevent "empty translation unit" or similar warnings... */
static void dummy(void) {} static void dummy(void) {}
#endif // WIN32 && !FL_DLL && !__GNUC__ #endif // WIN32 && !FL_DLL && !__GNUC__
+34 -34
View File
@@ -149,7 +149,7 @@ int Fl::screen_count() {
} }
// Return the screen bounding rect for the given mouse position... // Return the screen bounding rect for the given mouse position...
void Fl::screen_xywh(int &x, int &y, int &w, int &h, int mx, int my) { void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my) {
if (!num_screens) screen_init(); if (!num_screens) screen_init();
#ifdef WIN32 #ifdef WIN32
@@ -159,10 +159,10 @@ void Fl::screen_xywh(int &x, int &y, int &w, int &h, int mx, int my) {
for (i = 0; i < num_screens; i ++) { for (i = 0; i < num_screens; i ++) {
if (mx >= screens[i].left && mx < screens[i].right && if (mx >= screens[i].left && mx < screens[i].right &&
my >= screens[i].top && my < screens[i].bottom) { my >= screens[i].top && my < screens[i].bottom) {
x = screens[i].left; X = screens[i].left;
y = screens[i].top; Y = screens[i].top;
w = screens[i].right - screens[i].left; W = screens[i].right - screens[i].left;
h = screens[i].bottom - screens[i].top; H = screens[i].bottom - screens[i].top;
return; return;
} }
} }
@@ -176,10 +176,10 @@ void Fl::screen_xywh(int &x, int &y, int &w, int &h, int mx, int my) {
mx < (screens[i].x + screens[i].width) && mx < (screens[i].x + screens[i].width) &&
my >= screens[i].y && my >= screens[i].y &&
my < (screens[i].y + screens[i].height)) { my < (screens[i].y + screens[i].height)) {
x = screens[i].x; X = screens[i].x;
y = screens[i].y; Y = screens[i].y;
w = screens[i].width; W = screens[i].width;
h = screens[i].height; H = screens[i].height;
return; return;
} }
} }
@@ -193,10 +193,10 @@ void Fl::screen_xywh(int &x, int &y, int &w, int &h, int mx, int my) {
mx < (screens[i].x_org + screens[i].width) && mx < (screens[i].x_org + screens[i].width) &&
my >= screens[i].y_org && my >= screens[i].y_org &&
my < (screens[i].y_org + screens[i].height)) { my < (screens[i].y_org + screens[i].height)) {
x = screens[i].x_org; X = screens[i].x_org;
y = screens[i].y_org; Y = screens[i].y_org;
w = screens[i].width; W = screens[i].width;
h = screens[i].height; H = screens[i].height;
return; return;
} }
} }
@@ -206,48 +206,48 @@ void Fl::screen_xywh(int &x, int &y, int &w, int &h, int mx, int my) {
(void)my; (void)my;
#endif // WIN32 #endif // WIN32
x = Fl::x(); X = Fl::x();
y = Fl::y(); Y = Fl::y();
w = Fl::w(); W = Fl::w();
h = Fl::h(); H = Fl::h();
} }
// Return the screen bounding rect for the given screen... // Return the screen bounding rect for the given screen...
void Fl::screen_xywh(int &x, int &y, int &w, int &h, int n) { void Fl::screen_xywh(int &X, int &Y, int &W, int &H, int n) {
if (!num_screens) screen_init(); if (!num_screens) screen_init();
#ifdef WIN32 #ifdef WIN32
if (num_screens > 1 && n >= 0 && n < num_screens) { if (num_screens > 1 && n >= 0 && n < num_screens) {
x = screens[n].left; X = screens[n].left;
y = screens[n].top; Y = screens[n].top;
w = screens[n].right - screens[n].left; W = screens[n].right - screens[n].left;
h = screens[n].bottom - screens[n].top; H = screens[n].bottom - screens[n].top;
return; return;
} }
#elif defined(__APPLE__) #elif defined(__APPLE__)
if (num_screens > 1 && n >= 0 && n < num_screens) { if (num_screens > 1 && n >= 0 && n < num_screens) {
x = screens[n].x; X = screens[n].x;
y = screens[n].y; Y = screens[n].y;
w = screens[n].width; W = screens[n].width;
h = screens[n].height; H = screens[n].height;
return; return;
} }
#elif HAVE_XINERAMA #elif HAVE_XINERAMA
if (num_screens > 1 && n >= 0 && n < num_screens) { if (num_screens > 1 && n >= 0 && n < num_screens) {
x = screens[n].x_org; X = screens[n].x_org;
y = screens[n].y_org; Y = screens[n].y_org;
w = screens[n].width; W = screens[n].width;
h = screens[n].height; H = screens[n].height;
return; return;
} }
#else #else
(void)n; (void)n;
#endif // WIN32 #endif // WIN32
x = Fl::x(); X = Fl::x();
y = Fl::y(); Y = Fl::y();
w = Fl::w(); W = Fl::w();
h = Fl::h(); H = Fl::h();
} }
+1 -1
View File
@@ -738,7 +738,7 @@ BlockWindow::handle(int event) {
mx = w() - Fl::event_x() + BLOCK_SIZE; mx = w() - Fl::event_x() + BLOCK_SIZE;
my = h() - Fl::event_y(); my = h() - Fl::event_y();
count = 0; count = 0;
b = c->blocks; b = 0;
for (j = 0, c = columns_; !count && j < num_columns_; j ++, c ++) for (j = 0, c = columns_; !count && j < num_columns_; j ++, c ++)
for (k = 0, b = c->blocks; !count && k < c->num_blocks; k ++, b ++) for (k = 0, b = c->blocks; !count && k < c->num_blocks; k ++, b ++)