View Issue Details

IDProjectCategoryView StatusLast Update
0002137OpenFOAMBugpublic2016-07-01 14:54
Reporteruser696Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformanyOSanyOS Versionany
Product Versiondev 
Fixed in Versiondev 
Summary0002137: inconsistencies in unsigned primitives
DescriptionBy design, or by mistake, the unsigned versions have the same pTraits limits as their signed counterparts?

In uint32.C, uint64.C:

const uint64_t Foam::pTraits<uint64_t>::min = INT64_MIN;
const uint64_t Foam::pTraits<uint64_t>::max = INT64_MAX;

const uint32_t Foam::pTraits<uint32_t>::min = INT32_MIN;
const uint32_t Foam::pTraits<uint32_t>::max = INT32_MAX;

STYLE:
uLabel.H includes the zero-sized file "uLabelSpecific.H", which should be removed as clutter.
TagsNo tags attached.

Activities

user696

2016-07-01 07:16

  ~0006479

Any good reason not to hard-code the min values as 0 instead of using macros for the same? I can't think of any situation where an unsigned type can have a min value that is not zero.

henry

2016-07-01 10:37

manager   ~0006481

Resolved by commit c488c0208259f843dde129fcd7a6e3566aef0ee8

user696

2016-07-01 10:44

  ~0006483

Thanks.
On the same cleanup level, I think it would make sense to reduce other cruft.

In int32.H and uint32.H, remove the now superfluous UINT32_MIN defines.

Also hard-code the rootMin values
const uint32_t Foam::pTraits<uint32_t>::rootMin = 0;
const uint64_t Foam::pTraits<uint64_t>::rootMin = 0;

henry

2016-07-01 14:54

manager   ~0006486

Resolved by commit 97a889dbd8398323bb8c66c7743c75c5428ea726

Issue History

Date Modified Username Field Change
2016-07-01 07:12 user696 New Issue
2016-07-01 07:16 user696 Note Added: 0006479
2016-07-01 10:37 henry Note Added: 0006481
2016-07-01 10:37 henry Status new => resolved
2016-07-01 10:37 henry Fixed in Version => dev
2016-07-01 10:37 henry Resolution open => fixed
2016-07-01 10:37 henry Assigned To => henry
2016-07-01 10:44 user696 Note Added: 0006483
2016-07-01 10:44 user696 Status resolved => feedback
2016-07-01 10:44 user696 Resolution fixed => reopened
2016-07-01 14:54 henry Note Added: 0006486
2016-07-01 14:54 henry Status feedback => resolved
2016-07-01 14:54 henry Resolution reopened => fixed