This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 332 for ps


Ignore:
Timestamp:
06/01/04 18:51:37 (21 years ago)
Author:
janwas
Message:

removed obsoleted _int etc. typedefs

Location:
ps/trunk/source
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/maths/MathUtil.cpp

    r322 r332  
    1818//            FL_FP_TOLERANCE of each other.
    1919//
    20 _bool MathUtil::CompareFloat(const _double &num1, const _double &num2)
     20bool MathUtil::CompareFloat(const double &num1, const double &num2)
    2121{
    2222    if( Abs(num1 - num2) < FL_FP_TOLERANCE )
     
    3131// PURPOSE: Converts from Radians to Degrees
    3232//
    33 inline _double MathUtil::RadiansToDegrees(const _double &num)
     33inline double MathUtil::RadiansToDegrees(const double &num)
    3434{
    3535    return num*(PI/180);
     
    4141// PURPOSE: Converts from Degrees to Radians
    4242//
    43 inline _double MathUtil::DegreesToRadians(const _double &num)
     43inline double MathUtil::DegreesToRadians(const double &num)
    4444{
    4545    return (num*180)/PI;
     
    5353//   NOTES: returns -1 if lowerBound >= upperBound
    5454//
    55 _float MathUtil::Random(const _float &lowerBound, const _float &upperBound)
     55float MathUtil::Random(const float &lowerBound, const float &upperBound)
    5656{
    5757
     
    6464
    6565        // finds a floating point number between 0 and 1.0
    66         _float randVar = ( static_cast<_float>( rand() )/RAND_MAX );
     66        float randVar = ( static_cast<float>( rand() )/RAND_MAX );
    6767
    6868        // maps the number onto the set from 0 to upperBound
     
    8282//   NOTES: returns -1 if lowerBound >= upperBound
    8383//
    84 _int MathUtil::Random(const _int &lowerBound,const _int &upperBound)
     84int MathUtil::Random(const int &lowerBound,const int &upperBound)
    8585{
    8686    if( lowerBound >= upperBound)
     
    9292
    9393        // find a random variable between 0 and range size
    94         _int randVar = rand()%( Abs(upperBound - lowerBound) + 1);
     94        int randVar = rand()%( Abs(upperBound - lowerBound) + 1);
    9595
    9696        // translate to proper range
     
    108108//           float version.
    109109//
    110 _int MathUtil::Round(const float &num)
     110int MathUtil::Round(const float &num)
    111111{
    112112    if( num > 0 )
    113         return static_cast<_int>(num + .5);
     113        return static_cast<int>(num + .5);
    114114    else if (num < 0 )
    115         return static_cast<_int>(num - .5);
     115        return static_cast<int>(num - .5);
    116116    else
    117117        return 0;
     
    125125//           double version.
    126126//
    127 _int MathUtil::Round(const double &num)
     127int MathUtil::Round(const double &num)
    128128{
    129129    if( num > 0 )
    130         return static_cast<_int>(num + .5);
     130        return static_cast<int>(num + .5);
    131131    else if (num < 0 )
    132         return static_cast<_int>(num - .5);
     132        return static_cast<int>(num - .5);
    133133    else
    134134        return 0;
     
    140140// PURPOSE: returns a mathematically correct modulus for int
    141141//
    142 _int MathUtil::SignedModulus(const _int &num, const _int &n)
     142int MathUtil::SignedModulus(const int &num, const int &n)
    143143{
    144144    if( num >= 0 )
     
    149149        // we have to multiply by -1 to reflect it back.  This method
    150150        // is faster than calling Abs() and then doing the modulus.
    151         _int Tnum = -1*(num%n);
     151        int Tnum = -1*(num%n);
    152152       
    153153        // if num%n equals 0, then n - Tnum will be n, which, logically
     
    167167// PURPOSE: returns a mathematically correct modulus for long
    168168//
    169 _long MathUtil::SignedModulus(const _long &num, const _long &n)
     169long MathUtil::SignedModulus(const long &num, const long &n)
    170170{
    171171    if( num >= 0 )
     
    176176        // we have to multiply by -1 to reflect it back.  This method
    177177        // is faster than calling Abs() and then doing the modulus.
    178         _long Tnum = -1*(num%n);
     178        long Tnum = -1*(num%n);
    179179
    180180        // if num%n equals 0, then n - Tnum will be n, which, logically
     
    195195//   NOTES: uses fmod() in math.h, which returns the modulus of floats
    196196//
    197 _float MathUtil::SignedModulus(const _float &num, const _float &n)
     197float MathUtil::SignedModulus(const float &num, const float &n)
    198198{
    199199    if( num >=0 )
    200         return static_cast<_float>( fmod(num,n) );
    201     else
    202     {
    203         // the % operator reflects the range if num < 0, so
    204         // we have to multiply by -1 to reflect it back.  This method
    205         // is faster than calling Abs() and then doing the modulus.
    206         _float Tnum = -1*( static_cast<_float>( fmod(num,n) ) );
     200        return static_cast<float>( fmod(num,n) );
     201    else
     202    {
     203        // the % operator reflects the range if num < 0, so
     204        // we have to multiply by -1 to reflect it back.  This method
     205        // is faster than calling Abs() and then doing the modulus.
     206        float Tnum = -1*( static_cast<float>( fmod(num,n) ) );
    207207
    208208        // if num%n equals 0, then n - Tnum will be n, which, logically
     
    224224//   NOTES: uses fmod() in math.h, which returns the modulus of floats
    225225//
    226 _double MathUtil::SignedModulus(const _double &num, const _double &n)
     226double MathUtil::SignedModulus(const double &num, const double &n)
    227227{
    228228    if( num >=0 )
     
    233233        // we have to multiply by -1 to reflect it back.  This method
    234234        // is faster than calling Abs() and then doing the modulus.
    235         _double Tnum = -1*( fmod(num,n) );
     235        double Tnum = -1*( fmod(num,n) );
    236236
    237237        // if num%n equals 0, then n - Tnum will be n, which, logically
  • ps/trunk/source/maths/MathUtil.h

    r322 r332  
    5555namespace MathUtil
    5656{
    57     const _double PI = 3.14159265358932384;
    58     const _double FL_FP_TOLERANCE = .000000001;
     57    const double PI = 3.14159265358932384;
     58    const double FL_FP_TOLERANCE = .000000001;
    5959
    6060
     
    8686    //
    8787    template <typename T>
    88     T Clamp(T &num, const _int &lowerBound,const _int &upperBound)
     88    T Clamp(T &num, const int &lowerBound,const int &upperBound)
    8989    {
    9090        if(num <= lowerBound)
     
    129129    //
    130130    template <typename T>
    131     _int Sign(const T &num)
     131    int Sign(const T &num)
    132132    {
    133133        if( num > 0 )
     
    147147    //
    148148    template <typename T>
    149     inline _double Square(const T &num)
     149    inline double Square(const T &num)
    150150    {
    151151        return num*num;
     
    192192    //--------------------------------------------------------
    193193
    194     _int Ceiling(const float &num);
    195     _int Ceiling(const double &num);
    196 
    197     _bool CompareFloat(const _double &, const _double &);
    198 
    199     _int Floor(const float &num);
    200     _int Floor(const double &num);
    201 
    202     inline _double RadiansToDegrees(const _double &num);
    203     inline _double DegreesToRadians(const _double &num);
    204 
    205     _float Random(const _float &, const _float &);
    206     _int Random(const _int &,const _int &);
    207 
    208     _int Round(const float &num);
    209     _int Round(const double &num);
    210 
    211     _int SignedModulus(const _int &num, const _int &n);
    212     _long SignedModulus(const _long &num, const _long &n);
    213     _float SignedModulus(const _float &num, const _float &n);
    214     _double SignedModulus(const _double &num, const _double &n);
     194    int Ceiling(const float &num);
     195    int Ceiling(const double &num);
     196
     197    bool CompareFloat(const double &, const double &);
     198
     199    int Floor(const float &num);
     200    int Floor(const double &num);
     201
     202    inline double RadiansToDegrees(const double &num);
     203    inline double DegreesToRadians(const double &num);
     204
     205    float Random(const float &, const float &);
     206    int Random(const int &,const int &);   
     207
     208    int Round(const float &num);
     209    int Round(const double &num);
     210
     211    int SignedModulus(const int &num, const int &n);
     212    long SignedModulus(const long &num, const long &n);
     213    float SignedModulus(const float &num, const float &n);
     214    double SignedModulus(const double &num, const double &n);
    215215}
    216216
  • ps/trunk/source/ps/CStr.cpp

    r289 r332  
    3030}
    3131
    32 CStr::CStr(_int Number)
     32CStr::CStr(int Number)
    3333{
    3434    // Creates CStr from a int
     
    3636}
    3737
    38 CStr::CStr(_uint Number)
     38CStr::CStr(unsigned int Number)
    3939{
    4040    // Creates CStr from a uint
     
    4343
    4444
    45 CStr::CStr(_long Number)
     45CStr::CStr(long Number)
    4646{
    4747    // Creates CStr from a long
     
    5050
    5151
    52 CStr::CStr(_ulong Number)
     52CStr::CStr(unsigned long Number)
    5353{
    5454    // Creates CStr from a ulong
     
    5757
    5858
    59 CStr::CStr(_float Number)
     59CStr::CStr(float Number)
    6060{
    6161    // Creates CStr from a float
     
    6464}
    6565
    66 CStr::CStr(_double Number)
     66CStr::CStr(double Number)
    6767{
    6868    // Creates CStr from a double
     
    7777
    7878
    79 _int CStr::ToInt() const
     79int CStr::ToInt() const
    8080{
    8181    return _ttoi(m_String.c_str());
    8282}
    8383
    84 _uint CStr::ToUInt() const
    85 {
    86     return _uint(_ttoi(m_String.c_str()));
    87 }
    88 
    89 _long CStr::ToLong() const
     84unsigned int CStr::ToUInt() const
     85{
     86    return unsigned int(_ttoi(m_String.c_str()));
     87}
     88
     89long CStr::ToLong() const
    9090{
    9191    return _ttol(m_String.c_str());
    9292}
    9393
    94 _ulong CStr::ToULong() const
    95 {
    96     return _ulong(_ttol(m_String.c_str()));
    97 }
    98 
    99 
    100 _float CStr::ToFloat() const
    101 {
    102     return (_float)_tstod(m_String.c_str(), NULL);
    103 }
    104 
    105 _double CStr::ToDouble() const
     94unsigned long CStr::ToULong() const
     95{
     96    return unsigned long(_ttol(m_String.c_str()));
     97}
     98
     99
     100float CStr::ToFloat() const
     101{
     102    return (float)_tstod(m_String.c_str(), NULL);
     103}
     104
     105double  CStr::ToDouble() const
    106106{
    107107    return _tstod(m_String.c_str(), NULL);
     
    116116
    117117//Search the string for another string
    118 _long CStr::Find(const CStr &Str) const
    119 {
    120     _long Pos = (_long)m_String.find(Str.m_String, 0);
     118long CStr::Find(const CStr &Str) const
     119{
     120    long Pos = (long)m_String.find(Str.m_String, 0);
    121121
    122122    if (Pos != tstring::npos)
     
    127127
    128128//Search the string for another string
    129 _long CStr::Find(const TCHAR &tchar) const
    130 {
    131     _long Pos = (_long)m_String.find(tchar, 0);
     129long CStr::Find(const TCHAR &tchar) const
     130{
     131    long Pos = (long)m_String.find(tchar, 0);
    132132
    133133    if (Pos != tstring::npos)
     
    138138
    139139//Search the string for another string
    140 _long CStr::Find(const int &start, const TCHAR &tchar) const
    141 {
    142     _long Pos = (_long)m_String.find(tchar, start);
     140long CStr::Find(const int &start, const TCHAR &tchar) const
     141{
     142    long Pos = (long)m_String.find(tchar, start);
    143143
    144144    if (Pos != tstring::npos)
     
    148148}
    149149
    150 _long CStr::ReverseFind(const CStr &Str) const
    151 {
    152     _long Pos = (_long)m_String.rfind(Str.m_String, m_String.length() );
     150long CStr::ReverseFind(const CStr &Str) const
     151{
     152    long Pos = (long)m_String.rfind(Str.m_String, m_String.length() );
    153153
    154154    if (Pos != tstring::npos)
     
    199199
    200200//Retreive the substring of the first n characters
    201 CStr CStr::Left(_long len) const
     201CStr CStr::Left(long len) const
    202202{
    203203    return CStr( m_String.substr(0, len) );
     
    205205
    206206//Retreive the substring of the last n characters
    207 CStr CStr::Right(_long len) const
     207CStr CStr::Right(long len) const
    208208{
    209209    return CStr( m_String.substr(m_String.length()-len, len) );
     
    299299}
    300300
    301 CStr &CStr::operator=(_int Number)
     301CStr &CStr::operator=(int Number)
    302302{
    303303    m_String = _itot(Number, m_ConversionBuffer, 10);
     
    305305}
    306306
    307 CStr &CStr::operator=(_long Number)
     307CStr &CStr::operator=(long Number)
    308308{
    309309    m_String = _ltot(Number, m_ConversionBuffer, 10);
     
    311311}
    312312
    313 CStr &CStr::operator=(_uint Number)
     313CStr &CStr::operator=(unsigned int Number)
    314314{
    315315    m_String = _ultot(Number, m_ConversionBuffer, 10);
     
    317317}
    318318
    319 CStr &CStr::operator=(_ulong Number)
     319CStr &CStr::operator=(unsigned long Number)
    320320{
    321321    m_String = _ultot(Number, m_ConversionBuffer, 10);
     
    324324
    325325
    326 CStr &CStr::operator=(_float Number)
     326CStr &CStr::operator=(float Number)
    327327{
    328328    _tsprintf(m_ConversionBuffer, FLOAT_CONVERSION, Number);
     
    331331}
    332332
    333 CStr &CStr::operator=(_double Number)
     333CStr &CStr::operator=(double Number)
    334334{
    335335    _tsprintf(m_ConversionBuffer, FLOAT_CONVERSION, Number);
     
    338338}
    339339
    340 _bool CStr::operator==(const CStr &Str) const
     340bool CStr::operator==(const CStr &Str) const
    341341{
    342342    return (m_String == Str.m_String);
    343343}
    344344
    345 _bool CStr::operator!=(const CStr &Str) const
     345bool CStr::operator!=(const CStr &Str) const
    346346{
    347347    return (m_String != Str.m_String);
    348348}
    349349
    350 _bool CStr::operator<(const CStr &Str) const
     350bool CStr::operator<(const CStr &Str) const
    351351{
    352352    return (m_String < Str.m_String);
    353353}
    354354
    355 _bool CStr::operator<=(const CStr &Str) const
     355bool CStr::operator<=(const CStr &Str) const
    356356{
    357357    return (m_String <= Str.m_String);
    358358}
    359359
    360 _bool CStr::operator>(const CStr &Str) const
     360bool CStr::operator>(const CStr &Str) const
    361361{
    362362    return (m_String > Str.m_String);
    363363}
    364364
    365 _bool CStr::operator>=(const CStr &Str) const
     365bool CStr::operator>=(const CStr &Str) const
    366366{
    367367    return (m_String >= Str.m_String);
     
    392392
    393393
    394 TCHAR &CStr::operator[](_int n)
     394TCHAR &CStr::operator[](int n)
    395395{
    396396    assert((size_t)n < m_String.length());
     
    398398}
    399399
    400 TCHAR &CStr::operator[](_uint n)
     400TCHAR &CStr::operator[](unsigned int n)
    401401{
    402402    assert(n < m_String.length());
    403403    return m_String[n];
    404404}
    405 TCHAR &CStr::operator[](_long n)
     405TCHAR &CStr::operator[](long n)
    406406{
    407407    assert((size_t)n < m_String.length());
     
    409409}
    410410
    411 TCHAR &CStr::operator[](_ulong n)
     411TCHAR &CStr::operator[](unsigned long n)
    412412{
    413413    assert(n < m_String.length());
  • ps/trunk/source/ps/CStr.h

    r289 r332  
    1313   
    1414    CStr MyString = _T("Hello, World.");
    15     _int MyNum = 126;
     15    int MyNum = 126;
    1616    MyString += _T(" I'm the number ") += CStr(MyNumber);
    1717   
     
    103103    CStr(const TCHAR* String);  // Creates CStr from C-Style TCHAR string
    104104    CStr(TCHAR Char);       // Creates CStr from a TCHAR
    105     CStr(_int Number);      // Creates CStr from a int
    106     CStr(_uint Number);     // Creates CStr from a uint
    107     CStr(_long Number);     // Creates CStr from a long
    108     CStr(_ulong Number);    // Creates CStr from a ulong
    109     CStr(_float Number);    // Creates CStr from a float
    110     CStr(_double Number);   // Creates CStr from a double
     105    CStr(int Number);       // Creates CStr from a int
     106    CStr(unsigned int Number);      // Creates CStr from a uint
     107    CStr(long Number);      // Creates CStr from a long
     108    CStr(unsigned long Number); // Creates CStr from a ulong
     109    CStr(float Number); // Creates CStr from a float
     110    CStr(double Number);    // Creates CStr from a double
    111111    ~CStr();                // Destructor
    112112
    113113    // Conversions
    114     _int    ToInt() const;
    115     _uint   ToUInt() const;
    116     _long   ToLong() const;
    117     _ulong  ToULong() const;
    118     _float  ToFloat() const;
    119     _double ToDouble() const;
     114    int ToInt() const;
     115    unsigned int    ToUInt() const;
     116    long    ToLong() const;
     117    unsigned long   ToULong() const;
     118    float   ToFloat() const;
     119    double  ToDouble() const;
    120120
    121121    size_t Length() const {return m_String.length();}
     
    124124
    125125    //Search the string for another string
    126     _long Find(const CStr &Str) const;
     126    long Find(const CStr &Str) const;
    127127
    128128    //Search the string for another string
    129     _long Find(const TCHAR &tchar) const;
     129    long Find(const TCHAR &tchar) const;
    130130
    131131    //Search the string for another string
    132     _long Find(const int &start, const TCHAR &tchar) const;
     132    long Find(const int &start, const TCHAR &tchar) const;
    133133
    134134    //You can also do a "ReverseFind"- i.e. search starting from the end
    135     _long ReverseFind(const CStr &Str) const;
     135    long ReverseFind(const CStr &Str) const;
    136136
    137137    // Lowercase and uppercase
     
    144144
    145145    // Retreive the substring of the first n characters
    146     CStr Left(_long len) const;
     146    CStr Left(long len) const;
    147147
    148148    // Retreive the substring of the last n characters
    149     CStr Right(_long len) const;
     149    CStr Right(long len) const;
    150150   
    151151    //Remove all occurences of some character or substring
     
    162162    CStr &operator=(const TCHAR* String);
    163163    CStr &operator=(TCHAR Char);
    164     CStr &operator=(_int Number);
    165     CStr &operator=(_long Number);
    166     CStr &operator=(_uint Number);
    167     CStr &operator=(_ulong Number);
    168     CStr &operator=(_float Number);
    169     CStr &operator=(_double Number);
    170 
    171     _bool operator==(const CStr &Str) const;
    172     _bool operator!=(const CStr &Str) const;
    173     _bool operator<(const CStr &Str) const;
    174     _bool operator<=(const CStr &Str) const;
    175     _bool operator>(const CStr &Str) const;
    176     _bool operator>=(const CStr &Str) const;
     164    CStr &operator=(int Number);
     165    CStr &operator=(long Number);
     166    CStr &operator=(unsigned int Number);
     167    CStr &operator=(unsigned long Number);
     168    CStr &operator=(float Number);
     169    CStr &operator=(double Number);
     170
     171    bool operator==(const CStr &Str) const;
     172    bool operator!=(const CStr &Str) const;
     173    bool operator<(const CStr &Str) const;
     174    bool operator<=(const CStr &Str) const;
     175    bool operator>(const CStr &Str) const;
     176    bool operator>=(const CStr &Str) const;
    177177    CStr &operator+=(const CStr &Str);
    178178    CStr  operator+(const CStr &Str);
    179179    operator const TCHAR*();
    180180    operator const TCHAR*() const; // Gee, I've added this, Maybe the one above should be removed?
    181     TCHAR &operator[](_int n);
    182     TCHAR &operator[](_uint n);
    183     TCHAR &operator[](_long n);
    184     TCHAR &operator[](_ulong n);
     181    TCHAR &operator[](int n);
     182    TCHAR &operator[](unsigned int n);
     183    TCHAR &operator[](long n);
     184    TCHAR &operator[](unsigned long n);
    185185
    186186    inline const char *c_str()
  • ps/trunk/source/ps/Config.cpp

    r157 r332  
    111111PS_RESULT CConfig::Update()
    112112{
    113     _int slice = 0;
    114     _int failed = 0;
     113    int slice = 0;
     114    int failed = 0;
    115115    struct stat FileInfo;
    116116
     
    212212{
    213213    // Mostly identical to Update(), above.
    214     _int failed = 0;
    215     _int notfound = 0;
     214    int failed = 0;
     215    int notfound = 0;
    216216    struct stat FileInfo;
    217217
  • ps/trunk/source/ps/Encryption.cpp

    r5 r332  
    99// to call delete[].
    1010//--------------------------------------------------------------------
    11 _byte *EncryptData(_byte *Data, _long DataLength, _byte *Key, _long KeyLength)
     11char *EncryptData(char *Data, long DataLength, char *Key, long KeyLength)
    1212{
    1313    // Allocate space for new Encrypted data
    14     _byte *NewData = new _byte[DataLength];
     14    char *NewData = new char[DataLength];
    1515
    1616    // A counter to hold our absolute position in data
    17     _long DataOffset = 0;
     17    long DataOffset = 0;
    1818
    1919    // Loop through Data until end is reached
     
    2121    {
    2222        // Loop through the key
    23         for (_long KeyOffset = 0; KeyOffset < KeyLength; KeyOffset++)
     23        for (long KeyOffset = 0; KeyOffset < KeyLength; KeyOffset++)
    2424        {
    2525            // If were at end of data break and the the while loop should end as well.
     
    5151// to call delete[].
    5252//--------------------------------------------------------------------
    53 _byte *DecryptData(_byte *Data, _long DataLength, _byte *Key, _long KeyLength)
     53char *DecryptData(char *Data, long DataLength, char *Key, long KeyLength)
    5454{
    5555    // Allocate space for new Decrypted data
    56     _byte *NewData = new _byte[DataLength];
     56    char *NewData = new char[DataLength];
    5757
    5858    // A counter to hold our absolute position in data
    59     _long DataOffset = 0;
     59    long DataOffset = 0;
    6060
    6161    // Loop through Data until end is reached
     
    6363    {
    6464        // Loop through the key
    65         for (_long KeyOffset = 0; KeyOffset < KeyLength; KeyOffset++)
     65        for (long KeyOffset = 0; KeyOffset < KeyLength; KeyOffset++)
    6666        {
    6767            // If were at end of data break and the the while loop should end as well.
  • ps/trunk/source/ps/Encryption.h

    r5 r332  
    88advice using 128bit keys which you can define as such.
    99
    10 _byte MyKey[16] = { _byte(0xAF), _byte(0x2B), _byte(0x80), _byte(0x7E),
    11                     _byte(0x09), _byte(0x23), _byte(0xCC), _byte(0x95),
    12                     _byte(0xB4), _byte(0x2D), _byte(0xF4), _byte(0x90),
    13                     _byte(0xB3), _byte(0xC4), _byte(0x2A), _byte(0x3B) };
     10char MyKey[16] = { char(0xAF), char(0x2B), char(0x80), char(0x7E),
     11                    char(0x09), char(0x23), char(0xCC), char(0x95),
     12                    char(0xB4), char(0x2D), char(0xF4), char(0x90),
     13                    char(0xB3), char(0xC4), char(0x2A), char(0x3B) };
    1414
    1515There may be a better way to do this but this looks alright to me.
     
    2323
    2424// Simple Encryption function
    25 _byte *EncryptData(_byte *Data, _long DataLength, _byte *Key, _long KeyLength);
     25char *EncryptData(char *Data, long DataLength, char *Key, long KeyLength);
    2626
    2727// Simple Decryption function
    28 _byte *DecryptData(_byte *Data, _long DataLength, _byte *Key, _long KeyLength);
     28char *DecryptData(char *Data, long DataLength, char *Key, long KeyLength);
    2929
    3030#endif
  • ps/trunk/source/ps/LogFile.cpp

    r157 r332  
    5353// 3rd parameter determines whether the error frame is shown.
    5454//-------------------------------------------------
    55 CLogFile::CLogFile(string FileName, string PageTitle, _bool WithFrame)
     55CLogFile::CLogFile(string FileName, string PageTitle, bool WithFrame)
    5656{
    5757   
     
    105105//Opens an error file. If WithFrame is true then it constructs a framed page.
    106106//-------------------------------------------------
    107 PS_RESULT CLogFile::Open(string FileName, string PageTitle, _bool WithFrame)
     107PS_RESULT CLogFile::Open(string FileName, string PageTitle, bool WithFrame)
    108108{
    109109    if(m_IsFileOpen)
  • ps/trunk/source/ps/LogFile.h

    r5 r332  
    7070public:
    7171
    72     PS_DISPLAY_SETTINGS(_int Line, _char *File, _char *Date, PS_DISPLAY_MODE DisplayMode)
     72    PS_DISPLAY_SETTINGS(int Line, char *File, char *Date, PS_DISPLAY_MODE DisplayMode)
    7373    {
    7474        line=Line;
     
    7878    }
    7979
    80     _int line;
    81     _char *file;
    82     _char *date;
     80    int line;
     81    char *file;
     82    char *date;
    8383    PS_DISPLAY_MODE displayMode;
    8484};
     
    9595    CLogFile();
    9696    ~CLogFile();
    97     CLogFile(string FileName, string PageTitle, _bool WithFrame=false);
     97    CLogFile(string FileName, string PageTitle, bool WithFrame=false);
    9898   
    9999    //Opens a file for output the 3rd parameter can be set to true to enable the error frame.
    100     PS_RESULT Open(string FileName, string PageTitle, _bool WithFrame=false);
     100    PS_RESULT Open(string FileName, string PageTitle, bool WithFrame=false);
    101101
    102102    //Closes the file.
     
    134134
    135135private:
    136     _bool m_IsFileOpen; //Is the file open.
    137     _bool m_HasFrame; //Have frames been enabled.
     136    bool m_IsFileOpen; //Is the file open.
     137    bool m_HasFrame; //Have frames been enabled.
    138138    ofstream m_TheFile; //The main file.
    139139    ofstream m_ErrorFile; //The error link file, used only for frames.
    140140    string m_CurrentColour; //The current colour.
    141141    string m_FileName; //The name of the main file.
    142     _int m_ErrNo; //The error number.
     142    int m_ErrNo; //The error number.
    143143
    144144    //Sets the current alignment of the text.
  • ps/trunk/source/ps/Parser.cpp

    r287 r332  
    2121bool CParserValue::func_name(type &ret)                 \
    2222{                                                       \
    23     _double d;                                          \
     23    double d;                                           \
    2424    if (GetDouble(d))                                   \
    2525        return ret = (type)d, true;                     \
     
    4343//-------------------------------------------------
    4444
    45 static bool _IsStrictNameChar(const _char& c);
    46 static bool _IsValueChar(const _char& c);
     45static bool _IsStrictNameChar(const char& c);
     46static bool _IsValueChar(const char& c);
    4747
    4848
     
    5151
    5252// Checks ident
    53 static bool _IsStrictNameChar(const _char& c)
     53static bool _IsStrictNameChar(const char& c)
    5454{
    5555    return ((c >= 'a' && c <= 'z') ||
     
    5959
    6060// Checks value
    61 static bool _IsValueChar(const _char& c)
     61static bool _IsValueChar(const char& c)
    6262{
    6363    return ((c >= 'a' && c <= 'z') ||
     
    112112
    113113// double
    114 bool CParserValue::GetDouble(_double &ret)
     114bool CParserValue::GetDouble(double &ret)
    115115{
    116116    // locals
    117     _double         TempRet = 0.0;
     117    double          TempRet = 0.0;
    118118    int         Size = (int)m_String.size();
    119119    int         i;
     
    190190// the function in the macro argument for CParserValue
    191191// They use GetDouble, and then type-cast it
    192 FUNC_IMPL_CAST_GETDOUBLE(GetFloat,          _float)
    193 FUNC_IMPL_CAST_GETDOUBLE(GetChar,           _char)
    194 FUNC_IMPL_CAST_GETDOUBLE(GetShort,          _short)
     192FUNC_IMPL_CAST_GETDOUBLE(GetFloat,          float)
     193FUNC_IMPL_CAST_GETDOUBLE(GetChar,           char)
     194FUNC_IMPL_CAST_GETDOUBLE(GetShort,          short)
    195195FUNC_IMPL_CAST_GETDOUBLE(GetInt,            int)
    196 FUNC_IMPL_CAST_GETDOUBLE(GetLong,           _long)
    197 FUNC_IMPL_CAST_GETDOUBLE(GetUnsignedShort,  _ushort)
    198 FUNC_IMPL_CAST_GETDOUBLE(GetUnsignedInt,    _uint)
    199 FUNC_IMPL_CAST_GETDOUBLE(GetUnsignedLong,   _ulong)
     196FUNC_IMPL_CAST_GETDOUBLE(GetLong,           long)
     197FUNC_IMPL_CAST_GETDOUBLE(GetUnsignedShort,  unsigned short)
     198FUNC_IMPL_CAST_GETDOUBLE(GetUnsignedInt,    unsigned int)
     199FUNC_IMPL_CAST_GETDOUBLE(GetUnsignedLong,   unsigned long)
    200200
    201201// CParserTaskTypeNode
     
    277277FUNC_IMPL_GETARG(GetArgString,          GetString,          string)
    278278FUNC_IMPL_GETARG(GetArgBool,            GetBool,            bool)
    279 FUNC_IMPL_GETARG(GetArgChar,            GetChar,            _char)
    280 FUNC_IMPL_GETARG(GetArgShort,           GetShort,           _short)
     279FUNC_IMPL_GETARG(GetArgChar,            GetChar,            char)
     280FUNC_IMPL_GETARG(GetArgShort,           GetShort,           short)
    281281FUNC_IMPL_GETARG(GetArgInt,             GetInt,             int)
    282 FUNC_IMPL_GETARG(GetArgLong,            GetLong,            _long)
    283 FUNC_IMPL_GETARG(GetArgUnsignedShort,   GetUnsignedShort,   _ushort)
    284 FUNC_IMPL_GETARG(GetArgUnsignedInt,     GetUnsignedInt,     _uint)
    285 FUNC_IMPL_GETARG(GetArgUnsignedLong,    GetUnsignedLong,    _ulong)
    286 FUNC_IMPL_GETARG(GetArgFloat,           GetFloat,           _float)
    287 FUNC_IMPL_GETARG(GetArgDouble,          GetDouble,          _double)
     282FUNC_IMPL_GETARG(GetArgLong,            GetLong,            long)
     283FUNC_IMPL_GETARG(GetArgUnsignedShort,   GetUnsignedShort,   unsigned short)
     284FUNC_IMPL_GETARG(GetArgUnsignedInt,     GetUnsignedInt,     unsigned int)
     285FUNC_IMPL_GETARG(GetArgUnsignedLong,    GetUnsignedLong,    unsigned long)
     286FUNC_IMPL_GETARG(GetArgFloat,           GetFloat,           float)
     287FUNC_IMPL_GETARG(GetArgDouble,          GetDouble,          double)
    288288
    289289// ParseString
     
    308308    bool                Extract=false;
    309309    int             ExtractPos=0;
    310     _char               Buffer[256];
    311     _char               Letter[] = {'\0','\0'};     // Letter as string
     310    char                Buffer[256];
     311    char                Letter[] = {'\0','\0'};     // Letter as string
    312312    vector<string>      Segments;
    313313    string              strSub;
     
    339339                Extract = true;
    340340                ExtractPos = i;
    341                 memset((void*)Buffer, '\0', sizeof(_char)*256);
     341                memset((void*)Buffer, '\0', sizeof(char)*256);
    342342            }
    343343            else
     
    827827                Extract = true;
    828828                ExtractPos = i+1; // Skip $
    829                 memset((void*)Buffer, '\0', sizeof(_char)*REGULAR_MAX_LENGTH);
     829                memset((void*)Buffer, '\0', sizeof(char)*REGULAR_MAX_LENGTH);
    830830
    831831                // We don't want to extract '$' so we'll just continue to next loop run
  • ps/trunk/source/ps/Parser.h

    r157 r332  
    7676
    7777    // return is error status
    78     _bool GetString(std::string &ret);
    79     _bool GetBool(_bool &ret);
    80     _bool GetChar(_char &ret);  // As number! otherwise use GetString make sure size=1
    81     _bool GetShort(_short &ret);
    82     _bool GetInt(_int &ret);
    83     _bool GetLong(_long &ret);
    84     _bool GetUnsignedShort(_ushort &ret);
    85     _bool GetUnsignedInt(_uint &ret);
    86     _bool GetUnsignedLong(_ulong &ret);
    87     _bool GetFloat(float &ret);
    88     _bool GetDouble(double &ret);
     78    bool GetString(std::string &ret);
     79    bool GetBool(bool &ret);
     80    bool GetChar(char &ret);    // As number! otherwise use GetString make sure size=1
     81    bool GetShort(short &ret);
     82    bool GetInt(int &ret);
     83    bool GetLong(long &ret);
     84    bool GetUnsignedShort(unsigned short &ret);
     85    bool GetUnsignedInt(unsigned int &ret);
     86    bool GetUnsignedLong(unsigned long &ret);
     87    bool GetFloat(float &ret);
     88    bool GetDouble(double &ret);
    8989
    9090    // Memory regardless if it's an int, real, string or whatever
     
    117117    // Either the node is a letter or a type, if m_Leter is '\0'
    118118    //  then check m_Type what it is
    119     _char                           m_Letter;
     119    char                            m_Letter;
    120120    _ParserValueType                m_Type;
    121121    std::string                     m_String;   // Used for diverse storage
     
    130130    // true means AltNode can be looped <...>
    131131    // false means AltNode is just an optional part [...]
    132     _bool                           m_AltNodeRepeatable;
     132    bool                            m_AltNodeRepeatable;
    133133
    134134    // Whenever a dynamic argument is used, it's first node is stored in this
     
    171171
    172172    std::deque<CParserValue>            m_Arguments;
    173     _bool                           m_ParseOK;      // same as ParseString will return
     173    bool                            m_ParseOK;      // same as ParseString will return
    174174    std::string                     m_TaskTypeName; // Name of the task type found
    175175
    176176protected:
    177     _bool ClearArguments();
     177    bool ClearArguments();
    178178
    179179public:
    180180    // Interface
    181     _bool ParseString(const CParser& parser, std::string line);
     181    bool ParseString(const CParser& parser, std::string line);
    182182
    183183    // Methods for getting arguments
    184184    //  it returns success
    185     _bool GetArgString          (const _int& arg, std::string &ret);
    186     _bool GetArgBool                (const _int& arg, _bool &ret);
    187     _bool GetArgChar                (const _int& arg, _char &ret);
    188     _bool GetArgShort           (const _int& arg, _short &ret);
    189     _bool GetArgInt             (const _int& arg, _int &ret);
    190     _bool GetArgLong                (const _int& arg, _long &ret);
    191     _bool GetArgUnsignedShort   (const _int& arg, _ushort &ret);
    192     _bool GetArgUnsignedInt     (const _int& arg, _uint &ret);
    193     _bool GetArgUnsignedLong        (const _int& arg, _ulong &ret);
    194     _bool GetArgFloat           (const _int& arg, float &ret);
    195     _bool GetArgDouble          (const _int& arg, double &ret);
     185    bool GetArgString           (const int& arg, std::string &ret);
     186    bool GetArgBool             (const int& arg, bool &ret);
     187    bool GetArgChar             (const int& arg, char &ret);
     188    bool GetArgShort            (const int& arg, short &ret);
     189    bool GetArgInt              (const int& arg, int &ret);
     190    bool GetArgLong             (const int& arg, long &ret);
     191    bool GetArgUnsignedShort    (const int& arg, unsigned short &ret);
     192    bool GetArgUnsignedInt      (const int& arg, unsigned int &ret);
     193    bool GetArgUnsignedLong     (const int& arg, unsigned long &ret);
     194    bool GetArgFloat            (const int& arg, float &ret);
     195    bool GetArgDouble           (const int& arg, double &ret);
    196196
    197197    // Get Argument count
     
    211211
    212212    // Interface
    213     _bool InputTaskType(const std::string& strName, const std::string& strSyntax);
     213    bool InputTaskType(const std::string& strName, const std::string& strSyntax);
    214214};
    215215
  • ps/trunk/source/ps/Prometheus.cpp

    r74 r332  
    33// Globals
    44int g_xres = 800, g_yres = 600;
     5int g_bpp  = 32;
     6int g_freq = 60;
    57
    68DEFINE_ERROR(PS_OK, "OK");
  • ps/trunk/source/ps/Prometheus.h

    r208 r332  
    1010#define PROMETHEUS_H
    1111
    12 #pragma warning (disable : 4786)    // VC6 template warning spew
    13 #pragma warning (disable : 4291)
    1412
    1513#include <stdio.h>
     
    2018// Globals
    2119extern int g_xres, g_yres;
     20extern int g_bpp;
     21extern int g_freq;
    2222
    23 
    24 // Standard typedefs
    25 
    26 typedef int            _int;
    27 typedef unsigned int   _unsigned_int;
    28 
    29 typedef long           _long;
    30 typedef unsigned long  _unsigned_long;
    31 
    32 typedef bool           _bool;
    33 
    34 typedef char           _char;
    35 typedef unsigned char  _unsigned_char;
    36 
    37 typedef char           _byte;
    38 typedef unsigned char  _unsigned_byte;
    39 
    40 typedef float          _float;
    41 typedef double         _double;
    42 
    43 typedef unsigned short _unsigned_short;
    44 typedef unsigned short _ushort;
    45 typedef short _short;
    46 typedef unsigned long _ulong;
    47 typedef unsigned int _uint;
    4823
    4924// Error handling
Note: See TracChangeset for help on using the changeset viewer.