Sunday, September 29, 2024

Another Day Of Coding

Sigh, I must get used to thinking I can finished coding early. I discovered an annoying bug in Prometheus today which took a few panicky hours to fix. The root of the problem was that my units (seconds, millisecs, measures, beats, ticks) are now stored as a byte rather than an (unsigned) long. This, I thought, wouldn't cause much difficulty, but this happened:

a=-1; // a is a type byte
.
.
.
if (a==-1)
{
    (do important things)
}

It took some testing and lots of time to find that those important things didn't get done. Perhaps I needed to cast the literal -1 as a byte in the 'if' statement, but I thought the compiler might do that. It was messy anyway, I shouldn't use negative numbers for unsigned variables, so I used a define of a unique positive value instead.

After that, a trip to the local antique place for a casual day out, a particle of holiday combined with a book search, in the freezing cold. I wore my long leather coat, and Deb her long coat. Someone thought we had come from a Steampunk event, which was apparently happening today at 'Anderton Boat Lift'. Steampunk - the definitely worst sci-fi subgenre.

Perhaps I can start to file Prometheus tomorrow. Onwards.