Skip to content

clang-tidy: use auto #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/dom_parser/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0)
{
std::cout << indent << "content = " << nodeContent->get_content() << std::endl;
}
else if(const xmlpp::Element* nodeElement = dynamic_cast<const xmlpp::Element*>(node))
else if(auto nodeElement = dynamic_cast<const xmlpp::Element*>(node))
{
//A normal Element node:

Expand Down
2 changes: 1 addition & 1 deletion examples/dom_xinclude/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void print_node(const xmlpp::Node* node, unsigned int indentation = 0)
{
std::cout << indent << "content = " << nodeContent->get_content() << std::endl;
}
else if (const xmlpp::Element* nodeElement = dynamic_cast<const xmlpp::Element*>(node))
else if (auto nodeElement = dynamic_cast<const xmlpp::Element*>(node))
{
//A normal Element node:
std::cout << indent << " Element line = " << node->get_line() << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion libxml++/nodes/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ ustring Node::get_namespace_prefix() const
else if (impl_->type == XML_ATTRIBUTE_DECL)
{
//impl_ is actually of type xmlAttribute, instead of just xmlNode.
const xmlAttribute* const attr = reinterpret_cast<const xmlAttribute*>(impl_);
auto attr = reinterpret_cast<const xmlAttribute*>(impl_);
return attr->prefix ? (const char*)attr->prefix : "";
}
else if(impl_->ns && impl_->ns->prefix)
Expand Down
2 changes: 1 addition & 1 deletion libxml++/parsers/domparser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ namespace {
char * buffer,
int len)
{
std::istream *in = static_cast<std::istream*>(context);
auto in = static_cast<std::istream*>(context);
in->read(buffer, len);
return in->gcount();
}
Expand Down
2 changes: 1 addition & 1 deletion libxml++/parsers/saxparser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ namespace {
char * buffer,
int len)
{
std::istream *in = static_cast<std::istream*>(context);
auto in = static_cast<std::istream*>(context);
in->read(buffer, len);
return in->gcount();
}
Expand Down
2 changes: 1 addition & 1 deletion libxml++/validators/dtdvalidator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void DtdValidator::validate(const Document* document)
xmlResetLastError();
initialize_context();

const bool res = (bool)xmlValidateDtd(pimpl_->context, (xmlDoc*)document->cobj(),
const auto res = (bool)xmlValidateDtd(pimpl_->context, (xmlDoc*)document->cobj(),
pimpl_->dtd->cobj());

if (!res)
Expand Down