Skip to content

Commit 6ce64ed

Browse files
committed
[hist] Remove casts in TH[23]L::AddBinContent
They would truncate the count to 32 bits.
1 parent 7b3872e commit 6ce64ed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hist/hist/src/TH2.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3684,7 +3684,7 @@ void TH2L::AddBinContent(Int_t bin)
36843684
void TH2L::AddBinContent(Int_t bin, Double_t w)
36853685
{
36863686
Long64_t newval = fArray[bin] + Long64_t(w);
3687-
if (newval > -LLONG_MAX && newval < LLONG_MAX) {fArray[bin] = Int_t(newval); return;}
3687+
if (newval > -LLONG_MAX && newval < LLONG_MAX) {fArray[bin] = newval; return;}
36883688
if (newval < -LLONG_MAX) fArray[bin] = -LLONG_MAX;
36893689
if (newval > LLONG_MAX) fArray[bin] = LLONG_MAX;
36903690
}

hist/hist/src/TH3.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4344,7 +4344,7 @@ void TH3L::AddBinContent(Int_t bin)
43444344
void TH3L::AddBinContent(Int_t bin, Double_t w)
43454345
{
43464346
Long64_t newval = fArray[bin] + Long64_t(w);
4347-
if (newval > -LLONG_MAX && newval < LLONG_MAX) {fArray[bin] = Int_t(newval); return;}
4347+
if (newval > -LLONG_MAX && newval < LLONG_MAX) {fArray[bin] = newval; return;}
43484348
if (newval < -LLONG_MAX) fArray[bin] = -LLONG_MAX;
43494349
if (newval > LLONG_MAX) fArray[bin] = LLONG_MAX;
43504350
}

0 commit comments

Comments
 (0)