Skip to content

UnitPreferences class in unitsdata.cpp - #42

Merged
sffc merged 11 commits into
sffc:units-stagingfrom
hugovdm:UnitPreferences
May 12, 2020
Merged

sffc merged 11 commits into
sffc:units-stagingfrom
hugovdm:UnitPreferences

Conversation

@hugovdm

@hugovdm hugovdm commented May 4, 2020

Copy link
Copy Markdown
Collaborator
Checklist

@hugovdm
hugovdm requested review from sffc and younies May 4, 2020 08:59
@sffc

sffc commented May 4, 2020

Copy link
Copy Markdown
Owner

FYI, there is a depstest error:

Error: in group unitsformatter: i18n/unitsdata.o imports icu_67::number::impl::DecimalQuantity::~DecimalQuantity() but unitsformatter does not depend on number_representation (for i18n/number_decimalquantity.o)
Error: in group unitsformatter: i18n/unitsdata.o imports icu_67::number::impl::DecimalQuantity::toDouble() const but unitsformatter does not depend on number_representation (for i18n/number_decimalquantity.o)
Error: in group unitsformatter: i18n/unitsdata.o imports operator new(unsigned long) - is this a new system symbol?
Error: in group unitsformatter: i18n/unitsdata.o imports icu_67::number::impl::DecimalQuantity::DecimalQuantity() but unitsformatter does not depend on number_representation (for i18n/number_decimalquantity.o)
Error: in group unitsformatter: i18n/unitsdata.o imports icu_67::number::impl::DecimalQuantity::setToDecNumber(icu_67::StringPiece, UErrorCode&) but unitsformatter does not depend on number_representation (for i18n/number_decimalquantity.o)

Please add number_representation as a dependency of unitsformatter

Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.h Resolved
hugovdm added 3 commits May 5, 2020 02:42
With this hopefully more readable version, looking for an unknown
usage and region will result in the binary search being repeated four
times.

The previous version did not use a metadata instance comparator so
that individual components of the metadata key could be compared. A
comparator that returns status information on which of the components
had been found would be able to improve on this.
@hugovdm
hugovdm force-pushed the UnitPreferences branch from f9d468d to ab4087b Compare May 5, 2020 12:44

@hugovdm hugovdm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Requesting input on the two new binary search alternatives I've implemented.

(I still need to do the "return a slice" change.)

Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.h Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved

@hugovdm hugovdm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sorry about my delay in response. I think I've responded to all open threads.

Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
@hugovdm
hugovdm requested a review from sffc May 8, 2020 00:33

@sffc sffc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Just some comments about your use of const and const_cast.

Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
Comment thread icu4c/source/common/cmemory.h Resolved
Comment thread icu4c/source/i18n/unitsdata.cpp Resolved
@hugovdm
hugovdm requested review from sffc and younies May 9, 2020 00:59
@sffc
sffc merged commit 24494d9 into sffc:units-staging May 12, 2020
@hugovdm
hugovdm deleted the UnitPreferences branch May 12, 2020 19:00
hugovdm pushed a commit that referenced this pull request May 28, 2020
hugovdm added a commit to hugovdm/icu that referenced this pull request Jul 15, 2020
PR: sffc#42
Commit: 24494d9
UnitPreferences class in unitsdata.cpp

PR: sffc#43
Commit: d406b91
Add getUnitCategory()

PR: sffc#45
Commit: 6b14d7f
Support usage component dropping, and more

PR: sffc#46
Commit: 5e4f8d4
Add six more unit tests for getPreferencesFor.
hugovdm added a commit to hugovdm/icu that referenced this pull request Jul 23, 2020
PR: sffc#42
Commit: 24494d9
UnitPreferences class in unitsdata.cpp

PR: sffc#43
Commit: d406b91
Add getUnitCategory()

PR: sffc#45
Commit: 6b14d7f
Support usage component dropping, and more

PR: sffc#46
Commit: 5e4f8d4
Add six more unit tests for getPreferencesFor.

Rebase fixes:
- No getConstAlias
- SingleUnitImpl::getSimpleUnitID()
- ConversionRates class
- Use intltest.cpp/intltest.h from units-staging HEAD
hugovdm added a commit to hugovdm/icu that referenced this pull request Jul 23, 2020
PR: sffc#42
Commit: 24494d9
UnitPreferences class in unitsdata.cpp

PR: sffc#43
Commit: d406b91
Add getUnitCategory()

PR: sffc#45
Commit: 6b14d7f
Support usage component dropping, and more

PR: sffc#46
Commit: 5e4f8d4
Add six more unit tests for getPreferencesFor.

Rebase fixes:
- No getConstAlias
- SingleUnitImpl::getSimpleUnitID()
- Use intltest.cpp/intltest.h from units-staging HEAD
hugovdm added a commit to hugovdm/icu that referenced this pull request Jul 23, 2020
PR: sffc#42
Commit: 24494d9
UnitPreferences class in unitsdata.cpp

PR: sffc#43
Commit: d406b91
Add getUnitCategory()

PR: sffc#45
Commit: 6b14d7f
Support usage component dropping, and more

PR: sffc#46
Commit: 5e4f8d4
Add six more unit tests for getPreferencesFor.

Rebase fixes:
- No getConstAlias
- SingleUnitImpl::getSimpleUnitID()
- Use intltest.cpp/intltest.h from units-staging HEAD
hugovdm added a commit to hugovdm/icu that referenced this pull request Aug 3, 2020
PR: sffc#42
Commit: 24494d9
UnitPreferences class in unitsdata.cpp

PR: sffc#43
Commit: d406b91
Add getUnitCategory()

PR: sffc#45
Commit: 6b14d7f
Support usage component dropping, and more

PR: sffc#46
Commit: 5e4f8d4
Add six more unit tests for getPreferencesFor.

Rebase fixes:
- No getConstAlias
- SingleUnitImpl::getSimpleUnitID()
- Use intltest.cpp/intltest.h from units-staging HEAD
hugovdm added a commit to hugovdm/icu that referenced this pull request Aug 3, 2020
PR: sffc#42
Commit: 24494d9
UnitPreferences class in unitsdata.cpp

PR: sffc#43
Commit: d406b91
Add getUnitCategory()

PR: sffc#45
Commit: 6b14d7f
Support usage component dropping, and more

PR: sffc#46
Commit: 5e4f8d4
Add six more unit tests for getPreferencesFor.

Rebase fixes:
- No getConstAlias
- SingleUnitImpl::getSimpleUnitID()
- Use intltest.cpp/intltest.h from units-staging HEAD
hugovdm added a commit to hugovdm/icu that referenced this pull request Aug 15, 2020
PR: sffc#42
Commit: 24494d9
UnitPreferences class in unitsdata.cpp

PR: sffc#43
Commit: d406b91
Add getUnitCategory()

PR: sffc#45
Commit: 6b14d7f
Support usage component dropping, and more

PR: sffc#46
Commit: 5e4f8d4
Add six more unit tests for getPreferencesFor.

Rebase fixes:
- No getConstAlias
- SingleUnitImpl::getSimpleUnitID()
- Use intltest.cpp/intltest.h from units-staging HEAD
hugovdm added a commit to hugovdm/icu that referenced this pull request Aug 28, 2020
PR: sffc#42
Commit: 24494d9
UnitPreferences class in unitsdata.cpp

PR: sffc#43
Commit: d406b91
Add getUnitCategory()

PR: sffc#45
Commit: 6b14d7f
Support usage component dropping, and more

PR: sffc#46
Commit: 5e4f8d4
Add six more unit tests for getPreferencesFor.

Rebase fixes:
- No getConstAlias
- SingleUnitImpl::getSimpleUnitID()
- Use intltest.cpp/intltest.h from units-staging HEAD
hugovdm added a commit to hugovdm/icu that referenced this pull request Sep 1, 2020
PR: sffc#42
Commit: 24494d9
UnitPreferences class in unitsdata.cpp

PR: sffc#43
Commit: d406b91
Add getUnitCategory()

PR: sffc#45
Commit: 6b14d7f
Support usage component dropping, and more

PR: sffc#46
Commit: 5e4f8d4
Add six more unit tests for getPreferencesFor.

Rebase fixes:
- No getConstAlias
- SingleUnitImpl::getSimpleUnitID()
- Use intltest.cpp/intltest.h from units-staging HEAD
hugovdm added a commit to hugovdm/icu that referenced this pull request Sep 2, 2020
PR: sffc#42
Commit: 24494d9
UnitPreferences class in unitsdata.cpp

PR: sffc#43
Commit: d406b91
Add getUnitCategory()

PR: sffc#45
Commit: 6b14d7f
Support usage component dropping, and more

PR: sffc#46
Commit: 5e4f8d4
Add six more unit tests for getPreferencesFor.

Rebase fixes:
- No getConstAlias
- SingleUnitImpl::getSimpleUnitID()
- Use intltest.cpp/intltest.h from units-staging HEAD

SQUASHED:
- A CI fix for source/i18n/unitsdata.h

squash! CI fix for source/test/intltest/unitsdatatest.cpp
hugovdm added a commit to hugovdm/icu that referenced this pull request Sep 9, 2020
UnitPreferences class in unitsdata.cpp
PR: sffc#42
Commit: 24494d9

Add getUnitCategory()
PR: sffc#43
Commit: d406b91

Support usage component dropping, and more
PR: sffc#45
Commit: 6b14d7f

Add six more unit tests for getPreferencesFor.
PR: sffc#46
Commit: 5e4f8d4

Change getPreferencesFor parameters from char* to StringPiece.
PR: sffc#47
Commit: a7ca496
hugovdm added a commit to unicode-org/icu that referenced this pull request Sep 10, 2020
UnitPreferences class in unitsdata.cpp
PR: sffc#42
Commit: 24494d9

Add getUnitCategory()
PR: sffc#43
Commit: d406b91

Support usage component dropping, and more
PR: sffc#45
Commit: 6b14d7f

Add six more unit tests for getPreferencesFor.
PR: sffc#46
Commit: 5e4f8d4

Change getPreferencesFor parameters from char* to StringPiece.
PR: sffc#47
Commit: a7ca496
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.

2 participants