From 9c98edd1048b608e47f7b3991ef1d5d9bb5dcbc8 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 9 Dec 2014 22:36:42 -0800 Subject: [PATCH] Rename "union" semantics to "typeset". --- plugins/include/convars.inc | 2 +- plugins/include/events.inc | 4 ++-- plugins/include/sdktools_trace.inc | 2 +- plugins/include/sorting.inc | 2 +- plugins/include/timers.inc | 2 +- sourcepawn/compiler/sc.h | 1 + sourcepawn/compiler/sc1.cpp | 10 +++++----- sourcepawn/compiler/sc2.cpp | 2 +- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/plugins/include/convars.inc b/plugins/include/convars.inc index d938823d..bc7c345c 100644 --- a/plugins/include/convars.inc +++ b/plugins/include/convars.inc @@ -445,7 +445,7 @@ native void GetConVarName(Handle convar, char[] name, maxlength); */ native bool SendConVarValue(int client, Handle convar, const char[] value); -union ConVarQueryFinished +typeset ConVarQueryFinished { // Called when a query to retrieve a client's console variable has finished. // diff --git a/plugins/include/events.inc b/plugins/include/events.inc index cf745c0f..1fc61ab8 100644 --- a/plugins/include/events.inc +++ b/plugins/include/events.inc @@ -48,7 +48,7 @@ enum EventHookMode /** * Hook function types for events. */ -union EventHook +typeset EventHook { /** * Called when a game event is fired. @@ -273,4 +273,4 @@ methodmap Event < Handle { public SetString() = SetEventString; public GetName() = GetEventName; public SetBroadcast() = SetEventBroadcast; -} \ No newline at end of file +} diff --git a/plugins/include/sdktools_trace.inc b/plugins/include/sdktools_trace.inc index ce493547..8fe6f53c 100644 --- a/plugins/include/sdktools_trace.inc +++ b/plugins/include/sdktools_trace.inc @@ -110,7 +110,7 @@ enum RayType RayType_Infinite /**< The trace ray will go from the start position to infinity using a direction vector. */ }; -union TraceEntityFilter +typeset TraceEntityFilter { /** * Called on entity filtering. diff --git a/plugins/include/sorting.inc b/plugins/include/sorting.inc index e60bcd6e..03a49081 100644 --- a/plugins/include/sorting.inc +++ b/plugins/include/sorting.inc @@ -123,7 +123,7 @@ native SortCustom1D(array[], array_size, SortFunc1D:sortfunc, Handle:hndl=INVALI * 0 if first is equal to second * 1 if first should go after second */ -union SortFunc2D +typeset SortFunc2D { function int (int[] elem1, int[] elem2, const int[][] array, Handle hndl); function int (char[] elem1, char[] elem2, const char[][] array, Handle hndl); diff --git a/plugins/include/timers.inc b/plugins/include/timers.inc index c5ca0150..ba3f028f 100644 --- a/plugins/include/timers.inc +++ b/plugins/include/timers.inc @@ -45,7 +45,7 @@ /** * Any of the following prototypes will work for a timed function. */ -union Timer +typeset Timer { /** * Called when the timer interval has elapsed. diff --git a/sourcepawn/compiler/sc.h b/sourcepawn/compiler/sc.h index 63912f0c..c9eb0016 100644 --- a/sourcepawn/compiler/sc.h +++ b/sourcepawn/compiler/sc.h @@ -440,6 +440,7 @@ enum TokenKind { tTHEN, tTHIS, tTYPEDEF, + tTYPESET, tUNION, tVAR, tVIEW_AS, diff --git a/sourcepawn/compiler/sc1.cpp b/sourcepawn/compiler/sc1.cpp index aad91220..65875021 100644 --- a/sourcepawn/compiler/sc1.cpp +++ b/sourcepawn/compiler/sc1.cpp @@ -144,7 +144,7 @@ static void dolabel(void); static void doreturn(void); static void dofuncenum(int listmode); static void dotypedef(); -static void dounion(); +static void dotypeset(); static void domethodmap(LayoutSpec spec); static void dobreak(void); static void docont(void); @@ -1526,8 +1526,8 @@ static void parse(void) case tTYPEDEF: dotypedef(); break; - case tUNION: - dounion(); + case tTYPESET: + dotypeset(); break; case tSTRUCT: declstruct(); @@ -4357,8 +4357,8 @@ static void dotypedef() functags_add(def, &type); } -// Unsafe union - only supports function types. This is a transition hack for SP2. -static void dounion() +// Unsafe typeset - only supports function types. This is a transition hack for SP2. +static void dotypeset() { token_ident_t ident; if (!needsymbol(&ident)) diff --git a/sourcepawn/compiler/sc2.cpp b/sourcepawn/compiler/sc2.cpp index 353b0b86..51f13bd5 100644 --- a/sourcepawn/compiler/sc2.cpp +++ b/sourcepawn/compiler/sc2.cpp @@ -1974,7 +1974,7 @@ const char *sc_tokens[] = { "public", "return", "sizeof", "sleep", "static", "stock", "struct", "switch", - "tagof", "*then", "this", "typedef", + "tagof", "*then", "this", "typedef", "typeset", "union", "var", "view_as", "void", "while",