Skip to content

Commit

Permalink
scripts: consistent initialization of memory member
Browse files Browse the repository at this point in the history
Some classes did set it to nullptr and others did not.
For the sake of consistency, initialize it explicitly everywhere.
  • Loading branch information
jengelh committed Nov 3, 2024
1 parent 46fcae0 commit 7fa31b3
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 41 deletions.
56 changes: 28 additions & 28 deletions scripts/AIGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ struct pest_data {

class Pest final : public BaseObjScript {
private:
pest_data *memory;
pest_data *memory = nullptr;
void DoInit(int me_handle);

public:
Expand Down Expand Up @@ -575,7 +575,7 @@ class Lance final : public BaseObjScript {
private:
void DoInit(int me_handle);
void DoFrame(int me_handle);
lance_data *memory;
lance_data *memory = nullptr;

public:
Lance() {}
Expand All @@ -593,7 +593,7 @@ struct flak_data {

class Flak final : public BaseObjScript {
private:
flak_data *memory;
flak_data *memory = nullptr;
void DoInit(int me_handle);

public:
Expand Down Expand Up @@ -625,7 +625,7 @@ struct supertrooper_data {

class SuperTrooper final : public BaseObjScript {
private:
supertrooper_data *memory;
supertrooper_data *memory = nullptr;
void DoInit(int me_handle);

public:
Expand Down Expand Up @@ -668,7 +668,7 @@ struct sparky_data {

class Sparky final : public BaseObjScript {
private:
sparky_data *memory;
sparky_data *memory = nullptr;
void DoInit(int me);
void DoFrame(int me);
bool DoNotify(int me_handle, tOSIRISEventInfo *data);
Expand Down Expand Up @@ -728,7 +728,7 @@ struct hellion_data {

class Hellion final : public BaseObjScript {
private:
hellion_data *memory;
hellion_data *memory = nullptr;
void DoInit(int me);
void RemapAlert(int me, float start, float end, float time);
void RemapWB(int me, float start, float fire, int fire_sound, float end, float time, float latency, int index,
Expand Down Expand Up @@ -797,7 +797,7 @@ struct mantaray_data {

class MantaRay final : public BaseObjScript {
private:
mantaray_data *memory;
mantaray_data *memory = nullptr;
void DoInit(int me);

void DoSquadieFrame(int me);
Expand Down Expand Up @@ -844,7 +844,7 @@ struct skiff_data {

class Skiff final : public BaseObjScript {
private:
skiff_data *memory;
skiff_data *memory = nullptr;
void DoInit(int me);

void DoSquadieFrame(int me);
Expand Down Expand Up @@ -894,7 +894,7 @@ struct spyhunter_data {

class SpyHunter final : public BaseObjScript {
private:
spyhunter_data *memory;
spyhunter_data *memory = nullptr;
void DoInit(int me);
void DoFrame(int me);
void DoSummon(int me);
Expand Down Expand Up @@ -923,7 +923,7 @@ struct sniper_data {
};

class Sniper final : public BaseObjScript {
sniper_data *memory;
sniper_data *memory = nullptr;
void DoInit(int me);
void DoFrame(int me);
bool DoNotify(int me_handle, tOSIRISEventInfo *data);
Expand Down Expand Up @@ -951,7 +951,7 @@ struct snipernorun_data {
};

class SniperNoRun final : public BaseObjScript {
snipernorun_data *memory;
snipernorun_data *memory = nullptr;
void DoInit(int me);
void DoFrame(int me);
bool DoNotify(int me_handle, tOSIRISEventInfo *data);
Expand All @@ -976,7 +976,7 @@ struct evadermoda_data {
};

class EvaderModA final : public BaseObjScript {
evadermoda_data *memory;
evadermoda_data *memory = nullptr;
void DoInit(int me);
void DoFrame(int me);
bool DoNotify(int me_handle, tOSIRISEventInfo *data);
Expand Down Expand Up @@ -1004,7 +1004,7 @@ struct flameras_data {
};

class FlameRAS final : public BaseObjScript {
flameras_data *memory;
flameras_data *memory = nullptr;
void DoInit(int me);
void DoFrame(int me);
bool DoNotify(int me_handle, tOSIRISEventInfo *data);
Expand Down Expand Up @@ -1043,7 +1043,7 @@ struct jugg_data {

class Jugg final : public BaseObjScript {
private:
jugg_data *memory;
jugg_data *memory = nullptr;
void DoInit(int me_handle);
void DoFrame(int me_handle);
void SetMode(int me, char mode);
Expand All @@ -1069,7 +1069,7 @@ struct dtower_data {

class DTower final : public BaseObjScript {
private:
dtower_data *memory;
dtower_data *memory = nullptr;
void DoInit(int me_handle);
void DoFrame(int me_handle);

Expand All @@ -1092,7 +1092,7 @@ struct dcollector_data {

class DCollector final : public BaseObjScript {
private:
dcollector_data *memory;
dcollector_data *memory = nullptr;
void DoInit(int me_handle);
void DoFrame(int me_handle);

Expand All @@ -1112,7 +1112,7 @@ struct cball_data {

class CBall final : public BaseObjScript {
private:
cball_data *memory;
cball_data *memory = nullptr;
void DoInit(int me_handle);
void DoFrame(int me_handle);

Expand All @@ -1133,7 +1133,7 @@ struct sixgun_data {

class SixGun final : public BaseObjScript {
private:
sixgun_data *memory;
sixgun_data *memory = nullptr;
void DoInit(int me_handle);
bool DoNotify(int me_handle, tOSIRISEVTAINOTIFY *notify);

Expand All @@ -1152,7 +1152,7 @@ struct explodetimeout_data {

class ExplodeTimeOut final : public BaseObjScript {
private:
explodetimeout_data *memory;
explodetimeout_data *memory = nullptr;
void DoInit(int me_handle);

public:
Expand Down Expand Up @@ -1189,7 +1189,7 @@ struct sickle_data {

class Sickle final : public BaseObjScript {
private:
sickle_data *memory;
sickle_data *memory = nullptr;
void SetMode(int me, char mode);
void DoInit(int me_handle);
void DoFrame(int me_handle);
Expand Down Expand Up @@ -1310,7 +1310,7 @@ struct gbpowerup_data {

class GBPowerup final : public BaseObjScript {
private:
gbpowerup_data *memory;
gbpowerup_data *memory = nullptr;
void DoInit(int me);
void DoFrame(int me);

Expand All @@ -1332,7 +1332,7 @@ struct joshbell_data {

class JoshBell final : public BaseObjScript {
private:
joshbell_data *memory;
joshbell_data *memory = nullptr;
void DoInit(int me);
void DoCollide(int me);

Expand Down Expand Up @@ -1707,7 +1707,7 @@ struct thief_data {

class Thief final : public BaseObjScript {
private:
thief_data *memory;
thief_data *memory = nullptr;
void DoMessage(const char *str);

void SetMode(int me, int mode);
Expand Down Expand Up @@ -2301,7 +2301,7 @@ struct fireatdist_data {

class FireAtDist final : public BaseObjScript {
private:
fireatdist_data *memory;
fireatdist_data *memory = nullptr;
void DoInit(int me_handle);
void DoFrame(int me_handle);

Expand All @@ -2321,7 +2321,7 @@ struct hateptmc_data {

class HatePTMC final : public BaseObjScript {
private:
hateptmc_data *memory;
hateptmc_data *memory = nullptr;
void DoInit(int me_handle);
void DoFrame(int me_handle);

Expand All @@ -2344,7 +2344,7 @@ struct tubbs_data {

class Tubbs final : public BaseObjScript {
private:
tubbs_data *memory;
tubbs_data *memory = nullptr;
void DoInit(int me);
void DoFrame(int me);
bool DoNotify(int me, tOSIRISEVTAINOTIFY *notify);
Expand All @@ -2368,7 +2368,7 @@ struct oldscratch_data {

class OldScratch final : public BaseObjScript {
private:
oldscratch_data *memory;
oldscratch_data *memory = nullptr;
bool DoSteal(int me, int it);
void DoInit(int me);
void DoFrame(int me);
Expand Down Expand Up @@ -2429,7 +2429,7 @@ struct barnswallow_data {

class BarnSwallow final : public BaseObjScript {
private:
barnswallow_data *memory;
barnswallow_data *memory = nullptr;
void DoInit(int me);
bool SendCommand(int me, int it, char command, int value = 0);
bool ReceiveCommand(int me, int it, gb_com *command);
Expand Down
12 changes: 6 additions & 6 deletions scripts/AIGame3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ struct alienorganism_data {
// Alien Organism class definition
class AlienOrganism final : public BaseObjScript {
private:
alienorganism_data *memory;
alienorganism_data *memory = nullptr;

void SetMode(int me, char mode);
void DoTakeoff(int me, float takeoff_speed, float speed_variance);
Expand Down Expand Up @@ -985,7 +985,7 @@ struct heavytrooper_data {
// Heavy Trooper class definition
class HeavyTrooper final : public BaseObjScript {
private:
heavytrooper_data *memory;
heavytrooper_data *memory = nullptr;

void SetMode(int me, char mode);

Expand Down Expand Up @@ -1080,7 +1080,7 @@ struct lifter_data {
// Lifter class definition
class Lifter final : public BaseObjScript {
private:
lifter_data *memory;
lifter_data *memory = nullptr;

void SetMode(int me, char mode);

Expand Down Expand Up @@ -1294,7 +1294,7 @@ struct alienboss_data {
// Alien Boss class definition
class AlienBoss final : public BaseObjScript {
private:
alienboss_data *memory;
alienboss_data *memory = nullptr;

void SetMode(int me, char mode);
void DoTakeoff(int me, float takeoff_speed, float speed_variance);
Expand Down Expand Up @@ -1385,7 +1385,7 @@ struct securitycamera_data {
// Security Camera class definition
class SecurityCamera final : public BaseObjScript {
private:
securitycamera_data *memory;
securitycamera_data *memory = nullptr;

void SetMode(int me, char mode);

Expand Down Expand Up @@ -1429,7 +1429,7 @@ struct crowdcontrol_data {
// Security Camera class definition
class CrowdControl final : public BaseObjScript {
private:
crowdcontrol_data *memory;
crowdcontrol_data *memory = nullptr;

void DoInit(int me_handle);
void DoFrame(int me_handle);
Expand Down
4 changes: 2 additions & 2 deletions scripts/aigame2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class aiLukeTurret final : public aiObjScript {
float timer;
};

t_lturret_memory *memory;
t_lturret_memory *memory = nullptr;

public:
aiLukeTurret(){};
Expand All @@ -236,7 +236,7 @@ class aiSTBlackBarrel final : public aiObjScript {
matrix orient;
};

t_stblackbarrel_memory *memory;
t_stblackbarrel_memory *memory = nullptr;

public:
aiSTBlackBarrel(){};
Expand Down
10 changes: 5 additions & 5 deletions scripts/aigame4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ struct combwallhit_data {

class CombWallHit final : public BaseObjScript {
private:
combwallhit_data *memory;
combwallhit_data *memory = nullptr;

public:
CombWallHit() {}
Expand All @@ -162,7 +162,7 @@ struct droptarget_data {

class DropTarget final : public BaseObjScript {
private:
droptarget_data *memory;
droptarget_data *memory = nullptr;

public:
DropTarget() {}
Expand All @@ -179,7 +179,7 @@ struct gun_data {
};

class Gun final : public BaseObjScript {
gun_data *memory;
gun_data *memory = nullptr;

public:
Gun() {}
Expand All @@ -196,7 +196,7 @@ struct casing_data {

class Casing final : public BaseObjScript {
private:
casing_data *memory;
casing_data *memory = nullptr;

public:
Casing() {}
Expand Down Expand Up @@ -250,7 +250,7 @@ struct mercendboss_data {

class MercEndBoss final : public BaseObjScript {
private:
mercendboss_data *memory;
mercendboss_data *memory = nullptr;
void DoInit(int me);
void DoFrame(int me);
bool DoNotify(int me_handle, tOSIRISEventInfo *data);
Expand Down

0 comments on commit 7fa31b3

Please sign in to comment.