Friday, August 16, 2024

Fixed an old program that broke when we changed to 64bits.

It is an old C program that I have wanted to work on for years now but the error in the data handling was beyond my skill to fix. What brought it to mind was that it was very similar to the workflow program in python that I am working on right now. Makes me want to go back and get this working now too.  Like the python program it uses small separate programs I called widgets to add features to the system. 

I did identify the problem and could replicate it using a test harness but had no clue how to fix it.  I gave the file to claude and the gdb debugger info where it crashed and the AI knew right away what was wrong and gave me a couple of examples of what to fix and I fixed it. I had to change int to intptr_t. Still not sure what that means.  

Here is my program running now.


Here is was the beautiful site of the data.c test function finally working after years of being bad. 


And this is what made it so hard to figure out what was going on.  As the basis of the program I wrote a data holder that was simultaneously a string, an int, a float, and a  hex data type. It remembered what got set first and used that as the basis to switch to the other values if you asked for a different datatype from the object.  I used this as the basis of the node data structure which was everything in this system. 









No comments:

Post a Comment