Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-24 Thread Ian Hulin
Hi Graham, Carl, On Tue 23 Aug 2011 19:34:37 BST, Carl Sorensen wrote: On 8/23/11 12:21 PM, ianhuli...@gmail.com ianhuli...@gmail.com wrote: LGTM Maybe we should have some GOP rules for C++ about this? Only have multiple exit points from routines if you absolutely have to. Multiple

Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-24 Thread David Kastrup
Ian Hulin ianhuli...@gmail.com writes: I'm not asking for a grand re-write on this, but for single-exit to be the preferred style for new code and patches where this would not provoke changes on a GCR (Grand Code Re-write) scale. I disagree. Structured exits decrease the level of nesting and

Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-24 Thread Reinhold Kainhofer
Am Wednesday, 24. August 2011, 10:49:30 schrieben Sie: Hi Graham, Carl, On Tue 23 Aug 2011 19:34:37 BST, Carl Sorensen wrote: On 8/23/11 12:21 PM, ianhuli...@gmail.com ianhuli...@gmail.com wrote: Maybe we should have some GOP rules for C++ about this? Only have multiple exit points from

Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-24 Thread Dan Eble
On 2011-08-24, at 05:10 , Reinhold Kainhofer wrote: Am Wednesday, 24. August 2011, 10:49:30 schrieben Sie: Hi Graham, Carl, On Tue 23 Aug 2011 19:34:37 BST, Carl Sorensen wrote: On 8/23/11 12:21 PM, ianhuli...@gmail.com ianhuli...@gmail.com wrote: Maybe we should have some GOP rules for

Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-24 Thread David Kastrup
Dan Eble d...@faithful.be writes: There can be a run-time performance difference between branching or not branching. For the times you actually care, if you're not going to use compiler-specific features to mark conditions as likely or unlikely, you should test the likely case first so that

Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-24 Thread Han-Wen Nienhuys
On Tue, Aug 23, 2011 at 3:21 PM, ianhuli...@gmail.com wrote: LGTM Maybe we should have some GOP rules for C++ about this? Can we not? Professionally, I work with an enormous style guide, and having a lot of style prescribed needlessly complicates code reviews, because it makes people hammer

Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-24 Thread Dan Eble
On 2011-08-24, at 09:25 , David Kastrup wrote: Modern compilers pay very little attention to how you arrange the source code of equivalent constructs. My experience trying to finagle optimized code out of gcc was more than a year ago, and the compiler was probably a bit older than that (not

Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-23 Thread reinhold . kainhofer
Reviewers: , Message: Please review to get rid of some uninitialized variables. Description: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) Most code that called get_counts simply is like: int line, chr, col, offset = 0;

Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-23 Thread Carl . D . Sorensen
LGTM. Thanks! Carl http://codereview.appspot.com/4940047/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel

Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-23 Thread Graham Percival
On Tue, Aug 23, 2011 at 11:14:06AM +, reinhold.kainho...@gmail.com wrote: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) LGTM Cheers, - Graham ___ lilypond-devel mailing list

Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-23 Thread ianhulin44
LGTM Maybe we should have some GOP rules for C++ about this? Only have multiple exit points from routines if you absolutely have to. Make sure any output parameters are declared and initialized at the top of a routine so that however a routine exits, they are left in a defined state Ian

Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-23 Thread Graham Percival
On Tue, Aug 23, 2011 at 06:21:00PM +, ianhuli...@gmail.com wrote: Maybe we should have some GOP rules for C++ about this? Only have multiple exit points from routines if you absolutely have to. Make sure any output parameters are declared and initialized at the top of a routine so that

Re: Fix uninitialized variables when Source_file::get_counts returns early due to !contains (pos_str0) (issue 4940047)

2011-08-23 Thread Carl Sorensen
On 8/23/11 12:21 PM, ianhuli...@gmail.com ianhuli...@gmail.com wrote: LGTM Maybe we should have some GOP rules for C++ about this? Only have multiple exit points from routines if you absolutely have to. Multiple exit points is a standard idiom of the LilyPond code. Basically, the idiom is