Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

IPP 6.0: API const correctness

raphaelsp
Beginner
238 Views

Hi,

I have an application that uses the color API on planar images, calling ippiColorTwist32f_16u_P3R in particular. I pass a Ipp16u*[3] as the source, and that compiled fine with IPP 5.3. It does not compile anymore using IPP 6.0 released yesterday. I have noticed a change in the API:

IPPAPI ( IppStatus, ippiColorTwist32f_16u_P3R, ( const Ipp16u* const pSrc[3], int srcStep,
Ipp16u* const pDst[3], int dstStep,
IppiSize roiSize, const Ipp32f twist[3][4] ))
has become

IPPAPI ( IppStatus, ippiColorTwist32f_16u_P3R, ( const Ipp16u* pSrc[3], int srcStep,
Ipp16u* pDst[3], int dstStep,
IppiSize roiSize, const Ipp32f twist[3][4] ))

A const has been dropped from where I think it should have stayed, as the constness of the pointers in the array is no longer guaranteed.

Or am I mistaken and should find a way to circumvent this ?

Thanks,
Raphal

0 Kudos
2 Replies
Vladimir_Dudnik
Employee
238 Views
Hi Rafael,
sorry for the inconvenience. This was done tomaintain consistancy withIPP API look and feel (double const look ugly). Note, we do guarantee pointers will not change but the data pointed by pDst pointer should change of course and the data pointed by pSrc pointer will not change.
Regards,
Vladimir

0 Kudos
raphaelsp
Beginner
238 Views
Quoting - vdudnik
Hi Rafael,
sorry for the inconvenience. This was done tomaintain consistancy withIPP API look and feel (double const look ugly). Note, we do guarantee pointers will not change but the data pointed by pDst pointer should change of course and the data pointed by pSrc pointer will not change.
Regards,
Vladimir

Hi Vladimir,

Thank you for your answer.

The case does probably not deserve my spontaneous combustion, but still, here is my point: double const may not be pretty, but I find it uglier to C-cast my way around an API that breaks (i.e. promotes bad coding style) my perfectly valid code for aesthetic reasons (and it seems that I am not alone: http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.17 ).

Regards,
Raphal

0 Kudos
Reply