我來自OpenCV的源代碼閱讀爲什麼寫C代碼一樣「而((無效)0,0)」
#define IPP_FILTER_MEDIAN_BORDER(ippType, ippDataType, flavor) \
do \
{ \
if (ippiFilterMedianBorderGetBufferSize(dstRoiSize, maskSize, \
ippDataType, CV_MAT_CN(type), &bufSize) >= 0) \
{ \
Ipp8u * buffer = ippsMalloc_8u(bufSize); \
IppStatus status = ippiFilterMedianBorder_##flavor(src.ptr<ippType>(), (int)src.step, \
dst.ptr<ippType>(), (int)dst.step, dstRoiSize, maskSize, \
ippBorderRepl, (ippType)0, buffer); \
ippsFree(buffer); \
if (status >= 0) \
{ \
CV_IMPL_ADD(CV_IMPL_IPP); \
return; \
} \
} \
setIppErrorStatus(); \
} \
while ((void)0, 0)
我能理解,而(0)在這裏,但爲什麼要加上「 (無效)0" 。
要包括ASCII藝術')0,0)'? – ikegami 2014-11-03 16:25:29
http://stackoverflow.com/questions/4178695/c-what-is-the-purpose-of-casting-to-void – blfuentes 2014-11-03 16:26:32
可能重複[do {...} while(0) - 它有什麼好處對於?](http://stackoverflow.com/questions/257418/do-while-0-what-is-it-good-for) – 2014-11-03 16:27:06