pierre521 / ifcplusplus

Automatically exported from code.google.com/p/ifcplusplus
Other
0 stars 0 forks source link

Timestamp from int to unsigned int. #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In IfcTImeStamp.h

Could you please kindly change the timestamp value from int to unsigned int?

Thanks:)

        IfcTimeStamp( int value );// to unsigned int.
    int m_value;  // to unsigned int.

Original issue reported on code.google.com by sajlo...@gmail.com on 7 Jan 2015 at 3:58

GoogleCodeExporter commented 9 years ago
This is how IfcTimeStamp is defined in IFC4:

TYPE IfcTimeStamp = INTEGER;
END_TYPE;

Of course it is not necessary to have it signed, but the memory overhead is 
very very small, unless you have millions of timestamps.

The thing is, I can not change all INTEGER's to unsinged, and I don't really 
want to add item-specific changes that are not in the schema.

Or is there another reason why you want to change it?

Original comment by fabian.g...@gmail.com on 7 Jan 2015 at 11:02

GoogleCodeExporter commented 9 years ago
OK. I didn't realize that IfcTimpeStamp is defined as INTEGER in IFC4.

I agree with you. It is almost always better to stick to the specifications :).

Not really there is no reason. In our code, I get the time stamp which is 
unsigned int and then assign to IfcTimpeStamp and got a warning message as 
conversion from unsigned int to int. I will static_cast it.

Thank you.

Original comment by sajlo...@gmail.com on 7 Jan 2015 at 11:50

GoogleCodeExporter commented 9 years ago

Original comment by fabian.g...@gmail.com on 7 Jan 2015 at 12:23