mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
Bug fix/clang tidy warnings part2 (#296)
* core.StackAddressEscape * cplusplus.VirtualCall * clang-analyzer-deadcode.DeadStores * clang-analyzer-core.NullDereference * clang-analyzer-core.NonNullParamChecker * change to nolint --------- Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
This commit is contained in:
@@ -78,7 +78,7 @@ vector<DataBlock> readCorpus(const string &filename) {
|
||||
ostringstream err;
|
||||
err << "Unable to open database '" << filename << "': "
|
||||
<< sqlite3_errmsg(db);
|
||||
status = sqlite3_close(db);
|
||||
status = sqlite3_close(db); //NOLINT (clang-analyzer-deadcode.DeadStores)
|
||||
assert(status == SQLITE_OK);
|
||||
throw DataCorpusError(err.str());
|
||||
}
|
||||
@@ -91,9 +91,9 @@ vector<DataBlock> readCorpus(const string &filename) {
|
||||
status = sqlite3_prepare_v2(db, query.c_str(), query.size(), &statement,
|
||||
nullptr);
|
||||
if (status != SQLITE_OK) {
|
||||
status = sqlite3_finalize(statement);
|
||||
status = sqlite3_finalize(statement); //NOLINT (clang-analyzer-deadcode.DeadStores)
|
||||
assert(status == SQLITE_OK);
|
||||
status = sqlite3_close(db);
|
||||
status = sqlite3_close(db); //NOLINT (clang-analyzer-deadcode.DeadStores)
|
||||
assert(status == SQLITE_OK);
|
||||
|
||||
ostringstream oss;
|
||||
@@ -115,17 +115,17 @@ vector<DataBlock> readCorpus(const string &filename) {
|
||||
oss << "Error retrieving blocks from corpus: "
|
||||
<< sqlite3_errmsg(db);
|
||||
|
||||
status = sqlite3_finalize(statement);
|
||||
status = sqlite3_finalize(statement); //NOLINT (clang-analyzer-deadcode.DeadStores)
|
||||
assert(status == SQLITE_OK);
|
||||
status = sqlite3_close(db);
|
||||
status = sqlite3_close(db); //NOLINT (clang-analyzer-deadcode.DeadStores)
|
||||
assert(status == SQLITE_OK);
|
||||
|
||||
throw DataCorpusError(oss.str());
|
||||
}
|
||||
|
||||
status = sqlite3_finalize(statement);
|
||||
status = sqlite3_finalize(statement); //NOLINT (clang-analyzer-deadcode.DeadStores)
|
||||
assert(status == SQLITE_OK);
|
||||
status = sqlite3_close(db);
|
||||
status = sqlite3_close(db); //NOLINT (clang-analyzer-deadcode.DeadStores)
|
||||
assert(status == SQLITE_OK);
|
||||
|
||||
if (blocks.empty()) {
|
||||
|
@@ -234,13 +234,13 @@ void processArgs(int argc, char *argv[], vector<BenchmarkSigs> &sigSets,
|
||||
#endif
|
||||
;
|
||||
int in_sigfile = 0;
|
||||
int do_per_scan = 0;
|
||||
int do_compress = 0;
|
||||
static int do_per_scan = 0;
|
||||
static int do_compress = 0;
|
||||
int do_compress_size = 0;
|
||||
int do_echo_matches = 0;
|
||||
int do_sql_output = 0;
|
||||
static int do_echo_matches = 0;
|
||||
static int do_sql_output = 0;
|
||||
int option_index = 0;
|
||||
int literalFlag = 0;
|
||||
static int literalFlag = 0;
|
||||
vector<string> sigFiles;
|
||||
|
||||
static struct option longopts[] = {
|
||||
|
@@ -56,7 +56,7 @@ sqlite3 *initDB(const string &filename) {
|
||||
ostringstream oss;
|
||||
oss << "Unable to open database '" << filename
|
||||
<< "': " << sqlite3_errmsg(db);
|
||||
status = sqlite3_close(db);
|
||||
status = sqlite3_close(db); //NOLINT (clang-analyzer-deadcode.DeadStores)
|
||||
assert(status == SQLITE_OK);
|
||||
throw SqlFailure(oss.str());
|
||||
}
|
||||
@@ -115,7 +115,7 @@ sqlite3 *initDB(const string &filename) {
|
||||
fail:
|
||||
ostringstream oss;
|
||||
oss << "Unable to create tables: " << sqlite3_errmsg(db);
|
||||
status = sqlite3_close(db);
|
||||
status = sqlite3_close(db); //NOLINT (clang-analyzer-deadcode.DeadStores)
|
||||
assert(status == SQLITE_OK);
|
||||
throw SqlFailure(oss.str());
|
||||
}
|
||||
|
@@ -494,7 +494,7 @@ static
|
||||
void processArgs(int argc, char *argv[], UNUSED const unique_ptr<Grey> &grey) {
|
||||
const char options[] = "e:E:s:z:hHLNV8G:T:BC";
|
||||
bool signatureSet = false;
|
||||
int literalFlag = 0;
|
||||
static int literalFlag = 0;
|
||||
|
||||
static struct option longopts[] = {
|
||||
{"literal-on", no_argument, &literalFlag, 1},
|
||||
|
Reference in New Issue
Block a user