Skip to content

Consistently added include cstdint everywhere where it makes sense

Alex Toldaiev requested to merge otoldaie/labRemote:dev_sr1 into kk_DS10CP154A

The fixed-width ints (uint8_t, uint32_t etc) are missing in the FELIX environment in SR1, for the exception headers that are built with the AMAC OPC server:

modified:   src/libDevCom/ChecksumException.h
modified:   src/libDevCom/OutOfRangeException.h

Probably, it is due to some change in gcc or glibc of different versions.

This patch addes the in these headers and everywhere where it makes sense.

I.e. if a class inherits from an (Interface) class that already defines include cstdint or stdint.h, then the public inheritance assures that the necessary headers will be there by design.

But, if a class contains a pointer to another class, i.e. only uses it in implementation. Then the header with the other class could be moved into the implementation, together with the stdandard int headers. I.e. the standard ints get included in the class header only by accident, despite the fact that they are a part of the class definition.

These are the cases of:

src/libDevCom/HIH4000.h ClimateSensor and ADCDevice.h, and TextSerialCom.h is not used here at all?
src/libDevCom/HIH6130.h ClimateSensor and I2CCom.h
src/libDevCom/HTS221.h ClimateSensor and I2CCom.h

These classes implement ClimateSensor and have standard ints in their definition. But ClimateSensor does not include the int headers. And I2CCom includes them, but is used only for implementation.

The 2 last cases ICom.h and IDataSink.h never broke in SR1. Probably because we either never build them, or never build them separately from something else.

All changes:

modified:   src/libDevCom/ChecksumException.h
modified:   src/libDevCom/OutOfRangeException.h
modified:   src/libDevCom/HIH4000.h
modified:   src/libDevCom/HIH6130.h
modified:   src/libDevCom/HTS221.h
modified:   src/libCom/ICom.h
modified:   src/libDataSink/IDataSink.h

Merge request reports

Loading