Fix compiler warnings.

Use fl_yes and fl_no for the Forms emulation, instead of the hardcoded
strings.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4283 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2005-04-14 13:56:07 +00:00
parent 217f77c9ef
commit 70c4cd102f
5 changed files with 15 additions and 13 deletions

View File

@ -645,7 +645,7 @@ fl_add_free(int t,double x,double y,double w,double h,const char* l,
#include "fl_ask.H" #include "fl_ask.H"
#include "fl_show_colormap.H" #include "fl_show_colormap.H"
inline int fl_show_question(const char* c, int = 0) {return fl_choice(c,"No","Yes",0L);} inline int fl_show_question(const char* c, int = 0) {return fl_choice("%s",fl_no,fl_yes,0L,c);}
FL_EXPORT void fl_show_message(const char *,const char *,const char *); FL_EXPORT void fl_show_message(const char *,const char *,const char *);
FL_EXPORT void fl_show_alert(const char *,const char *,const char *,int=0); FL_EXPORT void fl_show_alert(const char *,const char *,const char *,int=0);
FL_EXPORT int fl_show_question(const char *,const char *,const char *); FL_EXPORT int fl_show_question(const char *,const char *,const char *);

View File

@ -982,10 +982,10 @@ void print_menu_cb(Fl_Widget *, void *) {
fl_draw(basename, 0, fontsize); fl_draw(basename, 0, fontsize);
fl_draw(date, 0.5 * (width - fl_width(date)), fontsize); fl_draw(date, (width - (int)fl_width(date)) / 2, fontsize);
sprintf(buffer, "%d/%d", winpage + 1, num_windows); sprintf(buffer, "%d/%d", winpage + 1, num_windows);
fl_draw(buffer, width - fl_width(buffer), fontsize); fl_draw(buffer, width - (int)fl_width(buffer), fontsize);
// Get window image... // Get window image...
uchar *pixels; // Window image data uchar *pixels; // Window image data
@ -1000,8 +1000,8 @@ void print_menu_cb(Fl_Widget *, void *) {
// Figure out the window size, first at 100 PPI and then scaled // Figure out the window size, first at 100 PPI and then scaled
// down if that is too big... // down if that is too big...
ww = w * xdpi / 100.0; ww = w * xdpi / 100;
hh = h * ydpi / 100.0; hh = h * ydpi / 100;
if (ww > width) { if (ww > width) {
ww = width; ww = width;

View File

@ -95,8 +95,10 @@ int Fl_Gl_Window::mode(int m, const int *a) {
if (m == mode_ && a == alist) return 0; if (m == mode_ && a == alist) return 0;
#ifndef __APPLE__ #ifndef __APPLE__
int oldmode = mode_; int oldmode = mode_;
#endif // !__APPLE__
#if !defined(WIN32) && !defined(__APPLE__)
Fl_Gl_Choice* oldg = g; Fl_Gl_Choice* oldg = g;
#endif #endif // !WIN32 && !__APPLE__
context(0); context(0);
mode_ = m; alist = a; mode_ = m; alist = a;
if (shown()) { if (shown()) {

View File

@ -158,9 +158,9 @@ void Fl::add_fd(int n, int events, void (*cb)(int, void*), void *v) {
if (events & POLLERR) mask |= FD_CLOSE; if (events & POLLERR) mask |= FD_CLOSE;
WSAAsyncSelect(n, fl_window, WM_FLSELECT, mask); WSAAsyncSelect(n, fl_window, WM_FLSELECT, mask);
#else #else
if (events & POLLIN) FD_SET(n, &fdsets[0]); if (events & POLLIN) FD_SET((unsigned)n, &fdsets[0]);
if (events & POLLOUT) FD_SET(n, &fdsets[1]); if (events & POLLOUT) FD_SET((unsigned)n, &fdsets[1]);
if (events & POLLERR) FD_SET(n, &fdsets[2]); if (events & POLLERR) FD_SET((unsigned)n, &fdsets[2]);
if (n > maxfd) maxfd = n; if (n > maxfd) maxfd = n;
#endif // USE_ASYNC_SELECT #endif // USE_ASYNC_SELECT
} }

View File

@ -43,7 +43,7 @@ int fl_scandir(const char *dirname, struct dirent ***namelist,
unsigned long ret; unsigned long ret;
len = strlen(dirname); len = strlen(dirname);
findIn = (char *)malloc(len+5); findIn = (char *)malloc((size_t)(len+5));
if (!findIn) return -1; if (!findIn) return -1;
@ -72,7 +72,7 @@ int fl_scandir(const char *dirname, struct dirent ***namelist,
} }
if (!select || (*select)(selectDir)) { if (!select || (*select)(selectDir)) {
if (nDir==NDir) { if (nDir==NDir) {
struct dirent **tempDir = (struct dirent **)calloc(sizeof(struct dirent*), NDir+33); struct dirent **tempDir = (struct dirent **)calloc(sizeof(struct dirent*), (size_t)(NDir+33));
if (NDir) memcpy(tempDir, dir, sizeof(struct dirent*)*NDir); if (NDir) memcpy(tempDir, dir, sizeof(struct dirent*)*NDir);
if (dir) free(dir); if (dir) free(dir);
dir = tempDir; dir = tempDir;
@ -94,7 +94,7 @@ int fl_scandir(const char *dirname, struct dirent ***namelist,
free (findIn); free (findIn);
if (compar) qsort (dir, nDir, sizeof(*dir), if (compar) qsort(dir, (size_t)nDir, sizeof(*dir),
(int(*)(const void*, const void*))compar); (int(*)(const void*, const void*))compar);
*namelist = dir; *namelist = dir;