From 975cd3b4fd1dc6cad320f62bfbf25b38d60e9181 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Fri, 18 Oct 2024 17:01:34 +0200 Subject: [PATCH] Remove unnecessary casts from glut demo programs These casts are no longer useful since commit 5cd9f6fb8058f92d: "STR #3323: glutAddMenuEntry now has a const label argument" --- CHANGES.txt | 3 ++- test/fractals.cxx | 26 +++++++++++++------------- test/glpuzzle.cxx | 10 +++++----- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3ef78a735..e680547d8 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -Changes in FLTK 1.4.0 Released: Feb ?? 2024 +Changes in FLTK 1.4.0 Released: Oct ?? 2024 General Information about this Release @@ -243,6 +243,7 @@ Changes in FLTK 1.4.0 Released: Feb ?? 2024 - Some methods of Fl_Tabs are now virtual and/or protected for easier subclassing without code duplication (STR #3211 and others). To be continued... + - glutAddMenuEntry() now has a *const* label argument (STR #3323) - Separated Fl_Input_Choice.H and Fl_Input_Choice.cxx (STR #2750, #2752). - Separated Fl_Spinner.H and Fl_Spinner.cxx (STR #2776). - New method Fl_Spinner::wrap(int) allows to set wrap mode at bounds if diff --git a/test/fractals.cxx b/test/fractals.cxx index bbdde0569..d9cf9905f 100644 --- a/test/fractals.cxx +++ b/test/fractals.cxx @@ -724,28 +724,28 @@ void MenuInit(void) int submenu3, submenu2, submenu1; submenu1 = glutCreateMenu(setlevel); - glutAddMenuEntry((char *)"0", 0); glutAddMenuEntry((char *)"1", 1); - glutAddMenuEntry((char *)"2", 2); glutAddMenuEntry((char *)"3", 3); - glutAddMenuEntry((char *)"4", 4); glutAddMenuEntry((char *)"5", 5); - glutAddMenuEntry((char *)"6", 6); glutAddMenuEntry((char *)"7", 7); - glutAddMenuEntry((char *)"8", 8); + glutAddMenuEntry("0", 0); glutAddMenuEntry("1", 1); + glutAddMenuEntry("2", 2); glutAddMenuEntry("3", 3); + glutAddMenuEntry("4", 4); glutAddMenuEntry("5", 5); + glutAddMenuEntry("6", 6); glutAddMenuEntry("7", 7); + glutAddMenuEntry("8", 8); submenu2 = glutCreateMenu(choosefract); - glutAddMenuEntry((char *)"Moutain", MOUNTAIN); - glutAddMenuEntry((char *)"Tree", TREE); - glutAddMenuEntry((char *)"Island", ISLAND); + glutAddMenuEntry("Moutain", MOUNTAIN); + glutAddMenuEntry("Tree", TREE); + glutAddMenuEntry("Island", ISLAND); submenu3 = glutCreateMenu(agvSwitchMoveMode); - glutAddMenuEntry((char *)"Flying", FLYING); - glutAddMenuEntry((char *)"Polar", POLAR); + glutAddMenuEntry("Flying", FLYING); + glutAddMenuEntry("Polar", POLAR); glutCreateMenu(handlemenu); glutAddSubMenu((char *)"Level", submenu1); glutAddSubMenu((char *)"Fractal", submenu2); glutAddSubMenu((char *)"Movement", submenu3); - glutAddMenuEntry((char *)"New Fractal", MENU_RAND); - glutAddMenuEntry((char *)"Toggle Axes", MENU_AXES); - glutAddMenuEntry((char *)"Quit", MENU_QUIT); + glutAddMenuEntry("New Fractal", MENU_RAND); + glutAddMenuEntry("Toggle Axes", MENU_AXES); + glutAddMenuEntry("Quit", MENU_QUIT); glutAttachMenu(GLUT_RIGHT_BUTTON); } diff --git a/test/glpuzzle.cxx b/test/glpuzzle.cxx index 2e8a307d5..f6d1c529e 100644 --- a/test/glpuzzle.cxx +++ b/test/glpuzzle.cxx @@ -4,7 +4,7 @@ // This is a GLUT demo program to demonstrate fltk's GLUT emulation. // Search for "fltk" to find all the changes // -// Copyright 1998-2020 by Bill Spitzak and others. +// Copyright 1998-2024 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -1485,10 +1485,10 @@ main(int argc, char **argv) glutMouseFunc(mouse); glutVisibilityFunc(visibility); glutCreateMenu(menu); - glutAddMenuEntry((char *)"Normal pos", 1); - glutAddMenuEntry((char *)"Solve", 2); - glutAddMenuEntry((char *)"Reset", 3); - glutAddMenuEntry((char *)"Quit", 4); + glutAddMenuEntry("Normal pos", 1); + glutAddMenuEntry("Solve", 2); + glutAddMenuEntry("Reset", 3); + glutAddMenuEntry("Quit", 4); glutAttachMenu(GLUT_RIGHT_BUTTON); glutMainLoop(); return 0; /* ANSI C requires main to return int. */