Changeset 144
- Timestamp:
- 06/22/05 08:18:26 (3 years ago)
- Files:
-
- libcrash/trunk/configure.in (modified) (8 diffs)
- libcrash/trunk/crash/Base64.cc (modified) (2 diffs)
- libcrash/trunk/crash/BufferStream.cc (modified) (2 diffs)
- libcrash/trunk/crash/Connect.cc (modified) (4 diffs)
- libcrash/trunk/crash/Crash.cc (modified) (2 diffs)
- libcrash/trunk/crash/crypto/Crypt.cc (modified) (3 diffs)
- libcrash/trunk/crash/crypto/DH.cc (modified) (3 diffs)
- libcrash/trunk/crash/crypto/Hash.cc (modified) (2 diffs)
- libcrash/trunk/crash/crypto/Makefile.am (modified) (1 diff)
- libcrash/trunk/crash/crypto/SSLConnect.cc (modified) (1 diff)
- libcrash/trunk/crash/generic.h (modified) (3 diffs)
- libcrash/trunk/crash/LayeredStream.cc (modified) (1 diff)
- libcrash/trunk/crash/Makefile.am (modified) (1 diff)
- libcrash/trunk/crash/MemStream.cc (modified) (1 diff)
- libcrash/trunk/crash/script/Makefile.am (modified) (1 diff)
- libcrash/trunk/crash/script/Object.cc (modified) (1 diff)
- libcrash/trunk/crash/script/Parser.cc (modified) (5 diffs)
- libcrash/trunk/crash/Signal.h (modified) (7 diffs)
- libcrash/trunk/crash/sql/Makefile.am (modified) (1 diff)
- libcrash/trunk/crash/Terminal.cc (modified) (1 diff)
- libcrash/trunk/crash/thread/Makefile.am (modified) (1 diff)
- libcrash/trunk/crash/thread/String.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
libcrash/trunk/configure.in
r140 r144 8 8 9 9 # -D_POSIX_C_SOURCE=2 required for mlock on Solaris 10 CXXFLAGS="${CXXFLAGS}-D_REENTRANT -Wall"10 EXTRA_CXXFLAGS="-D_REENTRANT -Wall" 11 11 12 12 AM_PROG_LIBTOOL … … 32 32 AC_ARG_ENABLE(debug, [ --enable-debug enable debugging CXXFLAGS (-Wall -g3) [off]]) 33 33 AC_ARG_ENABLE(profiling, [ --enable-profiling enable profiling CXXFLAGS (-pg -g3) [off]]) 34 AC_ARG_ENABLE(sqlite, [ --enable-sqlite enable SQLite support [on]]) 35 AC_ARG_ENABLE(mysql, [ --enable-mysql enable MySQL support [on]]) 36 AC_ARG_ENABLE(mhash, [ --enable-mhash enable mhash support [on]]) 37 AC_ARG_ENABLE(mcrypt, [ --enable-mcrypt enable mcrypt support [on]]) 38 AC_ARG_ENABLE(openssl, [ --enable-openssl enable OpenSSL support [yes]]) 34 39 35 40 AC_CHECK_SIZEOF(char) … … 124 129 125 130 if test "_$enable_debug" = _yes; then 126 CXXFLAGS="${CXXFLAGS} -g3"127 LDFLAGS="${LDFLAGS} -g3"128 else 129 CXXFLAGS="${CXXFLAGS} -DNDEBUG -O3 -fomit-frame-pointer"130 LDFLAGS="${LDFLAGS} -s"131 EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS} -g3" 132 LDFLAGS="${LDFLAGS} -g3" 133 else 134 EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS} -DNDEBUG -O3 -fomit-frame-pointer" 135 LDFLAGS="${LDFLAGS} -s" 131 136 fi 132 137 133 138 if test "_$enable_profiling" = _yes; then 134 CXXFLAGS="${CXXFLAGS} -pg" 135 LDFLAGS="${LDFLAGS} -pg" 136 fi 137 138 AC_CHECKING([for SQL drivers]) 139 140 AC_CHECK_LIB(sqlite, sqlite_compile, 141 [ 142 SQL_DRIVERS="${SQL_DRIVERS} SQLite.lo" 143 OPTIONAL_TESTS="${OPTIONAL_TESTS} sqlite" 144 SQLITE_LIBS="-lsqlite" 145 SQL_LIBS="${SQL_LIBS} ${SQLITE_LIBS}" 146 CRASH_MODULES="${CRASH_MODULES} sql/sqlite" 139 EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS} -pg" 140 LDFLAGS="${LDFLAGS} -pg" 141 fi 142 143 if test "_$enable_sqlite" = _yes; then 144 AC_CHECKING([for SQL drivers]) 145 146 AC_CHECK_LIB(sqlite, sqlite_compile, 147 [ 148 SQL_DRIVERS="${SQL_DRIVERS} SQLite.lo" 149 OPTIONAL_TESTS="${OPTIONAL_TESTS} sqlite" 150 SQLITE_LIBS="-lsqlite" 151 SQL_LIBS="${SQL_LIBS} ${SQLITE_LIBS}" 152 CRASH_MODULES="${CRASH_MODULES} sql/sqlite" 147 153 ] 148 ) 149 150 AC_CHECK_PROG(LOOKFORMYSQL, mysql_config, found, [not found]) 151 if test "$LOOKFORMYSQL" = "found"; then 154 ) 155 fi 156 157 if test "_$enable_mysql" = _yes; then 158 AC_CHECK_PROG(LOOKFORMYSQL, mysql_config, found, [not found]) 159 if test "$LOOKFORMYSQL" = "found"; then 152 160 OPTIONAL_TESTS="${OPTIONAL_TESTS} mysql" 153 161 SQL_DRIVERS="${SQL_DRIVERS} MySQL.lo" … … 157 165 SQL_CFLAGS="${SQL_CFLAGS} ${MYSQL_CFLAGS}" 158 166 CRASH_MODULES="${CRASH_MODULES} sql/mysql" 167 fi 159 168 fi 160 169 … … 176 185 AC_TRY_LINK_FUNC(drand48, [AC_DEFINE(HAVE_DRAND48, 1, [Have drand48])]) 177 186 178 AC_CHECK_LIB(mhash, mhash, 187 if test "_$enable_mhash" = _yes; then 188 AC_CHECK_LIB(mhash, mhash, 179 189 [ 180 190 CRYPTO_DRIVERS="${CRYPTO_DRIVERS} Hash.lo KeyGenerator.lo" … … 183 193 CRYPTO_LDFLAGS="${CRYPTO_LDFLAGS} -lmhash" 184 194 ]) 185 186 AC_CHECK_LIB(mcrypt, mcrypt_generic_init, 195 fi 196 197 if test "_$enable_mcrypt" = _yes; then 198 AC_CHECK_LIB(mcrypt, mcrypt_generic_init, 187 199 [ 188 200 CRYPTO_DRIVERS="${CRYPTO_DRIVERS} Crypt.lo" … … 192 204 CRYPTO_CFLAGS="${CRYPTO_CFLAGS} `libmcrypt-config --cflags`" 193 205 ]) 194 195 AC_CHECK_LIB(crypto, DSA_generate_parameters, 206 fi 207 208 if test "_$enable_openssl" = _yes; then 209 AC_CHECK_LIB(crypto, DSA_generate_parameters, 196 210 [ 197 211 CRYPTO_DRIVERS="${CRYPTO_DRIVERS} BigNum.lo DH.lo DSA.lo RSA.lo SSLConnect.lo SSLListen.lo" … … 201 215 ]) 202 216 203 if (echo "$CRYPTO_MODULES" | grep crypto/hash && echo "$CRYPTO_MODULES" | grep crypto/pk &&echo "$CRYPTO_MODULES" | grep crypto/cipher) > /dev/null 2>&1; then217 if (echo "$CRYPTO_MODULES" | grep crypto/hash && echo "$CRYPTO_MODULES" | grep crypto/pk &&echo "$CRYPTO_MODULES" | grep crypto/cipher) > /dev/null 2>&1; then 204 218 CRASH_MODULES="${CRASH_MODULES} crypto/pk-wrapper" 205 219 CRYPTO_DRIVERS="${CRYPTO_DRIVERS} PKServer.lo PKClient.lo" 206 fi 207 220 fi 221 fi 222 223 AC_SUBST(EXTRA_CXXFLAGS) 224 AC_SUBST(EXTRA_LDFLAGS) 208 225 AC_SUBST(CRASH_MODULES) 209 226 AC_SUBST(OPTIONAL_TESTS) libcrash/trunk/crash/Base64.cc
r135 r144 27 27 }; 28 28 29 IBase64Stream::IBase64Stream(istream &in) : StreamBuf(STREAMBUF_READ), ios(this), istream(this), minput(&in), mb64index(0), mblockindex(0) {29 IBase64Stream::IBase64Stream(istream &in) : StreamBuf(STREAMBUF_READ), IStream(this), minput(&in), mb64index(0), mblockindex(0) { 30 30 zero(mblock); 31 31 } … … 95 95 } 96 96 97 OBase64Stream::OBase64Stream(ostream &out, bool wrap) : StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this), mb64index(0), mblockindex(0), mcolumn(0), mwrap(wrap) {97 OBase64Stream::OBase64Stream(ostream &out, bool wrap) : StreamBuf(STREAMBUF_WRITE), OStream(this), mb64index(0), mblockindex(0), mcolumn(0), mwrap(wrap) { 98 98 zero(mblock); 99 99 tie(&out); libcrash/trunk/crash/BufferStream.cc
r135 r144 6 6 7 7 OBufferStream::OBufferStream() 8 : StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this), mbuffer(new Buffer), moffset(0),8 : StreamBuf(STREAMBUF_WRITE), OStream(this), mbuffer(new Buffer), moffset(0), 9 9 mallocated(true) { 10 10 } 11 11 12 12 OBufferStream::OBufferStream(Buffer &buffer, int offset) 13 : StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this), mbuffer(&buffer),13 : StreamBuf(STREAMBUF_WRITE), OStream(this), mbuffer(&buffer), 14 14 moffset(offset), mallocated(false) { 15 15 } … … 35 35 ///////////////////////////// IBufferStream 36 36 IBufferStream::IBufferStream(Buffer const &buffer, int offset, int length) 37 : StreamBuf(STREAMBUF_READ), ios(this), istream(this), mbuffer(buffer), moffset(offset), mlength(length) {37 : StreamBuf(STREAMBUF_READ), IStream(this), mbuffer(buffer), moffset(offset), mlength(length) { 38 38 if (mlength == -1) mlength = buffer.size(); 39 39 } libcrash/trunk/crash/Connect.cc
r135 r144 22 22 namespace crash { 23 23 24 Connect::Connect(string const &hostname, int port) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), ios(this), istream(this), ostream(this), mfd(-1), mtype(TCP) {24 Connect::Connect(string const &hostname, int port) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), IOStream(this), mfd(-1), mtype(TCP) { 25 25 init(this); 26 26 if (!open(hostname, port)) … … 28 28 } 29 29 30 Connect::Connect(string const &file) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), ios(this), istream(this), ostream(this), mfd(-1), mtype(LOCAL) {30 Connect::Connect(string const &file) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), IOStream(this), mfd(-1), mtype(LOCAL) { 31 31 init(this); 32 32 if (!open(file)) … … 34 34 } 35 35 36 Connect::Connect(int localfd, Type type) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), ios(this), istream(this), ostream(this), mfd(-1), mtype(type) {36 Connect::Connect(int localfd, Type type) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), IOStream(this), mfd(-1), mtype(type) { 37 37 if (localfd == -1) 38 38 throw Exception("invalid fd to accept from"); … … 55 55 } 56 56 57 Connect::Connect() : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), ios(this), istream(this), ostream(this), mfd(-1) {57 Connect::Connect() : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), IOStream(this), mfd(-1) { 58 58 } 59 59 60 Connect::Connect(Connect const ©) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), ios(this), istream(this), ostream(this), mfd(-1) {60 Connect::Connect(Connect const ©) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), IOStream(this), mfd(-1) { 61 61 mfd = dup(copy.mfd); 62 62 } libcrash/trunk/crash/Crash.cc
r140 r144 13 13 #include <crash/Crash.h> 14 14 #include <netinet/in.h> 15 #include <s trstream>15 #include <sstream> 16 16 17 17 #ifdef HAVE_BYTESWAP_H … … 123 123 string readfile(string const &filename) { 124 124 ifstream in(filename.c_str()); 125 ostr stream out;125 ostringstream out; 126 126 char buffer[512]; 127 127 libcrash/trunk/crash/crypto/Crypt.cc
r135 r144 342 342 ///////////////////////////// EncryptStream 343 343 EncryptStream::EncryptStream() 344 : StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this), mwbuf(BLOCK_SIZE) {344 : StreamBuf(STREAMBUF_WRITE), OStream(this), mwbuf(BLOCK_SIZE) { 345 345 } 346 346 347 347 EncryptStream::EncryptStream(ostream &out) 348 : StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this), mwbuf(BLOCK_SIZE) {348 : StreamBuf(STREAMBUF_WRITE), OStream(this), mwbuf(BLOCK_SIZE) { 349 349 tie(&out); 350 350 } 351 351 352 352 EncryptStream::EncryptStream(ostream &output, Buffer const &key, Cipher cipher, Mode mode) 353 : Encrypt(key, cipher, mode), StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this),353 : Encrypt(key, cipher, mode), StreamBuf(STREAMBUF_WRITE), OStream(this), 354 354 mwbuf(BLOCK_SIZE) { 355 355 tie(&output); … … 358 358 359 359 EncryptStream::EncryptStream(ostream &output, Buffer const &key, Buffer const &iv, Cipher cipher, Mode mode) 360 : Encrypt(key, iv, cipher, mode), StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this),360 : Encrypt(key, iv, cipher, mode), StreamBuf(STREAMBUF_WRITE), OStream(this), 361 361 mwbuf(BLOCK_SIZE) { 362 362 tie(&output); … … 388 388 //////////////////////////// DecryptStream 389 389 DecryptStream::DecryptStream() 390 : StreamBuf(STREAMBUF_READ), ios(this), istream(this), minput(0) {390 : StreamBuf(STREAMBUF_READ), IStream(this), minput(0) { 391 391 } 392 392 393 393 DecryptStream::DecryptStream(istream &in) 394 : StreamBuf(STREAMBUF_READ), ios(this), istream(this), minput(&in) {394 : StreamBuf(STREAMBUF_READ), IStream(this), minput(&in) { 395 395 } 396 396 397 397 DecryptStream::DecryptStream(istream &in, Buffer const &key, Cipher cipher, Mode mode) 398 : Decrypt(key, cipher, mode), StreamBuf(STREAMBUF_READ), 399 ios(this), istream(this), minput(&in) { 398 : Decrypt(key, cipher, mode), StreamBuf(STREAMBUF_READ), IStream(this), minput(&in) { 400 399 if (mode == CBC) throw Crypt::Exception("DecryptStream can not operate in CBC mode"); 401 400 } 402 401 403 402 DecryptStream::DecryptStream(istream &in, Buffer const &key, Buffer const &iv, Cipher cipher, Mode mode) 404 : Decrypt(key, iv, cipher, mode), StreamBuf(STREAMBUF_READ), 405 ios(this), istream(this), minput(&in) { 403 : Decrypt(key, iv, cipher, mode), StreamBuf(STREAMBUF_READ), IStream(this), minput(&in) { 406 404 if (mode == CBC) throw Crypt::Exception("DecryptStream can not operate in CBC mode"); 407 405 } libcrash/trunk/crash/crypto/DH.cc
r143 r144 101 101 if (pk.empty()) throw Exception("third party Diffie-Hellman public key is invalid"); 102 102 BIGNUM *bnpk = BN_bin2bn(pk, pk.size(), 0); 103 104 103 resize(DH_size(dh)); 105 104 int size = DH_compute_key(*this, bnpk, dh); … … 113 112 Buffer DH::pub() const { 114 113 Buffer out; 115 116 114 if (dh->pub_key) { 117 115 out.resize(BN_num_bytes(dh->pub_key)); … … 123 121 Buffer DH::priv() const { 124 122 Buffer out; 125 126 123 if (dh->priv_key) { 127 124 out.resize(BN_num_bytes(dh->priv_key)); libcrash/trunk/crash/crypto/Hash.cc
r135 r144 107 107 ///////////////////////////// IHashStream 108 108 IHashStream::IHashStream(istream &in, string const &key, Algorithm algorithm) 109 : Hash(key, algorithm), StreamBuf(STREAMBUF_READ), ios(this), istream(this), minput(&in) {109 : Hash(key, algorithm), StreamBuf(STREAMBUF_READ), IStream(this), minput(&in) { 110 110 } 111 111 112 112 IHashStream::IHashStream(istream &in, Buffer const &key, Algorithm algorithm) 113 : Hash(key, algorithm), StreamBuf(STREAMBUF_READ), ios(this), istream(this), minput(&in) {113 : Hash(key, algorithm), StreamBuf(STREAMBUF_READ), IStream(this), minput(&in) { 114 114 } 115 115 116 116 IHashStream::IHashStream(istream &in, Algorithm algorithm) 117 : Hash(algorithm), StreamBuf(STREAMBUF_READ), ios(this), istream(this), minput(&in) {117 : Hash(algorithm), StreamBuf(STREAMBUF_READ), IStream(this), minput(&in) { 118 118 } 119 119 … … 133 133 ///////////////////////////// OHashStream 134 134 OHashStream::OHashStream(string const &key, Algorithm algorithm) 135 : Hash(key, algorithm), StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this) {135 : Hash(key, algorithm), StreamBuf(STREAMBUF_WRITE), OStream(this) { 136 136 } 137 137 138 138 OHashStream::OHashStream(Buffer const &key, Algorithm algorithm) 139 : Hash(key, algorithm), StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this) {139 : Hash(key, algorithm), StreamBuf(STREAMBUF_WRITE), OStream(this) { 140 140 } 141 141 142 142 OHashStream::OHashStream(Algorithm algorithm) 143 : Hash(algorithm), StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this) {143 : Hash(algorithm), StreamBuf(STREAMBUF_WRITE), OStream(this) { 144 144 } 145 145 146 146 OHashStream::OHashStream(ostream &out, string const &key, Algorithm algorithm) 147 : Hash(key, algorithm), StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this) {147 : Hash(key, algorithm), StreamBuf(STREAMBUF_WRITE), OStream(this) { 148 148 tie(&out); 149 149 } 150 150 151 151 OHashStream::OHashStream(ostream &out, Buffer const &key, Algorithm algorithm) 152 : Hash(key, algorithm), StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this) {152 : Hash(key, algorithm), StreamBuf(STREAMBUF_WRITE), OStream(this) { 153 153 tie(&out); 154 154 } 155 155 156 156 OHashStream::OHashStream(ostream &out, Algorithm algorithm) 157 : Hash(algorithm), StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this) {157 : Hash(algorithm), StreamBuf(STREAMBUF_WRITE), OStream(this) { 158 158 tie(&out); 159 159 } libcrash/trunk/crash/crypto/Makefile.am
r135 r144 20 20 noinst_HEADERS = ${libcrashcrypto_la_SOURCES:%.cc=} ${EXTRA_libcrashcrypto_la_SOURCES:%.cc=} 21 21 22 AM_CXXFLAGS = @ CXXFLAGS@ @CRYPTO_CFLAGS@22 AM_CXXFLAGS = @EXTRA_CXXFLAGS@ @CRYPTO_CFLAGS@ 23 23 INCLUDES = -I../.. 24 24 libcrash/trunk/crash/crypto/SSLConnect.cc
r135 r144 9 9 namespace crypto { 10 10 11 SSLConnect::SSLConnect() : ios(this), istream(this), ostream(this){11 SSLConnect::SSLConnect() { 12 12 } 13 13 14 SSLConnect::SSLConnect(SSLConnect const ©) : Connect(copy), ios(this), istream(this), ostream(this),mstate(copy.mstate) {14 SSLConnect::SSLConnect(SSLConnect const ©) : Connect(copy), mstate(copy.mstate) { 15 15 } 16 16 17 SSLConnect::SSLConnect(SSL_CTX *context, int fd) : Connect(fd, TCP), ios(this), istream(this), ostream(this),mstate(new State(context)) {17 SSLConnect::SSLConnect(SSL_CTX *context, int fd) : Connect(fd, TCP), mstate(new State(context)) { 18 18 if (!mstate->bind(this->fd())) 19 19 throw Exception("could not bind to accepted socket"); 20 20 } 21 21 22 SSLConnect::SSLConnect(string const &file) : ios(this), istream(this), ostream(this){22 SSLConnect::SSLConnect(string const &file) { 23 23 open(file); 24 24 } 25 25 26 SSLConnect::SSLConnect(string const &hostname, int port) : ios(this), istream(this), ostream(this){26 SSLConnect::SSLConnect(string const &hostname, int port) { 27 27 open(hostname, port); 28 28 } libcrash/trunk/crash/generic.h
r143 r144 292 292 template <> struct generic_type<unsigned long> : public generic_type<signed int> { generic_type(unsigned long v) : generic_type<signed int>(v) {} }; 293 293 294 /*template <typename T>294 template <typename T> 295 295 class generic_type<shared_ptr<T> > : public generic_value_type<shared_ptr<T> > { 296 296 public : 297 generic_type(shared_ptr<T> const &v) : generic_value_type<shared_ptr<T> >(v, "generic_value_type<shared_ptr<T>>"), cp( c) {}297 generic_type(shared_ptr<T> const &v) : generic_value_type<shared_ptr<T> >(v, "generic_value_type<shared_ptr<T>>"), cp(generic_value_type<shared_ptr<T> >::c) {} 298 298 protected : 299 299 void const *cast_to(std::type_info const &type) const { … … 302 302 if (p) return p; 303 303 if (typeid(T const *) == type) { 304 cp = c;304 cp = generic_value_type<shared_ptr<T> >::c; 305 305 return &cp; 306 306 } … … 309 309 310 310 T *cp; 311 }; */311 }; 312 312 313 313 /** A generic is a type that can encapsulate any other type. This is libcrash/trunk/crash/LayeredStream.cc
r135 r144 6 6 7 7 LayeredStream::LayeredStream(istream &input, int size) 8 : StreamBuf(STREAMBUF_READ), ios(this), istream(this), minput(&input), moffset(0), msize(size) {8 : StreamBuf(STREAMBUF_READ), IStream(this), minput(&input), moffset(0), msize(size) { 9 9 } 10 10 libcrash/trunk/crash/Makefile.am
r143 r144 75 75 76 76 libcrash_la_LDFLAGS = -release @VERSION@ 77 AM_CXXFLAGS = @ CXXFLAGS@ -D_REENTRANT77 AM_CXXFLAGS = @EXTRA_CXXFLAGS@ 78 78 INCLUDES = -I.. 79 79 libcrash/trunk/crash/MemStream.cc
r135 r144 32 32 33 33 IMemStream::IMemStream(uint8 const *input, int len) 34 : MemStreamBuf(input, 0, len), ios(this), istream(this) {34 : MemStreamBuf(input, 0, len), IStream(this) { 35 35 } 36 36 37 37 OMemStream::OMemStream(uint8 *output, int len) 38 : MemStreamBuf(0, output, len), ios(this), ostream(this) {38 : MemStreamBuf(0, output, len), OStream(this) { 39 39 } 40 40 libcrash/trunk/crash/script/Makefile.am
r135 r144 10 10 noinst_HEADERS = ${libcrashscript_la_SOURCES:%.cc=} 11 11 12 AM_CXXFLAGS = @ CXXFLAGS@12 AM_CXXFLAGS = @EXTRA_CXXFLAGS@ 13 13 INCLUDES = -I../.. 14 14 libcrash/trunk/crash/script/Object.cc
r143 r144 4 4 #include <cmath> 5 5 #include <iostream> 6 #include <cmath> 6 7 7 8 using namespace std; libcrash/trunk/crash/script/Parser.cc
r135 r144 270 270 t == Lexer::OP_SUBASSIGN || t == Lexer::OP_MULASSIGN || 271 271 t == Lexer::OP_DIVASSIGN || t == Lexer::OP_MODASSIGN) { 272 Type type ;272 Type type = OP_ASSIGN; 273 273 274 274 if (!(l->type() == VAR || l->type() == INDEX || l->type() == MEMBER)) throw Exception(token, "lhs of assignment is not an l-value"); … … 316 316 317 317 if (token.type() == Lexer::OP_AND || token.type() == Lexer::OP_OR) { 318 Type type; 319 320 if (token.type() == Lexer::OP_AND) 321 type = OP_AND; 322 else if (token.type() == Lexer::OP_OR) 318 Type type = OP_AND; 319 320 if (token.type() == Lexer::OP_OR) 323 321 type = OP_OR; 324 322 ++token; … … 339 337 t == Lexer::OP_LE || t == Lexer::OP_GE || t == Lexer::OP_RXEQ || 340 338 t == Lexer::OP_RXNE) { 341 Type type ;339 Type type = OP_LT; 342 340 343 341 #define SET(n) case Lexer::n : type = n; break 344 342 switch (t) { 345 case '<' : type = OP_LT; break;346 343 case '>' : type = OP_GT; break; 347 344 SET(OP_EQ); … … 395 392 396 393 if (t == '+' || t == '-') { 397 Type type; 398 399 if (t == '+') type = OP_ADD; 400 else if (t == '-') type = OP_SUB; 394 Type type = OP_ADD; 395 396 if (t == '-') type = OP_SUB; 401 397 402 398 Ptr node = new Node(type, token); … … 415 411 416 412 if (t == '*' || t == '/' || t == '%') { 417 Type type; 418 419 if (t == '*') type = OP_MUL; 420 else if (t == '/') type = OP_DIV; 413 Type type = OP_MUL; 414 415 if (t == '/') type = OP_DIV; 421 416 else if (t == '%') type = OP_MOD; 422 417 libcrash/trunk/crash/Signal.h
r135 r144 62 62 /// Connect a method callback to this signal 63 63 template <typename C> 64 SignalConnection connect(C &object, R (C::*method)()) { re g(new MethodCallBack0<C, R>(object, method)); }64 SignalConnection connect(C &object, R (C::*method)()) { return reg(new MethodCallBack0<C, R>(object, method)); } 65 65 /// Connect a functor callback to this signal 66 66 template <typename C> … … 95 95 /// Connect a method callback to this signal 96 96 template <typename C> 97 SignalConnection connect(C &object, R (C::*method)(P0)) { re g(new MethodCallBack1<C, P0, R>(object, method)); }97 SignalConnection connect(C &object, R (C::*method)(P0)) { return reg(new MethodCallBack1<C, P0, R>(object, method)); } 98 98 /// Connect a functor callback to this signal 99 99 template <typename C> … … 128 128 /// Connect a method callback to this signal 129 129 template <typename C> 130 SignalConnection connect(C &object, R (C::*method)(P0, P1)) { re g(new MethodCallBack2<C, P0, P1, R>(object, method)); }130 SignalConnection connect(C &object, R (C::*method)(P0, P1)) { return reg(new MethodCallBack2<C, P0, P1, R>(object, method)); } 131 131 /// Connect a functor callback to this signal 132 132 template <typename C> … … 161 161 /// Connect a method callback to this signal 162 162 template <typename C> 163 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2)) { re g(new MethodCallBack3<C, P0, P1, P2, R>(object, method)); }163 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2)) { return reg(new MethodCallBack3<C, P0, P1, P2, R>(object, method)); } 164 164 /// Connect a functor callback to this signal 165 165 template <typename C> … … 194 194 /// Connect a method callback to this signal 195 195 template <typename C> 196 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2, P3)) { re g(new MethodCallBack4<C, P0, P1, P2, P3, R>(object, method)); }196 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2, P3)) { return reg(new MethodCallBack4<C, P0, P1, P2, P3, R>(object, method)); } 197 197 /// Connect a functor callback to this signal 198 198 template <typename C> … … 227 227 /// Connect a method callback to this signal 228 228 template <typename C> 229 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2, P3, P4)) { re g(new MethodCallBack5<C, P0, P1, P2, P3, P4, R>(object, method)); }229 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2, P3, P4)) { return reg(new MethodCallBack5<C, P0, P1, P2, P3, P4, R>(object, method)); } 230 230 /// Connect a functor callback to this signal 231 231 template <typename C> … … 260 260 /// Connect a method callback to this signal 261 261 template <typename C> 262 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2, P3, P4, P5)) { re g(new MethodCallBack6<C, P0, P1, P2, P3, P4, P5, R>(object, method)); }262 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2, P3, P4, P5)) { return reg(new MethodCallBack6<C, P0, P1, P2, P3, P4, P5, R>(object, method)); } 263 263 /// Connect a functor callback to this signal 264 264 template <typename C> libcrash/trunk/crash/sql/Makefile.am
r135 r144 6 6 libcrashsql_la_DEPENDENCIES = @SQL_DRIVERS@ 7 7 8 AM_CXXFLAGS = @ CXXFLAGS@8 AM_CXXFLAGS = @EXTRA_CXXFLAGS@ 9 9 INCLUDES = -I../.. 10 10 libcrash/trunk/crash/Terminal.cc
r135 r144 25 25 26 26 Terminal::Terminal(string const &term, int infd, int outfd) 27 : TermBuf(infd, outfd), ios(this), istream(this), ostream(this), mterm(term) {27 : TermBuf(infd, outfd), IOStream(this), mterm(term) { 28 28 Key keymap[] = { 29 29 // { "kl", LEFT }, { "kr", RIGHT }, { "ku", UP }, { "kd", DOWN }, libcrash/trunk/crash/thread/Makefile.am
r135 r144 8 8 Thread.cc Thread.h 9 9 10 AM_CXXFLAGS = @ CXXFLAGS@ -D_GNU_SOURCE10 AM_CXXFLAGS = @EXTRA_CXXFLAGS@ -D_GNU_SOURCE 11 11 INCLUDES = -I../.. 12 12 libcrash/trunk/crash/thread/String.cc
r135 r144 545 545 546 546 std::istream &operator >> (std::istream &in, crash::thread::String &value) { 547 int c ;547 int c = 0; 548 548 549 549 value = "";
