Changeset 140
- Timestamp:
- 04/04/05 00:10:06 (4 years ago)
- Files:
-
- libcrash/trunk/configure.in (modified) (3 diffs)
- libcrash/trunk/crash/Crash.cc (modified) (1 diff)
- libcrash/trunk/crash/Crash.h (modified) (2 diffs)
- libcrash/trunk/crash/EquivalentCategory.h (modified) (1 diff)
- libcrash/trunk/crash/OrderedCategory.h (modified) (1 diff)
- libcrash/trunk/crash/Variable.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libcrash/trunk/configure.in
r138 r140 142 142 SQL_DRIVERS="${SQL_DRIVERS} SQLite.lo" 143 143 OPTIONAL_TESTS="${OPTIONAL_TESTS} sqlite" 144 SQL_LIBS="${SQL_LIBS} -lsqlite" 144 SQLITE_LIBS="-lsqlite" 145 SQL_LIBS="${SQL_LIBS} ${SQLITE_LIBS}" 145 146 CRASH_MODULES="${CRASH_MODULES} sql/sqlite" 146 147 ] … … 151 152 OPTIONAL_TESTS="${OPTIONAL_TESTS} mysql" 152 153 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}" 155 158 CRASH_MODULES="${CRASH_MODULES} sql/mysql" 156 159 fi … … 208 211 AC_SUBST(SQL_LIBS) 209 212 AC_SUBST(SQL_CFLAGS) 213 AC_SUBST(MYSQL_LIBS) 214 AC_SUBST(MYSQL_CFLAGS) 215 AC_SUBST(SQLITE_LIBS) 216 AC_SUBST(SQLITE_CFLAGS) 210 217 AC_SUBST(SQL_DRIVERS) 211 218 AC_SUBST(CRYPTO_CFLAGS) libcrash/trunk/crash/Crash.cc
r135 r140 121 121 } 122 122 123 string getFile(string const &filename) {123 string readfile(string const &filename) { 124 124 ifstream in(filename.c_str()); 125 125 ostrstream out; libcrash/trunk/crash/Crash.h
r135 r140 112 112 113 113 /// Return the contents of a file - SLOWWWWW (mostly because of string copies) 114 std::string getFile(std::string const &filename);114 std::string readfile(std::string const &filename); 115 115 116 116 /// Host to network byte-order conversions … … 164 164 inline std::ostream &operator < (std::ostream &out, crash::TYPE const &v) { \ 165 165 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)); \ 167 167 } \ 168 168 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)); \ 170 170 v = crash::net2host(v); \ 171 171 return in; \ libcrash/trunk/crash/EquivalentCategory.h
r135 r140 12 12 struct EquivalentCategory { 13 13 /// 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); 16 16 } 17 17 }; libcrash/trunk/crash/OrderedCategory.h
r135 r140 17 17 template <typename T> 18 18 struct 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); } 22 22 }; 23 23 libcrash/trunk/crash/Variable.h
r135 r140 291 291 template <typename T> 292 292 std::string operator + (std::string const &l, Variable<T> const &r) { 293 return l + (std::string)r;293 return l + std::string(r); 294 294 } 295 295 296 296 template <typename T> 297 297 std::string operator + (char const *l, Variable<T> const &r) { 298 return l + (std::string)r;298 return l + std::string(r); 299 299 } 300 300
