]> git.uio.no Git - u/mrichter/AliRoot.git/commit
consolidate zero-length arrays (aka struct hack)
authortbreitne <timo.gunther.breitner@cern.ch>
Wed, 28 May 2014 07:25:53 +0000 (09:25 +0200)
committertbreitne <timo.gunther.breitner@cern.ch>
Fri, 30 May 2014 13:09:51 +0000 (15:09 +0200)
commit66b7af3215a3a680e090fd5cdf3b161ab668ff8b
tree2c5121349a11f2d38342aa419923f035b7530e53
parent1c9a06c8f310845557c6e8dec0bed2734d8318e1
consolidate zero-length arrays (aka struct hack)

HLT uses a lot of structs with zero-length arrays, using #ifdef for
platforms not supporting those (setting array_t array[1] instead of
array[0]). These ifdef were inconsistent. Sometimes also array[] instead
of array[0] was used. Moreover, for some structs clang was excluded
(defined(__clang__)), which lead to inconsistencies when calculating sizes
with sizeof() and ultimately runtime errors (output buffer too small in
TPC cluster transformation component). This patch tries to make all
zero-length array structs consistent and removes exceptions for clang.

Whether or not the __SUNPRO et al. defines are still needed is unclear,
maybe they can be removed in the future.
HLT/BASE/AliHLTExternalTrackParam.h
HLT/BASE/AliHLTTrackMCLabel.h
HLT/ITS/AliHLTITSClusterDataFormat.h
HLT/TPCLib/AliHLTTPCClusterDataFormat.h
HLT/TPCLib/AliHLTTPCClusterMCData.h
HLT/TPCLib/AliHLTTPCDigitData.h
HLT/TPCLib/AliHLTTPCTrackletDataFormat.h
HLT/TRD/AliHLTTRDCluster.h
HLT/TRD/AliHLTTRDTrackletWordArray.h