Update of /cvsroot/plib/plib/src/pui
In directory usw-pr-cvs1:/tmp/cvs-serv25822/src/pui
Modified Files:
puLargeInput.cxx puFileSelector.cxx puFilePicker.cxx pu.cxx
pu.h
Log Message:
Minor optimizations
Index: puLargeInput.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- puLargeInput.cxx 23 Mar 2002 16:26:40 -0000 1.31
+++ puLargeInput.cxx 20 Jun 2002 20:07:53 -0000 1.32
@@ -390,7 +390,7 @@
text = new char [ length ] ;
strcpy ( text, l ) ;
- if ( ( strlen(l) == 0 ) || ( *(l+strlen(l)-1) != '\n' ) )
+ if ( ( l [ 0 ] == '\0' ) || ( *(l+strlen(l)-1) != '\n' ) )
strcat ( text, "\n" ) ;
// Find the greatest width of a line
Index: puFileSelector.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/puFileSelector.cxx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- puFileSelector.cxx 10 Jun 2002 23:32:46 -0000 1.23
+++ puFileSelector.cxx 20 Jun 2002 20:07:53 -0000 1.24
@@ -610,7 +610,9 @@
return ;
}
- for ( ifile = 0 ; (dp = ulReadDir(dirp)) != NULL && ifile < num_files ; )
+ for ( ifile = 0 ;
+ (dp = ulReadDir(dirp)) != NULL && ifile < num_files ;
+ ifile++ )
{
/* Skip over the "." entry... */
@@ -631,8 +633,6 @@
files[ ifile ] = new char[ strlen(dp->d_name)+1 ] ;
strcpy ( files [ ifile ], dp->d_name ) ;
}
-
- ifile++ ;
}
files [ ifile ] = NULL ;
Index: puFilePicker.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/puFilePicker.cxx,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- puFilePicker.cxx 10 Jun 2002 23:32:46 -0000 1.26
+++ puFilePicker.cxx 20 Jun 2002 20:07:53 -0000 1.27
@@ -103,7 +103,7 @@
chop_file ( fname ) ;
- if ( strlen ( fname ) == 0 )
+ if ( fname [ 0 ] == '\0' )
{
/* Empty string! The only way to go up is to append a "../" */
@@ -273,7 +273,6 @@
dflag = NULL ;
num_files = 0 ;
- strcpy ( getStringValue(), "" ) ;
strcpy ( startDir, dir ) ;
if ( arrows > 2 ) arrows = 2 ;
Index: pu.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/pu.cxx,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- pu.cxx 23 Apr 2002 23:51:55 -0000 1.50
+++ pu.cxx 20 Jun 2002 20:07:54 -0000 1.51
@@ -360,6 +360,8 @@
else
last_buttons &= ~( 1 << button ) ;
+printf ( "last_buttons: %d\n", last_buttons ) ;
+
pu_mouse_x = x ;
pu_mouse_y = h - y ;
int return_value = puGetBaseLiveInterface () -> checkHit ( button,
@@ -398,7 +400,9 @@
int button =
(last_buttons & (1<<PU_LEFT_BUTTON )) ? PU_LEFT_BUTTON :
(last_buttons & (1<<PU_MIDDLE_BUTTON)) ? PU_MIDDLE_BUTTON :
- (last_buttons & (1<<PU_RIGHT_BUTTON )) ? PU_RIGHT_BUTTON : 0 ;
+ (last_buttons & (1<<PU_RIGHT_BUTTON )) ? PU_RIGHT_BUTTON : PU_NOBUTTON ;
+
+printf ( "%d\n", button ) ;
int h = puGetWindowHeight () ;
Index: pu.h
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/pu.h,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- pu.h 10 Jun 2002 23:32:46 -0000 1.106
+++ pu.h 20 Jun 2002 20:07:54 -0000 1.107
@@ -50,6 +50,7 @@
#ifdef PU_NOT_USING_GLUT
+#define PU_NOBUTTON -1
#define PU_LEFT_BUTTON 0
#define PU_MIDDLE_BUTTON 1
#define PU_RIGHT_BUTTON 2
@@ -58,6 +59,7 @@
#else
+#define PU_NOBUTTON -1
#define PU_LEFT_BUTTON GLUT_LEFT_BUTTON
#define PU_MIDDLE_BUTTON GLUT_MIDDLE_BUTTON
#define PU_RIGHT_BUTTON GLUT_RIGHT_BUTTON
|