Changeset 140

Show
Ignore:
Timestamp:
04/04/05 00:10:06 (4 years ago)
Author:
athomas
Message:

Eradicated some old style casts, fixed some issues with operators in
Ordered Category? and Equivalent Category?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libcrash/trunk/configure.in

    r138 r140  
    142142        SQL_DRIVERS="${SQL_DRIVERS} SQLite.lo" 
    143143        OPTIONAL_TESTS="${OPTIONAL_TESTS} sqlite" 
    144         SQL_LIBS="${SQL_LIBS} -lsqlite" 
     144        SQLITE_LIBS="-lsqlite" 
     145        SQL_LIBS="${SQL_LIBS} ${SQLITE_LIBS}" 
    145146        CRASH_MODULES="${CRASH_MODULES} sql/sqlite" 
    146147        ] 
     
    151152        OPTIONAL_TESTS="${OPTIONAL_TESTS} mysql" 
    152153        SQL_DRIVERS="${SQL_DRIVERS} MySQL.lo" 
    153         SQL_LIBS="${SQL_LIBS} `mysql_config --libs`" 
    154         SQL_CFLAGS="${SQL_CFLAGS} `mysql_config --cflags`" 
     154        MYSQL_LIBS="`mysql_config --libs`" 
     155        SQL_LIBS="${SQL_LIBS} ${MYSQL_LIBS}" 
     156        MYSQL_CFLAGS="`mysql_config --cflags`" 
     157        SQL_CFLAGS="${SQL_CFLAGS} ${MYSQL_CFLAGS}" 
    155158        CRASH_MODULES="${CRASH_MODULES} sql/mysql" 
    156159fi 
     
    208211AC_SUBST(SQL_LIBS) 
    209212AC_SUBST(SQL_CFLAGS) 
     213AC_SUBST(MYSQL_LIBS) 
     214AC_SUBST(MYSQL_CFLAGS) 
     215AC_SUBST(SQLITE_LIBS) 
     216AC_SUBST(SQLITE_CFLAGS) 
    210217AC_SUBST(SQL_DRIVERS) 
    211218AC_SUBST(CRYPTO_CFLAGS) 
  • libcrash/trunk/crash/Crash.cc

    r135 r140  
    121121} 
    122122 
    123 string getFile(string const &filename) { 
     123string readfile(string const &filename) { 
    124124ifstream in(filename.c_str()); 
    125125ostrstream out; 
  • libcrash/trunk/crash/Crash.h

    r135 r140  
    112112 
    113113/// Return the contents of a file - SLOWWWWW (mostly because of string copies) 
    114 std::string getFile(std::string const &filename); 
     114std::string readfile(std::string const &filename); 
    115115 
    116116///     Host to network byte-order conversions 
     
    164164        inline std::ostream &operator < (std::ostream &out, crash::TYPE const &v) { \ 
    165165        crash::TYPE t = crash::host2net(v); \ 
    166                 return out.write((const char*)&t, sizeof(t)); \ 
     166                return out.write(reinterpret_cast<const char*>(&t), sizeof(t)); \ 
    167167        } \ 
    168168        inline std::istream &operator > (std::istream &in, crash::TYPE &v) { \ 
    169                 in.read((char*)&v, sizeof(v)); \ 
     169                in.read(reinterpret_cast<char*>(&v), sizeof(v)); \ 
    170170                v = crash::net2host(v); \ 
    171171                return in; \ 
  • libcrash/trunk/crash/EquivalentCategory.h

    r135 r140  
    1212struct EquivalentCategory { 
    1313        ///     Compare two objects. 
    14         friend int operator != (const T &left, const T &right) { 
    15                 return !(left == right); 
     14        int operator != (const T &right) { 
     15                return !(*static_cast<T*>(this) == right); 
    1616        } 
    1717}; 
  • libcrash/trunk/crash/OrderedCategory.h

    r135 r140  
    1717template <typename T> 
    1818struct OrderedCategory : public EquivalentCategory<T> { 
    19         friend int operator <= (const T &left, const T &right) { return left < right || left == right; } 
    20         friend int operator >= (const T &left, const T &right) { return !(left < right); } 
    21         friend int operator > (const T &left, const T &right) { return !(left < right || left == right); } 
     19        int operator <= (const T &right) { return *static_cast<T*>(this) < right || *static_cast<T*>(this) == right; } 
     20        int operator >= (const T &right) { return !(*static_cast<T*>(this) < right); } 
     21        int operator > (const T &right) { return !(*static_cast<T*>(this) < right || *static_cast<T*>(this) == right); } 
    2222}; 
    2323 
  • libcrash/trunk/crash/Variable.h

    r135 r140  
    291291template <typename T> 
    292292std::string operator + (std::string const &l, Variable<T> const &r) { 
    293         return l + (std::string)r
     293        return l + std::string(r)
    294294} 
    295295 
    296296template <typename T> 
    297297std::string operator + (char const *l, Variable<T> const &r) { 
    298         return l + (std::string)r
     298        return l + std::string(r)
    299299} 
    300300