This is obviously wrong. There are two things wrong with it. Well, I see one of them. Why are you trying to "fix" code that isn't broken? It is a waste of time to try to rewrite all code that wasn't written exactly the way that you would have written it. The reason was that regnos are now unsigned.