Changeset 10979 for trunk/FACT++/src


Ignore:
Timestamp:
06/10/11 11:58:49 (13 years ago)
Author:
tbretz
Message:
Replaced Adc_data[1] by Adc_data[]
Location:
trunk/FACT++/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/EventBuilder.c

    r10963 r10979  
    262262
    263263   
    264    needmem = sizeof(EVENT) + NPIX*nRoi*2 + NTMARK*nRoi*2 - 2 ; //-2 because of dummy adc_data[1]
     264   needmem = sizeof(EVENT) + NPIX*nRoi*2 + NTMARK*nRoi*2;
    265265
    266266   headmem = NBOARDS* sizeof(PEVNT_HEADER) ;
  • trunk/FACT++/src/EventBuilderWrapper.h

    r10967 r10979  
    161161    enum
    162162    {
     163        kEndOfFile = 0,
    163164        kIdentifier = 1,
    164165        kRunHeader,
     
    202203        }
    203204
     205        // FIXME: Split this
    204206        const vector<char> block(sizeof(uint32_t)+sizeof(RUN_TAIL));
    205207        WriteBlockHeader(kRunSummary, 1, 0, block.size());
     
    221223    virtual bool Write(EVENT *evt)
    222224    {
    223         const int sh = sizeof(PEVNT_HEADER)+(NPIX-1)*evt->Roi*2;
     225        const int sh = sizeof(EVENT)-2 + NPIX*evt->Roi*2;
    224226
    225227        WriteBlockHeader(kEvent, 1, fCounter++, sh);
    226         fOut.write(reinterpret_cast<char*>(evt)+2, sh-2);
     228        fOut.write(reinterpret_cast<char*>(evt)+2, sh);
    227229        return true;
    228230    }
    229231    virtual bool Close(RUN_TAIL *tail= 0)
    230232    {
     233        WriteBlockHeader(kEndOfFile, 0, 0, 0);
     234
    231235        if (tail)
    232236        {
     
    522526        fNumRows++;
    523527
    524         const int sh = sizeof(PEVNT_HEADER)+(NPIX-1)*e->Roi*2;
     528        const int sh = sizeof(EVENT)+NPIX*e->Roi*2;
    525529
    526530        // column size pointer
  • trunk/FACT++/src/FAD.h

    r10963 r10979  
    128128   int16_t StartTM[NTMARK]; // First Channel for TimeMark (sorted Hardware ID) ; -1 if not filled
    129129
    130   uint16_t Adc_Data[1];     // final length defined by malloc ....
     130  uint16_t Adc_Data[];     // final length defined by malloc ....
    131131
    132132} EVENT ;
Note: See TracChangeset for help on using the changeset viewer.