<br><br><div class="gmail_quote">On Wed, Jan 19, 2011 at 12:50 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</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 &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi All,<br>
&gt;     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>

&gt; static void recordKeyboardEventCarbon(EventRef event) {<br>
&gt; you write<br>
&gt; static void<br>
&gt; recordKeyboardEventCarbon(EventRef event) {<br>
&gt; 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&#39;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>
&gt; 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&#39;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>
&gt; best<br>
&gt; Eliot<br>
&gt;<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
</font></blockquote></div><br>