]> Cypherpunks repositories - gostls13.git/commitdiff
cc: change cas to newcase
authorRon Minnich <rminnich@gmail.com>
Wed, 26 Oct 2011 22:27:59 +0000 (15:27 -0700)
committerRuss Cox <rsc@golang.org>
Wed, 26 Oct 2011 22:27:59 +0000 (15:27 -0700)
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

src/cmd/5c/gc.h
src/cmd/6c/gc.h
src/cmd/8c/gc.h
src/cmd/cc/pgen.c
src/cmd/cc/pswt.c

index 5349114f8f6c7a48c05746a51f9940255a7a58dd..8777ec6772b741382f3631766fa7d75c3914acdf 100644 (file)
@@ -304,7 +304,7 @@ void        gpseudo(int, Sym*, Node*);
 int    swcmp(const void*, const void*);
 void   doswit(Node*);
 void   swit1(C1*, int, int32, Node*);
-void   cas(void);
+void   newcase(void);
 void   bitload(Node*, Node*, Node*, Node*, Node*);
 void   bitstore(Node*, Node*, Node*, Node*, Node*);
 int    mulcon(Node*, Node*);
index 0c23b115cd3b247049a4f1054f007fd7995ac9d3..ed2338731f06703de8271b599a8716e920f90be3 100644 (file)
@@ -299,7 +299,7 @@ void        gpseudo(int, Sym*, Node*);
 int    swcmp(const void*, const void*);
 void   doswit(Node*);
 void   swit1(C1*, int, int32, Node*);
-void   cas(void);
+void   newcase(void);
 void   bitload(Node*, Node*, Node*, Node*, Node*);
 void   bitstore(Node*, Node*, Node*, Node*, Node*);
 int32  outstring(char*, int32);
index 32b80e99581722537f510b28589d21dd77b6f865..60ead6b034e829480db12b036818b921153aadf5 100644 (file)
@@ -304,7 +304,7 @@ void        gpseudo(int, Sym*, Node*);
 int    swcmp(const void*, const void*);
 void   doswit(Node*);
 void   swit1(C1*, int, int32, Node*);
-void   cas(void);
+void   newcase(void);
 void   bitload(Node*, Node*, Node*, Node*, Node*);
 void   bitstore(Node*, Node*, Node*, Node*, Node*);
 int32  outstring(char*, int32);
index 0e5e8c059dd32ea557df8dc21bfac182db9c9a2b..e652e2349d6841021702d32bc6291104ba5191e4 100644 (file)
@@ -266,7 +266,7 @@ loop:
                if(cases == C)
                        diag(n, "case/default outside a switch");
                if(l == Z) {
-                       cas();
+                       newcase();
                        cases->val = 0;
                        cases->def = 1;
                        cases->label = pc;
@@ -278,7 +278,7 @@ loop:
                        goto rloop;
                if(l->op == OCONST)
                if(typeword[l->type->etype] && l->type->etype != TIND) {
-                       cas();
+                       newcase();
                        cases->val = l->vconst;
                        cases->def = 0;
                        cases->label = pc;
@@ -303,7 +303,7 @@ loop:
 
                cn = cases;
                cases = C;
-               cas();
+               newcase();
 
                sbc = breakpc;
                breakpc = pc;
index 0e402dea71044f4ffc5cab272febf32405b11334..b94035faa0e737e25057bee65580e8509012b4f4 100644 (file)
@@ -92,7 +92,7 @@ doswit(Node *n)
 }
 
 void
-cas(void)
+newcase(void)
 {
        Case *c;