Skip to content

Commit

Permalink
require value initialization in Firmware-mimic structs
Browse files Browse the repository at this point in the history
  • Loading branch information
tomeichlersmith committed Sep 24, 2024
1 parent 05b052f commit 8a387d5
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions TrigScint/include/TrigScint/Firmware/objdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
#define NWORDS 72

struct Digi {
int mID, bID;
int adc0, adc1, adc2, adc3, adc4, adc5;
int tdc0, tdc1, tdc2, tdc3, tdc4, tdc5;
int mID{}, bID{};
int adc0{}, adc1{}, adc2{}, adc3{}, adc4{}, adc5{};
int tdc0{}, tdc1{}, tdc2{}, tdc3{}, tdc4{}, tdc5{};
};
inline void clearDigi(Digi& c) {
c.mID = 0;
Expand All @@ -45,8 +45,8 @@ inline void clearDigi(Digi& c) {
c.tdc5 = 0;
}
struct Hit {
ap_int<12> mID, bID;
ap_int<12> Amp, Time; // TrigTime;
ap_int<12> mID{}, bID{};
ap_int<12> Amp{}, Time{}; // TrigTime;
};
inline void clearHit(Hit& c) {
c.mID = 0;
Expand All @@ -62,9 +62,9 @@ inline void cpyHit(Hit& c1, Hit& c2) {
}

struct Cluster {
Hit Seed;
Hit Sec;
ap_int<11> Cent;
Hit Seed{};
Hit Sec{};
ap_int<11> Cent{};
// int nhits, mID, SeedID;
// float CentX, CentY, CentZ, Amp, Time, TrigTime;
};
Expand All @@ -89,10 +89,10 @@ inline void cpyCluster(Cluster& c1, Cluster& c2) {
}

struct Track {
Cluster Pad1;
Cluster Pad2;
Cluster Pad3;
ap_int<12> resid;
Cluster Pad1{};
Cluster Pad2{};
Cluster Pad3{};
ap_int<12> resid{};
};
inline void clearTrack(Track& c) {
clearClus(c.Pad1);
Expand Down

0 comments on commit 8a387d5

Please sign in to comment.