Thanks a lot for the comments guys! Here's a revised patch.. no more C++ style comments, no more inline variable declarations and no more useless casting!
I think it should work pretty well. I'll keep you updated with anything else I try soon as promised!
Philippe