Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3300 for code/trunk/src/util


Ignore:
Timestamp:
Jul 17, 2009, 11:53:35 PM (15 years ago)
Author:
rgrieder
Message:

Found a few more C-Style casts.

Location:
code/trunk/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/util/Math.h

    r3280 r3300  
    122122    inline int round(T x)
    123123    {
    124         return (int)(x + 0.5);
     124        return static_cast<int>(x + 0.5);
    125125    }
    126126
  • code/trunk/src/util/StringUtils.cc

    r3280 r3300  
    8282    {
    8383        size_t pos1 = 0;
    84         int pos2 = (int)(str.size() - 1);
     84        int pos2 = static_cast<int>(str.size() - 1);
    8585        for (; pos1 < str.size() && (str[pos1] == ' ' || str[pos1] == '\t' || str[pos1] == '\n'); pos1++);
    8686        for (; pos2 > 0         && (str[pos2] == ' ' || str[pos2] == '\t' || str[pos2] == '\n'); pos2--);
     
    352352        for (size_t i = 0; i < str->size(); ++i)
    353353        {
    354             (*str)[i] = (char)tolower((*str)[i]);
     354            (*str)[i] = static_cast<char>(tolower((*str)[i]));
    355355        }
    356356    }
     
    376376        for (size_t i = 0; i < str->size(); ++i)
    377377        {
    378             (*str)[i] = (char)toupper((*str)[i]);
     378            (*str)[i] = static_cast<char>(toupper((*str)[i]));
    379379        }
    380380    }
Note: See TracChangeset for help on using the changeset viewer.