Skip to content

Commit babd2bc

Browse files
committed
Add missing static casts
1 parent fd900b2 commit babd2bc

File tree

15 files changed

+31
-29
lines changed

15 files changed

+31
-29
lines changed

lima_common/src/common/FsaAccess/AbstractLexiconIdGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int AbstractLexiconIdGeneratorInformer::operator() (
2929
AbstractLexiconIdGeneratorInformer* AbstractLexiconIdGeneratorInformer::theInformer = 0;
3030

3131
AbstractLexiconIdGeneratorInformer* AbstractLexiconIdGeneratorInformer::getInstance() {
32-
if( theInformer == 0 ) {
32+
if( theInformer == nullptr ) {
3333
theInformer = new AbstractLexiconIdGeneratorInformer();
3434
}
3535
return theInformer;

lima_common/src/common/MediaticData/EntityType.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ bool EntityType::operator<(const EntityType& other) const
114114

115115
bool EntityType::isNull() const
116116
{
117-
return (m_d->m_id==static_cast<EntityTypeId>(0)
118-
&& m_d->m_groupId==static_cast<EntityGroupId>(0));
117+
return (m_d->m_id == static_cast<EntityTypeId>(0)
118+
&& m_d->m_groupId == static_cast<EntityGroupId>(0));
119119
}
120120

121121
EntityTypeId EntityType::getTypeId() const

lima_linguisticprocessing/src/linguisticProcessing/client/AnalysisHandlers/BowTextHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void BowTextHandler::startAnalysis()
8383
// delete m_writer;
8484
// m_writer=0;
8585
//}
86-
if (m_writer == 0){
86+
if (m_writer == nullptr){
8787
m_writer=new BowTextWriter();
8888
}
8989
m_bowstream=new std::ostringstream();

lima_linguisticprocessing/src/linguisticProcessing/client/AnalysisHandlers/BowTextWriter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void BowTextWriter::setOut(std::ostream* out)
5858

5959
void BowTextWriter::endAnalysis()
6060
{
61-
if (m_d->m_out == 0)
61+
if (m_d->m_out == nullptr)
6262
{
6363
BOWLOGINIT;
6464
LERROR << "BowTextWriter Error: output stream is not set !";
@@ -73,7 +73,7 @@ void BowTextWriter::endDocument()
7373

7474
void BowTextWriter::handle(const char* buf, int length)
7575
{
76-
if (m_d->m_out == 0)
76+
if (m_d->m_out == nullptr)
7777
{
7878
BOWLOGINIT;
7979
LERROR << "BowTextWriter Error: output stream is not set !";
@@ -86,7 +86,7 @@ void BowTextWriter::startAnalysis()
8686
{
8787
BOWLOGINIT;
8888
LDEBUG << "BowTextWriter::startAnalysis";
89-
if (m_d->m_out == 0)
89+
if (m_d->m_out == nullptr)
9090
{
9191
BOWLOGINIT;
9292
LERROR << "BowTextWriter Error: output stream is not set !";

lima_linguisticprocessing/src/linguisticProcessing/client/AnalysisHandlers/StructuredBoWToBoWDocument.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void StructuredBoWToBoWDocument::
9494
addProperties(BoWDocument& /*document*/,
9595
const GenericDocumentProperties* properties)
9696
{
97-
if (properties == 0 ) {
97+
if (properties == nullptr ) {
9898
return;
9999
}
100100
std::pair<GenericDocumentProperties::IntPropertiesIterator,GenericDocumentProperties::IntPropertiesIterator> intProps=properties->getIntProperties();

lima_linguisticprocessing/src/linguisticProcessing/client/xmlreader/XmlReaderClientFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void Lima::XmlReader::XmlReaderClientFactory::configureClientFactory(
103103
for(ItrIds = MapMediaFactory.begin(); ItrIds != MapMediaFactory.end(); ItrIds++) {
104104

105105
// on ne cree une factory que si elle n'est pas encore dans la liste
106-
if(factory->getFactoryFromId(ItrIds->second) == 0) {
106+
if(factory->getFactoryFromId(ItrIds->second) == nullptr) {
107107

108108
// Create the processor factory
109109
auto factoryfactory = Lima::AbstractProcessingClientFactoryFactory::getFactory(ItrIds->second);

lima_linguisticprocessing/src/linguisticProcessing/core/AnalysisDumpers/EasyXmlDumper/easyXmlDumper.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ LimaStatusCode EasyXmlDumper::process(AnalysisContent& analysis) const
121121
DUMPERLOGINIT;
122122

123123
LinguisticMetaData* metadata = static_cast<LinguisticMetaData*>(analysis.getData("LinguisticMetaData"));
124-
if (metadata == 0) {
124+
if (metadata == nullptr) {
125125
LERROR << "EasyXmlDumper::process no LinguisticMetaData ! abort";
126126
return MISSING_DATA;
127127
}
@@ -139,22 +139,22 @@ LimaStatusCode EasyXmlDumper::process(AnalysisContent& analysis) const
139139
}
140140

141141
auto graph = std::dynamic_pointer_cast<AnalysisGraph>(analysis.getData(m_graph));
142-
if (graph == 0)
142+
if (graph == nullptr)
143143
{
144144
graph = new AnalysisGraph(m_graph,m_language,true,true);
145145
analysis.setData(m_graph,graph);
146146
}
147147

148148
auto syntacticData = std::dynamic_pointer_cast<SyntacticData>(analysis.getData("SyntacticData"));
149-
if (syntacticData == 0)
149+
if (syntacticData == nullptr)
150150
{
151151
syntacticData = new SyntacticAnalysis::SyntacticData(std::dynamic_pointer_cast<AnalysisGraph>(analysis.getData(m_graph)),0);
152152
syntacticData->setupDependencyGraph();
153153
analysis.setData("SyntacticData",syntacticData);
154154
}
155155

156156
auto annotationData = std::dynamic_pointer_cast< AnnotationData >(analysis.getData("AnnotationData"));
157-
if (annotationData == 0)
157+
if (annotationData == nullptr)
158158
{
159159
annotationData = std::make_shared<AnnotationData>();
160160
if (std::dynamic_pointer_cast<AnalysisGraph>(analysis.getData("AnalysisGraph")) != 0)

lima_linguisticprocessing/src/linguisticProcessing/core/Automaton/basicConstraintFunctions.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ operator()(const LinguisticAnalysisStructure::AnalysisGraph& graph,
277277
AnalysisContent& /*ac*/ ) const
278278
{
279279
Token* token = get(vertex_token,*(graph.getGraph()),v);
280-
if (token == 0)
280+
if (token == nullptr)
281281
{
282282
AULOGINIT;
283283
LERROR << "Null token on vertex " << v;
@@ -338,7 +338,7 @@ operator()(const LinguisticAnalysisStructure::AnalysisGraph& graph,
338338
AnalysisContent& /*ac*/ ) const
339339
{
340340
Token* token = get(vertex_token,*(graph.getGraph()),v);
341-
if (token == 0)
341+
if (token == nullptr)
342342
{
343343
AULOGINIT;
344344
LERROR << "Null token on vertex " << v;
@@ -389,13 +389,13 @@ bool NoSpaceWith::operator()(const LinguisticAnalysisStructure::AnalysisGraph& g
389389
{
390390
Token* token1 = get(vertex_token,*(graph.getGraph()),v1);
391391
Token* token2 = get(vertex_token,*(graph.getGraph()),v2);
392-
if (token1 == 0)
392+
if (token1 == nullptr)
393393
{
394394
AULOGINIT;
395395
LERROR << "Null token on vertex " << v1;
396396
return false;
397397
}
398-
if (token2 == 0)
398+
if (token2 == nullptr)
399399
{
400400
AULOGINIT;
401401
LERROR << "Null token on vertex " << v2;

lima_linguisticprocessing/src/linguisticProcessing/core/FlatTokenizer/SpiritTokenizerLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ SpiritTokenizerLoader::SpiritTokenizerLoader(Automaton& automaton, const std::st
141141
State* SpiritTokenizerLoader::stateNamed(const LimaString& name)
142142
{
143143
State* newState = m_automaton.stateNamed(name);
144-
if (newState == 0)
144+
if (newState == nullptr)
145145
{
146146
newState = new State(name, m_automaton);
147147
m_automaton.states().push_back(newState);

lima_linguisticprocessing/src/linguisticProcessing/core/FlatTokenizer/Text.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ LimaString Text::token()
240240
#endif
241241
StringsPoolIndex form=(*m_d->m_stringsPool)[str];
242242
Token *tToken = new Token(form,str,m_d->m_debPtr+1,(delta-m_d->m_debPtr));
243-
if (tToken == 0) throw MemoryErrorException();
243+
if (tToken == nullptr) throw MemoryErrorException();
244244
// @todo: set default status here, according to structured status (alpha,numeric etc...)
245245
// instead of setting it at each change of status (setAlphaCapital, setNumeric etc...)
246246
tToken->setStatus(m_d->m_curSettings);

0 commit comments

Comments
 (0)