File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -114,15 +114,20 @@ main(int UNUSED(argc), char **argv)
114
114
/*
115
115
* Big Endian
116
116
*/
117
+ /*
118
+ * Use casts to (HALF *) because SWAP_HALF_IN_B* might expand to
119
+ * a simple assignment and SWAP_HALF_IN_FILEPOS might get a
120
+ * (HALF *) and a (FILEPOS *) which are not assignment-compatible.
121
+ */
117
122
if (fileposlen == 64 ) {
118
123
printf ("#define SWAP_HALF_IN_FILEPOS(dest, src) \\\n"
119
- "\tSWAP_HALF_IN_B64(dest, src)\n" );
124
+ "\tSWAP_HALF_IN_B64((HALF *) dest, (HALF *) src)\n" );
120
125
} else if (fileposlen == 32 ) {
121
126
printf ("#define SWAP_HALF_IN_FILEPOS(dest, src) \\\n"
122
- "\tSWAP_HALF_IN_B32(dest, src)\n" );
127
+ "\tSWAP_HALF_IN_B32((HALF *) dest, (HALF *) src)\n" );
123
128
} else if (fileposlen %BASEB == 0 ) {
124
129
printf ("#define SWAP_HALF_IN_FILEPOS(dest, src) \\\n"
125
- "\tswap_HALFs(dest, src, %d)\n" ,
130
+ "\tswap_HALFs((HALF *) dest, (HALF *) src, %d)\n" ,
126
131
fileposlen /BASEB );
127
132
} else {
128
133
fprintf (stderr , "%s: unexpected BIG_ENDIAN FILEPOS bit size: %d\n" ,
You can’t perform that action at this time.
0 commit comments