Loginskip to content

December 6th, 2009

Fixes and features

It’s hard to program when you’re dosed down with cold medicine and you keep coughing over and over again until you’re not only sick you’re sick of coughing.  That’s me right now, unfortunately.  Fortunately, I’ve been able to string together enough coherent thoughts and coordinate my fingers sufficiently to upload another update to the not-yet-officially released b36 version of NXC.

Thanks to Xander Soldaat who reported a bug with using enum types as function parameter types. It turned out that you couldn’t use any user-defined named type other than structs (i.e., typedefs and enums).  That defect has been fixed in this update. 

Thanks to ToGi who reported a bug that has existed since NXC came into being.  The internal list of function names that NXC uses was not correctly handling functions with names that differ only by case.  When I added the inline strcmp function to the standard NXC API in the last test release it broke his own function called StrCmp.  Now the list considers case when checking for duplicate names.

While looking at Spiller’s Structs.nxc file this weekend I came across a comment in a struct declaration that read

//you can’t “bool A,B;”?

Yes, that has been a limitation of the syntax supported by NXC for declaring struct members until today.  I had a quick look at the code that processes a struct declaration and it was pretty easy to rework the code a bit so that you can now declare sequential struct members of the same type using a comma-separated list of member names just like you can in Standard C.

Interestingly, I was about to check in all these changes today when I decided to first try to compile Spiller’s program and found that I got many compiler errors.  Doh!  The compiler was saying a struct member type didn’t match the type of the variable I was trying to assign to it.  At first I thought it had something to do with the enum changes I made which involved parameter type handling by the compiler along with a change to a function called CheckTypeCompatibility.  Thank goodness for SVN and the Tortoise SVN tools I use on Windows. With their help I was able to track down a silly mistake on my part in the comma-separated struct member changes and fix it before I checked in the code.

http://bricxcc.sourceforge.net/test_release.zip