c99-to-c89 icon indicating copy to clipboard operation
c99-to-c89 copied to clipboard

Casts in enum expressions make the converter fail an assertion

Open mstorsjo opened this issue 13 years ago • 4 comments

$subject, a test case (both a simple one and the full-blown one that triggered it in the user case) exists in https://github.com/mstorsjo/c99-to-c89/commit/enum-cast.

mstorsjo avatar Jan 25 '13 20:01 mstorsjo

Any progress on resolving this issue? I'm having problems with this as well and would appreciate a response. Thanks!

zachjacobs avatar May 30 '13 14:05 zachjacobs

I face this issue while compiling ffmpeg qsv module:

qsv.c
Assertion failed: cache2.n[0] == 2, file convert.c, line 546

I can workaround this by replacing MFX_MAKEFOURCC define with actual values:

#define MFX_MAKEFOURCC(A,B,C,D)    ((((int)A))+(((int)B)<<8)+(((int)C)<<16)+(((int)D)<<24))

    MFX_FOURCC_YV12         = MFX_MAKEFOURCC('Y','V','1','2'),

lieff avatar Feb 17 '16 15:02 lieff

Thank @lieff show me the way to modify mfxcommon.h: #define MFX_MAKEFOURCC(A,B,C,D) (((D*256+C)*256+B)*256+A) That passed the c99-to-c89 converter!

yihhann avatar May 15 '17 08:05 yihhann

Glad to hear!

lieff avatar May 16 '17 18:05 lieff