Module Name:    src
Committed By:   uwe
Date:           Mon Apr 17 17:44:48 UTC 2017

Modified Files:
        src/sys/lib/libsa: loadfile_elf32.c

Log Message:
Don't hide first = 1 assignment inside for(), that just obscures the
loop.  Same object code is generated.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/lib/libsa/loadfile_elf32.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libsa/loadfile_elf32.c
diff -u src/sys/lib/libsa/loadfile_elf32.c:1.36 src/sys/lib/libsa/loadfile_elf32.c:1.37
--- src/sys/lib/libsa/loadfile_elf32.c:1.36	Thu Feb 23 12:13:59 2017
+++ src/sys/lib/libsa/loadfile_elf32.c	Mon Apr 17 17:44:48 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: loadfile_elf32.c,v 1.36 2017/02/23 12:13:59 nonaka Exp $ */
+/* $NetBSD: loadfile_elf32.c,v 1.37 2017/04/17 17:44:48 uwe Exp $ */
 
 /*
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -321,7 +321,8 @@ ELFNAMEEND(loadfile)(int fd, Elf_Ehdr *e
 		goto freephdr;
 	}
 
-	for (first = 1, i = 0; i < elf->e_phnum; i++) {
+	first = 1;
+	for (i = 0; i < elf->e_phnum; i++) {
 		internalize_phdr(elf->e_ident[EI_DATA], &phdr[i]);
 
 #ifndef MD_LOADSEG /* Allow processor ABI specific segment loads */
@@ -471,7 +472,8 @@ ELFNAMEEND(loadfile)(int fd, Elf_Ehdr *e
 		 * string table that isn't referenced by a symbol
 		 * table.
 		 */
-		for (first = 1, i = 0; i < elf->e_shnum; i++) {
+		first = 1;
+		for (i = 0; i < elf->e_shnum; i++) {
 			if (i == elf->e_shstrndx) {
 				/* already loaded this section */
 				continue;

Reply via email to