[Vm-dev] "small" proposal for platform code in the upcoming VMs

Igor Stasenko siguctua at gmail.com
Wed Jan 19 20:50:01 UTC 2011


On 19 January 2011 21:18, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>
> Hi All,
>     one C coding convention I think is extremely useful for finding definitions is to always put the name of a function (not its forward declaration but its definition) on a newline, so that instead of writing e.g
> static void recordKeyboardEventCarbon(EventRef event) {
> you write
> static void
> recordKeyboardEventCarbon(EventRef event) {
> This makes it really easy to find the sole definition in text editors and using grep etc.

grep recordKeyboardEventCarbon.*\{$

will find anything that having { in the end, so it will skip the
declarations.. (as well as definitions if curly brace are on next line
:)

> If people feel they could live with this convention could I be allowed to make this change throughout the platform code base after code freeze and before the release so that this convention will be available to us all in the future?

yeah it's a pain to find the definition using grep.. A good C/C++ IDE
helps a lot in this regard..
unfortunately not all platforms having decent IDEs.. (Xcode is a piece
of shit ;) ).
currently i using things like this:

find -type f | xargs grep fooo

where foo is my search string/pattern :)


> best
> Eliot
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list