Fix a number of build warnings

(cherry picked from commit 292e3c8300)
v3.5.13-sru
Timothy Pearson 13 years ago committed by Slávek Banko
parent 6d45b35a4a
commit c34a46b466

@ -283,8 +283,8 @@ d4_inline bool operator!= (c4_Cursor a_, c4_Cursor b_)
d4_inline bool operator< (c4_Cursor a_, c4_Cursor b_) d4_inline bool operator< (c4_Cursor a_, c4_Cursor b_)
{ {
return a_._seq < b_._seq || return (a_._seq < b_._seq) ||
a_._seq == b_._seq && a_._index < b_._index; ((a_._seq == b_._seq) && (a_._index < b_._index));
} }
d4_inline bool operator> (c4_Cursor a_, c4_Cursor b_) d4_inline bool operator> (c4_Cursor a_, c4_Cursor b_)

@ -428,17 +428,21 @@ void c4_Column::MoveGapTo(t4_i32 pos_)
{ {
d4_assert(pos_ <= _size); d4_assert(pos_ <= _size);
if (_slack == 0) // if there is no real gap, then just move it if (_slack == 0) { // if there is no real gap, then just move it
_gap = pos_; _gap = pos_;
else if (_gap < pos_) // move the gap up, ie. some bytes down }
else if (_gap < pos_) { // move the gap up, ie. some bytes down
MoveGapUp(pos_); MoveGapUp(pos_);
else if (_gap > pos_) // move the gap down, ie. some bytes up }
else if (_gap > pos_) { // move the gap down, ie. some bytes up
if (_gap - pos_ > _size - _gap + fSegRest(pos_)) { if (_gap - pos_ > _size - _gap + fSegRest(pos_)) {
RemoveGap(); // it's faster to get rid of the gap instead RemoveGap(); // it's faster to get rid of the gap instead
_gap = pos_; _gap = pos_;
} }
else // normal case, move some bytes up else { // normal case, move some bytes up
MoveGapDown(pos_); MoveGapDown(pos_);
}
}
d4_assert(_gap == pos_); d4_assert(_gap == pos_);
@ -1201,11 +1205,11 @@ void c4_ColOfInts::SetAccessWidth(int bits_)
++l2bp1; ++l2bp1;
bits_ >>= 1; bits_ >>= 1;
} }
d4_assert(0 <= l2bp1 && l2bp1 < 8); d4_assert((0 <= l2bp1) && (l2bp1 < 8));
_currWidth = (1 << l2bp1) >> 1; _currWidth = (1 << l2bp1) >> 1;
if (l2bp1 > 4 && (_mustFlip || Persist() != 0 && Strategy()._bytesFlipped)) if (l2bp1 > 4 && (_mustFlip || ((Persist() != 0) && Strategy()._bytesFlipped)))
l2bp1 += 3; // switch to the trailing entries for byte flipping l2bp1 += 3; // switch to the trailing entries for byte flipping
// Metrowerks Codewarrior 11 is dumb, it requires the "&c4_ColOfInts::" // Metrowerks Codewarrior 11 is dumb, it requires the "&c4_ColOfInts::"

@ -661,13 +661,17 @@ void QGpgMECryptoConfigEntry::resetToDefault()
{ {
mSet = false; mSet = false;
mDirty = true; mDirty = true;
if ( mFlags & GPGCONF_FLAG_DEFAULT ) if ( mFlags & GPGCONF_FLAG_DEFAULT ) {
mValue = mDefaultValue; mValue = mDefaultValue;
else if ( mArgType == ArgType_None ) }
if ( isList() ) else if ( mArgType == ArgType_None ) {
if ( isList() ) {
mValue = 0U; mValue = 0U;
else }
else {
mValue = false; mValue = false;
}
}
} }
void QGpgMECryptoConfigEntry::setBoolValue( bool b ) void QGpgMECryptoConfigEntry::setBoolValue( bool b )

@ -190,11 +190,14 @@ void Kleo::QGpgMERefreshKeysJob::slotProcessExited( KProcess * proc ) {
if ( proc != mProcess ) if ( proc != mProcess )
return; return;
if ( !mError && !mPatternsToDo.empty() ) if ( !mError && !mPatternsToDo.empty() ) {
if ( const GpgME::Error err = startAProcess() ) if ( const GpgME::Error err = startAProcess() ) {
mError = err; mError = err;
else }
else {
return; return;
}
}
emit done(); emit done();
if ( !mError && if ( !mError &&

@ -115,8 +115,8 @@ void Kleo::QGpgMESignEncryptJob::doOperationDoneEvent( const GpgME::Error & ) {
} }
void Kleo::QGpgMESignEncryptJob::showErrorDialog( TQWidget * parent, const TQString & caption ) const { void Kleo::QGpgMESignEncryptJob::showErrorDialog( TQWidget * parent, const TQString & caption ) const {
if ( mResult.first.error() && !mResult.first.error().isCanceled() || if ( (mResult.first.error() && !mResult.first.error().isCanceled()) ||
mResult.second.error() && !mResult.second.error().isCanceled() ) (mResult.second.error() && !mResult.second.error().isCanceled()) )
Kleo::MessageBox::error( parent, mResult.first, mResult.second, this, caption ); Kleo::MessageBox::error( parent, mResult.first, mResult.second, this, caption );
} }

@ -86,13 +86,14 @@
static bool checkKeyUsage( const GpgME::Key & key, unsigned int keyUsage ) { static bool checkKeyUsage( const GpgME::Key & key, unsigned int keyUsage ) {
if ( keyUsage & Kleo::KeySelectionDialog::ValidKeys ) { if ( keyUsage & Kleo::KeySelectionDialog::ValidKeys ) {
if ( key.isInvalid() ) if ( key.isInvalid() ) {
if ( key.keyListMode() & GpgME::Context::Validate ) { if ( key.keyListMode() & GpgME::Context::Validate ) {
kdDebug() << "key is invalid" << endl; kdDebug() << "key is invalid" << endl;
return false; return false;
} else { } else {
kdDebug() << "key is invalid - ignoring" << endl; kdDebug() << "key is invalid - ignoring" << endl;
} }
}
if ( key.isExpired() ) { if ( key.isExpired() ) {
kdDebug() << "key is expired" << endl; kdDebug() << "key is expired" << endl;
return false; return false;

@ -75,7 +75,11 @@ void mmap_manager::resize( unsigned ns ) {
unsigned old_size = size(); unsigned old_size = size();
unmap(); unmap();
ns = ( ns / pagesize_ + bool( ns % pagesize_ ) ) * pagesize_; ns = ( ns / pagesize_ + bool( ns % pagesize_ ) ) * pagesize_;
ftruncate( fd_, ns ); if (ftruncate( fd_, ns ) < 0) {
// An error occurred
// FIXME
printf("Something went wrong in indexlib/mmap_manager.cpp\n");
}
map( ns ); map( ns );
logfile() << format( "Going to bzero from %s to %s)\n" ) % old_size % size(); logfile() << format( "Going to bzero from %s to %s)\n" ) % old_size % size();
memset( rw_base( old_size ), 0, size() - old_size ); memset( rw_base( old_size ), 0, size() - old_size );

@ -83,7 +83,11 @@ gpgme_error_t passphrase_callback( void * opaque, const char * uid_hint, const c
if ( passphrase && *passphrase ) if ( passphrase && *passphrase )
wipe( passphrase, strlen( passphrase ) ); wipe( passphrase, strlen( passphrase ) );
free( passphrase ); free( passphrase );
write( fd, "\n", 1 ); if (write( fd, "\n", 1 ) < 0) {
// An error occurred during write
// FIXME
printf("Something went wrong in libkdenetwork/gpgmepp/callbacks.cpp\n");
}
return err; return err;
} }

@ -51,7 +51,7 @@ bool BoolFlags::get(unsigned int i)
n=0; n=0;
} }
else { //second byte else { //second byte
p=(1 << i-8); p=(1 << (i-8));
n=1; n=1;
} }

@ -84,9 +84,9 @@ void CharFreq::count( const char * it, size_t len ) {
default: default:
{ {
uchar c = *it; uchar c = *it;
if ( c == '\t' || c >= ' ' && c <= '~' ) if ( (c == '\t') || ((c >= ' ') && (c <= '~')) )
++printable; ++printable;
else if ( c == 127 || c < ' ' ) else if ( (c == 127) || (c < ' ') )
++CTL; ++CTL;
else else
++eightBit; ++eightBit;

@ -60,7 +60,7 @@ static inline uchar lowNibble( uchar ch ) {
static inline bool keep( uchar ch ) { static inline bool keep( uchar ch ) {
// no CTLs, except HT and not '?' // no CTLs, except HT and not '?'
return !( ch < ' ' && ch != '\t' || ch == '?' ); return !( ((ch < ' ') && (ch != '\t')) || (ch == '?') );
} }
// //
@ -90,7 +90,7 @@ protected:
mFinished(false) {} mFinished(false) {}
bool needsEncoding( uchar ch ) { bool needsEncoding( uchar ch ) {
return ( ch > '~' || ch < ' ' && ch != '\t' || ch == '=' ); return ( (ch > '~') || ((ch < ' ') && (ch != '\t')) || (ch == '=') );
} }
bool needsEncodingAtEOL( uchar ch ) { bool needsEncodingAtEOL( uchar ch ) {
return ( ch == ' ' || ch == '\t' ); return ( ch == ' ' || ch == '\t' );
@ -273,8 +273,8 @@ bool QuotedPrintableDecoder::decode( const char* & scursor, const char * const s
// output mBadChar // output mBadChar
assert( mAccu == 0 ); assert( mAccu == 0 );
if ( mBadChar ) { if ( mBadChar ) {
if ( mBadChar >= '>' && mBadChar <= '~' || if ( ((mBadChar >= '>') && (mBadChar <= '~')) ||
mBadChar >= '!' && mBadChar <= '<' ) ((mBadChar >= '!') && (mBadChar <= '<')) )
*dcursor++ = mBadChar; *dcursor++ = mBadChar;
mBadChar = 0; mBadChar = 0;
} }
@ -355,7 +355,7 @@ bool QuotedPrintableDecoder::decode( const char* & scursor, const char * const s
mAccu = value << 4; mAccu = value << 4;
} }
} else { // not mInsideHexChar } else { // not mInsideHexChar
if ( ch <= '~' && ch >= ' ' || ch == '\t' ) { if ( ((ch <= '~') && (ch >= ' ')) || (ch == '\t') ) {
if ( ch == mEscapeChar ) { if ( ch == mEscapeChar ) {
mInsideHexChar = true; mInsideHexChar = true;
} else if ( mTQEncoding && ch == '_' ) { } else if ( mTQEncoding && ch == '_' ) {
@ -481,8 +481,8 @@ void QuotedPrintableEncoder::createOutputBuffer( char* & dcursor,
mCurrentLineLength = 0; mCurrentLineLength = 0;
} }
if ( Never == mAccuNeedsEncoding || if ( (Never == mAccuNeedsEncoding) ||
AtBOL == mAccuNeedsEncoding && mCurrentLineLength != 0 ) { ((AtBOL == mAccuNeedsEncoding) && (mCurrentLineLength != 0)) ) {
write( mAccu, dcursor, dend ); write( mAccu, dcursor, dend );
mCurrentLineLength++; mCurrentLineLength++;
} else { } else {

@ -76,7 +76,11 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
if(passphrase) if(passphrase)
{ {
pipe(ppass); if (pipe(ppass) < 0) {
// An error occurred
// FIXME
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
}
pass = fdopen(ppass[1], "w"); pass = fdopen(ppass[1], "w");
fwrite(passphrase, sizeof(char), strlen(passphrase), pass); fwrite(passphrase, sizeof(char), strlen(passphrase), pass);
@ -104,9 +108,21 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
error = ""; error = "";
output = ""; output = "";
pipe(pin); if (pipe(pin) < 0) {
pipe(pout); // An error occurred
pipe(perr); // FIXME
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
}
if (pipe(pout) < 0) {
// An error occurred
// FIXME
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
}
if (pipe(perr) < 0) {
// An error occurred
// FIXME
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
}
TQApplication::flushX(); TQApplication::flushX();
if(!(child_pid = fork())) if(!(child_pid = fork()))
@ -241,8 +257,13 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
} }
} }
} }
else // if input.isEmpty() else { // if input.isEmpty()
write(pin[1], "\n", 1); if (write(pin[1], "\n", 1) < 0) {
// An error occurred
// FIXME
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
}
}
//kdDebug(5100) << "All input was written to pin[1]" << endl; //kdDebug(5100) << "All input was written to pin[1]" << endl;
} }
close(pin[1]); close(pin[1]);
@ -398,7 +419,11 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
if(passphrase) if(passphrase)
{ {
pipe(ppass); if (pipe(ppass) < 0) {
// An error occurred
// FIXME
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
}
pass = fdopen(ppass[1], "w"); pass = fdopen(ppass[1], "w");
fwrite(passphrase, sizeof(char), strlen(passphrase), pass); fwrite(passphrase, sizeof(char), strlen(passphrase), pass);
@ -418,9 +443,21 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
error = ""; error = "";
output = ""; output = "";
pipe(pin); if (pipe(pin) < 0) {
pipe(pout); // An error occurred
pipe(perr); // FIXME
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
}
if (pipe(pout) < 0) {
// An error occurred
// FIXME
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
}
if (pipe(perr) < 0) {
// An error occurred
// FIXME
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
}
if( passphrase ) { if( passphrase ) {
if( mVersion >= "1.0.7" ) { if( mVersion >= "1.0.7" ) {
@ -617,7 +654,11 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
} }
} }
else { // if input.isEmpty() else { // if input.isEmpty()
write(pin[1], "\n", 1); if (write(pin[1], "\n", 1) < 0) {
// An error occurred
// FIXME
printf("Something went wrong in libkpgp/kpgpbase.cpp\n");
}
//kdDebug(5100) << "All input was written to pin[1]" << endl; //kdDebug(5100) << "All input was written to pin[1]" << endl;
close (pin[1]); close (pin[1]);
pin[1] = -1; pin[1] = -1;

@ -1031,8 +1031,8 @@ Base2::parseKeyList( const TQCString& output, bool secretKeys )
// Example: // Example:
// Key fingerprint = 47 30 7C 76 05 BF 5E FB 72 41 00 F2 7D 0B D0 49 // Key fingerprint = 47 30 7C 76 05 BF 5E FB 72 41 00 F2 7D 0B D0 49
int pos2; // int pos2;
pos2 = pos + 18; // pos2 = pos + 18;
TQCString fingerprint = output.mid( pos, index2-pos ); TQCString fingerprint = output.mid( pos, index2-pos );
// remove white space from the fingerprint // remove white space from the fingerprint
for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; ) for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; )

@ -129,9 +129,9 @@ namespace KSieve {
bool Parser::Impl::isArgumentToken() const { bool Parser::Impl::isArgumentToken() const {
return isStringToken() || return isStringToken() ||
token() == Lexer::Number || (token() == Lexer::Number) ||
token() == Lexer::Tag || (token() == Lexer::Tag) ||
token() == Lexer::Special && mTokenValue == "[" ; ((token() == Lexer::Special) && (mTokenValue == "[")) ;
} }
bool Parser::Impl::obtainToken() { bool Parser::Impl::obtainToken() {

Loading…
Cancel
Save