Commit 1bc1caa8 authored by Ron Minnich's avatar Ron Minnich Committed by Russ Cox

cc: change cas to newcase

Change the name of cas() in cc to newcase() to avoid a NIX conflict.
cas() is used in cc to create a new Case struct. There is a name
conflict in that cas() is a commonly-used
name for compare and swap. Since cas() is only used internally
in the compiler in 3 places, change the name to avoid a wider
conflict with the NIX runtime. This issue might well come up on
other OSes in the future anyway, as the name is fairly common.

R=rsc
CC=golang-dev
https://golang.org/cl/5294071
parent 8658b36b
...@@ -304,7 +304,7 @@ void gpseudo(int, Sym*, Node*); ...@@ -304,7 +304,7 @@ void gpseudo(int, Sym*, Node*);
int swcmp(const void*, const void*); int swcmp(const void*, const void*);
void doswit(Node*); void doswit(Node*);
void swit1(C1*, int, int32, Node*); void swit1(C1*, int, int32, Node*);
void cas(void); void newcase(void);
void bitload(Node*, Node*, Node*, Node*, Node*); void bitload(Node*, Node*, Node*, Node*, Node*);
void bitstore(Node*, Node*, Node*, Node*, Node*); void bitstore(Node*, Node*, Node*, Node*, Node*);
int mulcon(Node*, Node*); int mulcon(Node*, Node*);
......
...@@ -299,7 +299,7 @@ void gpseudo(int, Sym*, Node*); ...@@ -299,7 +299,7 @@ void gpseudo(int, Sym*, Node*);
int swcmp(const void*, const void*); int swcmp(const void*, const void*);
void doswit(Node*); void doswit(Node*);
void swit1(C1*, int, int32, Node*); void swit1(C1*, int, int32, Node*);
void cas(void); void newcase(void);
void bitload(Node*, Node*, Node*, Node*, Node*); void bitload(Node*, Node*, Node*, Node*, Node*);
void bitstore(Node*, Node*, Node*, Node*, Node*); void bitstore(Node*, Node*, Node*, Node*, Node*);
int32 outstring(char*, int32); int32 outstring(char*, int32);
......
...@@ -304,7 +304,7 @@ void gpseudo(int, Sym*, Node*); ...@@ -304,7 +304,7 @@ void gpseudo(int, Sym*, Node*);
int swcmp(const void*, const void*); int swcmp(const void*, const void*);
void doswit(Node*); void doswit(Node*);
void swit1(C1*, int, int32, Node*); void swit1(C1*, int, int32, Node*);
void cas(void); void newcase(void);
void bitload(Node*, Node*, Node*, Node*, Node*); void bitload(Node*, Node*, Node*, Node*, Node*);
void bitstore(Node*, Node*, Node*, Node*, Node*); void bitstore(Node*, Node*, Node*, Node*, Node*);
int32 outstring(char*, int32); int32 outstring(char*, int32);
......
...@@ -266,7 +266,7 @@ loop: ...@@ -266,7 +266,7 @@ loop:
if(cases == C) if(cases == C)
diag(n, "case/default outside a switch"); diag(n, "case/default outside a switch");
if(l == Z) { if(l == Z) {
cas(); newcase();
cases->val = 0; cases->val = 0;
cases->def = 1; cases->def = 1;
cases->label = pc; cases->label = pc;
...@@ -278,7 +278,7 @@ loop: ...@@ -278,7 +278,7 @@ loop:
goto rloop; goto rloop;
if(l->op == OCONST) if(l->op == OCONST)
if(typeword[l->type->etype] && l->type->etype != TIND) { if(typeword[l->type->etype] && l->type->etype != TIND) {
cas(); newcase();
cases->val = l->vconst; cases->val = l->vconst;
cases->def = 0; cases->def = 0;
cases->label = pc; cases->label = pc;
...@@ -303,7 +303,7 @@ loop: ...@@ -303,7 +303,7 @@ loop:
cn = cases; cn = cases;
cases = C; cases = C;
cas(); newcase();
sbc = breakpc; sbc = breakpc;
breakpc = pc; breakpc = pc;
......
...@@ -92,7 +92,7 @@ doswit(Node *n) ...@@ -92,7 +92,7 @@ doswit(Node *n)
} }
void void
cas(void) newcase(void)
{ {
Case *c; Case *c;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment