Aurora: August 2006 Archives

August 2006 Archives

Lint hidden in the PSDK

| | Comments (6)

I remember back in the day when I started programming C++ on the IBM computer there were a plethora of compilers out there. Borland Turbo C++, Visual Studio, djgpp and my favourite Watcom C++. Watcom was my favourite because it's optimizer and it's powerful inline assembly features allowing you to specify exactly where arguments were passed in registers and dirty registers. The debugger was also good (at least in my memory). We used a freeware extender for flat mode instead of the one supplied with Watcom (which you had to pay money for).

Writing portable code

| | Comments (0)

Here are some tips for writing portable code. Some of them may apply to your project and some might not, think before you choose and if you're going to make any "stupid" decisions, make sure that you are making them deliberately and with open eyes. It might be ok for your project. And of course if you're never ever cross your heart and hope to die going to port your code to any other platform than the current (you lucky dog) then just disregard everything in here and go home earlier and enjoy a cool beer on the balcony, in short do something better than sit in the office all day.

Perforce diff and patch

| | Comments (2)

I'm sitting here in my apartment amongst boxes and boxes, still unpacked from moving from San Diego. Moving is always a pain and this time is no exception. Packing all your stuff takes some time and unpacking takes even more time since you have to figure out where to place stuff, now in the new place you don't really know where everything goes. Speaking of packing and unpacking (nice dissolve, eh? :) doing the same for your changelists in perforce should be a breeze. The command 'p4 diff' actually outputs some interesting information, amongst them a full description of the differences of the currently checked out files. Unfortunately the output is not trivial to reapply again. Well to the rescue comes two little python scripts!

One of many wierd constructs in C++ is the ellipsis construct (...). That's a way to specify that there might come a variable amount of extra parameters after the one that you give. Underneath there is no real magic, the parameters that you specify are pushed onto the stack and then inside the function you can traverse the stack. There are some catches with this though. In this little article we'll explore how the ... works and what not to do.