The macros in khr_df.h were fixed some time ago to prevent this warning by the addition of uint32_t casts.
The dfd tests in KTX-Software's unittests (which should be moved to dfdutils after the cmake build and CI is set up), have several instances of code like
KHR_DF_CHANNEL_RGBSDA_ALPHA | KHR_DF_SAMPLE_DATATYPE_LINEAR
which triggers the warning. The code uses this pattern when setting the channel type parameter to a constructor used for building test DFDs. I do not know how common this pattern is in the wider world. If it is thought to be a common pattern then it will be helpful to add the following macro to khr_df.h
#define KHR_DF_CHANNEL_TYPE(id, q) \
((uint32_t)KHR_DF_CHANNEL_##id | (uint32_t)KHR_DF_SAMPLE_DATATYPE_##q)
This avoids having to remember to add casts everywhere.
@fluppeteer is this a worthwhile addition?
The macros in
khr_df.hwere fixed some time ago to prevent this warning by the addition ofuint32_tcasts.The dfd tests in KTX-Software's
unittests(which should be moved to dfdutils after the cmake build and CI is set up), have several instances of code likewhich triggers the warning. The code uses this pattern when setting the channel type parameter to a constructor used for building test DFDs. I do not know how common this pattern is in the wider world. If it is thought to be a common pattern then it will be helpful to add the following macro to
khr_df.hThis avoids having to remember to add casts everywhere.
@fluppeteer is this a worthwhile addition?