<br><br><div class="gmail_quote">On Wed, Jan 19, 2011 at 12:50 PM, Igor Stasenko <span dir="ltr"><<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On 19 January 2011 21:18, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<br>
><br>
> Hi All,<br>
> 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<br>
> static void recordKeyboardEventCarbon(EventRef event) {<br>
> you write<br>
> static void<br>
> recordKeyboardEventCarbon(EventRef event) {<br>
> This makes it really easy to find the sole definition in text editors and using grep etc.<br>
<br>
</div>grep recordKeyboardEventCarbon.*\{$<br>
<br>
will find anything that having { in the end, so it will skip the<br>
declarations.. (as well as definitions if curly brace are on next line<br>
:)<br></blockquote><div><br></div><div>This gets confused by</div><div><br></div><div> if (myFunction(blah)) {</div><div><br></div><div>and doesn't work in a text editor.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
> 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?<br>
<br>
</div>yeah it's a pain to find the definition using grep.. A good C/C++ IDE<br>
helps a lot in this regard..<br></blockquote><div><br></div><div>and which should one use across Mac OS X, Win32 and Linux? A simple cross-platform convention means not having to choose.</div><div><br></div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
unfortunately not all platforms having decent IDEs.. (Xcode is a piece<br>
of shit ;) ).<br></blockquote><div><br></div><div>It has its place; it has its limitations, as do they all. Hence my motivation for a really simple IDE-independent cross-platform scheme for finding definitions.</div><div>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
currently i using things like this:<br>
<br>
find -type f | xargs grep fooo<br>
<br>
where foo is my search string/pattern :)<br>
<br>
<br>
> best<br>
> Eliot<br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</font></blockquote></div><br>