[Libreoffice-commits] core.git: 5 commits - compilerplugins/clang idlc/source rsc/source solenv/gbuild unoidl/source xmloff/source
Stephan Bergmann
sbergman at redhat.com
Tue Apr 26 15:49:35 UTC 2016
compilerplugins/clang/pluginhandler.cxx | 5
compilerplugins/clang/pluginhandler.hxx | 1
idlc/source/parser.y | 210 +++++++++++++++--------------
rsc/source/parser/rscyacc.y | 51 +++----
solenv/gbuild/LinkTarget.mk | 2
solenv/gbuild/platform/com_GCC_class.mk | 10 -
solenv/gbuild/platform/com_GCC_defs.mk | 3
unoidl/source/sourceprovider-parser.y | 227 +++++++++++++++++---------------
xmloff/source/draw/ximpshap.cxx | 6
9 files changed, 273 insertions(+), 242 deletions(-)
New commits:
commit 2ac66f5a36d4fc3675ee32eb26b243a8e0912692
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Apr 26 17:33:47 2016 +0200
Enable Clang plugin warnings in Bison source code
-Werror is generally suppressed in Bison-generated C/C++ code (as in all other
generated code) to silence warnings from the Bison skeleton code. And the Clang
plugins suppress warnings in generated WORKDIR code based on the presumed source
location (i.e., taking #line directives into account). So introduce a new
PLUGIN_WARNINGS_AS_ERRORS mode where warnings from Clang plugins are reported as
errors even if -Werror is suppressed. That way, any warnings in the Bison
skeleton code still do not lead to compilation errors, while (at least plugin-
emitted) warnings in the genuine source code do.
Unfortunately this cannot also be enabled for Flex source code, as at least
Flex 2.5.39 generates poor code that does not properly prefix all skeleton code
with appropriate #line directives, so that some skeleton code would be mistaken
for genunie source code, and compilation would fail due to errors.
Also, %glr-parser Bison input appears to generate no #line directives at all (at
least with Bison 3.0.4), so all of connectivity/source/parse/sqlbison.y is
considered generated code and plugin warnings are still suppressed throughout.
Change-Id: Id746e81cbfa5f77628b0a34c7b82780948e7db08
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx
index 32651e1..bdee467 100644
--- a/compilerplugins/clang/pluginhandler.cxx
+++ b/compilerplugins/clang/pluginhandler.cxx
@@ -55,6 +55,7 @@ PluginHandler::PluginHandler( CompilerInstance& compiler, const vector< string >
: compiler( compiler )
, rewriter( compiler.getSourceManager(), compiler.getLangOpts())
, scope( "mainfile" )
+ , warningsAsErrors( false )
{
set< string > rewriters;
for( vector< string >::const_iterator it = args.begin();
@@ -101,6 +102,8 @@ void PluginHandler::handleOption( const string& option )
{
warningsOnly = option.substr(14);
}
+ else if( option == "warnings-as-errors" )
+ warningsAsErrors = true;
else
report( DiagnosticsEngine::Fatal, "unknown option %0" ) << option;
}
@@ -137,7 +140,7 @@ DiagnosticBuilder PluginHandler::report( DiagnosticsEngine::Level level, const c
{
DiagnosticsEngine& diag = compiler.getDiagnostics();
// Do some mappings (e.g. for -Werror) that clang does not do for custom messages for some reason.
- if( level == DiagnosticsEngine::Warning && diag.getWarningsAsErrors() && (plugin == nullptr || plugin != warningsOnly))
+ if( level == DiagnosticsEngine::Warning && ((diag.getWarningsAsErrors() && (plugin == nullptr || plugin != warningsOnly)) || warningsAsErrors))
level = DiagnosticsEngine::Error;
if( level == DiagnosticsEngine::Error && diag.getErrorsAsFatal())
level = DiagnosticsEngine::Fatal;
diff --git a/compilerplugins/clang/pluginhandler.hxx b/compilerplugins/clang/pluginhandler.hxx
index 3992a70..f0cece4 100644
--- a/compilerplugins/clang/pluginhandler.hxx
+++ b/compilerplugins/clang/pluginhandler.hxx
@@ -45,6 +45,7 @@ class PluginHandler
set< SourceLocation > removals;
string scope;
string warningsOnly;
+ bool warningsAsErrors;
};
/**
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 7f24a57..b00b300 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -611,6 +611,7 @@ $(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS :=
$(call gb_LinkTarget_get_target,$(1)) : NATIVERES :=
$(call gb_LinkTarget_get_target,$(1)) : VISIBILITY :=
$(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS :=
+$(call gb_LinkTarget_get_target,$(1)) : PLUGIN_WARNINGS_AS_ERRORS :=
$(call gb_LinkTarget_get_target,$(1)) : EXTERNAL_CODE :=
$(call gb_LinkTarget_get_target,$(1)) : SOVERSIONSCRIPT :=
@@ -1067,6 +1068,7 @@ endef
define gb_LinkTarget_add_grammar
$(call gb_YaccTarget_YaccTarget,$(2))
$(call gb_LinkTarget_add_generated_exception_object,$(1),YaccTarget/$(2),$(3),$(if $(filter GCC,$(COM)),-Wno-unused-macros))
+$(call gb_GenCxxObject_get_target,YaccTarget/$(2)): PLUGIN_WARNINGS_AS_ERRORS := $(true)
$(call gb_LinkTarget_get_clean_target,$(1)) : $(call gb_YaccTarget_get_clean_target,$(2))
$(call gb_LinkTarget_get_headers_target,$(1)) : $(call gb_YaccTarget_get_header_target,$(2))
$(call gb_LinkTarget__add_include,$(1),$(dir $(call gb_YaccTarget_get_header_target,$(2))))
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index 099c5d3..8c32795 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -51,7 +51,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(DEFS) \
$(gb_LTOFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
- $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
+ $(if $(WARNINGS_NOT_ERRORS),$(if $(ENABLE_WERROR),$(if $(PLUGIN_WARNINGS_AS_ERRORS),$(gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS))),$(gb_CFLAGS_WERROR)) \
$(if $(5),$(gb_COMPILER_PLUGINS)) \
$(2) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
@@ -75,7 +75,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(DEFS) \
$(gb_LTOFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
- $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
+ $(if $(WARNINGS_NOT_ERRORS),$(if $(ENABLE_WERROR),$(if $(PLUGIN_WARNINGS_AS_ERRORS),$(gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS))),$(gb_CFLAGS_WERROR)) \
$(gb_COMPILER_PLUGINS) \
$(T_CFLAGS) $(T_CFLAGS_APPEND) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
@@ -92,7 +92,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(DEFS) \
$(gb_LTOFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
- $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
+ $(if $(WARNINGS_NOT_ERRORS),$(if $(ENABLE_WERROR),$(if $(PLUGIN_WARNINGS_AS_ERRORS),$(gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS))),$(gb_CFLAGS_WERROR)) \
$(gb_COMPILER_PLUGINS) \
$(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
@@ -112,7 +112,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(DEFS) \
$(gb_LTOFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
- $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
+ $(if $(WARNINGS_NOT_ERRORS),$(if $(ENABLE_WERROR),$(if $(PLUGIN_WARNINGS_AS_ERRORS),$(gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS))),$(gb_CFLAGS_WERROR)) \
$(gb_COMPILER_PLUGINS) \
$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
@@ -129,7 +129,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(DEFS) \
$(gb_LTOFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
- $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
+ $(if $(WARNINGS_NOT_ERRORS),$(if $(ENABLE_WERROR),$(if $(PLUGIN_WARNINGS_AS_ERRORS),$(gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS))),$(gb_CFLAGS_WERROR)) \
$(gb_COMPILER_PLUGINS) \
$(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index f23705b..7e30ed1 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -216,9 +216,12 @@ endif
endif
# extra EF variable to make the command line shorter (just like is done with $(SRCDIR) etc.)
gb_COMPILER_PLUGINS_SETUP := EF=$(SRCDIR)/include/sal/log-areas.dox && ICECC_EXTRAFILES=$$EF CCACHE_EXTRAFILES=$$EF
+gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS := \
+ -Xclang -plugin-arg-loplugin -Xclang --warnings-as-errors
else
gb_COMPILER_PLUGINS :=
gb_COMPILER_PLUGINS_SETUP :=
+gb_COMPILER_PLUGINS_WARNINGS_AS_ERRORS :=
endif
# Executable class
commit 13213de7968586e5c36fe3f74cecdc872ab6ada4
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Apr 26 17:32:54 2016 +0200
loplugin:nullptr
Change-Id: I02e177e07fc5fef225351392c9cd5743a2212967
diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y
index 1a662d7..27c4452 100644
--- a/unoidl/source/sourceprovider-parser.y
+++ b/unoidl/source/sourceprovider-parser.y
@@ -62,7 +62,7 @@
do { (Current) = YYRHSLOC((Rhs), (N) ? 1 : 0); } while (0)
void yyerror(YYLTYPE * locp, yyscan_t yyscanner, char const * msg) {
- assert(locp != 0);
+ assert(locp != nullptr);
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
data->errorLine = *locp;
data->parserError = OString(msg);
@@ -106,7 +106,7 @@ OUString flagName(unoidl::detail::SourceProviderFlags flag) {
}
OUString convertName(OString const * name) {
- assert(name != 0);
+ assert(name != nullptr);
OUString s(OStringToOUString(*name, RTL_TEXTENCODING_ASCII_US));
delete name;
return s;
@@ -116,7 +116,7 @@ OUString convertToFullName(
unoidl::detail::SourceProviderScannerData const * data,
OString const * identifier)
{
- assert(data != 0);
+ assert(data != nullptr);
OUString pref;
if (!data->modules.empty()) {
pref = data->modules.back() + ".";
@@ -128,14 +128,14 @@ void convertToCurrentName(
unoidl::detail::SourceProviderScannerData * data,
OString const * identifier)
{
- assert(data != 0);
+ assert(data != nullptr);
assert(data->currentName.isEmpty());
data->currentName = convertToFullName(data, identifier);
assert(!data->currentName.isEmpty());
}
void clearCurrentState(unoidl::detail::SourceProviderScannerData * data) {
- assert(data != 0);
+ assert(data != nullptr);
data->currentName.clear();
data->publishedContext = false;
}
@@ -143,7 +143,7 @@ void clearCurrentState(unoidl::detail::SourceProviderScannerData * data) {
unoidl::detail::SourceProviderEntity * getCurrentEntity(
unoidl::detail::SourceProviderScannerData * data)
{
- assert(data != 0);
+ assert(data != nullptr);
assert(!data->currentName.isEmpty());
std::map<OUString, unoidl::detail::SourceProviderEntity>::iterator i(
data->entities.find(data->currentName));
@@ -173,8 +173,8 @@ bool coerce(
unoidl::detail::SourceProviderExpr * lhs,
unoidl::detail::SourceProviderExpr * rhs)
{
- assert(lhs != 0);
- assert(rhs != 0);
+ assert(lhs != nullptr);
+ assert(rhs != nullptr);
bool ok = bool(); // avoid warnings
switch (lhs->type) {
case unoidl::detail::SourceProviderExpr::TYPE_BOOL:
@@ -258,8 +258,8 @@ bool coerce(
unoidl::detail::SourceProviderEntity * findEntity_(
unoidl::detail::SourceProviderScannerData * data, OUString * name)
{
- assert(data != 0);
- assert(name != 0);
+ assert(data != nullptr);
+ assert(name != nullptr);
OUString n;
if (!name->startsWith(".", &n)) {
for (auto i(data->modules.rbegin()); i != data->modules.rend(); ++i) {
@@ -305,7 +305,7 @@ unoidl::detail::SourceProviderEntity * findEntity_(
*name = n;
return &j->second;
}
- return 0;
+ return nullptr;
}
enum Found { FOUND_ERROR, FOUND_TYPE, FOUND_ENTITY };
@@ -318,16 +318,16 @@ Found findEntity(
unoidl::detail::SourceProviderType * typedefedType)
{
//TODO: avoid recursion
- assert(data != 0);
- assert(name != 0);
- assert(entity != 0);
+ assert(data != nullptr);
+ assert(name != nullptr);
+ assert(entity != nullptr);
unoidl::detail::SourceProviderEntity * e = findEntity_(data, name);
OUString n(*name);
OUString typeNucleus;
std::size_t rank = 0;
std::vector<unoidl::detail::SourceProviderType> args;
for (;;) {
- if (e != 0) {
+ if (e != nullptr) {
switch (e->kind) {
case unoidl::detail::SourceProviderEntity::KIND_LOCAL:
if (e->pad.is()) {
@@ -337,7 +337,7 @@ Found findEntity(
// fall through
case unoidl::detail::SourceProviderEntity::KIND_EXTERNAL:
if (e->entity->getSort() == unoidl::Entity::SORT_TYPEDEF) {
- if (typedefed != 0) {
+ if (typedefed != nullptr) {
*typedefed = true;
}
if (data->publishedContext
@@ -414,14 +414,14 @@ Found findEntity(
switch (
findEntity(
location, yyscanner, data, false,
- &argName, &argEnt, 0, &argType))
+ &argName, &argEnt, nullptr, &argType))
{
case FOUND_ERROR:
return FOUND_ERROR;
case FOUND_TYPE:
break;
case FOUND_ENTITY:
- if (argEnt == 0) {
+ if (argEnt == nullptr) {
error(
location, yyscanner,
(("inconsistent type manager: bad"
@@ -575,9 +575,9 @@ Found findEntity(
}
}
if (!typeNucleus.isEmpty() || rank != 0 || !args.empty()) {
- if (typeNucleus.isEmpty() && e == 0) {
+ if (typeNucleus.isEmpty() && e == nullptr) {
// Found a type name based on an unknown entity:
- *entity = 0;
+ *entity = nullptr;
return FOUND_ENTITY;
}
unoidl::detail::SourceProviderType t;
@@ -626,27 +626,27 @@ Found findEntity(
unoidl::detail::SourceProviderType::TYPE_ANY);
} else {
assert(typeNucleus.isEmpty());
- assert(e != 0);
+ assert(e != nullptr);
switch (e->kind) {
case unoidl::detail::SourceProviderEntity::KIND_LOCAL:
if (e->pad.is()) {
if (dynamic_cast<unoidl::detail::SourceProviderEnumTypeEntityPad *>(
e->pad.get())
- != 0)
+ != nullptr)
{
t = unoidl::detail::SourceProviderType(
unoidl::detail::SourceProviderType::TYPE_ENUM,
n, e);
} else if (dynamic_cast<unoidl::detail::SourceProviderPlainStructTypeEntityPad *>(
e->pad.get())
- != 0)
+ != nullptr)
{
t = unoidl::detail::SourceProviderType(
unoidl::detail::SourceProviderType::TYPE_PLAIN_STRUCT,
n, e);
} else if (dynamic_cast<unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *>(
e->pad.get())
- != 0)
+ != nullptr)
{
error(
location, yyscanner,
@@ -657,14 +657,14 @@ Found findEntity(
return FOUND_ERROR;
} else if (dynamic_cast<unoidl::detail::SourceProviderExceptionTypeEntityPad *>(
e->pad.get())
- != 0)
+ != nullptr)
{
t = unoidl::detail::SourceProviderType(
unoidl::detail::SourceProviderType::TYPE_EXCEPTION,
n, e);
} else if (dynamic_cast<unoidl::detail::SourceProviderInterfaceTypeEntityPad *>(
e->pad.get())
- != 0)
+ != nullptr)
{
t = unoidl::detail::SourceProviderType(
unoidl::detail::SourceProviderType::TYPE_INTERFACE,
@@ -729,7 +729,7 @@ Found findEntity(
}
} else {
assert(typeNucleus.isEmpty());
- assert(e != 0);
+ assert(e != nullptr);
switch (e->kind) {
case unoidl::detail::SourceProviderEntity::KIND_LOCAL:
if (e->pad.is()) {
@@ -791,14 +791,14 @@ Found findEntity(
assert(false && "this cannot happen");
}
}
- if (typedefedType != 0) {
+ if (typedefedType != nullptr) {
for (std::size_t i = 0; i != rank; ++i) {
t = unoidl::detail::SourceProviderType(&t);
}
*typedefedType = t;
typedefedType->typedefName = *name;
}
- *entity = 0;
+ *entity = nullptr;
return FOUND_TYPE;
}
*entity = e;
@@ -1000,7 +1000,7 @@ enumDefn:
unoidl::detail::SourceProviderEnumTypeEntityPad * pad =
dynamic_cast<unoidl::detail::SourceProviderEnumTypeEntityPad *>(
ent->pad.get());
- assert(pad != 0);
+ assert(pad != nullptr);
ent->entity = new unoidl::EnumTypeEntity(
pad->isPublished(), pad->members, annotations($1));
ent->pad.clear();
@@ -1084,15 +1084,16 @@ plainStructDefn:
convertToCurrentName(data, $4);
OUString baseName;
rtl::Reference<unoidl::PlainStructTypeEntity> baseEnt;
- if ($5 != 0) {
+ if ($5 != nullptr) {
baseName = convertName($5);
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(@5, yyscanner, data, false, &baseName, &p, 0, 0)
+ if (findEntity(
+ @5, yyscanner, data, false, &baseName, &p, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (p == 0 || !p->entity.is()
+ if (p == nullptr || !p->entity.is()
|| p->entity->getSort() != unoidl::Entity::SORT_PLAIN_STRUCT_TYPE)
{
error(
@@ -1132,7 +1133,7 @@ plainStructDefn:
dynamic_cast<
unoidl::detail::SourceProviderPlainStructTypeEntityPad *>(
ent->pad.get());
- assert(pad != 0);
+ assert(pad != nullptr);
ent->entity = new unoidl::PlainStructTypeEntity(
pad->isPublished(), pad->baseName, pad->members, annotations($1));
ent->pad.clear();
@@ -1166,7 +1167,7 @@ polymorphicStructTemplateDefn:
pad = dynamic_cast<
unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *>(
ent->pad.get());
- assert(pad != 0);
+ assert(pad != nullptr);
ent->entity = new unoidl::PolymorphicStructTypeTemplateEntity(
pad->isPublished(), pad->typeParameters, pad->members,
annotations($1));
@@ -1215,15 +1216,16 @@ exceptionDefn:
convertToCurrentName(data, $4);
OUString baseName;
rtl::Reference<unoidl::ExceptionTypeEntity> baseEnt;
- if ($5 != 0) {
+ if ($5 != nullptr) {
baseName = convertName($5);
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(@5, yyscanner, data, false, &baseName, &p, 0, 0)
+ if (findEntity(
+ @5, yyscanner, data, false, &baseName, &p, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (p == 0 || !p->entity.is()
+ if (p == nullptr || !p->entity.is()
|| p->entity->getSort() != unoidl::Entity::SORT_EXCEPTION_TYPE)
{
error(
@@ -1261,7 +1263,7 @@ exceptionDefn:
unoidl::detail::SourceProviderExceptionTypeEntityPad * pad =
dynamic_cast<unoidl::detail::SourceProviderExceptionTypeEntityPad *>(
ent->pad.get());
- assert(pad != 0);
+ assert(pad != nullptr);
ent->entity = new unoidl::ExceptionTypeEntity(
pad->isPublished(), pad->baseName, pad->members, annotations($1));
ent->pad.clear();
@@ -1323,7 +1325,7 @@ structMember:
unoidl::detail::SourceProviderPlainStructTypeEntityPad * p1 =
dynamic_cast<unoidl::detail::SourceProviderPlainStructTypeEntityPad *>(
ent->pad.get());
- if (p1 != 0) {
+ if (p1 != nullptr) {
for (auto & i: p1->members) {
if (id == i.name) {
error(
@@ -1363,12 +1365,13 @@ structMember:
}
unoidl::detail::SourceProviderEntity const * p;
if (findEntity(
- @2, yyscanner, data, false, &baseName, &p, 0, 0)
+ @2, yyscanner, data, false, &baseName, &p, nullptr,
+ nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (p == 0 || !p->entity.is()
+ if (p == nullptr || !p->entity.is()
|| (p->entity->getSort()
!= unoidl::Entity::SORT_PLAIN_STRUCT_TYPE))
{
@@ -1389,7 +1392,7 @@ structMember:
unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *
p2 = dynamic_cast<unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *>(
ent->pad.get());
- if (p2 != 0) {
+ if (p2 != nullptr) {
for (auto & i: p2->members) {
if (id == i.name) {
error(
@@ -1408,7 +1411,7 @@ structMember:
unoidl::detail::SourceProviderExceptionTypeEntityPad * p3
= dynamic_cast<unoidl::detail::SourceProviderExceptionTypeEntityPad *>(
ent->pad.get());
- assert(p3 != 0);
+ assert(p3 != nullptr);
for (auto & i: p3->members) {
if (id == i.name) {
error(
@@ -1448,12 +1451,13 @@ structMember:
}
unoidl::detail::SourceProviderEntity const * p;
if (findEntity(
- @2, yyscanner, data, false, &baseName, &p, 0, 0)
+ @2, yyscanner, data, false, &baseName, &p,
+ nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (p == 0 || !p->entity.is()
+ if (p == nullptr || !p->entity.is()
|| (p->entity->getSort()
!= unoidl::Entity::SORT_EXCEPTION_TYPE))
{
@@ -1483,15 +1487,16 @@ interfaceDefn:
convertToCurrentName(data, $4);
OUString baseName;
rtl::Reference<unoidl::InterfaceTypeEntity> baseEnt;
- if ($5 != 0) {
+ if ($5 != nullptr) {
baseName = convertName($5);
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(@5, yyscanner, data, true, &baseName, &p, 0, 0)
+ if (findEntity(
+ @5, yyscanner, data, true, &baseName, &p, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (p == 0 || !p->entity.is()
+ if (p == nullptr || !p->entity.is()
|| p->entity->getSort() != unoidl::Entity::SORT_INTERFACE_TYPE)
{
error(
@@ -1555,18 +1560,18 @@ interfaceDefn:
unoidl::detail::SourceProviderInterfaceTypeEntityPad * pad =
dynamic_cast<unoidl::detail::SourceProviderInterfaceTypeEntityPad *>(
ent->pad.get());
- assert(pad != 0);
+ assert(pad != nullptr);
if (pad->directMandatoryBases.empty()
&& data->currentName != "com.sun.star.uno.XInterface")
{
OUString base(".com.sun.star.uno.XInterface");
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(@4, yyscanner, data, true, &base, &p, 0, 0)
+ if (findEntity(@4, yyscanner, data, true, &base, &p, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (p == 0 || !p->entity.is()
+ if (p == nullptr || !p->entity.is()
|| p->entity->getSort() != unoidl::Entity::SORT_INTERFACE_TYPE)
{
error(
@@ -1639,12 +1644,12 @@ interfaceBase:
OUString orgName(name);
unoidl::detail::SourceProviderEntity const * p;
bool typedefed = false;
- if (findEntity(@4, yyscanner, data, true, &name, &p, &typedefed, 0)
+ if (findEntity(@4, yyscanner, data, true, &name, &p, &typedefed, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (p == 0 || !p->entity.is()
+ if (p == nullptr || !p->entity.is()
|| p->entity->getSort() != unoidl::Entity::SORT_INTERFACE_TYPE)
{
error(
@@ -1809,7 +1814,7 @@ interfaceMethod:
}
'(' methodParams_opt ')' exceptionSpec_opt ';'
{
- if ($8 != 0) {
+ if ($8 != nullptr) {
unoidl::detail::SourceProviderScannerData * data
= yyget_extra(yyscanner);
rtl::Reference<unoidl::detail::SourceProviderInterfaceTypeEntityPad>
@@ -1974,7 +1979,7 @@ constantGroupDefn:
unoidl::detail::SourceProviderConstantGroupEntityPad * pad =
dynamic_cast<unoidl::detail::SourceProviderConstantGroupEntityPad *>(
ent->pad.get());
- assert(pad != 0);
+ assert(pad != nullptr);
ent->entity = new unoidl::ConstantGroupEntity(
pad->isPublished(), pad->members, annotations($1));
ent->pad.clear();
@@ -2276,14 +2281,14 @@ singleInterfaceBasedServiceDefn:
convertToCurrentName(data, $4);
OUString base(convertName($5));
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(@5, yyscanner, data, false, &base, &p, 0, 0)
+ if (findEntity(@5, yyscanner, data, false, &base, &p, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
bool ifcBase = false;
bool pubBase = false;
- if (p != 0) {
+ if (p != nullptr) {
switch (p->kind) {
case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
ifcBase = true;
@@ -2338,7 +2343,7 @@ singleInterfaceBasedServiceDefn:
unoidl::detail::SourceProviderSingleInterfaceBasedServiceEntityPad * pad =
dynamic_cast<unoidl::detail::SourceProviderSingleInterfaceBasedServiceEntityPad *>(
ent->pad.get());
- assert(pad != 0);
+ assert(pad != nullptr);
std::vector<unoidl::SingleInterfaceBasedServiceEntity::Constructor> ctors;
if ($7) {
for (auto & i: pad->constructors) {
@@ -2401,7 +2406,7 @@ ctor:
pad(getCurrentPad<unoidl::detail::SourceProviderSingleInterfaceBasedServiceEntityPad>(
data));
assert(!pad->constructors.empty());
- if ($7 != 0) {
+ if ($7 != nullptr) {
pad->constructors.back().exceptions = *$7;
delete $7;
}
@@ -2552,7 +2557,7 @@ accumulationBasedServiceDefn:
unoidl::detail::SourceProviderAccumulationBasedServiceEntityPad * pad =
dynamic_cast<unoidl::detail::SourceProviderAccumulationBasedServiceEntityPad *>(
ent->pad.get());
- assert(pad != 0);
+ assert(pad != nullptr);
ent->entity = new unoidl::AccumulationBasedServiceEntity(
pad->isPublished(), pad->directMandatoryBaseServices,
pad->directOptionalBaseServices, pad->directMandatoryBaseInterfaces,
@@ -2590,12 +2595,12 @@ serviceBase:
}
bool opt = ($2 & unoidl::detail::FLAG_OPTIONAL) != 0;
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(@4, yyscanner, data, false, &name, &p, 0, 0)
+ if (findEntity(@4, yyscanner, data, false, &name, &p, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (p == 0 || !p->entity.is()
+ if (p == nullptr || !p->entity.is()
|| (p->entity->getSort()
!= unoidl::Entity::SORT_ACCUMULATION_BASED_SERVICE))
{
@@ -2648,14 +2653,14 @@ serviceInterfaceBase:
}
bool opt = ($2 & unoidl::detail::FLAG_OPTIONAL) != 0;
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(@4, yyscanner, data, false, &name, &p, 0, 0)
+ if (findEntity(@4, yyscanner, data, false, &name, &p, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
bool ifcBase = false;
bool pubBase = false;
- if (p != 0) {
+ if (p != nullptr) {
switch (p->kind) {
case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
ifcBase = true;
@@ -2807,14 +2812,14 @@ interfaceBasedSingletonDefn:
OUString name(convertToFullName(data, $4));
OUString base(convertName($5));
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(@5, yyscanner, data, false, &base, &p, 0, 0)
+ if (findEntity(@5, yyscanner, data, false, &base, &p, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
bool ifcBase = false;
bool pubBase = false;
- if (p != 0) {
+ if (p != nullptr) {
switch (p->kind) {
case unoidl::detail::SourceProviderEntity::KIND_INTERFACE_DECL:
ifcBase = true;
@@ -2875,12 +2880,12 @@ serviceBasedSingletonDefn:
OUString name(convertToFullName(data, $4));
OUString base(convertName($7));
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(@7, yyscanner, data, false, &base, &p, 0, 0)
+ if (findEntity(@7, yyscanner, data, false, &base, &p, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (p == 0
+ if (p == nullptr
|| !p->entity.is()
|| (p->entity->getSort()
!= unoidl::Entity::SORT_ACCUMULATION_BASED_SERVICE))
@@ -2919,7 +2924,7 @@ serviceBasedSingletonDefn:
singleInheritance_opt:
singleInheritance
-| /* empty */ { $$ = 0; }
+| /* empty */ { $$ = nullptr; }
;
singleInheritance: ':' name { $$ = $2; }
@@ -2927,7 +2932,7 @@ singleInheritance: ':' name { $$ = $2; }
exceptionSpec_opt:
exceptionSpec
-| /* empty */ { $$ = 0; }
+| /* empty */ { $$ = nullptr; }
;
exceptionSpec: TOK_RAISES '(' exceptions ')' { $$ = $3; }
@@ -2939,13 +2944,13 @@ exceptions:
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
OUString name(convertName($3));
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(@3, yyscanner, data, false, &name, &p, 0, 0)
+ if (findEntity(@3, yyscanner, data, false, &name, &p, nullptr, nullptr)
== FOUND_ERROR)
{
delete $1; /* see commented-out %destructor above */
YYERROR;
}
- if (p == 0
+ if (p == nullptr
|| !p->entity.is()
|| (p->entity->getSort() != unoidl::Entity::SORT_EXCEPTION_TYPE))
{
@@ -2979,12 +2984,12 @@ exceptions:
unoidl::detail::SourceProviderScannerData * data = yyget_extra(yyscanner);
OUString name(convertName($1));
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(@1, yyscanner, data, false, &name, &p, 0, 0)
+ if (findEntity(@1, yyscanner, data, false, &name, &p, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (p == 0
+ if (p == nullptr
|| !p->entity.is()
|| (p->entity->getSort() != unoidl::Entity::SORT_EXCEPTION_TYPE))
{
@@ -3468,7 +3473,7 @@ primaryExpr:
getCurrentEntity(data)->pad);
unoidl::detail::SourceProviderEnumTypeEntityPad * p1 = dynamic_cast<
unoidl::detail::SourceProviderEnumTypeEntityPad *>(pad.get());
- if (p1 != 0) {
+ if (p1 != nullptr) {
for (auto & j: p1->members) {
if (j.name == name) {
v = unoidl::ConstantValue(j.value);
@@ -3481,7 +3486,7 @@ primaryExpr:
= dynamic_cast<
unoidl::detail::SourceProviderConstantGroupEntityPad *>(
pad.get());
- if (p2 != 0) {
+ if (p2 != nullptr) {
for (auto & j: p2->members) {
if (j.name == name) {
v = j.value;
@@ -3494,12 +3499,13 @@ primaryExpr:
} else {
OUString scope(name.copy(0, i));
unoidl::detail::SourceProviderEntity const * ent;
- if (findEntity(@1, yyscanner, data, false, &scope, &ent, 0, 0)
+ if (findEntity(
+ @1, yyscanner, data, false, &scope, &ent, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (ent != 0) {
+ if (ent != nullptr) {
OUString id(name.copy(i + 1));
// No need to check for enum members here, as they cannot be
// referenced in expressions by qualified name (TODO: is that true?):
@@ -3528,7 +3534,7 @@ primaryExpr:
= dynamic_cast<
unoidl::detail::SourceProviderConstantGroupEntityPad *>(
ent->pad.get());
- if (pad != 0) {
+ if (pad != nullptr) {
for (auto & j: pad->members) {
if (j.name == id) {
v = j.value;
@@ -3716,7 +3722,7 @@ type:
pad = dynamic_cast<
unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *>(
ent->pad.get());
- if (pad != 0
+ if (pad != nullptr
&& (std::find(
pad->typeParameters.begin(), pad->typeParameters.end(),
name)
@@ -3729,7 +3735,9 @@ type:
if (!done) {
unoidl::detail::SourceProviderEntity const * ent;
unoidl::detail::SourceProviderType t;
- switch (findEntity(@1, yyscanner, data, false, &name, &ent, 0, &t)) {
+ switch (findEntity(
+ @1, yyscanner, data, false, &name, &ent, nullptr, &t))
+ {
case FOUND_ERROR:
YYERROR;
break;
@@ -3737,7 +3745,7 @@ type:
$$ = new unoidl::detail::SourceProviderType(t);
break;
case FOUND_ENTITY:
- if (ent == 0) {
+ if (ent == nullptr) {
error(@1, yyscanner, "unknown entity " + name);
YYERROR;
}
@@ -3754,7 +3762,7 @@ type:
}
if (dynamic_cast<unoidl::detail::SourceProviderEnumTypeEntityPad *>(
ent->pad.get())
- != 0)
+ != nullptr)
{
$$ = new unoidl::detail::SourceProviderType(
unoidl::detail::SourceProviderType::TYPE_ENUM,
@@ -3762,7 +3770,7 @@ type:
ok = true;
} else if (dynamic_cast<unoidl::detail::SourceProviderPlainStructTypeEntityPad *>(
ent->pad.get())
- != 0)
+ != nullptr)
{
$$ = new unoidl::detail::SourceProviderType(
unoidl::detail::SourceProviderType::TYPE_PLAIN_STRUCT,
@@ -3770,7 +3778,7 @@ type:
ok = true;
} else if (dynamic_cast<unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *>(
ent->pad.get())
- != 0)
+ != nullptr)
{
error(
@1, yyscanner,
@@ -3780,7 +3788,7 @@ type:
YYERROR;
} else if (dynamic_cast<unoidl::detail::SourceProviderExceptionTypeEntityPad *>(
ent->pad.get())
- != 0)
+ != nullptr)
{
$$ = new unoidl::detail::SourceProviderType(
unoidl::detail::SourceProviderType::TYPE_EXCEPTION,
@@ -3788,7 +3796,7 @@ type:
ok = true;
} else if (dynamic_cast<unoidl::detail::SourceProviderInterfaceTypeEntityPad *>(
ent->pad.get())
- != 0)
+ != nullptr)
{
$$ = new unoidl::detail::SourceProviderType(
unoidl::detail::SourceProviderType::TYPE_INTERFACE,
@@ -3883,12 +3891,12 @@ type:
std::vector<unoidl::detail::SourceProviderType> args(*$3);
delete $3;
unoidl::detail::SourceProviderEntity const * ent;
- if (findEntity(@1, yyscanner, data, false, &name, &ent, 0, 0)
+ if (findEntity(@1, yyscanner, data, false, &name, &ent, nullptr, nullptr)
== FOUND_ERROR)
{
YYERROR;
}
- if (ent == 0) {
+ if (ent == nullptr) {
error(@1, yyscanner, "unknown entity " + name);
YYERROR;
}
@@ -3898,7 +3906,7 @@ type:
if (ent->pad.is()) {
if (dynamic_cast<unoidl::detail::SourceProviderPolymorphicStructTypeTemplateEntityPad *>(
ent->pad.get())
- != 0)
+ != nullptr)
{
error(
@1, yyscanner,
@@ -4073,7 +4081,7 @@ bool SourceProviderInterfaceTypeEntityPad::addDirectMember(
YYLTYPE location, yyscan_t yyscanner, SourceProviderScannerData * data,
OUString const & name)
{
- assert(data != 0);
+ assert(data != nullptr);
if (!checkMemberClashes(location, yyscanner, data, "", name, true)) {
return false;
}
@@ -4089,9 +4097,9 @@ bool SourceProviderInterfaceTypeEntityPad::checkBaseClashes(
rtl::Reference<unoidl::InterfaceTypeEntity> const & entity, bool direct,
bool optional, bool outerOptional, std::set<OUString> * seen) const
{
- assert(data != 0);
+ assert(data != nullptr);
assert(entity.is());
- assert(seen != 0);
+ assert(seen != nullptr);
if (direct || optional || seen->insert(name).second) {
std::map<OUString, BaseKind>::const_iterator i(allBases.find(name));
if (i != allBases.end()) {
@@ -4138,12 +4146,14 @@ bool SourceProviderInterfaceTypeEntityPad::checkBaseClashes(
for (auto & j: entity->getDirectMandatoryBases()) {
OUString n("." + j.name);
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(location, yyscanner, data, true, &n, &p, 0, 0)
+ if (findEntity(
+ location, yyscanner, data, true, &n, &p, nullptr,
+ nullptr)
== FOUND_ERROR)
{
return false;
}
- if (p == 0 || !p->entity.is()
+ if (p == nullptr || !p->entity.is()
|| (p->entity->getSort()
!= unoidl::Entity::SORT_INTERFACE_TYPE))
{
@@ -4166,12 +4176,14 @@ bool SourceProviderInterfaceTypeEntityPad::checkBaseClashes(
for (auto & j: entity->getDirectOptionalBases()) {
OUString n("." + j.name);
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(location, yyscanner, data, true, &n, &p, 0, 0)
+ if (findEntity(
+ location, yyscanner, data, true, &n, &p, nullptr,
+ nullptr)
== FOUND_ERROR)
{
return false;
}
- if (p == 0 || !p->entity.is()
+ if (p == nullptr || !p->entity.is()
|| (p->entity->getSort()
!= unoidl::Entity::SORT_INTERFACE_TYPE))
{
@@ -4250,7 +4262,7 @@ bool SourceProviderInterfaceTypeEntityPad::addBase(
rtl::Reference<unoidl::InterfaceTypeEntity> const & entity, bool direct,
bool optional)
{
- assert(data != 0);
+ assert(data != nullptr);
assert(entity.is());
BaseKind kind = optional
? direct ? BASE_DIRECT_OPTIONAL : BASE_INDIRECT_OPTIONAL
@@ -4266,12 +4278,13 @@ bool SourceProviderInterfaceTypeEntityPad::addBase(
for (auto & i: entity->getDirectMandatoryBases()) {
OUString n("." + i.name);
unoidl::detail::SourceProviderEntity const * q;
- if (findEntity(location, yyscanner, data, true, &n, &q, 0, 0)
+ if (findEntity(
+ location, yyscanner, data, true, &n, &q, nullptr, nullptr)
== FOUND_ERROR)
{
return false;
}
- if (q == 0 || !q->entity.is()
+ if (q == nullptr || !q->entity.is()
|| q->entity->getSort() != unoidl::Entity::SORT_INTERFACE_TYPE)
{
error(
@@ -4293,12 +4306,13 @@ bool SourceProviderInterfaceTypeEntityPad::addBase(
{
OUString n("." + i.name);
unoidl::detail::SourceProviderEntity const * q;
- if (findEntity(location, yyscanner, data, true, &n, &q, 0, 0)
+ if (findEntity(
+ location, yyscanner, data, true, &n, &q, nullptr, nullptr)
== FOUND_ERROR)
{
return false;
}
- if (q == 0 || !q->entity.is()
+ if (q == nullptr || !q->entity.is()
|| q->entity->getSort() != unoidl::Entity::SORT_INTERFACE_TYPE)
{
error(
@@ -4337,12 +4351,13 @@ bool SourceProviderInterfaceTypeEntityPad::addOptionalBaseMembers(
for (auto & i: entity->getDirectMandatoryBases()) {
OUString n("." + i.name);
unoidl::detail::SourceProviderEntity const * p;
- if (findEntity(location, yyscanner, data, true, &n, &p, 0, 0)
+ if (findEntity(
+ location, yyscanner, data, true, &n, &p, nullptr, nullptr)
== FOUND_ERROR)
{
return false;
}
- if (p == 0 || !p->entity.is()
+ if (p == nullptr || !p->entity.is()
|| p->entity->getSort() != unoidl::Entity::SORT_INTERFACE_TYPE)
{
error(
@@ -4381,7 +4396,7 @@ bool SourceProviderInterfaceTypeEntityPad::addOptionalBaseMembers(
}
bool parse(OUString const & uri, SourceProviderScannerData * data) {
- assert(data != 0);
+ assert(data != nullptr);
oslFileHandle handle;
oslFileError e = osl_openFile(uri.pData, &handle, osl_File_OpenFlag_Read);
switch (e) {
commit db151516b5a724426580bb081c849150bf47e963
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Apr 26 17:23:13 2016 +0200
loplugin:nullptr
Change-Id: I699ce2c97d7874eac78b3afcd08ba011f56156bd
diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y
index c0a9114..8a67316 100644
--- a/rsc/source/parser/rscyacc.y
+++ b/rsc/source/parser/rscyacc.y
@@ -109,10 +109,10 @@ RscId MakeRscId( RscExpType aExpType )
sal_Int32 lValue(0);
if( !aExpType.Evaluate( &lValue ) )
- pTC->pEH->Error( ERR_ZERODIVISION, NULL, RscId() );
+ pTC->pEH->Error( ERR_ZERODIVISION, nullptr, RscId() );
if( lValue < 1 || lValue > (sal_Int32)0x7FFF )
{
- pTC->pEH->Error( ERR_IDRANGE, NULL, RscId(),
+ pTC->pEH->Error( ERR_IDRANGE, nullptr, RscId(),
rtl::OString::number(lValue).getStr() );
}
@@ -176,9 +176,9 @@ bool DoClassHeader( RSCHEADER * pHeader, bool bMember )
pTC->pEH->Error( WRN_GLOBALID, pHeader->pClass, aName1 );
if( aCopyInst.IsInst() )
- S.Push( pHeader->pClass->Create( NULL, aCopyInst ) );
+ S.Push( pHeader->pClass->Create( nullptr, aCopyInst ) );
else
- S.Push( pHeader->pClass->Create( NULL, RSCINST() ) );
+ S.Push( pHeader->pClass->Create( nullptr, RSCINST() ) );
pTC->pEH->StdOut( ".", RscVerbosityVerbose );
@@ -240,7 +240,7 @@ RSCINST GetFirstTupelEle( const RSCINST & rTop )
RSCINST aInst;
ERRTYPE aErr;
- aErr = rTop.pClass->GetElement( rTop, RscId(), NULL, RSCINST(), &aInst );
+ aErr = rTop.pClass->GetElement( rTop, RscId(), nullptr, RSCINST(), &aInst );
if( !aErr.IsError() )
aInst = aInst.pClass->GetTupelVar( aInst, 0, RSCINST() );
return aInst;
@@ -366,7 +366,7 @@ resource_definitions
pExp = new RscExpression( aExpType, '+', $2 );
if( !pExp->Evaluate( &lValue ) )
{
- pTC->pEH->Error( ERR_ZERODIVISION, NULL, RscId() );
+ pTC->pEH->Error( ERR_ZERODIVISION, nullptr, RscId() );
}
delete pExp;
}
@@ -414,12 +414,13 @@ resource_definition
if( bError )
{
- pTC->pEH->Error( ERR_DECLAREDEFINE, NULL, RscId(), $3 );
+ pTC->pEH->Error( ERR_DECLAREDEFINE, nullptr, RscId(), $3 );
}
}
| '#' DEFINE RSCDEFINE macro_expression
{
- pTC->pEH->Error( ERR_DOUBLEDEFINE, NULL, RscId(), $3->GetName().getStr() );
+ pTC->pEH->Error(
+ ERR_DOUBLEDEFINE, nullptr, RscId(), $3->GetName().getStr() );
}
| '#' INCLUDE STRING
{
@@ -470,12 +471,12 @@ property_definition
{
// Variable anlegen
Atom nId = pTC->aNmTb.Put( $3, VARNAME );
- pCurClass->SetVariable( nId, $2, NULL, $1, nCurMask );
+ pCurClass->SetVariable( nId, $2, nullptr, $1, nCurMask );
nCurMask <<= 1;
}
| type_flags type VARNAME
{
- pCurClass->SetVariable( $3, $2, NULL, $1, nCurMask );
+ pCurClass->SetVariable( $3, $2, nullptr, $1, nCurMask );
nCurMask <<= 1;
}
;
@@ -518,7 +519,7 @@ type
}
else
{
- $$ = NULL;
+ $$ = nullptr;
}
}
;
@@ -596,7 +597,7 @@ class_header_body
$$.pClass = $1;
$$.nName1 = $2;
$$.nTyp = $3;
- $$.pRefClass = NULL;
+ $$.pRefClass = nullptr;
$$.nName2 = $4;
}
| CLASSNAME id_expression
@@ -604,7 +605,7 @@ class_header_body
$$.pClass = $1;
$$.nName1 = $2;
$$.nTyp = TYPE_NOTHING;
- $$.pRefClass = NULL;
+ $$.pRefClass = nullptr;
$$.nName2.cType = RSCEXP_NOTHING;
}
| CLASSNAME copy_ref id_expression
@@ -612,7 +613,7 @@ class_header_body
$$.pClass = $1;
$$.nName1.cType = RSCEXP_NOTHING;
$$.nTyp = $2;
- $$.pRefClass = NULL;
+ $$.pRefClass = nullptr;
$$.nName2 = $3;
}
| CLASSNAME copy_ref CLASSNAME id_expression
@@ -800,7 +801,8 @@ var_header_class
ERRTYPE aError;
RSCINST aIdxInst;
- aError = aInst.pClass->GetArrayEle( aInst, $3.hashid, NULL, &aIdxInst );
+ aError = aInst.pClass->GetArrayEle(
+ aInst, $3.hashid, nullptr, &aIdxInst );
if( aError.IsError() || aError.IsWarning() )
pTC->pEH->Error( aError, S.Top().pClass, RscId() );
if( aError.IsError() )
@@ -829,7 +831,8 @@ var_header_class
ERRTYPE aError;
RSCINST aIdxInst;
- aError = aInst.pClass->GetArrayEle( aInst, nNewLang, NULL, &aIdxInst );
+ aError = aInst.pClass->GetArrayEle(
+ aInst, nNewLang, nullptr, &aIdxInst );
if( aError.IsError() || aError.IsWarning() )
pTC->pEH->Error( aError, S.Top().pClass, RscId() );
if( aError.IsError() )
@@ -875,7 +878,8 @@ var_header
ERRTYPE aError;
RSCINST aIdxInst;
- aError = aInst.pClass->GetArrayEle( aInst, $3.hashid, NULL, &aIdxInst );
+ aError = aInst.pClass->GetArrayEle(
+ aInst, $3.hashid, nullptr, &aIdxInst );
if( aError.IsError() || aError.IsWarning() )
pTC->pEH->Error( aError, S.Top().pClass, RscId() );
if( aError.IsError() )
@@ -901,7 +905,8 @@ var_header
ERRTYPE aError;
RSCINST aIdxInst;
- aError = aInst.pClass->GetArrayEle( aInst, nNewLang, NULL, &aIdxInst );
+ aError = aInst.pClass->GetArrayEle(
+ aInst, nNewLang, nullptr, &aIdxInst );
if( aError.IsError() || aError.IsWarning() )
pTC->pEH->Error( aError, S.Top().pClass, RscId() );
if( aError.IsError() )
@@ -994,12 +999,12 @@ var_list_header
RSCINST aInst;
aError = S.Top().pClass->GetElement( S.Top(), RscId(),
- NULL, RSCINST(), &aInst );
+ nullptr, RSCINST(), &aInst );
if( aError.IsError() || aError.IsWarning() )
pTC->pEH->Error( aError, S.Top().pClass, RscId() );
if( aError.IsError() )
{ // unbedingt Instanz auf den Stack bringen
- aInst = S.Top().pClass->Create( NULL, RSCINST() );
+ aInst = S.Top().pClass->Create( nullptr, RSCINST() );
}
S.Push( aInst );
}
@@ -1038,7 +1043,7 @@ var_bodysimple
ERRTYPE aError;
if( !$1.Evaluate( &l ) )
- pTC->pEH->Error( ERR_ZERODIVISION, NULL, RscId() );
+ pTC->pEH->Error( ERR_ZERODIVISION, nullptr, RscId() );
else
{
aError = S.Top().pClass->SetRef( S.Top(), RscId( $1 ) );
@@ -1173,7 +1178,7 @@ long_expression
: macro_expression
{
if( !$1.Evaluate( &$$ ) )
- pTC->pEH->Error( ERR_ZERODIVISION, NULL, RscId() );
+ pTC->pEH->Error( ERR_ZERODIVISION, nullptr, RscId() );
if( $1.IsExpression() )
delete $1.aExp.pExp;
}
@@ -1336,7 +1341,7 @@ id_expression
sal_Int32 lValue;
if( !$1.Evaluate( &lValue ) )
- pTC->pEH->Error( ERR_ZERODIVISION, NULL, RscId() );
+ pTC->pEH->Error( ERR_ZERODIVISION, nullptr, RscId() );
delete $1.aExp.pExp;
$$.cType = RSCEXP_LONG;
$$.SetLong( lValue );
commit d36b8733c010e054a6f785767b2ba09520863e32
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Apr 26 17:22:42 2016 +0200
loplugin:nullptr
Change-Id: Id58f3320ff152286fa6b3268cdc9c2af2d7e068b
diff --git a/idlc/source/parser.y b/idlc/source/parser.y
index 8296ac4..edd636c 100644
--- a/idlc/source/parser.y
+++ b/idlc/source/parser.y
@@ -112,7 +112,7 @@ void addInheritedInterface(
{
AstDeclaration * decl = ifc->lookupByName(name);
AstDeclaration const * resolved = resolveTypedefs(decl);
- if (resolved != 0 && resolved->getNodeType() == NT_interface) {
+ if (resolved != nullptr && resolved->getNodeType() == NT_interface) {
if (ErrorHandler::checkPublished(decl)) {
if (!static_cast< AstInterface const * >(resolved)->isDefined()) {
ErrorHandler::inheritanceError(
@@ -152,17 +152,17 @@ AstDeclaration const * createNamedType(
AstDeclaration * decl = idlc()->scopes()->topNonNull()->lookupByName(
*scopedName);
AstDeclaration const * resolved = resolveTypedefs(decl);
- if (decl == 0) {
+ if (decl == nullptr) {
ErrorHandler::lookupError(*scopedName);
} else if (!ErrorHandler::checkPublished(decl)) {
- decl = 0;
+ decl = nullptr;
} else if (resolved->getNodeType() == NT_struct) {
if (static_cast< AstStruct const * >(resolved)->getTypeParameterCount()
- != (typeArgs == 0 ? 0 : typeArgs->size()))
+ != (typeArgs == nullptr ? 0 : typeArgs->size()))
{
ErrorHandler::error0(EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS);
- decl = 0;
- } else if (typeArgs != 0) {
+ decl = nullptr;
+ } else if (typeArgs != nullptr) {
AstScope * global = idlc()->scopes()->bottom();
AstDeclaration * inst = new AstStructInstance(
static_cast< AstType * >(decl), typeArgs, global);
@@ -172,13 +172,13 @@ AstDeclaration const * createNamedType(
}
}
} else if (decl->isType()) {
- if (typeArgs != 0) {
+ if (typeArgs != nullptr) {
ErrorHandler::error0(EIDL_WRONG_NUMBER_OF_TYPE_ARGUMENTS);
- decl = 0;
+ decl = nullptr;
}
} else {
ErrorHandler::noTypeError(decl);
- decl = 0;
+ decl = nullptr;
}
delete scopedName;
delete typeArgs;
@@ -186,8 +186,8 @@ AstDeclaration const * createNamedType(
}
bool includes(AstDeclaration const * type1, AstDeclaration const * type2) {
- OSL_ASSERT(type2 != 0);
- if (type1 != 0) {
+ OSL_ASSERT(type2 != nullptr);
+ if (type1 != nullptr) {
if (type1->getNodeType() == NT_instantiated_struct) {
AstStructInstance const * inst
= static_cast< AstStructInstance const * >(type1);
@@ -444,8 +444,8 @@ module_dcl :
checkIdentifier($3);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstModule* pModule = NULL;
- AstDeclaration* pExists = NULL;
+ AstModule* pModule = nullptr;
+ AstDeclaration* pExists = nullptr;
if ( pScope )
{
@@ -515,15 +515,15 @@ forward_dcl :
idlc()->setParseState(PS_ForwardDeclSeen);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstInterface* pForward = NULL;
- AstDeclaration* pDecl = NULL;
+ AstInterface* pForward = nullptr;
+ AstDeclaration* pDecl = nullptr;
/*
* Make a new forward interface node and add it to its enclosing scope
*/
if ( pScope && $1 )
{
- pForward = new AstInterface(*$1, NULL, pScope);
+ pForward = new AstInterface(*$1, nullptr, pScope);
pDecl = pScope->lookupByName(pForward->getScopedName());
if ( pDecl )
@@ -554,9 +554,9 @@ interface_dcl :
idlc()->setParseState(PS_InterfaceHeadSeen);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstInterface* pInterface = NULL;
- AstInterface* pForward = NULL;
- AstDeclaration* pDecl = NULL;
+ AstInterface* pInterface = nullptr;
+ AstInterface* pForward = nullptr;
+ AstDeclaration* pDecl = nullptr;
/*
* Make a new interface node and add it to its enclosing scope
@@ -666,7 +666,7 @@ interfaceheader :
{
idlc()->setParseState(PS_InheritSpecSeen);
- $$ = new FeInheritanceHeader(NT_interface, $1, $2, 0);
+ $$ = new FeInheritanceHeader(NT_interface, $1, $2, nullptr);
delete $2;
}
;
@@ -682,7 +682,7 @@ inheritance_spec :
}
| /* EMPTY */
{
- $$ = NULL;
+ $$ = nullptr;
}
;
@@ -846,10 +846,10 @@ opt_attribute_block:
'{' attribute_block_rest { $$ = $2; }
| /* empty */
{
- $$.get.documentation = 0;
- $$.get.exceptions = 0;
- $$.set.documentation = 0;
- $$.set.exceptions = 0;
+ $$.get.documentation = nullptr;
+ $$.get.exceptions = nullptr;
+ $$.set.documentation = nullptr;
+ $$.set.exceptions = nullptr;
}
;
@@ -859,10 +859,10 @@ attribute_block_rest:
{
yyerror("bad attribute raises block");
yyerrok;
- $$.get.documentation = 0;
- $$.get.exceptions = 0;
- $$.set.documentation = 0;
- $$.set.exceptions = 0;
+ $$.get.documentation = nullptr;
+ $$.get.exceptions = nullptr;
+ $$.set.documentation = nullptr;
+ $$.set.exceptions = nullptr;
}
;
@@ -881,16 +881,16 @@ opt_attribute_raises:
}
| /* empty */
{
- $$.get.documentation = 0;
- $$.get.exceptions = 0;
- $$.set.documentation = 0;
- $$.set.exceptions = 0;
+ $$.get.documentation = nullptr;
+ $$.get.exceptions = nullptr;
+ $$.set.documentation = nullptr;
+ $$.set.exceptions = nullptr;
}
;
opt_attribute_get_raises:
attribute_get_raises
- | /* empty */ { $$.documentation = 0; $$.exceptions = 0; }
+ | /* empty */ { $$.documentation = nullptr; $$.exceptions = nullptr; }
;
attribute_get_raises:
@@ -905,7 +905,7 @@ attribute_get_raises:
opt_attribute_set_raises:
attribute_set_raises
- | /* empty */ { $$.documentation = 0; $$.exceptions = 0; }
+ | /* empty */ { $$.documentation = nullptr; $$.exceptions = nullptr; }
;
attribute_set_raises:
@@ -938,7 +938,7 @@ operation :
AstInterface * pScope = static_cast< AstInterface * >(
idlc()->scopes()->top());
- AstOperation* pOp = NULL;
+ AstOperation* pOp = nullptr;
/*
* Create a node representing an operation on an interface
@@ -984,7 +984,7 @@ operation :
opt_raises
{
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstOperation* pOp = NULL;
+ AstOperation* pOp = nullptr;
/*
* Add exceptions and context to the operation
*/
@@ -1045,7 +1045,7 @@ parameter :
AstOperation * pScope = static_cast< AstOperation * >(
idlc()->scopes()->top());
- AstParameter* pParam = NULL;
+ AstParameter* pParam = nullptr;
/*
* Create a node representing an argument to an operation
@@ -1133,7 +1133,7 @@ opt_raises:
raises
| /* empty */
{
- $$ = 0;
+ $$ = nullptr;
}
;
@@ -1175,13 +1175,13 @@ exception_name:
// attributes), so look up exception names in the next-to-topmost scope:
AstDeclaration * decl = idlc()->scopes()->nextToTop()->lookupByName(
*$1);
- if (decl == 0) {
+ if (decl == nullptr) {
ErrorHandler::lookupError(*$1);
} else if (!ErrorHandler::checkPublished(decl)) {
- decl = 0;
+ decl = nullptr;
} else if (decl->getNodeType() != NT_exception) {
ErrorHandler::error1(EIDL_ILLEGAL_RAISES, decl);
- decl = 0;
+ decl = nullptr;
}
delete $1;
$$ = decl;
@@ -1243,7 +1243,7 @@ constants_export :
idlc()->setParseState(PS_ConstExprSeen);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstConstant* pConstant = NULL;
+ AstConstant* pConstant = nullptr;
if ( $9 && pScope )
{
@@ -1278,8 +1278,8 @@ constants_dcl :
idlc()->setParseState(PS_ConstantsSqSeen);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstConstants* pConstants = NULL;
- AstDeclaration* pExists = NULL;
+ AstConstants* pConstants = nullptr;
+ AstDeclaration* pExists = nullptr;
if ( pScope )
{
@@ -1383,11 +1383,11 @@ unary_expr :
primary_expr
| '+' primary_expr
{
- $$ = new AstExpression(EC_u_plus, $2, NULL);
+ $$ = new AstExpression(EC_u_plus, $2, nullptr);
}
| '-' primary_expr
{
- $$ = new AstExpression(EC_u_minus, $2, NULL);
+ $$ = new AstExpression(EC_u_minus, $2, nullptr);
}
| '~' primary_expr
{
@@ -1442,7 +1442,7 @@ const_type :
| scoped_name
{
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstDeclaration const * type = 0;
+ AstDeclaration const * type = nullptr;
/*
* If the constant's type is a scoped name, it must resolve
@@ -1451,7 +1451,7 @@ const_type :
if ( pScope && (type = pScope->lookupByName(*$1)) ) {
if (!ErrorHandler::checkPublished(type))
{
- type = 0;
+ type = nullptr;
$$ = ET_none;
}
else
@@ -1483,7 +1483,7 @@ exception_header :
{
idlc()->setParseState(PS_InheritSpecSeen);
- $$ = new FeInheritanceHeader(NT_exception, $3, $5, 0);
+ $$ = new FeInheritanceHeader(NT_exception, $3, $5, nullptr);
delete $5;
}
;
@@ -1494,7 +1494,7 @@ exception_dcl :
idlc()->setParseState(PS_ExceptHeaderSeen);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstException* pExcept = NULL;
+ AstException* pExcept = nullptr;
if ( pScope )
{
@@ -1536,10 +1536,10 @@ property :
idlc()->setParseState(PS_PropertyCompleted);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstAttribute* pAttr = NULL;
+ AstAttribute* pAttr = nullptr;
FeDeclList* pList = $4;
- FeDeclarator* pDecl = NULL;
- AstType const * pType = NULL;
+ FeDeclarator* pDecl = nullptr;
+ AstType const * pType = nullptr;
if ( pScope->getScopeNodeType() == NT_singleton )
{
@@ -1610,8 +1610,8 @@ service_export :
idlc()->setParseState(PS_ServiceMemberSeen);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstDeclaration* pDecl = NULL;
- AstInterfaceMember* pIMember = NULL;
+ AstDeclaration* pDecl = nullptr;
+ AstInterfaceMember* pIMember = nullptr;
if ( pScope->getScopeNodeType() == NT_singleton )
{
@@ -1659,8 +1659,8 @@ service_export :
idlc()->setParseState(PS_ServiceMemberSeen);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstDeclaration* pDecl = NULL;
- AstServiceMember* pSMember = NULL;
+ AstDeclaration* pDecl = nullptr;
+ AstServiceMember* pSMember = nullptr;
/*
* Create a node representing a class member.
@@ -1700,8 +1700,8 @@ service_export :
idlc()->setParseState(PS_ServiceMemberSeen);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstDeclaration* pDecl = NULL;
- AstObserves* pObserves = NULL;
+ AstDeclaration* pDecl = nullptr;
+ AstObserves* pObserves = nullptr;
if ( pScope->getScopeNodeType() == NT_singleton )
{
@@ -1741,8 +1741,8 @@ service_export :
idlc()->setParseState(PS_ServiceMemberSeen);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstDeclaration* pDecl = NULL;
- AstNeeds* pNeeds = NULL;
+ AstDeclaration* pDecl = nullptr;
+ AstNeeds* pNeeds = nullptr;
if ( pScope->getScopeNodeType() == NT_singleton )
{
@@ -1825,12 +1825,12 @@ service_dcl :
checkIdentifier($3);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstService* pService = NULL;
+ AstService* pService = nullptr;
/*
* Make a new service and add it to the enclosing scope
*/
- if (pScope != NULL)
+ if (pScope != nullptr)
{
pService = new AstService(*$3, pScope);
pScope->addDeclaration(pService);
@@ -1859,7 +1859,9 @@ service_interface_dfn:
AstScope * scope = idlc()->scopes()->nextToTop();
// skip the scope pushed by service_dcl
AstDeclaration * decl = scope->lookupByName(*$2);
- if (decl != 0 && resolveTypedefs(decl)->getNodeType() == NT_interface) {
+ if (decl != nullptr
+ && resolveTypedefs(decl)->getNodeType() == NT_interface)
+ {
if (ErrorHandler::checkPublished(decl)) {
idlc()->scopes()->top()->addDeclaration(decl);
}
@@ -1872,7 +1874,7 @@ service_interface_dfn:
opt_service_body
{
AstService * s = static_cast< AstService * >(idlc()->scopes()->top());
- if (s != 0) {
+ if (s != nullptr) {
s->setSingleInterfaceBasedService();
s->setDefaultConstructor(!$4);
}
@@ -1900,7 +1902,7 @@ constructor:
{
checkIdentifier($1);
AstScope * scope = idlc()->scopes()->top();
- AstOperation * ctor = new AstOperation(0, *$1, scope);
+ AstOperation * ctor = new AstOperation(nullptr, *$1, scope);
delete $1;
scope->addDeclaration(ctor);
idlc()->scopes()->push(ctor);
@@ -1934,12 +1936,12 @@ singleton_dcl :
checkIdentifier($3);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstService* pService = NULL;
+ AstService* pService = nullptr;
/*
* Make a new service and add it to the enclosing scope
*/
- if (pScope != NULL)
+ if (pScope != nullptr)
{
pService = new AstService(NT_singleton, *$3, pScope);
pScope->addDeclaration(pService);
@@ -1968,7 +1970,9 @@ singleton_interface_dfn:
AstScope * scope = idlc()->scopes()->nextToTop();
// skip the scope (needlessly) pushed by singleton_dcl
AstDeclaration * decl = scope->lookupByName(*$2);
- if (decl != 0 && resolveTypedefs(decl)->getNodeType() == NT_interface) {
+ if (decl != nullptr
+ && resolveTypedefs(decl)->getNodeType() == NT_interface)
+ {
if (ErrorHandler::checkPublished(decl)) {
idlc()->scopes()->top()->addDeclaration(decl);
}
@@ -2015,7 +2019,7 @@ type_declarator :
type_spec
{
idlc()->setParseState(PS_TypeSpecSeen);
- if ($1 != 0 && $1->getNodeType() == NT_instantiated_struct) {
+ if ($1 != nullptr && $1->getNodeType() == NT_instantiated_struct) {
ErrorHandler::error0(EIDL_INSTANTIATED_STRUCT_TYPE_TYPEDEF);
}
}
@@ -2024,10 +2028,10 @@ type_declarator :
idlc()->setParseState(PS_DeclaratorsSeen);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstTypeDef* pTypeDef = NULL;
+ AstTypeDef* pTypeDef = nullptr;
FeDeclList* pList = $3;
- FeDeclarator* pDecl = NULL;
- AstType const * pType = NULL;
+ FeDeclarator* pDecl = nullptr;
+ AstType const * pType = nullptr;
/*
* Create nodes representing typedefs and add them to the
@@ -2104,7 +2108,7 @@ declarators :
}
| /* EMPTY */
{
- $$ = NULL;
+ $$ = nullptr;
}
;
@@ -2115,7 +2119,7 @@ declarator :
// members with illegal names (of the form "m_DataN"); avoid useless
// warnings about them:
AstScope * scope = idlc()->scopes()->top();
- if (scope == 0 || scope->getScopeNodeType() != NT_struct
+ if (scope == nullptr || scope->getScopeNodeType() != NT_struct
|| (scopeAsDecl(scope)->getScopedName()
!= "com::sun::star::uno::Uik"))
{
@@ -2168,7 +2172,7 @@ scoped_names :
}
| /* EMPTY */
{
- $$ = NULL;
+ $$ = nullptr;
}
;
@@ -2228,7 +2232,7 @@ fundamental_type:
opt_type_args:
'<' type_args '>' { $$ = $2; }
- | /* empty */ { $$ = 0; }
+ | /* empty */ { $$ = nullptr; }
;
type_args:
@@ -2247,7 +2251,7 @@ type_args:
type_arg:
simple_type_spec
{
- if ($1 != 0 && static_cast< AstType const * >($1)->isUnsigned()) {
+ if ($1 != nullptr && static_cast< AstType const * >($1)->isUnsigned()) {
ErrorHandler::error0(EIDL_UNSIGNED_TYPE_ARGUMENT);
}
$$ = $1;
@@ -2365,7 +2369,7 @@ sequence_type_spec :
/*
* Push a sequence marker on scopes stack
*/
- idlc()->scopes()->push(NULL);
+ idlc()->scopes()->push(nullptr);
}
'<'
{
@@ -2381,14 +2385,14 @@ sequence_type_spec :
/*
* Remove sequence marker from scopes stack
*/
- if (idlc()->scopes()->top() == NULL)
+ if (idlc()->scopes()->top() == nullptr)
idlc()->scopes()->pop();
/*
* Create a node representing a sequence
*/
AstScope* pScope = idlc()->scopes()->bottom();
- AstDeclaration* pDecl = NULL;
- AstDeclaration* pSeq = NULL;
+ AstDeclaration* pDecl = nullptr;
+ AstDeclaration* pSeq = nullptr;
if ( $5 )
{
@@ -2414,7 +2418,7 @@ sequence_type_spec :
{
yyerror("sequence declaration");
yyerrok;
- $$ = 0;
+ $$ = nullptr;
}
;
@@ -2424,7 +2428,7 @@ struct_type :
idlc()->setParseState(PS_StructHeaderSeen);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstStruct* pStruct = NULL;
+ AstStruct* pStruct = nullptr;
if ( pScope )
{
@@ -2482,7 +2486,7 @@ structure_header :
// (Note that plain struct types with instantiated polymorphic struct
// type bases, which might also cause problems in language bindings, are
// already rejected on a syntactic level.)
- if ($5 != 0 && $6 != 0) {
+ if ($5 != nullptr && $6 != nullptr) {
ErrorHandler::error0(EIDL_STRUCT_TYPE_TEMPLATE_WITH_BASE);
}
@@ -2494,7 +2498,7 @@ structure_header :
opt_type_params:
'<' type_params '>' { $$ = $2; }
- | /* empty */ { $$ = 0; }
+ | /* empty */ { $$ = nullptr; }
;
type_params:
@@ -2536,10 +2540,10 @@ member :
idlc()->setParseState(PS_MemberDeclsCompleted);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstMember* pMember = NULL;
+ AstMember* pMember = nullptr;
FeDeclList* pList = $3;
- FeDeclarator* pDecl = NULL;
- AstType const * pType = NULL;
+ FeDeclarator* pDecl = nullptr;
+ AstType const * pType = nullptr;
// !!! check recursive type
@@ -2589,20 +2593,20 @@ type_or_parameter:
fundamental_type
| scoped_name opt_type_args
{
- AstDeclaration const * decl = 0;
+ AstDeclaration const * decl = nullptr;
AstStruct * scope = static_cast< AstStruct * >(idlc()->scopes()->top());
- if (scope != 0 && $2 == 0) {
+ if (scope != nullptr && $2 == nullptr) {
decl = scope->findTypeParameter(*$1);
}
- if (decl != 0) {
+ if (decl != nullptr) {
delete $1;
delete $2;
} else {
decl = createNamedType($1, $2);
- if (scope != 0 && includes(decl, scopeAsDecl(scope))) {
+ if (scope != nullptr && includes(decl, scopeAsDecl(scope))) {
ErrorHandler::error1(
EIDL_RECURSIVE_TYPE, scopeAsDecl(scope));
- decl = 0;
+ decl = nullptr;
}
}
$$ = decl;
@@ -2620,13 +2624,13 @@ enum_type :
checkIdentifier($3);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstEnum* pEnum = NULL;
+ AstEnum* pEnum = nullptr;
/*
* Create a node representing an enum and add it to its
* enclosing scope
*/
- if (pScope != NULL)
+ if (pScope != nullptr)
{
pEnum = new AstEnum(*$3, pScope);
/*
@@ -2655,8 +2659,8 @@ enum_type :
/*
* Done with this enum. Pop its scope from the scopes stack
*/
- if (idlc()->scopes()->top() == NULL)
- $$ = NULL;
+ if (idlc()->scopes()->top() == nullptr)
+ $$ = nullptr;
else
{
$$ = static_cast<AstEnum*>(idlc()->scopes()->topNonNull());
@@ -2688,8 +2692,8 @@ enumerator :
checkIdentifier($1);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstEnum* pEnum = NULL;
- AstConstant* pEnumVal = NULL;
+ AstEnum* pEnum = nullptr;
+ AstConstant* pEnumVal = nullptr;
if ( pScope && pScope->getScopeNodeType() == NT_enum)
{
@@ -2714,8 +2718,8 @@ enumerator :
checkIdentifier($1);
AstScope* pScope = idlc()->scopes()->topNonNull();
- AstEnum* pEnum = NULL;
- AstConstant* pEnumVal = NULL;
+ AstEnum* pEnum = nullptr;
+ AstConstant* pEnumVal = nullptr;
if ( $3 && pScope && pScope->getScopeNodeType() == NT_enum)
{
commit f88f82233df696bb8b5e6294ad448e4eb20e8270
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Apr 26 15:58:11 2016 +0200
simplify
Change-Id: Iecb9ea0106cf57ef3c873d3a62407a3da5706d92
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 637790a..f1fd887 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -3904,10 +3904,8 @@ void SdXMLCustomShapeContext::EndElement()
if(xPropSet.is())
{
- const OUString sFlushCustomShapeUnoApiObjects("FlushCustomShapeUnoApiObjects");
- uno::Any aAny;
- aAny <<= true;
- xPropSet->setPropertyValue(sFlushCustomShapeUnoApiObjects, aAny);
+ xPropSet->setPropertyValue(
+ "FlushCustomShapeUnoApiObjects", css::uno::Any(true));
}
}
catch(const uno::Exception&)
More information about the Libreoffice-commits
mailing list