Skip to content
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

Use Impl libraries for all internal libraries #15

Merged
merged 18 commits into from
Jul 23, 2020
Merged

Conversation

younies
Copy link

@younies younies commented Jul 4, 2020

This PR is the first PR among a series of PR to point all the internal code to use impl instances instead of the public ones.

Checklist

@younies younies requested review from sffc and hugovdm July 4, 2020 01:15
Copy link
Collaborator

@hugovdm hugovdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some initial things - not yet a thorough review.

The variouis functions aren't immediately clear to me, I'll probably write some notes as I go: if I have short proposed documentation sentences for each, do you suggest I just leave them as comments? Or better to simply push a commit to the branch?

icu4c/source/i18n/measunit_extra.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/measunit_extra.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/measunit_extra.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/measunit_extra.cpp Outdated Show resolved Hide resolved
for (int32_t i = 0, baseUnitsCount = baseUnits.length(); i < baseUnitsCount; i++) {
baseUnits[i]->dimensionality *= singleUnit.dimensionality;
// TODO: Deal with SI-prefix
result.append(*baseUnits[i], status);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a unit test? Maybe with a commented-out test that would show what is currently broken (until you deal with SI prefixes)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add a test cases that fails while I fixing this issue.

icu4c/source/i18n/unitconverter.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/measunit_extra.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/measunit_impl.h Outdated Show resolved Hide resolved
icu4c/source/i18n/measunit_extra.cpp Outdated Show resolved Hide resolved
@hugovdm
Copy link
Collaborator

hugovdm commented Jul 10, 2020

I noticed a merge conflict due to my -p4- -> -pow4- fix. For convenience, I went ahead and merged units-staging and fixed this.

@sffc sffc linked an issue Jul 14, 2020 that may be closed by this pull request
@sffc sffc added this to the 2020-Q3-m1 milestone Jul 14, 2020
@younies younies changed the title Use MeasureUnitImpl for check convertibility Use Impl libraries for all internal libraries Jul 20, 2020
icu4c/source/i18n/complexunitsconverter.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/complexunitsconverter.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/complexunitsconverter.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/complexunitsconverter.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/measunit_extra.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/unitconverter.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/unitconverter.h Outdated Show resolved Hide resolved
icu4c/source/test/intltest/unitstest.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Please also see the other open threads.

@younies younies requested review from hugovdm and sffc July 21, 2020 01:29
Copy link
Collaborator

@sffc sffc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost done!

icu4c/source/i18n/complexunitsconverter.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/complexunitsconverter.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/measunit_extra.cpp Outdated Show resolved Hide resolved
icu4c/source/i18n/unitconverter.h Outdated Show resolved Hide resolved
icu4c/source/i18n/measunit_impl.h Outdated Show resolved Hide resolved
icu4c/source/i18n/complexunitsconverter.cpp Outdated Show resolved Hide resolved
@younies younies requested review from hugovdm and sffc July 22, 2020 13:21
@younies younies self-assigned this Jul 22, 2020
@sffc
Copy link
Collaborator

sffc commented Jul 22, 2020

There's still an error:

Error: in group units: i18n/measunit.o imports icu_67::MeasureUnitImpl::copy(UErrorCode&) const but units does not depend on units_extra (for i18n/measunit_extra.o)

IIRC, this is why the copy function is defined in the header file. If you want to move the copy function to the cpp file, put it in measunit.cpp instead of measunit_extra.cpp.

@younies younies merged commit cc786cf into units-staging Jul 23, 2020
@younies younies deleted the use-impl branch July 23, 2020 00:30
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Jul 23, 2020
Commit: cc786cf

Use `Impl` libraries for all internal libraries
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Jul 23, 2020
Commit: cc786cf

Use `Impl` libraries for all internal libraries
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Jul 23, 2020
Commit: cc786cf

Use `Impl` libraries for all internal libraries
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Jul 23, 2020
Commit: cc786cf

Use `Impl` libraries for all internal libraries
younies added a commit that referenced this pull request Jul 24, 2020
Use `Impl` libraries for all internal libraries
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Aug 3, 2020
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Aug 3, 2020
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Aug 15, 2020
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Aug 28, 2020
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Sep 1, 2020
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Sep 2, 2020
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Sep 2, 2020
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Sep 9, 2020
Add precision to the output of UnitsRouter#route
PR: icu-units#10
Commit: 030bda3

Use `Impl` libraries for all internal libraries
PR: icu-units#15
Commit: cc786cf

Sort the units in ComplexUnitConverter
PR: icu-units#6
Commit: f65b181
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Sep 10, 2020
Add precision to the output of UnitsRouter#route
PR: icu-units#10
Commit: 030bda3

Use `Impl` libraries for all internal libraries
PR: icu-units#15
Commit: cc786cf

Sort the units in ComplexUnitConverter
PR: icu-units#6
Commit: f65b181
hugovdm pushed a commit to hugovdm/icu that referenced this pull request Sep 10, 2020
Add precision to the output of UnitsRouter#route
PR: icu-units#10
Commit: 030bda3

Use `Impl` libraries for all internal libraries
PR: icu-units#15
Commit: cc786cf

Sort the units in ComplexUnitConverter
PR: icu-units#6
Commit: f65b181
hugovdm pushed a commit to unicode-org/icu that referenced this pull request Sep 10, 2020
Add precision to the output of UnitsRouter#route
PR: icu-units#10
Commit: 030bda3

Use `Impl` libraries for all internal libraries
PR: icu-units#15
Commit: cc786cf

Sort the units in ComplexUnitConverter
PR: icu-units#6
Commit: f65b181
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICU-21536 Fix remaining TODOs and FIXMEs in units code
3 participants