Looking at longwords they are 4 bytes wide and unsigned. The way that the original source used the int's was as a unsigned value so I thought long was appropriate. I'll give normal ints a try .

The classes thing is just me being lazy and not cleaning up lazarus' default template