[Plib-cvs] plib/src/pui pu.h,1.133,1.134 puComboBox.cxx,1.13,1.14 puDial.cxx,1.25,1.26 puFilePicker.
Brought to you by:
sjbaker
From: Sebastian U. <ud...@us...> - 2002-09-21 17:47:14
|
Update of /cvsroot/plib/plib/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv14959 Modified Files: pu.h puComboBox.cxx puDial.cxx puFilePicker.cxx puFileSelector.cxx puLargeInput.cxx puScrollBar.cxx Log Message: Added trailing 'f' to some floating-point constants Index: pu.h =================================================================== RCS file: /cvsroot/plib/plib/src/pui/pu.h,v retrieving revision 1.133 retrieving revision 1.134 diff -u -d -r1.133 -r1.134 --- pu.h 21 Sep 2002 15:59:56 -0000 1.133 +++ pu.h 21 Sep 2002 17:47:09 -0000 1.134 @@ -1202,8 +1202,8 @@ setMaxValue ( 1.0f ) ; setMinValue ( 0.0f ) ; setStepSize ( 1.0f ) ; - current_max = 1.0 ; - current_min = 0.0 ; + current_max = 1.0f ; + current_min = 0.0f ; active_button = 0 ; } @@ -1216,8 +1216,8 @@ setMaxValue ( 1.0f ) ; setMinValue ( 0.0f ) ; setStepSize ( 1.0f ) ; - current_max = 1.0 ; - current_min = 0.0 ; + current_max = 1.0f ; + current_min = 0.0f ; active_button = 0 ; } Index: puComboBox.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puComboBox.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- puComboBox.cxx 2 Sep 2002 06:05:45 -0000 1.13 +++ puComboBox.cxx 21 Sep 2002 17:47:09 -0000 1.14 @@ -238,7 +238,7 @@ type |= PUCLASS_COMBOBOX ; char *stringval ; - int arrow_width = (int) ( (maxy-miny) / 1.5 ) ; + int arrow_width = (int) ( (maxy-miny) / 1.5f ) ; input = new puInput ( 0, 0, maxx-minx - arrow_width, maxy-miny ) ; input -> setUserData ( this ) ; Index: puDial.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puDial.cxx,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- puDial.cxx 21 Sep 2002 15:59:56 -0000 1.25 +++ puDial.cxx 21 Sep 2002 17:47:09 -0000 1.26 @@ -86,8 +86,8 @@ getValue ( &val ) ; val = ( val - minimum_value) / (maximum_value - minimum_value) ; - if ( val < 0.0 ) val = 0.0 ; - if ( val > 1.0 ) val = 1.0 ; + if ( val < 0.0f ) val = 0.0f ; + if ( val > 1.0f ) val = 1.0f ; val = ( 2.0f * val - 1.0f ) * SG_PI ; @@ -133,9 +133,9 @@ // Move to within the (0,1) interval if ( angle < -1.0f ) - angle += 2.0 ; + angle += 2.0f ; else if (angle > 1.0f ) - angle -= 2.0 ; + angle -= 2.0f ; angle = ( angle + 1.0f ) / 2.0f ; @@ -143,10 +143,10 @@ // of the widget) if ( !wrap ) { - if ( ( angle > 0.75 ) && ( getFloatValue () < 0.25 ) ) - angle = 0.0 ; - else if ( ( angle < 0.25 ) && ( getFloatValue () > 0.75 ) ) - angle = 1.0 ; + if ( ( angle > 0.75f ) && ( getFloatValue () < 0.25f ) ) + angle = 0.0f ; + else if ( ( angle < 0.25f ) && ( getFloatValue () > 0.75f ) ) + angle = 1.0f ; } angle = angle * (maximum_value - minimum_value) + minimum_value ; Index: puFilePicker.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFilePicker.cxx,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- puFilePicker.cxx 15 Sep 2002 01:00:23 -0000 1.30 +++ puFilePicker.cxx 21 Sep 2002 17:47:09 -0000 1.31 @@ -81,7 +81,7 @@ int num_items = list_box->getNumItems () - 1 ; if ( num_items > 0 ) { - int idx = int ( num_items * val + 0.5 ) + inc ; + int idx = int ( num_items * val + 0.5f ) + inc ; if ( idx > num_items ) idx = num_items ; if ( idx < 0 ) idx = 0 ; Index: puFileSelector.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puFileSelector.cxx,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- puFileSelector.cxx 20 Sep 2002 00:30:10 -0000 1.29 +++ puFileSelector.cxx 21 Sep 2002 17:47:09 -0000 1.30 @@ -82,7 +82,7 @@ int num_items = list_box->getNumItems () - 1 ; if ( num_items > 0 ) { - int idx = int ( num_items * val + 0.5 ) + inc ; + int idx = int ( num_items * val + 0.5f ) + inc ; if ( idx > num_items ) idx = num_items ; if ( idx < 0 ) idx = 0 ; Index: puLargeInput.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puLargeInput.cxx,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- puLargeInput.cxx 19 Sep 2002 23:32:58 -0000 1.41 +++ puLargeInput.cxx 21 Sep 2002 17:47:09 -0000 1.42 @@ -38,7 +38,7 @@ int num_lines = text->getNumLines () ; if ( num_lines > 0 ) - text->setTopLineInWindow ( int ( val + 0.5 ) ) ; + text->setTopLineInWindow ( int ( val + 0.5f ) ) ; } // Private function from the widget itself @@ -320,8 +320,8 @@ void puLargeInput::setValue ( const char *s ) [...79 lines suppressed...] int current_line_in_window = 0; /* Current line # in window */ char *line_end = 0 ; char* p = new char[ strlen(old_text)+1 ] ; - float bottom_value = bottom_slider ? bottom_slider->getFloatValue () : 0.0 ; /* Value of the bottom slider */ + float bottom_value = bottom_slider ? bottom_slider->getFloatValue () : 0.0f ; /* Value of the bottom slider */ if ( old_text[1] != '\0' ) /* Ensure that we don't delete something that doesn't exist! - JCJ 22 July 2002 */ { /*Count how many characters from the beginning of the line the cursor is*/ @@ -1215,10 +1215,8 @@ { // Wrap the text in "text" and put it in "wrapped_text" - int l_len = strlen ( getStringValue () ) ; delete [] wrapped_text ; - wrapped_text = new char[l_len + 1] ; - memcpy(wrapped_text, getStringValue (), l_len + 1) ; + wrapped_text = ulStrDup ( getStringValue () ) ; char *wrapped_text_wp = wrapped_text, *space_ptr, Index: puScrollBar.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/pui/puScrollBar.cxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- puScrollBar.cxx 2 Sep 2002 06:05:46 -0000 1.3 +++ puScrollBar.cxx 21 Sep 2002 17:47:09 -0000 1.4 @@ -151,7 +151,7 @@ float next_value = getFloatValue () ; float step = getStepSize () ; - if ( step == 0.0 ) step = ( getMaxValue () - getMinValue () ) / 10.0 ; + if ( step == 0.0f ) step = ( getMaxValue () - getMinValue () ) / 10.0f ; /* Check for hitting a button */ @@ -161,10 +161,10 @@ if( arrow_count == 2 ) { if ( coord < abox.min[sd] + width ) /* Fast down button */ - next_value -= 10.0 * step ; + next_value -= 10.0f * step ; if ( coord > abox.max[sd] - width ) /* Fast up button */ - next_value += 10.0 * step ; + next_value += 10.0f * step ; } if ( arrow_count > 0 ) |