mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-30 03:34:25 +03:00
use STL make_unique, remove wrapper header, breaks C++17 compilation
This commit is contained in:
@@ -50,7 +50,6 @@
|
||||
#include "parser/unsupported.h"
|
||||
#include "parser/logical_combination.h"
|
||||
#include "util/compile_context.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/report_manager.h"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -131,7 +130,7 @@ void CNGInfo::compile() {
|
||||
|
||||
try {
|
||||
if (combination) {
|
||||
auto pl = ue2::make_unique<ParsedLogical>();
|
||||
auto pl = std::make_unique<ParsedLogical>();
|
||||
pl->parseLogicalCombination(id, re.c_str(), ~0U, 0, ~0ULL);
|
||||
pl->logicalKeyRenumber();
|
||||
cng = make_unique<CompiledNG>(move(pl));
|
||||
@@ -148,7 +147,7 @@ void CNGInfo::compile() {
|
||||
// original expression starts with (*UTF8)
|
||||
utf8 |= pe.expr.utf8;
|
||||
|
||||
auto rm = ue2::make_unique<ReportManager>(cc.grey);
|
||||
auto rm = std::make_unique<ReportManager>(cc.grey);
|
||||
|
||||
// Expressions containing zero-width assertions and other extended pcre
|
||||
// types aren't supported yet. This call will throw a ParseError
|
||||
|
@@ -42,7 +42,6 @@
|
||||
#include "parser/control_verbs.h"
|
||||
#include "parser/Parser.h"
|
||||
#include "parser/parse_error.h"
|
||||
#include "util/make_unique.h"
|
||||
#include "util/string_util.h"
|
||||
#include "util/unicode_def.h"
|
||||
#include "util/unordered.h"
|
||||
@@ -331,7 +330,7 @@ GroundTruth::compile(unsigned id, bool no_callouts) {
|
||||
int errloc = 0;
|
||||
int errcode = 0;
|
||||
|
||||
unique_ptr<CompiledPcre> compiled = make_unique<CompiledPcre>();
|
||||
unique_ptr<CompiledPcre> compiled = std::make_unique<CompiledPcre>();
|
||||
compiled->utf8 = flags & PCRE_UTF8;
|
||||
compiled->highlander = highlander;
|
||||
compiled->prefilter = prefilter;
|
||||
|
@@ -39,7 +39,6 @@
|
||||
#include "crc32.h"
|
||||
#include "hs.h"
|
||||
#include "hs_internal.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include "scratch.h"
|
||||
#include "nfa/nfa_api_queue.h"
|
||||
@@ -948,7 +947,7 @@ compileHyperscan(vector<const char *> &patterns, vector<unsigned> &flags,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ue2::make_unique<HyperscanDB>(db, idsvec.begin(), idsvec.end());
|
||||
return std::make_unique<HyperscanDB>(db, idsvec.begin(), idsvec.end());
|
||||
}
|
||||
|
||||
#ifdef HS_HYBRID
|
||||
@@ -970,7 +969,7 @@ compileHybrid(vector<const char *> &patterns,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return ue2::make_unique<HybridDB>(db, idsvec.begin(), idsvec.end());
|
||||
return std::make_unique<HybridDB>(db, idsvec.begin(), idsvec.end());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -52,7 +52,6 @@
|
||||
#include "parser/utf8_validate.h"
|
||||
#include "ue2common.h"
|
||||
#include "util/container.h"
|
||||
#include "util/make_unique.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@@ -1077,7 +1076,7 @@ void addCorporaToQueue(ostream &out, BoundedQueue<TestUnit> &testq, unsigned id,
|
||||
|
||||
size_t corpus_id = 0;
|
||||
for (const Corpus &corpus : c) {
|
||||
tests.push_back(ue2::make_unique<TestUnit>(id, corpus_id, corpus, cpcre,
|
||||
tests.push_back(std::make_unique<TestUnit>(id, corpus_id, corpus, cpcre,
|
||||
cngi, ue2, multi, utf8,
|
||||
highlander, prefilter, som));
|
||||
corpus_id++;
|
||||
@@ -1435,7 +1434,7 @@ unique_ptr<CorpusGenUnit> makeCorpusGenUnit(unsigned id, TestSummary &summary,
|
||||
// Caller may already have set the UTF-8 property (in multi cases)
|
||||
utf8 |= cpcre ? cpcre->utf8 : cngi->utf8;
|
||||
|
||||
return ue2::make_unique<CorpusGenUnit>(move(cngi), move(cpcre), ue2, id,
|
||||
return std::make_unique<CorpusGenUnit>(move(cngi), move(cpcre), ue2, id,
|
||||
multi, utf8);
|
||||
}
|
||||
|
||||
@@ -1824,7 +1823,7 @@ static
|
||||
unique_ptr<CorporaSource> buildCorpora(const vector<string> &corporaFiles,
|
||||
const ExpressionMap &exprMap) {
|
||||
if (!corporaFiles.empty()) {
|
||||
auto c = ue2::make_unique<FileCorpora>();
|
||||
auto c = std::make_unique<FileCorpora>();
|
||||
for (const auto &file : corporaFiles) {
|
||||
if (!c->readFile(file)) {
|
||||
cout << "Error reading corpora from file: " << file << endl;
|
||||
@@ -1833,7 +1832,7 @@ unique_ptr<CorporaSource> buildCorpora(const vector<string> &corporaFiles,
|
||||
}
|
||||
return move(c); /* move allows unique_ptr<CorporaSource> conversion */
|
||||
} else {
|
||||
auto c = ue2::make_unique<NfaGeneratedCorpora>(
|
||||
auto c = std::make_unique<NfaGeneratedCorpora>(
|
||||
exprMap, corpus_gen_prop, force_utf8, force_prefilter);
|
||||
return move(c);
|
||||
}
|
||||
@@ -1886,7 +1885,7 @@ bool runTests(CorporaSource &corpora_source, const ExpressionMap &exprMap,
|
||||
// Start scanning threads.
|
||||
vector<unique_ptr<ScanThread>> scanners;
|
||||
for (size_t i = 0; i < numScannerThreads; i++) {
|
||||
auto s = ue2::make_unique<ScanThread>(i, testq, exprMap, plat, grey);
|
||||
auto s = std::make_unique<ScanThread>(i, testq, exprMap, plat, grey);
|
||||
s->start();
|
||||
scanners.push_back(move(s));
|
||||
}
|
||||
@@ -1989,7 +1988,7 @@ int HS_CDECL main(int argc, char *argv[]) {
|
||||
|
||||
// If we're saving corpora out, truncate the output file.
|
||||
if (saveCorpora) {
|
||||
corporaOut = ue2::make_unique<CorpusWriter>(saveCorporaFile);
|
||||
corporaOut = std::make_unique<CorpusWriter>(saveCorporaFile);
|
||||
}
|
||||
|
||||
GroundTruth::global_prep();
|
||||
|
Reference in New Issue
Block a user