diff --git a/sc2/content/defgrp.dat b/sc2/content/defgrp.dat index a1927a635..4e86979e9 100644 Binary files a/sc2/content/defgrp.dat and b/sc2/content/defgrp.dat differ diff --git a/sc2/content/randgrp.dat b/sc2/content/randgrp.dat index 92febcd74..e8004882c 100644 Binary files a/sc2/content/randgrp.dat and b/sc2/content/randgrp.dat differ diff --git a/sc2/content/starinfo.dat b/sc2/content/starinfo.dat index 3256fac5d..353217abe 100644 Binary files a/sc2/content/starinfo.dat and b/sc2/content/starinfo.dat differ diff --git a/sc2/src/msvc++/Starcon2.dsp b/sc2/src/msvc++/Starcon2.dsp index 14072d2f9..0f775e320 100644 --- a/sc2/src/msvc++/Starcon2.dsp +++ b/sc2/src/msvc++/Starcon2.dsp @@ -574,10 +574,6 @@ SOURCE=..\sc2code\libs\timelib.h # End Source File # Begin Source File -SOURCE=..\sc2code\libs\vargs.h -# End Source File -# Begin Source File - SOURCE=..\sc2code\libs\vidlib.h # End Source File # End Group diff --git a/sc2/src/sc2code/coderes.h b/sc2/src/sc2code/coderes.h index cde94a87c..2954a8272 100644 --- a/sc2/src/sc2code/coderes.h +++ b/sc2/src/sc2code/coderes.h @@ -20,7 +20,6 @@ #define _CODERES_H #include "reslib.h" -#include "vargs.h" extern MEM_HANDLE LoadCodeResFile (PSTR pStr); extern BOOLEAN InstallCodeResType (COUNT code_type); diff --git a/sc2/src/sc2code/comm/chmmr/chmmrc.c b/sc2/src/sc2code/comm/chmmr/chmmrc.c index b070d3927..f86f657ca 100644 --- a/sc2/src/sc2code/comm/chmmr/chmmrc.c +++ b/sc2/src/sc2code/comm/chmmr/chmmrc.c @@ -515,7 +515,7 @@ Intro (void) construct_response (shared_phrase_buf, i_am_captain0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), i_am_captain1, GLOBAL_SIS (ShipName), i_am_captain2, diff --git a/sc2/src/sc2code/comm/comandr/comandr.c b/sc2/src/sc2code/comm/comandr/comandr.c index 04c45d110..36f61eded 100644 --- a/sc2/src/sc2code/comm/comandr/comandr.c +++ b/sc2/src/sc2code/comm/comandr/comandr.c @@ -127,7 +127,7 @@ ByeBye (RESPONSE_REF R) construct_response (shared_phrase_buf, name_40, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), name_41, 0); @@ -524,7 +524,7 @@ RevealSelf (RESPONSE_REF R) { construct_response (shared_phrase_buf, we_are_vindicator0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), we_are_vindicator1, GLOBAL_SIS (ShipName), we_are_vindicator2, @@ -630,7 +630,7 @@ Intro (void) construct_response ( shared_phrase_buf, no_but_well_help0, - (vararg_dcl)GLOBAL_SIS (ShipName), + GLOBAL_SIS (ShipName), no_but_well_help1, 0 ); diff --git a/sc2/src/sc2code/comm/melnorm/melnorm.c b/sc2/src/sc2code/comm/melnorm/melnorm.c index f2a132a1e..577744e6e 100644 --- a/sc2/src/sc2code/comm/melnorm/melnorm.c +++ b/sc2/src/sc2code/comm/melnorm/melnorm.c @@ -1398,7 +1398,7 @@ yack0_respond (void) construct_response ( shared_phrase_buf, we_are_from_alliance0, - (vararg_dcl)buf, + buf, (RESPONSE_REF)-1 ); DoResponsePhrase (we_are_from_alliance0, DoFirstMeeting, shared_phrase_buf); diff --git a/sc2/src/sc2code/comm/orz/orzc.c b/sc2/src/sc2code/comm/orz/orzc.c index 0b71881a3..42f88085b 100644 --- a/sc2/src/sc2code/comm/orz/orzc.c +++ b/sc2/src/sc2code/comm/orz/orzc.c @@ -521,7 +521,7 @@ OrzNeutral (RESPONSE_REF R) { construct_response (shared_phrase_buf, we_are_vindicator0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), we_are_vindicator1, GLOBAL_SIS (ShipName), we_are_vindicator2, diff --git a/sc2/src/sc2code/comm/pkunk/pkunkc.c b/sc2/src/sc2code/comm/pkunk/pkunkc.c index 7232ccd1b..e14291388 100644 --- a/sc2/src/sc2code/comm/pkunk/pkunkc.c +++ b/sc2/src/sc2code/comm/pkunk/pkunkc.c @@ -294,7 +294,7 @@ DiscussConquer (RESPONSE_REF R) construct_response ( shared_phrase_buf, conquer_because_1, - (vararg_dcl)buf, + buf, (RESPONSE_REF)-1 ); DoResponsePhrase (conquer_because_1, DiscussConquer, shared_phrase_buf); @@ -607,7 +607,7 @@ PkunkHome (RESPONSE_REF R) { construct_response (shared_phrase_buf, we_are_vindicator0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), we_are_vindicator1, GLOBAL_SIS (ShipName), we_are_vindicator2, diff --git a/sc2/src/sc2code/comm/shofixt/shofixt.c b/sc2/src/sc2code/comm/shofixt/shofixt.c index db55d76f5..4e45c9020 100644 --- a/sc2/src/sc2code/comm/shofixt/shofixt.c +++ b/sc2/src/sc2code/comm/shofixt/shofixt.c @@ -329,7 +329,7 @@ RealizeMistake (RESPONSE_REF R) construct_response ( shared_phrase_buf, i_am_captain0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), i_am_captain1, buf, i_am_captain2, diff --git a/sc2/src/sc2code/comm/slyhome/slyhome.c b/sc2/src/sc2code/comm/slyhome/slyhome.c index 4197ac6a6..5e2267065 100644 --- a/sc2/src/sc2code/comm/slyhome/slyhome.c +++ b/sc2/src/sc2code/comm/slyhome/slyhome.c @@ -723,7 +723,7 @@ HomeWorld (RESPONSE_REF R) case 0: construct_response (shared_phrase_buf, we_are_us0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), we_are_us1, GLOBAL_SIS (ShipName), we_are_us2, diff --git a/sc2/src/sc2code/comm/spahome/spahome.c b/sc2/src/sc2code/comm/spahome/spahome.c index 4ee97245d..83bb3958f 100644 --- a/sc2/src/sc2code/comm/spahome/spahome.c +++ b/sc2/src/sc2code/comm/spahome/spahome.c @@ -853,7 +853,7 @@ SpathiPassword (RESPONSE_REF R) { construct_response (shared_phrase_buf, we_are_vindicator0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), we_are_vindicator1, GLOBAL_SIS (ShipName), we_are_vindicator2, diff --git a/sc2/src/sc2code/comm/starbas/starbas.c b/sc2/src/sc2code/comm/starbas/starbas.c index e14e02810..a0bd5a2ef 100644 --- a/sc2/src/sc2code/comm/starbas/starbas.c +++ b/sc2/src/sc2code/comm/starbas/starbas.c @@ -917,7 +917,7 @@ TellStarBase (RESPONSE_REF R) construct_response ( buf0, tell_me_about_modules0, - (vararg_dcl)GLOBAL_SIS (ShipName), + GLOBAL_SIS (ShipName), tell_me_about_modules1, 0 ); @@ -933,7 +933,7 @@ TellStarBase (RESPONSE_REF R) construct_response ( shared_phrase_buf, tell_me_about_fuel0, - (vararg_dcl)GLOBAL_SIS (ShipName), + GLOBAL_SIS (ShipName), tell_me_about_fuel1, 0 ); diff --git a/sc2/src/sc2code/comm/supox/supoxc.c b/sc2/src/sc2code/comm/supox/supoxc.c index cf27e0903..f11b48c86 100644 --- a/sc2/src/sc2code/comm/supox/supoxc.c +++ b/sc2/src/sc2code/comm/supox/supoxc.c @@ -406,7 +406,7 @@ NeutralSupox (RESPONSE_REF R) case 0: construct_response (shared_phrase_buf, i_am0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), i_am1, 0); pStr[0] = i_am0; @@ -415,7 +415,7 @@ NeutralSupox (RESPONSE_REF R) case 1: construct_response (shared_phrase_buf, my_ship0, - (vararg_dcl)GLOBAL_SIS (ShipName), + GLOBAL_SIS (ShipName), my_ship1, 0); pStr[0] = my_ship0; @@ -429,7 +429,7 @@ NeutralSupox (RESPONSE_REF R) construct_response ( shared_phrase_buf, from_alliance0, - (vararg_dcl)buf, + buf, from_alliance1, 0 ); diff --git a/sc2/src/sc2code/comm/syreen/syreenc.c b/sc2/src/sc2code/comm/syreen/syreenc.c index dac84402f..a2d90d5c1 100644 --- a/sc2/src/sc2code/comm/syreen/syreenc.c +++ b/sc2/src/sc2code/comm/syreen/syreenc.c @@ -870,7 +870,7 @@ Intro (void) { construct_response (shared_phrase_buf, we_are_vindicator0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), we_are_vindicator1, GLOBAL_SIS (ShipName), we_are_vindicator2, diff --git a/sc2/src/sc2code/comm/talkpet/talkpet.c b/sc2/src/sc2code/comm/talkpet/talkpet.c index bd2ef62cf..96b69f7e7 100644 --- a/sc2/src/sc2code/comm/talkpet/talkpet.c +++ b/sc2/src/sc2code/comm/talkpet/talkpet.c @@ -491,7 +491,7 @@ CompelPlayer (RESPONSE_REF R) construct_response ( shared_phrase_buf, we_are_vindicator0, - (vararg_dcl)GLOBAL_SIS (ShipName), + GLOBAL_SIS (ShipName), we_are_vindicator1, 0 ); diff --git a/sc2/src/sc2code/comm/umgah/umgahc.c b/sc2/src/sc2code/comm/umgah/umgahc.c index f938163fd..deb39b416 100644 --- a/sc2/src/sc2code/comm/umgah/umgahc.c +++ b/sc2/src/sc2code/comm/umgah/umgahc.c @@ -350,7 +350,7 @@ Zombies (RESPONSE_REF R) { construct_response (shared_phrase_buf, we_vindicator0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), we_vindicator1, GLOBAL_SIS (ShipName), we_vindicator2, diff --git a/sc2/src/sc2code/comm/utwig/utwigc.c b/sc2/src/sc2code/comm/utwig/utwigc.c index e87a321b4..c4eb2191b 100644 --- a/sc2/src/sc2code/comm/utwig/utwigc.c +++ b/sc2/src/sc2code/comm/utwig/utwigc.c @@ -528,7 +528,7 @@ NeutralUtwig (RESPONSE_REF R) construct_response ( shared_phrase_buf, we_are_vindicator0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), we_are_vindicator1, buf, we_are_vindicator2, diff --git a/sc2/src/sc2code/comm/yehat/yehatc.c b/sc2/src/sc2code/comm/yehat/yehatc.c index eb0b5fee6..7a69a299e 100644 --- a/sc2/src/sc2code/comm/yehat/yehatc.c +++ b/sc2/src/sc2code/comm/yehat/yehatc.c @@ -360,7 +360,7 @@ YehatHome (RESPONSE_REF R) construct_response ( shared_phrase_buf, i_demand_you_ally_homeworld0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), i_demand_you_ally_homeworld1, buf, i_demand_you_ally_homeworld2, @@ -486,7 +486,7 @@ YehatSpace (RESPONSE_REF R) construct_response ( shared_phrase_buf, i_demand_you_ally_space0, - (vararg_dcl)GLOBAL_SIS (CommanderName), + GLOBAL_SIS (CommanderName), i_demand_you_ally_space1, GLOBAL_SIS (ShipName), i_demand_you_ally_space2, diff --git a/sc2/src/sc2code/comm/zoqfot/zoqfotc.c b/sc2/src/sc2code/comm/zoqfot/zoqfotc.c index 0ad0f8c03..167e04035 100644 --- a/sc2/src/sc2code/comm/zoqfot/zoqfotc.c +++ b/sc2/src/sc2code/comm/zoqfot/zoqfotc.c @@ -465,7 +465,7 @@ AquaintZoqFot (RESPONSE_REF R) construct_response ( shared_phrase_buf, we_are_vindicator0, - (vararg_dcl)buf, + buf, we_are_vindicator1, GLOBAL_SIS (ShipName), we_are_vindicator2, diff --git a/sc2/src/sc2code/commglue.c b/sc2/src/sc2code/commglue.c index 5c69e237f..764304a4c 100644 --- a/sc2/src/sc2code/commglue.c +++ b/sc2/src/sc2code/commglue.c @@ -19,6 +19,7 @@ #include "starcon.h" #include "commglue.h" #include "libs/sound/trackplayer.h" +#include void NPCPhrase (int index) @@ -106,13 +107,12 @@ GetAllianceName (UNICODE *buf, RESPONSE_REF name_1) } void -construct_response (UNICODE *buf, RESPONSE_REF R, vararg_dcl c_args, - ...) +construct_response (UNICODE *buf, RESPONSE_REF R, ...) { UNICODE *name; - vararg_list vlist; + va_list vlist; - vararg_start (vlist, c_args); + va_start (vlist, R); do { COUNT len; @@ -122,18 +122,18 @@ construct_response (UNICODE *buf, RESPONSE_REF R, vararg_dcl c_args, wstrcpy (buf, (UNICODE *)GetStringAddress (S)); len = wstrlen (buf); buf += len; - name = vararg_val (vlist, UNICODE *); + name = va_arg (vlist, UNICODE *); if (name) { len = wstrlen (name); wstrncpy (buf, name, len); buf += len; - if ((R = vararg_val (vlist, RESPONSE_REF)) == (RESPONSE_REF)-1) + if ((R = va_arg (vlist, RESPONSE_REF)) == (RESPONSE_REF)-1) name = 0; } } while (name); - vararg_end (vlist); + va_end (vlist); *buf = '\0'; } diff --git a/sc2/src/sc2code/commglue.h b/sc2/src/sc2code/commglue.h index b98843e3c..72ba1a726 100644 --- a/sc2/src/sc2code/commglue.h +++ b/sc2/src/sc2code/commglue.h @@ -19,8 +19,6 @@ #ifndef _COMMGLUE_H #define _COMMGLUE_H -#include "libs/vargs.h" - extern LOCDATA CommData; extern int cur_comm; extern UNICODE shared_phrase_buf[256]; @@ -61,8 +59,7 @@ extern void NPCPhrase (int index); extern void GetAllianceName (UNICODE *buf, RESPONSE_REF name_1); -extern void construct_response (UNICODE *buf, RESPONSE_REF R, vararg_dcl - c_args, ...); +extern void construct_response (UNICODE *buf, RESPONSE_REF R, ...); extern LOCDATAPTR init_race (RESOURCE comm_id); diff --git a/sc2/src/sc2code/libs/Makefile.am b/sc2/src/sc2code/libs/Makefile.am index 1482c4e56..bcfbe398a 100644 --- a/sc2/src/sc2code/libs/Makefile.am +++ b/sc2/src/sc2code/libs/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = decomp graphics input math memory resource sound strings \ noinst_HEADERS = \ compiler.h declib.h gfxlib.h inplib.h mathlib.h \ memlib.h reslib.h sndlib.h strlib.h tasklib.h threadlib.h \ - timelib.h vargs.h vidlib.h misc.h + timelib.h vidlib.h misc.h INCLUDES = @SDL_CFLAGS@ \ -I$(top_srcdir)/src \ diff --git a/sc2/src/sc2code/libs/vargs.h b/sc2/src/sc2code/libs/vargs.h deleted file mode 100644 index 0c45a070e..000000000 --- a/sc2/src/sc2code/libs/vargs.h +++ /dev/null @@ -1,45 +0,0 @@ -//Copyright Paul Reiche, Fred Ford. 1992-2002 - -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef _VARARGS_H -#define _VARARGS_H - -typedef char *vararg_list; -typedef char *vararg_dcl; -#define vararg_start(list,alist) (list) = (vararg_list)&(alist) -#define vararg_end(list) -#define vararg_val(list,type) \ - (sizeof (type) >= sizeof (int) ? \ - (((type *)((list) += sizeof (type)))[-1]) : \ - ((type)((int *)((list) += sizeof (int)))[-1])) -#define vararg_farval(list,type) \ - (sizeof (type) >= sizeof (int) ? \ - (((type *)((list) += sizeof (type)))[-1]) : \ - (((int *)((list) += sizeof (int)))[-1])) -#define begin_arg_stack(name) char name[0 -#define add_to_arg_stack(type) + (sizeof (type) > sizeof (int) ? \ - sizeof (type) : sizeof (int)) -#define end_arg_stack ]; -#define arg_stack_push(list,type,val) \ - (sizeof (type) >= sizeof (int) ? \ - (((type *)((list) += sizeof (type)))[-1] = (val)) : \ - (((int *)((list) += sizeof (int)))[-1] = (int)(val))) - - -#endif /* _VARARGS_H */ -