Changeset 144

Show
Ignore:
Timestamp:
06/22/05 08:18:26 (3 years ago)
Author:
athomas
Message:
  • Committed patch from Aaron Walker fixing quite a few compiler warnings. Also adds --enable-* configure flags for optional features. Full list of changes is:
    • Add AC_ARG_ENABLE for all optional things so that they may be disabled.
      • Use EXTRA_CXXFLAGS instead of CXXFLAGS.
      • Signal.h: missing 'return' for functions that should return a Signal Connection?.
      • thread/String.cc, script/Parser.cc: fixes "'foo' may be unitialized..."warnings.
      • Base64.cc, Buffer Stream?.cc, Connect.cc, crypto/SSLConnect.cc, crypto/Hash.cc, crypto/Crypt.cc Layered Stream?.cc, Mem Stream?.cc: ios/istream/ostream/iostream direct initialization where the respective base (IStream,OStream, etc) should be initialized instead.
      • Crash.cc: Use sstream over the deprecated strstream.
      • String Manip?.cc: cast char to int before using as a char[] subscript.
Files:

Legend:

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

    r140 r144  
    88 
    99# -D_POSIX_C_SOURCE=2 required for mlock on Solaris 
    10 CXXFLAGS="${CXXFLAGS} -D_REENTRANT -Wall" 
     10EXTRA_CXXFLAGS="-D_REENTRANT -Wall" 
    1111 
    1212AM_PROG_LIBTOOL 
     
    3232AC_ARG_ENABLE(debug,            [  --enable-debug          enable debugging CXXFLAGS (-Wall -g3) [off]]) 
    3333AC_ARG_ENABLE(profiling,        [  --enable-profiling      enable profiling CXXFLAGS (-pg -g3) [off]]) 
     34AC_ARG_ENABLE(sqlite,           [  --enable-sqlite         enable SQLite support [on]]) 
     35AC_ARG_ENABLE(mysql,            [  --enable-mysql          enable MySQL support [on]]) 
     36AC_ARG_ENABLE(mhash,            [  --enable-mhash          enable mhash support [on]]) 
     37AC_ARG_ENABLE(mcrypt,           [  --enable-mcrypt         enable mcrypt support [on]]) 
     38AC_ARG_ENABLE(openssl,          [  --enable-openssl        enable OpenSSL support [yes]]) 
    3439 
    3540AC_CHECK_SIZEOF(char) 
     
    124129 
    125130if 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" 
     133else 
     134    EXTRA_CXXFLAGS="${EXTRA_CXXFLAGS} -DNDEBUG -O3 -fomit-frame-pointer" 
     135    LDFLAGS="${LDFLAGS} -s" 
    131136fi 
    132137 
    133138if 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" 
     141fi 
     142 
     143if 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" 
    147153        ] 
    148         ) 
    149  
    150 AC_CHECK_PROG(LOOKFORMYSQL, mysql_config, found, [not found]) 
    151 if test "$LOOKFORMYSQL" = "found"; then 
     154    ) 
     155fi 
     156 
     157if test "_$enable_mysql" = _yes; then 
     158    AC_CHECK_PROG(LOOKFORMYSQL, mysql_config, found, [not found]) 
     159    if test "$LOOKFORMYSQL" = "found"; then 
    152160        OPTIONAL_TESTS="${OPTIONAL_TESTS} mysql" 
    153161        SQL_DRIVERS="${SQL_DRIVERS} MySQL.lo" 
     
    157165        SQL_CFLAGS="${SQL_CFLAGS} ${MYSQL_CFLAGS}" 
    158166        CRASH_MODULES="${CRASH_MODULES} sql/mysql" 
     167    fi 
    159168fi 
    160169 
     
    176185AC_TRY_LINK_FUNC(drand48, [AC_DEFINE(HAVE_DRAND48, 1, [Have drand48])]) 
    177186 
    178 AC_CHECK_LIB(mhash, mhash, 
     187if test "_$enable_mhash" = _yes; then 
     188    AC_CHECK_LIB(mhash, mhash, 
    179189        [ 
    180190                CRYPTO_DRIVERS="${CRYPTO_DRIVERS} Hash.lo KeyGenerator.lo" 
     
    183193                CRYPTO_LDFLAGS="${CRYPTO_LDFLAGS} -lmhash" 
    184194        ]) 
    185  
    186 AC_CHECK_LIB(mcrypt, mcrypt_generic_init, 
     195fi 
     196 
     197if test "_$enable_mcrypt" = _yes; then 
     198    AC_CHECK_LIB(mcrypt, mcrypt_generic_init, 
    187199        [ 
    188200                CRYPTO_DRIVERS="${CRYPTO_DRIVERS} Crypt.lo" 
     
    192204                CRYPTO_CFLAGS="${CRYPTO_CFLAGS} `libmcrypt-config --cflags`" 
    193205        ]) 
    194  
    195 AC_CHECK_LIB(crypto, DSA_generate_parameters, 
     206fi 
     207 
     208if test "_$enable_openssl" = _yes; then 
     209    AC_CHECK_LIB(crypto, DSA_generate_parameters, 
    196210        [ 
    197211                CRYPTO_DRIVERS="${CRYPTO_DRIVERS} BigNum.lo DH.lo DSA.lo RSA.lo SSLConnect.lo SSLListen.lo" 
     
    201215        ]) 
    202216 
    203 if (echo "$CRYPTO_MODULES" | grep crypto/hash && echo "$CRYPTO_MODULES" | grep crypto/pk &&echo "$CRYPTO_MODULES" | grep crypto/cipher) > /dev/null 2>&1; then 
     217    if (echo "$CRYPTO_MODULES" | grep crypto/hash && echo "$CRYPTO_MODULES" | grep crypto/pk &&echo "$CRYPTO_MODULES" | grep crypto/cipher) > /dev/null 2>&1; then 
    204218        CRASH_MODULES="${CRASH_MODULES} crypto/pk-wrapper" 
    205219        CRYPTO_DRIVERS="${CRYPTO_DRIVERS} PKServer.lo PKClient.lo" 
    206 fi 
    207  
     220    fi 
     221fi 
     222 
     223AC_SUBST(EXTRA_CXXFLAGS) 
     224AC_SUBST(EXTRA_LDFLAGS) 
    208225AC_SUBST(CRASH_MODULES) 
    209226AC_SUBST(OPTIONAL_TESTS) 
  • libcrash/trunk/crash/Base64.cc

    r135 r144  
    2727}; 
    2828 
    29 IBase64Stream::IBase64Stream(istream &in) : StreamBuf(STREAMBUF_READ), ios(this), istream(this), minput(&in), mb64index(0), mblockindex(0) { 
     29IBase64Stream::IBase64Stream(istream &in) : StreamBuf(STREAMBUF_READ), IStream(this), minput(&in), mb64index(0), mblockindex(0) { 
    3030        zero(mblock); 
    3131} 
     
    9595} 
    9696 
    97 OBase64Stream::OBase64Stream(ostream &out, bool wrap) : StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this), mb64index(0), mblockindex(0), mcolumn(0), mwrap(wrap) { 
     97OBase64Stream::OBase64Stream(ostream &out, bool wrap) : StreamBuf(STREAMBUF_WRITE), OStream(this), mb64index(0), mblockindex(0), mcolumn(0), mwrap(wrap) { 
    9898        zero(mblock); 
    9999        tie(&out); 
  • libcrash/trunk/crash/BufferStream.cc

    r135 r144  
    66 
    77OBufferStream::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),  
    99        mallocated(true) { 
    1010} 
    1111 
    1212OBufferStream::OBufferStream(Buffer &buffer, int offset)  
    13         : StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this), mbuffer(&buffer),  
     13        : StreamBuf(STREAMBUF_WRITE), OStream(this), mbuffer(&buffer),  
    1414        moffset(offset), mallocated(false) { 
    1515} 
     
    3535///////////////////////////// IBufferStream 
    3636IBufferStream::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) { 
    3838        if (mlength == -1) mlength = buffer.size(); 
    3939} 
  • libcrash/trunk/crash/Connect.cc

    r135 r144  
    2222namespace crash { 
    2323 
    24 Connect::Connect(string const &hostname, int port) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), ios(this), istream(this), ostream(this), mfd(-1), mtype(TCP) { 
     24Connect::Connect(string const &hostname, int port) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), IOStream(this), mfd(-1), mtype(TCP) { 
    2525        init(this); 
    2626        if (!open(hostname, port)) 
     
    2828} 
    2929 
    30 Connect::Connect(string const &file) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), ios(this), istream(this), ostream(this), mfd(-1), mtype(LOCAL) { 
     30Connect::Connect(string const &file) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), IOStream(this), mfd(-1), mtype(LOCAL) { 
    3131        init(this); 
    3232        if (!open(file)) 
     
    3434} 
    3535 
    36 Connect::Connect(int localfd, Type type) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), ios(this), istream(this), ostream(this), mfd(-1), mtype(type) { 
     36Connect::Connect(int localfd, Type type) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), IOStream(this), mfd(-1), mtype(type) { 
    3737        if (localfd == -1) 
    3838                throw Exception("invalid fd to accept from"); 
     
    5555} 
    5656 
    57 Connect::Connect() : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), ios(this), istream(this), ostream(this), mfd(-1) { 
     57Connect::Connect() : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), IOStream(this), mfd(-1) { 
    5858} 
    5959 
    60 Connect::Connect(Connect const &copy) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), ios(this), istream(this), ostream(this), mfd(-1) { 
     60Connect::Connect(Connect const &copy) : StreamBuf(STREAMBUF_READ | STREAMBUF_WRITE), IOStream(this), mfd(-1) { 
    6161        mfd = dup(copy.mfd); 
    6262} 
  • libcrash/trunk/crash/Crash.cc

    r140 r144  
    1313#include <crash/Crash.h> 
    1414#include <netinet/in.h> 
    15 #include <strstream> 
     15#include <sstream> 
    1616 
    1717#ifdef HAVE_BYTESWAP_H 
     
    123123string readfile(string const &filename) { 
    124124ifstream in(filename.c_str()); 
    125 ostrstream out; 
     125ostringstream out; 
    126126char buffer[512]; 
    127127 
  • libcrash/trunk/crash/crypto/Crypt.cc

    r135 r144  
    342342///////////////////////////// EncryptStream 
    343343EncryptStream::EncryptStream() 
    344         : StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this), mwbuf(BLOCK_SIZE) { 
     344        : StreamBuf(STREAMBUF_WRITE), OStream(this), mwbuf(BLOCK_SIZE) { 
    345345} 
    346346 
    347347EncryptStream::EncryptStream(ostream &out)  
    348         : StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this), mwbuf(BLOCK_SIZE) { 
     348        : StreamBuf(STREAMBUF_WRITE), OStream(this), mwbuf(BLOCK_SIZE) { 
    349349        tie(&out); 
    350350} 
    351351 
    352352EncryptStream::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), 
    354354        mwbuf(BLOCK_SIZE) { 
    355355        tie(&output); 
     
    358358 
    359359EncryptStream::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), 
    361361        mwbuf(BLOCK_SIZE) { 
    362362        tie(&output); 
     
    388388//////////////////////////// DecryptStream 
    389389DecryptStream::DecryptStream() 
    390         : StreamBuf(STREAMBUF_READ), ios(this), istream(this), minput(0) { 
     390        : StreamBuf(STREAMBUF_READ), IStream(this), minput(0) { 
    391391} 
    392392 
    393393DecryptStream::DecryptStream(istream &in)  
    394         : StreamBuf(STREAMBUF_READ), ios(this), istream(this), minput(&in) { 
     394        : StreamBuf(STREAMBUF_READ), IStream(this), minput(&in) { 
    395395} 
    396396 
    397397DecryptStream::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) { 
    400399        if (mode == CBC) throw Crypt::Exception("DecryptStream can not operate in CBC mode"); 
    401400} 
    402401 
    403402DecryptStream::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) { 
    406404        if (mode == CBC) throw Crypt::Exception("DecryptStream can not operate in CBC mode"); 
    407405} 
  • libcrash/trunk/crash/crypto/DH.cc

    r143 r144  
    101101        if (pk.empty()) throw Exception("third party Diffie-Hellman public key is invalid"); 
    102102BIGNUM *bnpk = BN_bin2bn(pk, pk.size(), 0); 
    103  
    104103        resize(DH_size(dh)); 
    105104int size = DH_compute_key(*this, bnpk, dh); 
     
    113112Buffer DH::pub() const { 
    114113Buffer out; 
    115  
    116114        if (dh->pub_key) { 
    117115                out.resize(BN_num_bytes(dh->pub_key)); 
     
    123121Buffer DH::priv() const { 
    124122Buffer out; 
    125  
    126123        if (dh->priv_key) { 
    127124                out.resize(BN_num_bytes(dh->priv_key)); 
  • libcrash/trunk/crash/crypto/Hash.cc

    r135 r144  
    107107///////////////////////////// IHashStream 
    108108IHashStream::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) { 
    110110} 
    111111 
    112112IHashStream::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) { 
    114114} 
    115115 
    116116IHashStream::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) { 
    118118} 
    119119 
     
    133133///////////////////////////// OHashStream 
    134134OHashStream::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) { 
    136136} 
    137137 
    138138OHashStream::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) { 
    140140} 
    141141 
    142142OHashStream::OHashStream(Algorithm algorithm) 
    143         : Hash(algorithm), StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this) { 
     143        : Hash(algorithm), StreamBuf(STREAMBUF_WRITE), OStream(this) { 
    144144} 
    145145 
    146146OHashStream::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) { 
    148148        tie(&out); 
    149149} 
    150150 
    151151OHashStream::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) { 
    153153        tie(&out); 
    154154} 
    155155 
    156156OHashStream::OHashStream(ostream &out, Algorithm algorithm) 
    157         : Hash(algorithm), StreamBuf(STREAMBUF_WRITE), ios(this), ostream(this) { 
     157        : Hash(algorithm), StreamBuf(STREAMBUF_WRITE), OStream(this) { 
    158158        tie(&out); 
    159159} 
  • libcrash/trunk/crash/crypto/Makefile.am

    r135 r144  
    2020noinst_HEADERS = ${libcrashcrypto_la_SOURCES:%.cc=} ${EXTRA_libcrashcrypto_la_SOURCES:%.cc=} 
    2121 
    22 AM_CXXFLAGS = @CXXFLAGS@ @CRYPTO_CFLAGS@ 
     22AM_CXXFLAGS = @EXTRA_CXXFLAGS@ @CRYPTO_CFLAGS@ 
    2323INCLUDES = -I../.. 
    2424 
  • libcrash/trunk/crash/crypto/SSLConnect.cc

    r135 r144  
    99namespace crypto { 
    1010 
    11 SSLConnect::SSLConnect() : ios(this), istream(this), ostream(this)
     11SSLConnect::SSLConnect()
    1212} 
    1313 
    14 SSLConnect::SSLConnect(SSLConnect const &copy) : Connect(copy), ios(this), istream(this), ostream(this), mstate(copy.mstate) { 
     14SSLConnect::SSLConnect(SSLConnect const &copy) : Connect(copy), mstate(copy.mstate) { 
    1515} 
    1616 
    17 SSLConnect::SSLConnect(SSL_CTX *context, int fd) : Connect(fd, TCP), ios(this), istream(this), ostream(this), mstate(new State(context)) { 
     17SSLConnect::SSLConnect(SSL_CTX *context, int fd) : Connect(fd, TCP), mstate(new State(context)) { 
    1818        if (!mstate->bind(this->fd())) 
    1919                throw Exception("could not bind to accepted socket"); 
    2020} 
    2121 
    22 SSLConnect::SSLConnect(string const &file) : ios(this), istream(this), ostream(this)
     22SSLConnect::SSLConnect(string const &file)
    2323        open(file); 
    2424} 
    2525 
    26 SSLConnect::SSLConnect(string const &hostname, int port) : ios(this), istream(this), ostream(this)
     26SSLConnect::SSLConnect(string const &hostname, int port)
    2727        open(hostname, port); 
    2828} 
  • libcrash/trunk/crash/generic.h

    r143 r144  
    292292template <> struct generic_type<unsigned long> : public generic_type<signed int> { generic_type(unsigned long v) : generic_type<signed int>(v) {} }; 
    293293 
    294 /*template <typename T> 
     294template <typename T> 
    295295class generic_type<shared_ptr<T> > : public generic_value_type<shared_ptr<T> > { 
    296296        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) {} 
    298298        protected : 
    299299                void const *cast_to(std::type_info const &type) const { 
     
    302302                        if (p) return p; 
    303303                        if (typeid(T const *) == type) { 
    304                                 cp = c; 
     304                                cp = generic_value_type<shared_ptr<T> >::c; 
    305305                                return &cp; 
    306306                        } 
     
    309309 
    310310                T *cp; 
    311 };*/ 
     311}; 
    312312 
    313313/**     A generic is a type that can encapsulate any other type. This is  
  • libcrash/trunk/crash/LayeredStream.cc

    r135 r144  
    66 
    77LayeredStream::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) { 
    99} 
    1010 
  • libcrash/trunk/crash/Makefile.am

    r143 r144  
    7575 
    7676libcrash_la_LDFLAGS = -release @VERSION@ 
    77 AM_CXXFLAGS = @CXXFLAGS@ -D_REENTRANT 
     77AM_CXXFLAGS = @EXTRA_CXXFLAGS@ 
    7878INCLUDES = -I.. 
    7979 
  • libcrash/trunk/crash/MemStream.cc

    r135 r144  
    3232 
    3333IMemStream::IMemStream(uint8 const *input, int len)  
    34         : MemStreamBuf(input, 0, len), ios(this), istream(this) { 
     34        : MemStreamBuf(input, 0, len), IStream(this) { 
    3535} 
    3636 
    3737OMemStream::OMemStream(uint8 *output, int len)  
    38         : MemStreamBuf(0, output, len), ios(this), ostream(this) { 
     38        : MemStreamBuf(0, output, len), OStream(this) { 
    3939} 
    4040 
  • libcrash/trunk/crash/script/Makefile.am

    r135 r144  
    1010noinst_HEADERS = ${libcrashscript_la_SOURCES:%.cc=} 
    1111 
    12 AM_CXXFLAGS = @CXXFLAGS@ 
     12AM_CXXFLAGS = @EXTRA_CXXFLAGS@ 
    1313INCLUDES = -I../.. 
    1414 
  • libcrash/trunk/crash/script/Object.cc

    r143 r144  
    44#include <cmath> 
    55#include <iostream> 
     6#include <cmath> 
    67 
    78using namespace std; 
  • libcrash/trunk/crash/script/Parser.cc

    r135 r144  
    270270                        t == Lexer::OP_SUBASSIGN || t == Lexer::OP_MULASSIGN || 
    271271                        t == Lexer::OP_DIVASSIGN || t == Lexer::OP_MODASSIGN) { 
    272         Type type
     272        Type type = OP_ASSIGN
    273273 
    274274                if (!(l->type() == VAR || l->type() == INDEX || l->type() == MEMBER)) throw Exception(token, "lhs of assignment is not an l-value"); 
     
    316316 
    317317        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) 
    323321                        type = OP_OR; 
    324322                ++token; 
     
    339337                        t == Lexer::OP_LE || t == Lexer::OP_GE || t == Lexer::OP_RXEQ || 
    340338                        t == Lexer::OP_RXNE) { 
    341         Type type
     339        Type type = OP_LT
    342340         
    343341                #define SET(n) case Lexer::n : type = n; break 
    344342                switch (t) { 
    345                         case '<' : type = OP_LT; break; 
    346343                        case '>' : type = OP_GT; break; 
    347344                        SET(OP_EQ); 
     
    395392 
    396393        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; 
    401397 
    402398        Ptr node = new Node(type, token); 
     
    415411 
    416412        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; 
    421416                else if (t == '%') type = OP_MOD; 
    422417 
  • libcrash/trunk/crash/Signal.h

    r135 r144  
    6262                ///     Connect a method callback to this signal 
    6363                template <typename C> 
    64                 SignalConnection connect(C &object, R (C::*method)()) { reg(new MethodCallBack0<C, R>(object, method)); } 
     64                SignalConnection connect(C &object, R (C::*method)()) { return reg(new MethodCallBack0<C, R>(object, method)); } 
    6565                ///     Connect a functor callback to this signal 
    6666                template <typename C> 
     
    9595                ///     Connect a method callback to this signal 
    9696                template <typename C> 
    97                 SignalConnection connect(C &object, R (C::*method)(P0)) { reg(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)); } 
    9898                ///     Connect a functor callback to this signal 
    9999                template <typename C> 
     
    128128                ///     Connect a method callback to this signal 
    129129                template <typename C> 
    130                 SignalConnection connect(C &object, R (C::*method)(P0, P1)) { reg(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)); } 
    131131                ///     Connect a functor callback to this signal 
    132132                template <typename C> 
     
    161161                ///     Connect a method callback to this signal 
    162162                template <typename C> 
    163                 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2)) { reg(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)); } 
    164164                ///     Connect a functor callback to this signal 
    165165                template <typename C> 
     
    194194                ///     Connect a method callback to this signal 
    195195                template <typename C> 
    196                 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2, P3)) { reg(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)); } 
    197197                ///     Connect a functor callback to this signal 
    198198                template <typename C> 
     
    227227                ///     Connect a method callback to this signal 
    228228                template <typename C> 
    229                 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2, P3, P4)) { reg(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)); } 
    230230                ///     Connect a functor callback to this signal 
    231231                template <typename C> 
     
    260260                ///     Connect a method callback to this signal 
    261261                template <typename C> 
    262                 SignalConnection connect(C &object, R (C::*method)(P0, P1, P2, P3, P4, P5)) { reg(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)); } 
    263263                ///     Connect a functor callback to this signal 
    264264                template <typename C> 
  • libcrash/trunk/crash/sql/Makefile.am

    r135 r144  
    66libcrashsql_la_DEPENDENCIES = @SQL_DRIVERS@ 
    77 
    8 AM_CXXFLAGS = @CXXFLAGS@ 
     8AM_CXXFLAGS = @EXTRA_CXXFLAGS@ 
    99INCLUDES = -I../.. 
    1010 
  • libcrash/trunk/crash/Terminal.cc

    r135 r144  
    2525 
    2626Terminal::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) { 
    2828Key keymap[] = { 
    2929//      { "kl", LEFT }, { "kr", RIGHT }, { "ku", UP }, { "kd", DOWN }, 
  • libcrash/trunk/crash/thread/Makefile.am

    r135 r144  
    88        Thread.cc Thread.h 
    99 
    10 AM_CXXFLAGS = @CXXFLAGS@ -D_GNU_SOURCE 
     10AM_CXXFLAGS = @EXTRA_CXXFLAGS@ -D_GNU_SOURCE 
    1111INCLUDES = -I../.. 
    1212 
  • libcrash/trunk/crash/thread/String.cc

    r135 r144  
    545545 
    546546std::istream &operator >> (std::istream &in, crash::thread::String &value) { 
    547 int c
     547int c = 0
    548548 
    549549        value = "";