From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Wed, 08 Apr 2009 22:12:08 -0400 Subject: [U-Boot] use of C99 In-Reply-To: <139940.41801.qm@web31807.mail.mud.yahoo.com> References: <139940.41801.qm@web31807.mail.mud.yahoo.com> Message-ID: <49DD5978.3090706@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Pink Boy wrote: [snip] > Pops out of hole, looks at shadow, 6 more weeks till we ship... > > Um... my feeling is that if one is going to declare a variable > inside a #ifdef then that variable ought to be called something > like > > int indx_CONFIG_COOL_FEATURE > > and > > u32 indx_CONFIG_HOT_FEATURE > > Matt Harper > Tehama Wireless EWWWWwww. Quoting from Documentation/CodingStyle: ------------------------------------------------------------------------ Chapter 4: Naming C is a Spartan language, and so should your naming be. Unlike Modula-2 and Pascal programmers, C programmers do not use cute names like ThisVariableIsATemporaryCounter. A C programmer would call that variable "tmp", which is much easier to write, and not the least more difficult to understand. [snip] LOCAL variable names should be short, and to the point. If you have some random integer loop counter, it should probably be called "i". Calling it "loop_counter" is non-productive, if there is no chance of it being mis-understood. Similarly, "tmp" can be just about any type of variable that is used to hold a temporary value. If you are afraid to mix up your local variable names, you have another problem, which is called the function-growth-hormone-imbalance syndrome. See chapter 6 (Functions). ------------------------------------------------------------------------ Best regards, gvb