mirror of
https://github.com/fltk/fltk.git
synced 2026-05-30 13:05:35 +08:00
Removed some (not all) of the warnings when compiled with -Wwrite-strings,
this should also get similar warnings Solaris produces. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1292 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+5
-4
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: fluid.cxx,v 1.15.2.8 2000/06/08 08:26:45 bill Exp $"
|
// "$Id: fluid.cxx,v 1.15.2.9 2000/08/20 04:35:16 spitzak Exp $"
|
||||||
//
|
//
|
||||||
// FLUID main entry for the Fast Light Tool Kit (FLTK).
|
// FLUID main entry for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -208,7 +208,7 @@ void write_cb(Fl_Widget *, void *) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void write_strings_cb(Fl_Widget *, void *) {
|
void write_strings_cb(Fl_Widget *, void *) {
|
||||||
static char *exts[] = { ".txt", ".po", ".msg" };
|
static const char *exts[] = { ".txt", ".po", ".msg" };
|
||||||
if (!filename) {
|
if (!filename) {
|
||||||
save_cb(0,0);
|
save_cb(0,0);
|
||||||
if (!filename) return;
|
if (!filename) return;
|
||||||
@@ -421,11 +421,12 @@ static int arg(int argc, char** argv, int& i) {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
static void sigint(SIGARG) {
|
static void sigint(SIGARG) {
|
||||||
signal(SIGINT,sigint);
|
signal(SIGINT,sigint);
|
||||||
exit_cb(0,0);
|
exit_cb(0,0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc,char **argv) {
|
int main(int argc,char **argv) {
|
||||||
@@ -464,5 +465,5 @@ int main(int argc,char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: fluid.cxx,v 1.15.2.8 2000/06/08 08:26:45 bill Exp $".
|
// End of "$Id: fluid.cxx,v 1.15.2.9 2000/08/20 04:35:16 spitzak Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
+4
-2
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: Fl_x.cxx,v 1.24.2.18 2000/06/18 00:38:41 bill Exp $"
|
// "$Id: Fl_x.cxx,v 1.24.2.19 2000/08/20 04:35:16 spitzak Exp $"
|
||||||
//
|
//
|
||||||
// X specific code for the Fast Light Tool Kit (FLTK).
|
// X specific code for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -242,9 +242,11 @@ static Atom wm_delete_window;
|
|||||||
static Atom wm_protocols;
|
static Atom wm_protocols;
|
||||||
static Atom _motif_wm_hints;
|
static Atom _motif_wm_hints;
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
static void fd_callback(int,void *) {do_queued_events();}
|
static void fd_callback(int,void *) {do_queued_events();}
|
||||||
|
|
||||||
static int io_error_handler(Display*) {Fl::fatal("X I/O error"); return 0;}
|
static int io_error_handler(Display*) {Fl::fatal("X I/O error"); return 0;}
|
||||||
|
}
|
||||||
|
|
||||||
static int xerror_handler(Display* d, XErrorEvent* e) {
|
static int xerror_handler(Display* d, XErrorEvent* e) {
|
||||||
char buf1[128], buf2[128];
|
char buf1[128], buf2[128];
|
||||||
@@ -896,5 +898,5 @@ void Fl_Window::make_current() {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: Fl_x.cxx,v 1.24.2.18 2000/06/18 00:38:41 bill Exp $".
|
// End of "$Id: Fl_x.cxx,v 1.24.2.19 2000/08/20 04:35:16 spitzak Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: fl_ask.cxx,v 1.8.2.6 2000/06/05 21:21:05 mike Exp $"
|
// "$Id: fl_ask.cxx,v 1.8.2.7 2000/08/20 04:35:16 spitzak Exp $"
|
||||||
//
|
//
|
||||||
// Standard dialog functions for the Fast Light Tool Kit (FLTK).
|
// Standard dialog functions for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -50,7 +50,7 @@ static Fl_Box *message;
|
|||||||
static Fl_Box *icon;
|
static Fl_Box *icon;
|
||||||
static Fl_Button *button[3];
|
static Fl_Button *button[3];
|
||||||
static Fl_Input *input;
|
static Fl_Input *input;
|
||||||
static char *iconlabel = "?";
|
static const char *iconlabel = "?";
|
||||||
uchar fl_message_font_ = 0;
|
uchar fl_message_font_ = 0;
|
||||||
uchar fl_message_size_ = 14;
|
uchar fl_message_size_ = 14;
|
||||||
|
|
||||||
@@ -230,5 +230,5 @@ const char *fl_password(const char *fmt, const char *defstr, ...) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: fl_ask.cxx,v 1.8.2.6 2000/06/05 21:21:05 mike Exp $".
|
// End of "$Id: fl_ask.cxx,v 1.8.2.7 2000/08/20 04:35:16 spitzak Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: fl_file_chooser.cxx,v 1.10.2.5 2000/06/05 21:21:08 mike Exp $"
|
// "$Id: fl_file_chooser.cxx,v 1.10.2.6 2000/08/20 04:35:16 spitzak Exp $"
|
||||||
//
|
//
|
||||||
// File chooser widget for the Fast Light Tool Kit (FLTK).
|
// File chooser widget for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -438,7 +438,7 @@ static void input_cb(Fl_Widget*, void* v) {
|
|||||||
static void up_cb(Fl_Widget*, void* v) { // the .. button
|
static void up_cb(Fl_Widget*, void* v) { // the .. button
|
||||||
FCW* w = (FCW*)v;
|
FCW* w = (FCW*)v;
|
||||||
char* p;
|
char* p;
|
||||||
char* newname;
|
const char* newname;
|
||||||
char buf[FL_PATH_MAX];
|
char buf[FL_PATH_MAX];
|
||||||
p = w->browser.listed+w->browser.dirend-1; // point right before last '/'
|
p = w->browser.listed+w->browser.dirend-1; // point right before last '/'
|
||||||
if (p < w->browser.listed)
|
if (p < w->browser.listed)
|
||||||
@@ -632,5 +632,5 @@ char* fl_file_chooser(const char* message, const char* pat, const char* fname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: fl_file_chooser.cxx,v 1.10.2.5 2000/06/05 21:21:08 mike Exp $".
|
// End of "$Id: fl_file_chooser.cxx,v 1.10.2.6 2000/08/20 04:35:16 spitzak Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: fl_set_fonts.cxx,v 1.6.2.3 2000/06/05 21:21:10 mike Exp $"
|
// "$Id: fl_set_fonts.cxx,v 1.6.2.4 2000/08/20 04:35:16 spitzak Exp $"
|
||||||
//
|
//
|
||||||
// More font utilities for the Fast Light Tool Kit (FLTK).
|
// More font utilities for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -145,6 +145,7 @@ const char* Fl::get_font_name(Fl_Font fnum, int* ap) {
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
// sort raw (non-'*') X font names into perfect order:
|
// sort raw (non-'*') X font names into perfect order:
|
||||||
|
|
||||||
static int ultrasort(const void *aa, const void *bb) {
|
static int ultrasort(const void *aa, const void *bb) {
|
||||||
@@ -214,13 +215,14 @@ static int ultrasort(const void *aa, const void *bb) {
|
|||||||
// something wrong, just do a string compare...
|
// something wrong, just do a string compare...
|
||||||
return strcmp(*(char**)aa, *(char**)bb);
|
return strcmp(*(char**)aa, *(char**)bb);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// converts a X font name to a standard starname, returns point size:
|
// converts a X font name to a standard starname, returns point size:
|
||||||
static int to_canonical(char *to, const char *from) {
|
static int to_canonical(char *to, const char *from) {
|
||||||
char* c = fl_find_fontsize((char*)from);
|
char* c = fl_find_fontsize((char*)from);
|
||||||
if (!c) return -1; // no point size found...
|
if (!c) return -1; // no point size found...
|
||||||
char* endptr;
|
const char* endptr;
|
||||||
int size = strtol(c,&endptr,10);
|
int size = strtol(c,(char**)&endptr,10);
|
||||||
if (from[0] == '-') {
|
if (from[0] == '-') {
|
||||||
// replace the "foundry" with -*-:
|
// replace the "foundry" with -*-:
|
||||||
*to++ = '-'; *to++ = '*';
|
*to++ = '-'; *to++ = '*';
|
||||||
@@ -327,5 +329,5 @@ int Fl::get_font_sizes(Fl_Font fnum, int*& sizep) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: fl_set_fonts.cxx,v 1.6.2.3 2000/06/05 21:21:10 mike Exp $".
|
// End of "$Id: fl_set_fonts.cxx,v 1.6.2.4 2000/08/20 04:35:16 spitzak Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: CubeMain.cxx,v 1.2.2.2 2000/06/05 21:21:14 mike Exp $"
|
// "$Id: CubeMain.cxx,v 1.2.2.3 2000/08/20 04:35:17 spitzak Exp $"
|
||||||
//
|
//
|
||||||
// CubeView class definitions for the Fast Light Tool Kit (FLTK).
|
// CubeView class definitions for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
#include "CubeViewUI.h"
|
#include "CubeViewUI.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv) {
|
main(int /*argc*/, char **/*argv*/) {
|
||||||
|
|
||||||
CubeViewUI *cvui=new CubeViewUI;
|
CubeViewUI *cvui=new CubeViewUI;
|
||||||
|
|
||||||
@@ -43,5 +43,5 @@ main(int argc, char **argv) {
|
|||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: CubeMain.cxx,v 1.2.2.2 2000/06/05 21:21:14 mike Exp $".
|
// End of "$Id: CubeMain.cxx,v 1.2.2.3 2000/08/20 04:35:17 spitzak Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
+7
-7
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: demo.cxx,v 1.8.2.3 2000/06/05 21:21:18 mike Exp $"
|
// "$Id: demo.cxx,v 1.8.2.4 2000/08/20 04:35:17 spitzak Exp $"
|
||||||
//
|
//
|
||||||
// Main demo program for the Fast Light Tool Kit (FLTK).
|
// Main demo program for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -91,7 +91,7 @@ typedef struct {
|
|||||||
MENU menus[MAXMENU];
|
MENU menus[MAXMENU];
|
||||||
int mennumb = 0;
|
int mennumb = 0;
|
||||||
|
|
||||||
int find_menu(char nnn[])
|
int find_menu(const char* nnn)
|
||||||
/* Returns the number of a given menu name. */
|
/* Returns the number of a given menu name. */
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -100,7 +100,7 @@ int find_menu(char nnn[])
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_menu(char nnn[])
|
void create_menu(const char* nnn)
|
||||||
/* Creates a new menu with name nnn */
|
/* Creates a new menu with name nnn */
|
||||||
{
|
{
|
||||||
if (mennumb == MAXMENU -1) return;
|
if (mennumb == MAXMENU -1) return;
|
||||||
@@ -109,7 +109,7 @@ void create_menu(char nnn[])
|
|||||||
mennumb++;
|
mennumb++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void addto_menu(char men[], char item[], char comm[])
|
void addto_menu(const char* men, const char* item, const char* comm)
|
||||||
/* Adds an item to a menu */
|
/* Adds an item to a menu */
|
||||||
{
|
{
|
||||||
int n = find_menu(men);
|
int n = find_menu(men);
|
||||||
@@ -160,7 +160,7 @@ int numb2but(int inumb, int maxnumb)
|
|||||||
char stack[64][32];
|
char stack[64][32];
|
||||||
char stsize = 0;
|
char stsize = 0;
|
||||||
|
|
||||||
void push_menu(char nnn[])
|
void push_menu(const char* nnn)
|
||||||
/* Pushes a menu to be visible */
|
/* Pushes a menu to be visible */
|
||||||
{
|
{
|
||||||
int n,i,bn;
|
int n,i,bn;
|
||||||
@@ -267,7 +267,7 @@ void doback(Fl_Widget *, void *) {pop_menu();}
|
|||||||
|
|
||||||
void doexit(Fl_Widget *, void *) {exit(0);}
|
void doexit(Fl_Widget *, void *) {exit(0);}
|
||||||
|
|
||||||
int load_the_menu(const char fname[])
|
int load_the_menu(const char* fname)
|
||||||
/* Loads the menu file. Returns whether successful. */
|
/* Loads the menu file. Returns whether successful. */
|
||||||
{
|
{
|
||||||
FILE *fin;
|
FILE *fin;
|
||||||
@@ -332,6 +332,6 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: demo.cxx,v 1.8.2.3 2000/06/05 21:21:18 mike Exp $".
|
// End of "$Id: demo.cxx,v 1.8.2.4 2000/08/20 04:35:17 spitzak Exp $".
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user