Page MenuHomePhabricator

Get rid of namespace imports & backporting univalue
ClosedPublic

Authored by jasonbcox on Nov 8 2017, 04:04.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rSTAGING41abbec5fd78: Get rid of namespace imports & backporting univalue
rABC41abbec5fd78: Get rid of namespace imports & backporting univalue
Summary

Remove namespace imports as they pollute namespace and are prone to symbol clashes. Backport univalue to latest version, which also includes namespace removals.

Test Plan

These changes build. No new tests should be necessary.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
namespace
Lint
Lint Passed
SeverityLocationCodeMessage
Auto-Fixsrc/univalue/include/univalue.h:1CFMTCode style violation
Auto-Fixsrc/univalue/lib/univalue.cpp:1CFMTCode style violation
Auto-Fixsrc/univalue/lib/univalue_get.cpp:1CFMTCode style violation
Auto-Fixsrc/univalue/lib/univalue_read.cpp:1CFMTCode style violation
Auto-Fixsrc/univalue/lib/univalue_utffilter.h:1CFMTCode style violation
Auto-Fixsrc/univalue/lib/univalue_write.cpp:1CFMTCode style violation
Auto-Fixsrc/univalue/test/no_nul.cpp:1CFMTCode style violation
Auto-Fixsrc/univalue/test/object.cpp:1CFMTCode style violation
Auto-Fixsrc/univalue/test/test_json.cpp:1CFMTCode style violation
Auto-Fixsrc/univalue/test/unitester.cpp:1CFMTCode style violation
Unit
No Test Coverage
Build Status
Buildable 1158
Build 1158: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Nov 8 2017, 04:04
jasonbcox added a task: Restricted Maniphest Task.Nov 8 2017, 04:06

I also noticed one last 'using namespace' in /test/streams_tests.cpp::13

using namespace boost::assign; // bring 'operator+=()' into scope

However, this one makes sense as the alternative is to bring the namespace into scope in every function that it's needed. Something like what is suggested here: https://stackoverflow.com/questions/4892662/is-there-a-way-to-use-boostassign-operators-without-polluting-namespace I could understand this if it was used once, but considering that it's used throughout the file, I think it's ok to leave this one alone. Thoughts?

deadalnix requested changes to this revision.Nov 8 2017, 13:12

univalue is a imported codebase, we don't want ot mess with it. If you want to change it, direct this to the univalue devs and then backport here.

This revision now requires changes to proceed.Nov 8 2017, 13:12

Backported latest univalue changes

deadalnix requested changes to this revision.Nov 22 2017, 19:20

Please update the diff title and description to match the actual content. Except that, it's all good.

This revision now requires changes to proceed.Nov 22 2017, 19:20
jasonbcox retitled this revision from Get rid of namespace imports to Get rid of namespace imports & backporting univalue.Nov 26 2017, 01:30
jasonbcox edited the summary of this revision. (Show Details)

Updated the title and summary to better reflect these changes.

This revision is now accepted and ready to land.Nov 27 2017, 00:48
This revision was automatically updated to reflect the committed changes.