Ignore:
Timestamp:
05/29/15 17:28:16 (10 years ago)
Author:
epyon
Message:
  • oops, missed src : got rid of to_string and other std::string utilities (except slurp) string no longer in nv namespace
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/stl/string.cc

    r378 r380  
    9797{
    9898#if NV_COMPILER == NV_MSVC
    99         sprintf_s( str, 64, "%.*g", 6, n );
     99        int result = sprintf_s( str, 64, "%.*g", 6, n );
    100100#else
    101         snprintf( str, 64, "%.*g", 6, n );
     101        int result = snprintf( str, 64, "%.*g", 6, n );
    102102#endif
    103         sprintf( str, "%g", n );
    104         return strlen( str );
     103        return result > 0 ? ( nv::size_t )result : 0;
    105104}
    106105
     
    108107{
    109108#if NV_COMPILER == NV_MSVC
    110         sprintf_s( str, 64, "%.*g", 6, n );
     109        int result = sprintf_s( str, 64, "%.*g", 6, n );
    111110#else
    112         snprintf( str, 64, "%.*g", 6, n );
     111        int result = snprintf( str, 64, "%.*g", 6, n );
    113112#endif
    114         return strlen( str );
     113        return result > 0 ? ( nv::size_t )result : 0;
    115114}
    116115
     
    162161        while ( *s >= '0' && *s <= '9' )
    163162        {
    164                 result = ( result * 10 ) + ( *s - '0' );
     163                result = ( result * 10 ) + (uint32)( *s - '0' );
    165164                ++s;
    166165        }
     
    175174        while ( *s >= '0' && *s <= '9' )
    176175        {
    177                 result = ( result * 10 ) + ( *s - '0' );
     176                result = ( result * 10 ) + (uint32)( *s - '0' );
    178177                ++s;
    179178        }
Note: See TracChangeset for help on using the changeset viewer.