Skip to content

Commit e7975c9

Browse files
authored
make the glui library variable allow_glui_post_redisplay private (only visible within the library) to eliminate smokeview compiler warnings (#2630)
* glui source: make variable allow_glui_post_redisplay private to eliminate 'defined but not used warnings' - addresses smokeview issue 2628 * smv build: update makefile to avoid false positives * smv build: remove sanitize build option
1 parent 98e0ff1 commit e7975c9

7 files changed

Lines changed: 21 additions & 20 deletions

File tree

Build/scripts/setopts.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ LIBSDIR=`pwd`
1010

1111
SMV_MAKE_OPTS=
1212
TEST=
13-
SANITIZE=
1413
if [ "`uname`" == "Darwin" ]; then
1514
GLUT=
1615
GLIBDIROPT=
@@ -34,7 +33,7 @@ BUILD_LIBS=
3433
BUILD_ALL=1
3534
GLTYPE=COCOA
3635
TESTOPT=
37-
while getopts 'CfGhiIl:LprSX' OPTION
36+
while getopts 'CfGhiIl:LprX' OPTION
3837
do
3938
case $OPTION in
4039
C)
@@ -55,7 +54,6 @@ case $OPTION in
5554
echo "-i - incremental build"
5655
echo "-L - rebuild all libraries"
5756
echo "-p - build a profiling version of smokeview"
58-
echo "-S - build smokeview with sanitize debug options"
5957
exit
6058
;;
6159
i)
@@ -77,9 +75,6 @@ case $OPTION in
7775
;;
7876
r)
7977
;;
80-
S)
81-
SANITIZE=1
82-
;;
8378
X)
8479
GLTYPE=XQUARTZ
8580
;;
@@ -89,7 +84,6 @@ done
8984
export SMV_MAKE_OPTS
9085
export GLUT
9186
export TEST
92-
export SANITIZE
9387
export GLTYPE
9488

9589
# this parameter is only for the mac

Build/smokeview/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ gnu_linux_db : $(obj)
293293

294294
# ------------- gnu_linux ----------------
295295

296-
gnu_linux : CFLAGS = -O0 -ggdb -Wall -Wno-parentheses -Wno-unknown-pragmas \
296+
gnu_linux : CFLAGS = -O0 -ggdb -Wall -Wno-parentheses -Wno-unknown-pragmas -Wno-comment -Wno-address\
297297
-D NDEBUG $(CFLAGS_COM)
298298
gnu_linux : CC = gcc
299299
gnu_linux : CPP = g++

Source/glui_v2_1_beta/glui.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
#include "glui.h"
2121
#include "stdinc.h"
2222

23+
static int allow_glui_post_redisplay = 1;
24+
25+
/************************************ GetGluiPostReDisplay ************/
26+
27+
int GetGluiPostReDisplay(void){
28+
return allow_glui_post_redisplay;
29+
}
30+
2331
/************************************ GluiPostRedisplayOn ************/
2432

2533
void GluiPostRedisplayOn(void){
@@ -986,7 +994,7 @@ void GLUI_Main::post_update_main_gfx( void )
986994
if ( main_gfx_window_id > 0 ) {
987995
old_window = glutGetWindow();
988996
glutSetWindow( main_gfx_window_id );
989-
if(allow_glui_post_redisplay==1)glutPostRedisplay();
997+
if(GetGluiPostReDisplay()==1)glutPostRedisplay();
990998
if( old_window > 0 )
991999
glutSetWindow( old_window );
9921000
}
@@ -1427,7 +1435,7 @@ void GLUI::close( void )
14271435

14281436
old_glut_window = glutGetWindow();
14291437
glutSetWindow( get_glut_window_id() );
1430-
if(allow_glui_post_redisplay==1)glutPostRedisplay();
1438+
if(GetGluiPostReDisplay() == 1)glutPostRedisplay();
14311439

14321440
glutSetWindow( old_glut_window );
14331441
}
@@ -1864,7 +1872,7 @@ void GLUI_Main::refresh( void )
18641872

18651873
if ( glut_window_id > 0 )
18661874
glutSetWindow( glut_window_id );
1867-
if(allow_glui_post_redisplay==1)glutPostRedisplay();
1875+
if(GetGluiPostReDisplay() ==1)glutPostRedisplay();
18681876

18691877
/* printf( "top_level: %d\n", top_level_glut_window_id );*/
18701878
glutSetWindow( top_level_glut_window_id );
@@ -1883,7 +1891,7 @@ void GLUI_Main::refresh( void )
18831891

18841892
glutReshapeWindow( new_w, new_h );
18851893

1886-
if(allow_glui_post_redisplay==1)glutPostRedisplay();
1894+
if(GetGluiPostReDisplay() ==1)glutPostRedisplay();
18871895
}
18881896

18891897
glutSetWindow( orig);

Source/glui_v2_1_beta/glui.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,7 @@ enum GLUI_StdBitmaps_Codes {
361361
GLUI_STDBITMAP_NUM_ITEMS
362362
};
363363

364-
static int allow_glui_post_redisplay=1;
365-
364+
extern "C" int GetGluiPostReDisplay(void);
366365
extern "C" void GluiPostRedisplayOn(void);
367366
extern "C" void GluiPostRedisplayOff(void);
368367

Source/glui_v2_1_beta/glui_control.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ void GLUI_Control::set_w( int new_w )
481481
if ( glui->get_glut_window_id() != -1 ) {
482482
int orig = set_to_glut_window();
483483
glutReshapeWindow( glui->main_panel->w, glui->main_panel->h );
484-
if(allow_glui_post_redisplay==1)glutPostRedisplay();
484+
if(GetGluiPostReDisplay()==1)glutPostRedisplay();
485485
/* printf( "Requesting a reshape to window %d: %d %d\n",
486486
glutGetWindow(),
487487
glui->main_panel->w, glui->main_panel->h );*/
@@ -505,7 +505,7 @@ void GLUI_Control::set_h( int new_h )
505505
if ( glui->get_glut_window_id() != -1 ) {
506506
int orig = set_to_glut_window();
507507
glutReshapeWindow( glui->main_panel->w, glui->main_panel->h );
508-
if(allow_glui_post_redisplay==1)glutPostRedisplay();
508+
if(GetGluiPostReDisplay()==1)glutPostRedisplay();
509509
restore_window(orig);
510510
}
511511
}
@@ -522,7 +522,7 @@ void GLUI_Control::set_alignment( int new_align )
522522

523523
if ( glui->get_glut_window_id() != -1 ) {
524524
int orig = set_to_glut_window();
525-
if(allow_glui_post_redisplay==1)glutPostRedisplay();
525+
if(GetGluiPostReDisplay()==1)glutPostRedisplay();
526526
restore_window(orig);
527527
}
528528
}

Source/glui_v2_1_beta/glui_panel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void GLUI_Panel::set_type( int new_type )
149149
update_size();
150150

151151
old_window = set_to_glut_window();
152-
if(allow_glui_post_redisplay==1)glutPostRedisplay();
152+
if(GetGluiPostReDisplay()==1)glutPostRedisplay();
153153
restore_window( old_window );
154154
}
155155
}

Source/glui_v2_1_beta/glui_rollout.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void GLUI_Rollout::open( void )
5757
restore_window(orig);
5858
refresh_glui_dialogs = 1;
5959
SetMainWindow();
60-
if(allow_glui_post_redisplay==1)glutPostRedisplay();
60+
if(GetGluiPostReDisplay()==1)glutPostRedisplay();
6161
}
6262

6363

@@ -94,7 +94,7 @@ void GLUI_Rollout::close( void )
9494
glui->refresh();
9595
refresh_glui_dialogs = 1;
9696
SetMainWindow();
97-
if(allow_glui_post_redisplay==1)glutPostRedisplay();
97+
if(GetGluiPostReDisplay()==1)glutPostRedisplay();
9898
}
9999

100100

0 commit comments

Comments
 (0)