Changeset 10640


Ignore:
Timestamp:
May 10, 2011, 11:00:47 AM (9 years ago)
Author:
tbretz
Message:
Fixed the Converter::GetHex for the col==0 case.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Converter.h

    r10449 r10640  
    1212#include <stdexcept>
    1313
     14#include <iostream>
    1415class Converter
    1516{
     
    109110        text << std::hex;
    110111
    111         const size_t w = log2l(size+1)/4+1;
     112        const size_t w = nearbyint(ceil(log2(size+1)))/4+1;
    112113
    113114        for (size_t i=0; i<size/sizeof(T); i++)
     
    116117                text << std::setfill('0') << std::setw(w) << i << "| ";
    117118
    118             text << std::setfill('0') << std::setw(2*sizeof(T)) << (unsigned int)ptr[i];
    119             text << ':';
     119            text << std::setfill('0') << std::setw(2*sizeof(T));
     120            text << (unsigned int)ptr[i] << ':';
    120121
    121             if (i%col==col-1)
     122            if (col!=0 && i%col==col-1)
    122123                text << '\n';
     124
    123125        }
    124126
  • trunk/FACT++/src/HeadersFTM.cc

    r10598 r10640  
    151151    out << "       CRC counter = " << dec << fCrcErrorCounter << endl;
    152152    out << "       CRC         = " << hex << fCrcCheckSum << endl;
    153 //  out << "       Data: " << Converter::GetHex<unsigned short>(fData, 0, false) << endl;
     153    out << "       Data: " << Converter::GetHex<unsigned short>(fData, 0, false) << endl;
    154154}
Note: See TracChangeset for help on using the changeset viewer.