From: Haavard Skinnemoen Date: Sun, 15 Jun 2008 16:56:56 +0200 Subject: [U-Boot-Users] Patch to clean up syntax highlighting In-Reply-To: <48526499.6000804@ge.com> References: <48515BDA.8080404@harris.com> <4851EFA3.3010505@gmail.com> <48526499.6000804@ge.com> Message-ID: <20080615165656.0b693611@siona.local> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 13 Jun 2008 08:14:17 -0400 Jerry Van Baren wrote: > Looking at the source code, its pretty ugly already. Your change > doesn't make it any more ugly and it could be argued that it is slightly > less ugly (your patch removes the duplication of the "if( (...)" > statement). I also don't see any alternative that would make the code > beautiful. :-( Actually, I think the following would be slightly cleaner: #ifdef CONFIG_HAS_UID # define HAS_UID (1) #else # define HAS_UID (0) #endif /* ... */ if (((strcmp (name, "serial#") == 0) && (!HAS_UID || (flag != 0xdeaf4add))) || ((strcmp (name, "ethaddr") == 0) (I may have miscounted the parentheses though...I certainly see the need for working syntax highlighting on this code ;-) Haavard