mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 03:15:21 +08:00
Fix compiler warning when compiled with USING_XCODE [-fpermissive].
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11561 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+6
-7
@@ -363,7 +363,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(char* fname)
|
||||||
/* Loads the menu file. Returns whether successful. */
|
/* Loads the menu file. Returns whether successful. */
|
||||||
{
|
{
|
||||||
FILE *fin = 0;
|
FILE *fin = 0;
|
||||||
@@ -375,7 +375,7 @@ int load_the_menu(const char* fname)
|
|||||||
// mac os bundle menu detection:
|
// mac os bundle menu detection:
|
||||||
char* pos = strrchr(fname,'/');
|
char* pos = strrchr(fname,'/');
|
||||||
if (!pos) return 0;
|
if (!pos) return 0;
|
||||||
*pos='\0';
|
*pos = '\0';
|
||||||
pos = strrchr(fname,'/');
|
pos = strrchr(fname,'/');
|
||||||
if (!pos) return 0;
|
if (!pos) return 0;
|
||||||
strcpy(pos,"/Resources/demo.menu");
|
strcpy(pos,"/Resources/demo.menu");
|
||||||
@@ -394,7 +394,7 @@ int load_the_menu(const char* fname)
|
|||||||
*d = *s++;
|
*d = *s++;
|
||||||
if (!*d) break;
|
if (!*d) break;
|
||||||
}
|
}
|
||||||
// interprete the line
|
// interpret the line
|
||||||
j = 0; i = 0;
|
j = 0; i = 0;
|
||||||
while (line[i] == ' ' || line[i] == '\t') i++;
|
while (line[i] == ' ' || line[i] == '\t') i++;
|
||||||
if (line[i] == '\n') continue;
|
if (line[i] == '\n') continue;
|
||||||
@@ -403,8 +403,7 @@ int load_the_menu(const char* fname)
|
|||||||
mname[j] = '\0';
|
mname[j] = '\0';
|
||||||
if (line[i] == ':') i++;
|
if (line[i] == ':') i++;
|
||||||
j = 0;
|
j = 0;
|
||||||
while (line[i] != ':' && line[i] != '\n')
|
while (line[i] != ':' && line[i] != '\n') {
|
||||||
{
|
|
||||||
if (line[i] == '\\') {
|
if (line[i] == '\\') {
|
||||||
i++;
|
i++;
|
||||||
if (line[i] == 'n') iname[j++] = '\n';
|
if (line[i] == 'n') iname[j++] = '\n';
|
||||||
@@ -434,7 +433,7 @@ int main(int argc, char **argv) {
|
|||||||
buf[ strlen(buf)-1 ] = 0;
|
buf[ strlen(buf)-1 ] = 0;
|
||||||
#endif
|
#endif
|
||||||
fl_filename_setext(buf,".menu");
|
fl_filename_setext(buf,".menu");
|
||||||
const char *fname = buf;
|
char *fname = buf;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if (!Fl::args(argc,argv,i) || i < argc-1)
|
if (!Fl::args(argc,argv,i) || i < argc-1)
|
||||||
Fl::fatal("Usage: %s <switches> <menufile>\n%s",argv[0],Fl::help);
|
Fl::fatal("Usage: %s <switches> <menufile>\n%s",argv[0],Fl::help);
|
||||||
@@ -443,7 +442,7 @@ int main(int argc, char **argv) {
|
|||||||
create_the_forms();
|
create_the_forms();
|
||||||
|
|
||||||
if (!load_the_menu(fname)) Fl::fatal("Can't open %s",fname);
|
if (!load_the_menu(fname)) Fl::fatal("Can't open %s",fname);
|
||||||
if (buf!=fname)
|
if (buf != fname)
|
||||||
strcpy(buf,fname);
|
strcpy(buf,fname);
|
||||||
const char *c = fl_filename_name(buf);
|
const char *c = fl_filename_name(buf);
|
||||||
if (c > buf) {
|
if (c > buf) {
|
||||||
|
|||||||
Reference in New Issue
Block a user