Fix clang unreachable code warnings

This commit is contained in:
Ai Lin Chia
2016-11-22 12:31:44 +01:00
parent 279eb30017
commit 7cee4ea8e3
8 changed files with 4 additions and 11 deletions

@ -834,7 +834,6 @@ int Mem::printBreech ( int32_t i) {
if ( flag == 0 ) return 1;
gbshutdownCorrupted();
return 1; //shut up PVS-studio
}
// check all allocated memory for buffer under/overruns

@ -193,7 +193,6 @@ bool Parm::printVal(SafeBuf *sb, collnum_t collnum, int32_t occNum) const {
log("parms: missing parm type!!");
g_process.shutdownAbort(true);
return false;
}

@ -438,7 +438,6 @@ int64_t Posdb::getTermFreq ( collnum_t collnum, int64_t termId ) {
if( !buckets ) {
log(LOG_LOGIC, "%s:%s:%d: No buckets!", __FILE__, __func__, __LINE__);
gbshutdownLogicError();
return -1; // for code analyzers not catching the abort above
}
int64_t numBytes = buckets->getListSize(collnum, (char *)&startKey, (char *)&endKey, NULL, NULL);

@ -5771,7 +5771,6 @@ static inline bool isTermValueInRange( const char *p, const QueryTerm *qt ) {
// how did this happen?
gbshutdownAbort(true);
return false; // shut up PVS-Studio
}

@ -683,12 +683,12 @@ bool RdbMap::addRecord ( char *key, char *rec , int32_t recSize ) {
m_badKeys, m_file.getDir(), m_file.getFilename());
log(LOG_LOGIC,"build: offset=%" PRId64" k1=%s k2=%s", m_offset, KEYSTR(m_lastKey,m_ks), KEYSTR(key,m_ks));
// @todo: Temporarily added for tracking down bug. We want the core. Keep permanently?
/// @todo Temporarily added for tracking down bug. We want the core. Keep permanently?
gbshutdownCorrupted();
// if being called from RdbDump.cpp...
g_errno = ECORRUPTDATA;
return false;
// g_errno = ECORRUPTDATA;
// return false;
}
// remember the lastKey in the whole file

@ -1395,7 +1395,6 @@ bool SpiderLoop::spiderUrl9 ( SpiderRequest *sreq ,
if( !tree ) {
// Sanity
gbshutdownLogicError();
return false; // shut up, pvs..
}
// now we just take it out of doledb instantly

@ -324,7 +324,6 @@ bool Statsdb::addStat ( int32_t niceness ,
if( !tree ) {
log(LOG_LOGIC,"%s:%s:%d: Rdb has no tree!", __FILE__, __func__, __LINE__);
gbshutdownLogicError();
return true;
}
// do not add stats to our tree if it is loading
if(tree->isLoading()) return true;

@ -2785,7 +2785,6 @@ int TcpServer::sslHandshake ( TcpSocket *s ) {
if ( !s->m_ssl ) {
log("ssl: SSL is NULL after SSL_new");
g_process.shutdownAbort(true);
return -1; // for code analyzers..
}
SSL_set_fd(s->m_ssl, s->m_sd);