aboutsummaryrefslogtreecommitdiff
path: root/src/liblink/sym.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-01-12 15:17:10 -0500
committerRuss Cox <rsc@golang.org>2015-01-14 19:18:05 +0000
commit3be0a0ef6fb80d099aefdba67b68df3b500188bc (patch)
tree8330ebaf4e92310212d0f383179b1065c3d0ca26 /src/liblink/sym.c
parent5bfed7c6c03bf3cc9a0a1d7a0ab056b9dfaae920 (diff)
downloadgo-3be0a0ef6fb80d099aefdba67b68df3b500188bc.tar.xz
liblink: adjustments for c2go conversion
Mostly this is using uint32 instead of int32 for unsigned values like instruction encodings or float32 bit representations, removal of ternary operations, and removal of #defines. Delete sched9.c, because it is not compiled (it is still in the history if we ever need it). Change-Id: I68579cfea679438a27a80416727a9af932b088ae Reviewed-on: https://go-review.googlesource.com/2658 Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/liblink/sym.c')
-rw-r--r--src/liblink/sym.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/liblink/sym.c b/src/liblink/sym.c
index bd85518467..e06837118a 100644
--- a/src/liblink/sym.c
+++ b/src/liblink/sym.c
@@ -57,7 +57,6 @@ static struct {
{"solaris", Hsolaris},
{"windows", Hwindows},
{"windowsgui", Hwindows},
- {0, 0},
};
int
@@ -65,7 +64,7 @@ headtype(char *name)
{
int i;
- for(i=0; headers[i].name; i++)
+ for(i=0; i < nelem(headers); i++)
if(strcmp(name, headers[i].name) == 0)
return headers[i].val;
return -1;
@@ -77,7 +76,7 @@ headstr(int v)
static char buf[20];
int i;
- for(i=0; headers[i].name; i++)
+ for(i=0; i < nelem(headers); i++)
if(v == headers[i].val)
return headers[i].name;
snprint(buf, sizeof buf, "%d", v);