|
From: andy p. <bod...@gm...> - 2026-06-08 10:26:28
|
In the day-job we auto-generate code from Simulink. Today it created this horror. I count 18 casts in a row at the beginning. * S-Function (sfix_bitop): '<S230>/BitwiseOperator1' */ tmp_VectorConcatenate_atij[1] = (U8)((U32)((U32)((U32)((U32)((U32)((U32)((U32)((S32)(((FLAG)((S32)((S32)(((FLAG)((S32) ((S32)(((FLAG)((S32)((S32)(tmp_Switch1_bhzg ? 1 : 0) | (S32)(tmp_Switch1_c2ot ? 1 : 0)) != 0)) ? 1 : 0) | (S32) (tmp_tmp_RelationalOperator2_idx_2 ? 1 : 0)) != 0)) ? 1 : 0) | (S32)(tmp_Switch1_dhzf ? 1 : 0)) != 0)) ? 1 : 0)) + (U32)((S32)((S32)(tmp_Switch1_bhzg ? 1 : 0) * 2))) + (U32)((S32)((S32)(tmp_Switch1_c2ot ? 1 : 0) * 4))) + (U32)((S32) ((S32)(tmp_tmp_RelationalOperator2_idx_2 ? 1 : 0) * 8))) + (U32)((S32)((S32)(tmp_Switch1_dhzf ? 1 : 0) * 16))) + (U32)((S32)((((U32)Var1 == Lv1) ? ((S32)1) : ((S32)0)) * 32))) + (U32)((S32)((((U32) Var1 == Lv2) ? ((S32)1) : ((S32)0)) * 64)))); -- atp "A motorcycle is a bicycle with a pandemonium attachment and is designed for the especial use of mechanical geniuses, daredevils and lunatics." — George Fitch, Atlanta Constitution Newspaper, 1912 |