Commit 32e97907 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Removed useless shared_ptr initialization with NULL value

parent 40c048cf
......@@ -44,6 +44,7 @@ private:
class ABNFNumval : public ABNFBuilder{
public:
ABNFNumval();
static shared_ptr<ABNFNumval> create();
shared_ptr<Recognizer> buildRecognizer(const shared_ptr<Grammar> &grammar);
void setDecVal(const string &decval);
......
......@@ -181,7 +181,7 @@ _parserElementT ParserHandler<_derivedParserElementT,_parserElementT>::invoke(co
//
template <typename _parserElementT>
ParserContext<_parserElementT>::ParserContext(Parser<_parserElementT> &parser) : mParser(parser), mRoot(NULL) {
ParserContext<_parserElementT>::ParserContext(Parser<_parserElementT> &parser) : mParser(parser) {
}
template <typename _parserElementT>
......@@ -294,7 +294,7 @@ void ParserContext<_parserElementT>::removeBranch(const shared_ptr<HandlerContex
//
template <typename _parserElementT>
Parser<_parserElementT>::Parser(const shared_ptr<Grammar> &grammar) : mGrammar(grammar), mNullHandler(NULL), mNullCollector(NULL) {
Parser<_parserElementT>::Parser(const shared_ptr<Grammar> &grammar) : mGrammar(grammar) {
if (!mGrammar->isComplete()){
cerr<<"Grammar not complete, aborting."<<endl;
return;
......
......@@ -203,8 +203,8 @@ void Selector::_optimize(int recursionLevel){
}
ExclusiveSelector::ExclusiveSelector(){
mIsExclusive=true;
ExclusiveSelector::ExclusiveSelector() {
mIsExclusive = true;
}
size_t ExclusiveSelector::_feed(const shared_ptr<ParserContextBase> &ctx, const string &input, size_t pos){
......@@ -253,7 +253,7 @@ void Sequence::_optimize(int recursionLevel){
}
Loop::Loop() : mRecognizer(NULL), mMin(0), mMax(-1) {
Loop::Loop() : mMin(0), mMax(-1) {
}
......@@ -320,8 +320,8 @@ shared_ptr<Loop> Foundation::loop(){
return make_shared<Loop>();
}
Literal::Literal(const string& lit) : mLiteral(tolower(lit)){
mLiteralSize=mLiteral.size();
Literal::Literal(const string& lit) : mLiteral(tolower(lit)), mLiteralSize(mLiteral.size()) {
}
size_t Literal::_feed(const shared_ptr< ParserContextBase >& ctx, const string& input, size_t pos){
......@@ -350,7 +350,7 @@ shared_ptr<Recognizer> Utils::char_range(int begin, int end){
return make_shared<CharRange>(begin, end);
}
RecognizerPointer::RecognizerPointer() : mRecognizer(NULL){
RecognizerPointer::RecognizerPointer() {
}
shared_ptr<Recognizer> RecognizerPointer::getPointed(){
......
......@@ -13,6 +13,10 @@ namespace belr{
ABNFBuilder::~ABNFBuilder(){
}
ABNFNumval::ABNFNumval() : mIsRange(false) {
}
shared_ptr< ABNFNumval > ABNFNumval::create(){
return make_shared<ABNFNumval>();
}
......@@ -70,7 +74,7 @@ shared_ptr< Recognizer > ABNFOption::buildRecognizer(const shared_ptr< Grammar >
return Foundation::loop()->setRecognizer(mAlternation->buildRecognizer(grammar),0,1);
}
ABNFOption::ABNFOption() : mAlternation(NULL) {
ABNFOption::ABNFOption() {
}
......@@ -82,7 +86,7 @@ void ABNFOption::setAlternation(const shared_ptr< ABNFAlternation >& a){
mAlternation=a;
}
ABNFGroup::ABNFGroup() : mAlternation(NULL) {
ABNFGroup::ABNFGroup() {
}
......@@ -114,7 +118,7 @@ shared_ptr< Recognizer > ABNFElement::buildRecognizer(const shared_ptr< Grammar
return NULL;
}
ABNFElement::ABNFElement() : mElement(NULL) {
ABNFElement::ABNFElement() {
}
......@@ -141,7 +145,7 @@ void ABNFElement::setProseVal(const string& prose){
}
}
ABNFRepetition::ABNFRepetition() : mMin(0), mMax(-1), mCount(-1), mElement(NULL) {
ABNFRepetition::ABNFRepetition() : mMin(0), mMax(-1), mCount(-1) {
}
......@@ -226,7 +230,7 @@ shared_ptr< Recognizer > ABNFAlternation::buildRecognizerNoOptim(const shared_pt
return sel;
}
ABNFRule::ABNFRule() : mAlternation(NULL) {
ABNFRule::ABNFRule() {
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment