Hello,
I've been reading the C source code of the video game “Hard Drivin’” (1989) for the Atari ST, and I've stumbled upon this line of code, that doesn't compile under modern C compilers:
long* d;
int* p;
/* ... */
*d++ = *((long*)p)++;
I would like to decompose this line to make it much easier to understand. No need to write “clever” code.
Here what I've come up with, from what I understand the code is trying to do (since it doesn't compile):
long tmp = (long)*p;
++tmp;
*d = tmp;
++d;
If you need to have more context, the line in question in the full source code is visible here: https://github.com/malespiaut/hard-drivin-st/blob/master/src/display.c#L894
Is this correct?
Thank you all for your time!