]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
bugfix: making distinct Swap functions; error code resolved in HOMER reader
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Mar 2008 14:36:16 +0000 (14:36 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Mar 2008 14:36:16 +0000 (14:36 +0000)
HLT/BASE/AliHLTOUT.cxx
HLT/BASE/AliHLTOUT.h
HLT/BASE/AliHLTOUTHomerBuffer.cxx
HLT/BASE/HOMER/AliHLTHOMERReader.cxx
HLT/rec/AliHLTOUTRawReader.cxx
HLT/sim/AliHLTOUTComponent.cxx

index b248571fad11c673eb9e3f4ccf3131b235e042d8..e063ffffd1e0ddccfbf0e6ffbfb7ee9135959b95 100644 (file)
@@ -402,7 +402,7 @@ bool AliHLTOUT::AliHLTOUTHandlerListEntry::HasIndex(AliHLTUInt32_t index)
 
 const AliHLTOUT::AliHLTOUTHandlerListEntry AliHLTOUT::AliHLTOUTHandlerListEntry::fgkVoidHandlerListEntry;
 
-AliHLTUInt64_t AliHLTOUT::Swap(AliHLTUInt64_t src)
+AliHLTUInt64_t AliHLTOUT::Swap64(AliHLTUInt64_t src)
 {
   // see header file for class documentation
   return ((src & 0xFFULL) << 56) | 
@@ -415,7 +415,7 @@ AliHLTUInt64_t AliHLTOUT::Swap(AliHLTUInt64_t src)
     ((src & 0xFF00000000000000ULL) >> 56);
 }
 
-AliHLTUInt32_t AliHLTOUT::Swap(AliHLTUInt32_t src)
+AliHLTUInt32_t AliHLTOUT::Swap32(AliHLTUInt32_t src)
 {
   // see header file for class documentation
   return ((src & 0xFFULL) << 24) | 
index 755e406b397793193fb3a0d55b201076447c18c0..af5ad6a0042f3e236d076116d33ba8a510d58caf 100644 (file)
@@ -229,12 +229,12 @@ class AliHLTOUT : public AliHLTLogging {
   /**
    * Helper function to byte swap a 64 bit value.
    */
-  static AliHLTUInt64_t Swap(AliHLTUInt64_t src);
+  static AliHLTUInt64_t Swap64(AliHLTUInt64_t src);
 
   /**
    * Helper function to byte swap a 32 bit value.
    */
-  static AliHLTUInt32_t Swap(AliHLTUInt32_t src);
+  static AliHLTUInt32_t Swap32(AliHLTUInt32_t src);
 
  protected:
   /**
index d6b10409ab9f0573bd57d7281fef7a3fcfb41956..8533014855d237ede5a46fda114fe8a365bd7430 100644 (file)
@@ -142,7 +142,7 @@ int AliHLTOUTHomerBuffer::ScanReader(AliHLTMonitoringReader* pReader, AliHLTUInt
       homer_uint32 origin=pReader->GetBlockDataOrigin( i );
       homer_uint32 spec=pReader->GetBlockDataSpec( i );
       AliHLTComponentDataType dt;
-      AliHLTComponent::SetDataType(dt, Swap(id), Swap(origin));
+      AliHLTComponent::SetDataType(dt, Swap64(id), Swap32(origin));
       AliHLTOUTBlockDescriptor desc(dt, spec, offset|i);
       HLTDebug("adding block %d: %s %#x", i, AliHLTComponent::DataType2Text(dt).c_str(), spec);
       iResult=AddBlockDescriptor(desc);
index 6674144b026316aebfce98bac179a2d47b24aded..ec3394573d43c7312b3f1516364e6352e091586f 100644 (file)
@@ -1230,7 +1230,7 @@ int AliHLTHOMERReader::ParseSourceData( DataSource& source )
            homer_uint8* descr = ((homer_uint8*)source.fData)+descrOffset;
            unsigned descrLen = Swap( kHOMERNativeByteOrder, sourceByteOrder, ((homer_uint64*)descr)[ kLength_64b_Offset ] );
            if (descrOffset+descrLen>=source.fDataSize) return EBADMSG;
-           if (Swap( kHOMERNativeByteOrder, sourceByteOrder, ((homer_uint64*)descr)[ kID_64b_Offset ] ) != HOMER_BLOCK_DESCRIPTOR_TYPEID) return ENOKEY;
+           if (Swap( kHOMERNativeByteOrder, sourceByteOrder, ((homer_uint64*)descr)[ kID_64b_Offset ] ) != HOMER_BLOCK_DESCRIPTOR_TYPEID) return 126/*ENOKEY*/;
            fBlocks[fBlockCnt].fSource = source.fNdx;
            fBlocks[fBlockCnt].fData = ((homer_uint8*)source.fData) + Swap( kHOMERNativeByteOrder, sourceByteOrder, ((homer_uint64*)descr)[ kOffset_64b_Offset ] );
            fBlocks[fBlockCnt].fLength = Swap( kHOMERNativeByteOrder, sourceByteOrder, ((homer_uint64*)descr)[ kSize_64b_Offset ] );
index b28540f30d17418540191b5eb5e25c775efea1e8..1dafa76432fc9c3c19c2b0a45e244145f2042119 100644 (file)
@@ -186,7 +186,7 @@ AliHLTHOMERReader* AliHLTOUTRawReader::OpenReader(UChar_t* pSrc, unsigned int si
   // check for the HOME descriptor type id
   AliHLTUInt64_t* pHomerDesc=reinterpret_cast<AliHLTUInt64_t*>(pSrc+offset);
   if (*(pHomerDesc+kID_64b_Offset) != HOMER_BLOCK_DESCRIPTOR_TYPEID && 
-      Swap(*(pHomerDesc+kID_64b_Offset)) != HOMER_BLOCK_DESCRIPTOR_TYPEID) {
+      Swap64(*(pHomerDesc+kID_64b_Offset)) != HOMER_BLOCK_DESCRIPTOR_TYPEID) {
     HLTWarning("format error: can not find HOMER block descriptor typid, skipping this data block");
     return NULL;
   }
index 45b73e192c9ca072c994159e3971fba7795572d1..8f504283f771bc4604964e736d18feda2e5a24ac 100644 (file)
@@ -196,8 +196,8 @@ int AliHLTOUTComponent::DumpEvent( const AliHLTComponentEventData& evtData,
       homer_uint64 origin=0;
       memcpy(&id, blocks[n].fDataType.fID, sizeof(homer_uint64));
       memcpy(((AliHLTUInt8_t*)&origin)+sizeof(homer_uint32), blocks[n].fDataType.fOrigin, sizeof(homer_uint32));
-      homerDescriptor.SetType(AliHLTOUT::Swap(id));
-      homerDescriptor.SetSubType1(AliHLTOUT::Swap(origin));
+      homerDescriptor.SetType(AliHLTOUT::Swap64(id));
+      homerDescriptor.SetSubType1(AliHLTOUT::Swap32(origin));
       homerDescriptor.SetSubType2(blocks[n].fSpecification);
       homerDescriptor.SetBlockSize(blocks[n].fSize);
       int writerNo=ShuffleWriters(fWriters, blocks[n].fSize);