Conversation

Notices

  1. Apparently reading a binary file to a char pointer and casting to a struct is a bad thing because different architectures can insert padding between the fields to cause them to align "better" for that machine. Writing is the same. I was writing an RLE binary file (a packed bitmap) this way on x64 and reading on 6502 (Commodore 64) and I guess I got lucky that nothing exploded since all the fields were in order of descending size.

    Sunday, 22-Dec-19 03:43:18 UTC from web
    1. @thismightbeauser Actually I double checked and I guess it's fine since the writer just uses offsets. The reader was coded for the C64 so it doesn't matter if it's portable.

      Sunday, 22-Dec-19 04:30:39 UTC from web