Fix a number of build warnings

pull/21/head
Timothy Pearson 13 years ago
parent dc69027b0e
commit 292e3c8300

@ -283,8 +283,8 @@ 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 ||
a_._seq == b_._seq && a_._index < b_._index;
return (a_._seq < b_._seq) ||
((a_._seq == b_._seq) && (a_._index < b_._index));
}
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);
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_;
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_);
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_)) {
RemoveGap(); // it's faster to get rid of the gap instead
_gap = pos_;
}
else // normal case, move some bytes up
else { // normal case, move some bytes up
MoveGapDown(pos_);
}
}
d4_assert(_gap == pos_);
@ -1201,11 +1205,11 @@ void c4_ColOfInts::SetAccessWidth(int bits_)
++l2bp1;
bits_ >>= 1;
}
d4_assert(0 <= l2bp1 && l2bp1 < 8);
d4_assert((0 <= l2bp1) && (l2bp1 < 8));
_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
// Metrowerks Codewarrior 11 is dumb, it requires the "&c4_ColOfInts::"

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

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

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

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

@ -75,7 +75,11 @@ void mmap_manager::resize( unsigned ns ) {
unsigned old_size = size();
unmap();
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 );
logfile() << format( "Going to bzero from %s to %s)\n" ) % old_size % size();
memset( rw_base( old_size ), 0, size() - old_size );

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

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

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

@ -76,7 +76,11 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
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");
fwrite(passphrase, sizeof(char), strlen(passphrase), pass);
@ -104,9 +108,21 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
error = "";
output = "";
pipe(pin);
pipe(pout);
pipe(perr);
if (pipe(pin) < 0) {
// An error occurred
// 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();
if(!(child_pid = fork()))
@ -241,8 +257,13 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP )
}
}
}
else // if input.isEmpty()
write(pin[1], "\n", 1);
else { // if input.isEmpty()
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;
}
close(pin[1]);
@ -398,7 +419,11 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
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");
fwrite(passphrase, sizeof(char), strlen(passphrase), pass);
@ -418,9 +443,21 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
error = "";
output = "";
pipe(pin);
pipe(pout);
pipe(perr);
if (pipe(pin) < 0) {
// An error occurred
// 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( mVersion >= "1.0.7" ) {
@ -617,7 +654,11 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG )
}
}
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;
close (pin[1]);
pin[1] = -1;

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

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

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

Loading…
Cancel
Save