diff --git a/MAC/APL/CR_Protocol/src/CRreadRequest.cc b/MAC/APL/CR_Protocol/src/CRreadRequest.cc index 064c869e5a805e932abdfe2fcb7043e91940f523..d30d5b33490709abc5d9cf07822534eb58041546 100644 --- a/MAC/APL/CR_Protocol/src/CRreadRequest.cc +++ b/MAC/APL/CR_Protocol/src/CRreadRequest.cc @@ -47,9 +47,9 @@ size_t CRreadRequest::getSize() size_t CRreadRequest::pack (char* buffer) const { - uint32 offset = 0; - MSH_pack(buffer, offset, stationList); - MSH_pack(buffer, offset, rcuList); + size_t offset = 0; + offset = MSH_pack(buffer, offset, stationList); + offset = MSH_pack(buffer, offset, rcuList); offset += readTime.pack((char*)(buffer)+offset); offset += timeBefore.pack((char*)(buffer)+offset); offset += timeAfter.pack((char*)(buffer)+offset); @@ -58,9 +58,9 @@ size_t CRreadRequest::pack (char* buffer) const size_t CRreadRequest::unpack(const char *buffer) { - uint32 offset = 0; - MSH_unpack(buffer, offset, stationList); - MSH_unpack(buffer, offset, rcuList); + size_t offset = 0; + offset = MSH_unpack(buffer, offset, stationList); + offset = MSH_unpack(buffer, offset, rcuList); offset += readTime.unpack((char*)(buffer)+offset); offset += timeBefore.unpack((char*)(buffer)+offset); offset += timeAfter.unpack((char*)(buffer)+offset); diff --git a/MAC/APL/CR_Protocol/src/CRrecordRequest.cc b/MAC/APL/CR_Protocol/src/CRrecordRequest.cc index 054481e23034e57f0790e04bd5aa64be73c00bee..2a8d1b93f0d6af4afd5b254a5319e5983c452291 100644 --- a/MAC/APL/CR_Protocol/src/CRrecordRequest.cc +++ b/MAC/APL/CR_Protocol/src/CRrecordRequest.cc @@ -47,17 +47,17 @@ size_t CRrecordRequest::getSize() size_t CRrecordRequest::pack (char* buffer) const { - uint32 offset = 0; - MSH_pack(buffer, offset, stationList); - MSH_pack(buffer, offset, rcuList); + size_t offset = 0; + offset = MSH_pack(buffer, offset, stationList); + offset = MSH_pack(buffer, offset, rcuList); return (offset); } size_t CRrecordRequest::unpack(const char *buffer) { - uint32 offset = 0; - MSH_unpack(buffer, offset, stationList); - MSH_unpack(buffer, offset, rcuList); + size_t offset = 0; + offset = MSH_unpack(buffer, offset, stationList); + offset = MSH_unpack(buffer, offset, rcuList); return (offset); } diff --git a/MAC/APL/CR_Protocol/src/CRstopRequest.cc b/MAC/APL/CR_Protocol/src/CRstopRequest.cc index 1e76a486852e2791d537f5b2499aee0fd8c11b3e..dd5ba6d6e3913dea7b9f5869d091e3a667bfad67 100644 --- a/MAC/APL/CR_Protocol/src/CRstopRequest.cc +++ b/MAC/APL/CR_Protocol/src/CRstopRequest.cc @@ -47,18 +47,18 @@ size_t CRstopRequest::getSize() size_t CRstopRequest::pack (char* buffer) const { - uint32 offset = 0; - MSH_pack(buffer, offset, stationList); - MSH_pack(buffer, offset, rcuList); + size_t offset = 0; + offset = MSH_pack(buffer, offset, stationList); + offset = MSH_pack(buffer, offset, rcuList); offset += stopTime.pack(buffer + offset); return (offset); } size_t CRstopRequest::unpack(const char *buffer) { - uint32 offset = 0; - MSH_unpack(buffer, offset, stationList); - MSH_unpack(buffer, offset, rcuList); + size_t offset = 0; + offset = MSH_unpack(buffer, offset, stationList); + offset = MSH_unpack(buffer, offset, rcuList); offset += stopTime.unpack(buffer + offset); return (offset); } diff --git a/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc b/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc index 14121b9b9d62f53354b4176c9964f58715ca762f..2b6459b740dac45b6b827239fa0bd2b1c4d68787 100644 --- a/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc +++ b/MAC/APL/PAC/CAL_Protocol/src/AntennaGains.cc @@ -88,8 +88,8 @@ size_t AntennaGains::pack(char* buffer) const size_t offset = 0; lock(); - MSH_pack(buffer, offset, m_gains); - MSH_pack(buffer, offset, m_quality); + offset = MSH_pack(buffer, offset, m_gains); + offset = MSH_pack(buffer, offset, m_quality); memcpy((char*)buffer + offset, &m_done, sizeof(bool)); offset += sizeof(bool); unlock(); @@ -102,8 +102,8 @@ size_t AntennaGains::unpack(const char* buffer) size_t offset = 0; lock(); - MSH_unpack(buffer, offset, m_gains); - MSH_unpack(buffer, offset, m_quality); + offset = MSH_unpack(buffer, offset, m_gains); + offset = MSH_unpack(buffer, offset, m_quality); memcpy(&m_done, (char*)buffer + offset, sizeof(bool)); offset += sizeof(bool); unlock(); diff --git a/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc b/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc index 2f88bea2d81c9edee2661b063d4296638b920118..7a43347a2f5fd113343c86a5a0dcafd2d9c850e7 100644 --- a/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc +++ b/MAC/APL/PAC/CAL_Protocol/src/SpectralWindow.cc @@ -148,9 +148,9 @@ size_t SpectralWindow::getSize() const size_t SpectralWindow::pack(char* buffer) const { - uint32 offset = 0; + size_t offset = 0; - MSH_pack(buffer, offset, m_name); + offset = MSH_pack(buffer, offset, m_name); memcpy(buffer + offset, &m_sampling_freq, sizeof(m_sampling_freq)); offset += sizeof(m_sampling_freq); memcpy(buffer + offset, &m_nyquist_zone, sizeof(m_nyquist_zone)); @@ -165,9 +165,9 @@ size_t SpectralWindow::pack(char* buffer) const size_t SpectralWindow::unpack(const char* buffer) { - uint32 offset = 0; + size_t offset = 0; - MSH_unpack(buffer, offset, m_name); + offset = MSH_unpack(buffer, offset, m_name); memcpy(&m_sampling_freq, buffer + offset, sizeof(m_sampling_freq)); offset += sizeof(m_sampling_freq); memcpy(&m_nyquist_zone, buffer + offset, sizeof(m_nyquist_zone)); diff --git a/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc b/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc index cd61d804920f8cd3caee20930f84d9b716967227..a2585d2b7d9142653c1705ecac43bd8b6a556a26 100644 --- a/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc +++ b/MAC/APL/PAC/CAL_Protocol/src/SubArray.cc @@ -210,13 +210,13 @@ size_t SubArray::getSize() const size_t SubArray::pack(char* buffer) const { - uint32 offset = 0; + size_t offset = 0; - MSH_pack(buffer, offset, m_name); - MSH_pack(buffer, offset, m_geoloc); - MSH_pack(buffer, offset, m_pos); - MSH_pack(buffer, offset, m_rcuindex); - MSH_pack(buffer, offset, itsRCUmask); + offset = MSH_pack(buffer, offset, m_name); + offset = MSH_pack(buffer, offset, m_geoloc); + offset = MSH_pack(buffer, offset, m_pos); + offset = MSH_pack(buffer, offset, m_rcuindex); + offset = MSH_pack(buffer, offset, itsRCUmask); offset += m_spw.pack(buffer + offset); return offset; @@ -224,13 +224,13 @@ size_t SubArray::pack(char* buffer) const size_t SubArray::unpack(const char* buffer) { - uint32 offset = 0; + size_t offset = 0; - MSH_unpack(buffer, offset, m_name); - MSH_unpack(buffer, offset, m_geoloc); - MSH_unpack(buffer, offset, m_pos); - MSH_unpack(buffer, offset, m_rcuindex); - MSH_unpack(buffer, offset, itsRCUmask); + offset = MSH_unpack(buffer, offset, m_name); + offset = MSH_unpack(buffer, offset, m_geoloc); + offset = MSH_unpack(buffer, offset, m_pos); + offset = MSH_unpack(buffer, offset, m_rcuindex); + offset = MSH_unpack(buffer, offset, itsRCUmask); offset += m_spw.unpack(buffer + offset); return offset; @@ -245,15 +245,13 @@ size_t SubArrayMap::getSize() const size_t SubArrayMap::pack(char* buffer) const { - uint32 offset = 0; - MSH_pack(buffer, offset, (*this)); - return (offset); + size_t offset = 0; + return MSH_pack(buffer, offset, (*this)); } size_t SubArrayMap::unpack(const char* buffer) { - uint32 offset = 0; - MSH_unpack(buffer, offset, (*this)); - return (offset); + size_t offset = 0; + return MSH_unpack(buffer, offset, (*this)); } diff --git a/MAC/APL/PAC/IBS_Protocol/src/Beamlet2SubbandMap.cc b/MAC/APL/PAC/IBS_Protocol/src/Beamlet2SubbandMap.cc index d6f2d66988a50ab0f012a6bc67f4b3553387f8db..c544e4ba06cf7519c45f1007ae714617fe16b1b3 100644 --- a/MAC/APL/PAC/IBS_Protocol/src/Beamlet2SubbandMap.cc +++ b/MAC/APL/PAC/IBS_Protocol/src/Beamlet2SubbandMap.cc @@ -58,9 +58,7 @@ size_t Beamlet2SubbandMap::pack (char* buffer) const maparray(i+1) = iter->second; } - MSH_pack(buffer, offset, maparray); - - return offset; + return MSH_pack(buffer, offset, maparray); } size_t Beamlet2SubbandMap::unpack(const char *buffer) @@ -69,7 +67,7 @@ size_t Beamlet2SubbandMap::unpack(const char *buffer) blitz::Array<uint16, 1> maparray; size_t offset = 0; - MSH_unpack(buffer, offset, maparray); + offset = MSH_unpack(buffer, offset, maparray); ASSERT(maparray.extent(firstDim) % 2 == 0); // convert Blitz array to map diff --git a/MAC/APL/PAC/IBS_Protocol/src/Pointing.cc b/MAC/APL/PAC/IBS_Protocol/src/Pointing.cc index 2b574f65a4f63470899bde59b7c9ce22855d9ae7..8bb73655546ae8b2c178281add5e212cb3f92673 100644 --- a/MAC/APL/PAC/IBS_Protocol/src/Pointing.cc +++ b/MAC/APL/PAC/IBS_Protocol/src/Pointing.cc @@ -102,7 +102,7 @@ size_t Pointing::getSize() const // size_t Pointing::pack (char* buffer) const { - uint32 offset = 0; + size_t offset = 0; memcpy(buffer + offset, &itsAngle2Pi, sizeof(double)); offset += sizeof(double); @@ -121,7 +121,7 @@ size_t Pointing::pack (char* buffer) const // size_t Pointing::unpack(const char *buffer) { - uint32 offset = 0; + size_t offset = 0; memcpy(&itsAngle2Pi, buffer + offset, sizeof(double)); offset += sizeof(double); diff --git a/MAC/APL/PAC/ICAL_Protocol/src/AntennaGains.cc b/MAC/APL/PAC/ICAL_Protocol/src/AntennaGains.cc index d9af4956b312f84e6bf37ddc78e26196a8d7a8fd..ad5ebce6e97f3b8d4ee3f2ac4b1eca27da56c8e5 100644 --- a/MAC/APL/PAC/ICAL_Protocol/src/AntennaGains.cc +++ b/MAC/APL/PAC/ICAL_Protocol/src/AntennaGains.cc @@ -79,8 +79,8 @@ size_t AntennaGains::pack(char* buffer) const { size_t offset = 0; - MSH_pack(buffer, offset, m_gains); - MSH_pack(buffer, offset, m_quality); + offset = MSH_pack(buffer, offset, m_gains); + offset = MSH_pack(buffer, offset, m_quality); return offset; } @@ -89,8 +89,8 @@ size_t AntennaGains::unpack(const char* buffer) { size_t offset = 0; - MSH_unpack(buffer, offset, m_gains); - MSH_unpack(buffer, offset, m_quality); + offset = MSH_unpack(buffer, offset, m_gains); + offset = MSH_unpack(buffer, offset, m_quality); return offset; } diff --git a/MAC/APL/PAC/ICAL_Protocol/src/SpectralWindow.cc b/MAC/APL/PAC/ICAL_Protocol/src/SpectralWindow.cc index 1ed72a1168243af4fdcc1b441989db02d92b507e..d65c50813d53817957bedf00f50cf5ef75a9d8b7 100644 --- a/MAC/APL/PAC/ICAL_Protocol/src/SpectralWindow.cc +++ b/MAC/APL/PAC/ICAL_Protocol/src/SpectralWindow.cc @@ -114,9 +114,9 @@ size_t SpectralWindow::getSize() const size_t SpectralWindow::pack(char* buffer) const { - uint32 offset = 0; + size_t offset = 0; - MSH_pack(buffer, offset, itsName); + offset = MSH_pack(buffer, offset, itsName); memcpy(buffer + offset, &itsSamplingFreq, sizeof(itsSamplingFreq)); offset += sizeof(itsSamplingFreq); memcpy(buffer + offset, &itsNyquistZone, sizeof(itsNyquistZone)); @@ -129,9 +129,9 @@ size_t SpectralWindow::pack(char* buffer) const size_t SpectralWindow::unpack(const char* buffer) { - uint32 offset = 0; + size_t offset = 0; - MSH_unpack(buffer, offset, itsName); + offset = MSH_unpack(buffer, offset, itsName); memcpy(&itsSamplingFreq, buffer + offset, sizeof(itsSamplingFreq)); offset += sizeof(itsSamplingFreq); memcpy(&itsNyquistZone, buffer + offset, sizeof(itsNyquistZone)); diff --git a/MAC/APL/PAC/ICAL_Protocol/src/SubArray.cc b/MAC/APL/PAC/ICAL_Protocol/src/SubArray.cc index a41c8b675410ceed1d2208709389ae8470b9a7d9..423ffb665f22a27d0ff09f20e8da90aa78098a6d 100644 --- a/MAC/APL/PAC/ICAL_Protocol/src/SubArray.cc +++ b/MAC/APL/PAC/ICAL_Protocol/src/SubArray.cc @@ -199,11 +199,11 @@ size_t SubArray::getSize() const size_t SubArray::pack(char* buffer) const { - uint32 offset = 0; + size_t offset = 0; - MSH_pack(buffer, offset, itsName); - MSH_pack(buffer, offset, itsAntennaSet); - MSH_pack(buffer, offset, itsRCUmask); + offset = MSH_pack(buffer, offset, itsName); + offset = MSH_pack(buffer, offset, itsAntennaSet); + offset = MSH_pack(buffer, offset, itsRCUmask); offset += itsSPW.pack(buffer + offset); return offset; @@ -211,11 +211,11 @@ size_t SubArray::pack(char* buffer) const size_t SubArray::unpack(const char* buffer) { - uint32 offset = 0; + size_t offset = 0; - MSH_unpack(buffer, offset, itsName); - MSH_unpack(buffer, offset, itsAntennaSet); - MSH_unpack(buffer, offset, itsRCUmask); + offset = MSH_unpack(buffer, offset, itsName); + offset = MSH_unpack(buffer, offset, itsAntennaSet); + offset = MSH_unpack(buffer, offset, itsRCUmask); offset += itsSPW.unpack(buffer + offset); return offset; @@ -230,16 +230,14 @@ size_t SubArrayMap::getSize() const size_t SubArrayMap::pack(char* buffer) const { - uint32 offset = 0; - MSH_pack(buffer, offset, (*this)); - return (offset); + size_t offset = 0; + return MSH_pack(buffer, offset, (*this)); } size_t SubArrayMap::unpack(const char* buffer) { - uint32 offset = 0; - MSH_unpack(buffer, offset, (*this)); - return (offset); + size_t offset = 0; + return MSH_unpack(buffer, offset, (*this)); } } // namespace ICAL diff --git a/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.cc b/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.cc index 092f9f64e8927dd8ad11d5a7075346e1cc2f8371..f93929852318b4b2cf5f1317a5e8fcca46edcd85 100644 --- a/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.cc +++ b/MAC/APL/PAC/SHMInfo_Server/src/RspStatus.cc @@ -47,19 +47,13 @@ namespace LOFAR { size_t RspStatus::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_board_status); - - return offset; + return MSH_pack(buffer, offset, m_board_status); } size_t RspStatus::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_board_status); - - return offset; + return MSH_unpack(buffer, offset, m_board_status); } } } diff --git a/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.cc b/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.cc index 2f380a91a6ec04a8df70299d3a52e68cf3d79584..84422ca08e4d7e449fd140ec7fabf588a31dda78 100644 --- a/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.cc +++ b/MAC/APL/PAC/SHMInfo_Server/src/XCStatistics.cc @@ -40,19 +40,13 @@ namespace LOFAR { size_t XCStatistics::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_xstatistics); - - return offset; + return MSH_pack(buffer, offset, m_xstatistics); } size_t XCStatistics::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_xstatistics); - - return offset; + return MSH_unpack(buffer, offset, m_xstatistics); } } } diff --git a/MAC/APL/PIC/RSP_Protocol/src/BeamletWeights.cc b/MAC/APL/PIC/RSP_Protocol/src/BeamletWeights.cc index 4f40d20d7f9b246ea32e73c8ab6e9273e9d4769f..c85a3923ff7ac029c3ec6fe52ed4a96754ff3ff8 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/BeamletWeights.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/BeamletWeights.cc @@ -39,13 +39,11 @@ size_t BeamletWeights::getSize() const size_t BeamletWeights::pack (char* buffer) const { size_t offset = 0; - MSH_pack(buffer, offset, m_weights); - return offset; + return MSH_pack(buffer, offset, m_weights); } size_t BeamletWeights::unpack(const char *buffer) { size_t offset = 0; - MSH_unpack(buffer, offset, m_weights); - return offset; + return MSH_unpack(buffer, offset, m_weights); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/Bitmode.cc b/MAC/APL/PIC/RSP_Protocol/src/Bitmode.cc index 1c3e2467d2d6eb73614cfb129ca63fd0553b2e3e..385714fd4d38769273b8dc45e0dffe2e990cd62b 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/Bitmode.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/Bitmode.cc @@ -39,17 +39,11 @@ size_t BitmodeInfo::getSize() const size_t BitmodeInfo::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, itsBitmodeInfo); - - return offset; + return MSH_pack(buffer, offset, itsBitmodeInfo); } size_t BitmodeInfo::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, itsBitmodeInfo); - - return offset; + return MSH_unpack(buffer, offset, itsBitmodeInfo); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/BypassSettings.cc b/MAC/APL/PIC/RSP_Protocol/src/BypassSettings.cc index 561b8c377634be010c332fab13d61042ae8830d0..e668f5917fb2c819ec9ed207f1fe35ea3545dc06 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/BypassSettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/BypassSettings.cc @@ -40,15 +40,13 @@ size_t BypassSettings::getSize() const size_t BypassSettings::pack (char* buffer) const { size_t offset = 0; - MSH_pack(buffer, offset, m_registers); - return offset; + return MSH_pack(buffer, offset, m_registers); } size_t BypassSettings::unpack(const char *buffer) { size_t offset = 0; - MSH_unpack(buffer, offset, m_registers); - return offset; + return MSH_unpack(buffer, offset, m_registers); } } // namespace RSP_Protocol diff --git a/MAC/APL/PIC/RSP_Protocol/src/HBASettings.cc b/MAC/APL/PIC/RSP_Protocol/src/HBASettings.cc index d8d2160bf97c41e1358788988cfbd378af3e56dc..38b1e047aa51b384229d37b3141b401ff6c985c5 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/HBASettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/HBASettings.cc @@ -39,17 +39,11 @@ size_t HBASettings::getSize() const size_t HBASettings::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_delay); - - return offset; + return MSH_pack(buffer, offset, m_delay); } size_t HBASettings::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_delay); - - return offset; + return MSH_unpack(buffer, offset, m_delay); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/Latency.cc b/MAC/APL/PIC/RSP_Protocol/src/Latency.cc index 6bea7d41104bb73b160d778be6dd90c6960d4065..a4e3fb7f5bdd0b4d9b1c95cf910151bb4c11f052 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/Latency.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/Latency.cc @@ -44,17 +44,11 @@ size_t Latency::getSize() const size_t Latency::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, itsLatency); - - return offset; + return MSH_pack(buffer, offset, itsLatency); } size_t Latency::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, itsLatency); - - return offset; + return MSH_unpack(buffer, offset, itsLatency); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/RCUSettings.cc b/MAC/APL/PIC/RSP_Protocol/src/RCUSettings.cc index 8fed669ff650d108f202864cf1922ec8bf6b1045..1ca3e38c9645af52b55b9dc363a5b36cdaed3a92 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/RCUSettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/RCUSettings.cc @@ -83,17 +83,11 @@ size_t RCUSettings::getSize() const size_t RCUSettings::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_registers); - - return offset; + return MSH_pack(buffer, offset, m_registers); } size_t RCUSettings::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_registers); - - return offset; + return MSH_unpack(buffer, offset, m_registers); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/RSUSettings.cc b/MAC/APL/PIC/RSP_Protocol/src/RSUSettings.cc index b59b9dffb3c07a8bca3747c550cc65041e05d0cf..afa054347003492752c14b9aa6e8a8c695fbf967 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/RSUSettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/RSUSettings.cc @@ -40,17 +40,11 @@ size_t RSUSettings::getSize() const size_t RSUSettings::pack (char * buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_registers); - - return offset; + return MSH_pack(buffer, offset, m_registers); } size_t RSUSettings::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_registers); - - return offset; + return MSH_unpack(buffer, offset, m_registers); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/SDOMode.cc b/MAC/APL/PIC/RSP_Protocol/src/SDOMode.cc index 2aec1b0cd437dc90ba2edd83800fc226893c954b..4532c18772009b22b99ec2883b5968c8161aaa37 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/SDOMode.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/SDOMode.cc @@ -39,17 +39,11 @@ size_t SDOModeInfo::getSize() const size_t SDOModeInfo::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, itsSDOModeInfo); - - return offset; + return MSH_pack(buffer, offset, itsSDOModeInfo); } size_t SDOModeInfo::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, itsSDOModeInfo); - - return offset; + return MSH_unpack(buffer, offset, itsSDOModeInfo); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/SDOSelection.cc b/MAC/APL/PIC/RSP_Protocol/src/SDOSelection.cc index a627c1be0efcb8126b6ded6f7a792b295a6c94c0..b0c2adba599c2a640094a9f10b6cdcf276e560a5 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/SDOSelection.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/SDOSelection.cc @@ -44,15 +44,13 @@ size_t SDOSelection::getSize() const size_t SDOSelection::pack(char* buffer) const { size_t offset = 0; - MSH_pack(buffer, offset, itsSubbands); - return offset; + return MSH_pack(buffer, offset, itsSubbands); } size_t SDOSelection::unpack(const char *buffer) { size_t offset = 0; - MSH_unpack(buffer, offset, itsSubbands); - return offset; + return MSH_unpack(buffer, offset, itsSubbands); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/SPUStatus.cc b/MAC/APL/PIC/RSP_Protocol/src/SPUStatus.cc index 5fbfe57a7170ae40a7c606bf2c5dc88a288c8ef9..ca07ff0f535d9acabe412d2c7405cce4aeadb9db 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/SPUStatus.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/SPUStatus.cc @@ -44,17 +44,11 @@ size_t SPUStatus::getSize() const size_t SPUStatus::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, itsSPUStatus); - - return offset; + return MSH_pack(buffer, offset, itsSPUStatus); } size_t SPUStatus::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, itsSPUStatus); - - return offset; + return MSH_unpack(buffer, offset, itsSPUStatus); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/Statistics.cc b/MAC/APL/PIC/RSP_Protocol/src/Statistics.cc index d5fe5acd7ed1bfea2fc89e8baf94bc476d5f5079..c87f64323bd35c89063cc49871d7b55b04d8e17e 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/Statistics.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/Statistics.cc @@ -39,17 +39,11 @@ size_t Statistics::getSize() const size_t Statistics::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_statistics); - - return offset; + return MSH_pack(buffer, offset, m_statistics); } size_t Statistics::unpack(const char*buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_statistics); - - return offset; + return MSH_unpack(buffer, offset, m_statistics); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/SubbandSelection.cc b/MAC/APL/PIC/RSP_Protocol/src/SubbandSelection.cc index e7775a7ef128a1b09f4144d90577e24f4ca252a7..11d590df8b2311821cf4530d18505415d9bf7e5f 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/SubbandSelection.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/SubbandSelection.cc @@ -47,8 +47,8 @@ size_t SubbandSelection::pack(char* buffer) const { size_t offset = 0; - MSH_pack(buffer, offset, itsCrosslets); - MSH_pack(buffer, offset, itsBeamlets); + offset = MSH_pack(buffer, offset, itsCrosslets); + offset = MSH_pack(buffer, offset, itsBeamlets); memcpy(buffer + offset, &m_type, sizeof(uint16)); offset += sizeof(uint16); @@ -59,8 +59,8 @@ size_t SubbandSelection::unpack(const char *buffer) { size_t offset = 0; - MSH_unpack(buffer, offset, itsCrosslets); - MSH_unpack(buffer, offset, itsBeamlets); + offset = MSH_unpack(buffer, offset, itsCrosslets); + offset = MSH_unpack(buffer, offset, itsBeamlets); memcpy(&m_type, buffer + offset, sizeof(uint16)); offset += sizeof(uint16); diff --git a/MAC/APL/PIC/RSP_Protocol/src/SystemStatus.cc b/MAC/APL/PIC/RSP_Protocol/src/SystemStatus.cc index fb74ff657a10f355dc7cd09a0d3c342aaffb5f42..6e0af2d8e40bfb26935e6d9bffb252b4b58cef34 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/SystemStatus.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/SystemStatus.cc @@ -44,17 +44,11 @@ size_t SystemStatus::getSize() const size_t SystemStatus::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_board_status); - - return offset; + return MSH_pack(buffer, offset, m_board_status); } size_t SystemStatus::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_board_status); - - return offset; + return MSH_unpack(buffer, offset, m_board_status); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/TBBSettings.cc b/MAC/APL/PIC/RSP_Protocol/src/TBBSettings.cc index 3bf2e5aea12ee00755827b2c20c12f32d36dfc32..ff17e4106151502d52315c9f6540a8bbe1ede3f9 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/TBBSettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/TBBSettings.cc @@ -39,17 +39,11 @@ size_t TBBSettings::getSize() const size_t TBBSettings::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_bandsel); - - return offset; + return MSH_pack(buffer, offset, m_bandsel); } size_t TBBSettings::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_bandsel); - - return offset; + return MSH_unpack(buffer, offset, m_bandsel); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/TDStatus.cc b/MAC/APL/PIC/RSP_Protocol/src/TDStatus.cc index ef2455782c5407cf62adbad06f31afbae8390d8b..617c3459f0e9cded4670d78b9896bb88ccb1e25f 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/TDStatus.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/TDStatus.cc @@ -44,17 +44,11 @@ size_t TDStatus::getSize() const size_t TDStatus::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_board_status); - - return offset; + return MSH_pack(buffer, offset, m_board_status); } size_t TDStatus::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_board_status); - - return offset; + return MSH_unpack(buffer, offset, m_board_status); } diff --git a/MAC/APL/PIC/RSP_Protocol/src/Versions.cc b/MAC/APL/PIC/RSP_Protocol/src/Versions.cc index 6c851f54d722ec83d7b9267837d383b11560f8c6..723e57bec6d9a53eca4384e7d9a691f4aa5725d8 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/Versions.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/Versions.cc @@ -41,19 +41,15 @@ size_t Versions::getSize() const size_t Versions::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_bp_versions); - MSH_pack(buffer, offset, m_ap_versions); - + offset = MSH_pack(buffer, offset, m_bp_versions); + offset = MSH_pack(buffer, offset, m_ap_versions); return offset; } size_t Versions::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_bp_versions); - MSH_unpack(buffer, offset, m_ap_versions); - + offset = MSH_unpack(buffer, offset, m_bp_versions); + offset = MSH_unpack(buffer, offset, m_ap_versions); return offset; } diff --git a/MAC/APL/PIC/RSP_Protocol/src/WGSettings.cc b/MAC/APL/PIC/RSP_Protocol/src/WGSettings.cc index 42182dca84cdd983c145acf801b7d4568fe4b693..02b47ebbd7d6794cebb7ebad87a164c06af4d84c 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/WGSettings.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/WGSettings.cc @@ -105,19 +105,13 @@ size_t WGSettings::getSize() const size_t WGSettings::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_registers); - - return offset; + return MSH_pack(buffer, offset, m_registers); } size_t WGSettings::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_registers); - - return offset; + return MSH_unpack(buffer, offset, m_registers); } Array<int32, 1> WGSettings::preset(int index) diff --git a/MAC/APL/PIC/RSP_Protocol/src/XCStatistics.cc b/MAC/APL/PIC/RSP_Protocol/src/XCStatistics.cc index 6e720e95c51c8054d11cca1fd7a3b5e98468a92a..a81fb4ea2141187280f5300478acdc73b8726b9d 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/XCStatistics.cc +++ b/MAC/APL/PIC/RSP_Protocol/src/XCStatistics.cc @@ -39,17 +39,11 @@ size_t XCStatistics::getSize() const size_t XCStatistics::pack (char* buffer) const { size_t offset = 0; - - MSH_pack(buffer, offset, m_xstatistics); - - return offset; + return MSH_pack(buffer, offset, m_xstatistics); } size_t XCStatistics::unpack(const char *buffer) { size_t offset = 0; - - MSH_unpack(buffer, offset, m_xstatistics); - - return offset; + return MSH_unpack(buffer, offset, m_xstatistics); } diff --git a/MAC/APL/RTCCommon/include/APL/RTCCommon/MarshallBlitz.h b/MAC/APL/RTCCommon/include/APL/RTCCommon/MarshallBlitz.h index 93406e176fe6518f7c6c2304623afb6ada682fe7..d80112da45caebe7ca1ff6b8e44d246c62d781e2 100644 --- a/MAC/APL/RTCCommon/include/APL/RTCCommon/MarshallBlitz.h +++ b/MAC/APL/RTCCommon/include/APL/RTCCommon/MarshallBlitz.h @@ -37,7 +37,7 @@ template<typename T, int N> size_t MSH_size( const blitz::Array<T,N> &array ) // PACK blitz::array<...> // first copy the dimensions of the array, then the array itself. -template<typename T, int N> void MSH_pack( char *bufptr, size_t &offset, const blitz::Array<T,N> &array ) +template<typename T, int N> size_t MSH_pack( char *bufptr, size_t offset, const blitz::Array<T,N> &array ) { for (int dim = blitz::firstDim; dim < blitz::firstDim + N; dim++) { LOFAR::int32 extent = array.extent(dim); @@ -55,10 +55,11 @@ template<typename T, int N> void MSH_pack( char *bufptr, size_t &offset, const b exit(EXIT_FAILURE); } } + return (offset); } // UNPACK blitz::array<...> -template<typename T, int N> void MSH_unpack( const char *bufptr, size_t &offset, blitz::Array<T,N> &array ) +template<typename T, int N> size_t MSH_unpack( const char *bufptr, size_t offset, blitz::Array<T,N> &array ) { blitz::TinyVector<int, N> extent; @@ -74,6 +75,7 @@ template<typename T, int N> void MSH_unpack( const char *bufptr, size_t &offset, memcpy(array.data(), bufptr + offset, array.size() * sizeof(T)); offset += array.size() * sizeof(T); + return (offset); } #endif /* MARSHALLBLITZ_H_ */ diff --git a/MAC/APL/RTCCommon/include/APL/RTCCommon/RegisterState.h b/MAC/APL/RTCCommon/include/APL/RTCCommon/RegisterState.h index d247674115d8c9a8948f1239abd3e64f65c5a72f..e5a7f0a3b685e987e1dbee98c580ceae704b268a 100644 --- a/MAC/APL/RTCCommon/include/APL/RTCCommon/RegisterState.h +++ b/MAC/APL/RTCCommon/include/APL/RTCCommon/RegisterState.h @@ -135,14 +135,12 @@ public: size_t pack(char* buffer) const { size_t offset = 0; - MSH_pack(buffer, offset, m_state); - return offset; + return MSH_pack(buffer, offset, m_state); } size_t unpack(const char* buffer) { size_t offset = 0; - MSH_unpack(buffer, offset, m_state); - return offset; + return MSH_unpack(buffer, offset, m_state); } private: diff --git a/MAC/APL/RTCCommon/test/tMarshallBlitz.cc b/MAC/APL/RTCCommon/test/tMarshallBlitz.cc index 369a3f9a6c3e5adb7febfaf087a02b8594820217..5c9f3471576ef0318b16e0d87912cb07995fea3d 100644 --- a/MAC/APL/RTCCommon/test/tMarshallBlitz.cc +++ b/MAC/APL/RTCCommon/test/tMarshallBlitz.cc @@ -51,13 +51,13 @@ int main (int, char* argv[]) bzero(buf, 4096); offset = 0; - MSH_pack(buf, offset, ba1); + offset = MSH_pack(buf, offset, ba1); cout << "packed:" << endl; hexdump(buf, offset); blitz::Array<double, 2> ba2(2,4); offset = 0; - MSH_unpack(buf, offset, ba2); + offset = MSH_unpack(buf, offset, ba2); cout << "unpacked: " << ba2 << endl; // blitz array <int> @@ -68,13 +68,13 @@ int main (int, char* argv[]) bzero(buf, 4096); offset = 0; - MSH_pack(buf, offset, emptyArr); + offset = MSH_pack(buf, offset, emptyArr); cout << "packed:" << endl; hexdump(buf, offset); blitz::Array<int, 2> empty2; offset = 0; - MSH_unpack(buf, offset, empty2); + offset = MSH_unpack(buf, offset, empty2); cout << "unpacked: " << empty2 << endl; return (0); diff --git a/MAC/MACIO/test/tMarshalling.cc b/MAC/MACIO/test/tMarshalling.cc index 679ca1bc023da46b8ebd0183fae3069c2e936644..25f47fda1426894d0b346e99b050813b5ba8579f 100644 --- a/MAC/MACIO/test/tMarshalling.cc +++ b/MAC/MACIO/test/tMarshalling.cc @@ -45,24 +45,21 @@ size_t SubArray::getSize() const { } size_t SubArray::pack(char* buffer) const { - uint32 offset = 0; + size_t offset = 0; memcpy(buffer+offset, &someInt, sizeof(int)); offset += sizeof (int); memcpy(buffer+offset, &someDouble, sizeof(double)); offset += sizeof (double); - MSH_pack(buffer, offset, someString); - - return (offset); + return MSH_pack(buffer, offset, someString); } size_t SubArray::unpack(const char* buffer) { - uint32 offset = 0; + size_t offset = 0; memcpy(&someInt, buffer+offset, sizeof(int)); offset += sizeof(int); memcpy(&someDouble, buffer+offset, sizeof(double)); offset += sizeof(double); - MSH_unpack(buffer, offset, someString); - return (offset); + return MSH_unpack(buffer, offset, someString); } SubArrayNC::SubArrayNC(int i, double d, string s) : @@ -75,24 +72,21 @@ size_t SubArrayNC::getSize() const { } size_t SubArrayNC::pack(char* buffer) const { - uint32 offset = 0; + size_t offset = 0; memcpy(buffer+offset, &someInt, sizeof(int)); offset += sizeof (int); memcpy(buffer+offset, &someDouble, sizeof(double)); offset += sizeof (double); - MSH_pack(buffer, offset, someString); - - return (offset); + return MSH_pack(buffer, offset, someString); } size_t SubArrayNC::unpack(const char* buffer) { - uint32 offset = 0; + size_t offset = 0; memcpy(&someInt, buffer+offset, sizeof(int)); offset += sizeof(int); memcpy(&someDouble, buffer+offset, sizeof(double)); offset += sizeof(double); - MSH_unpack(buffer, offset, someString); - return (offset); + return MSH_unpack(buffer, offset, someString); } @@ -109,14 +103,14 @@ int main (int /*argc*/, char** /*argv[]*/) cout << "size = " << MSH_size(tstString) << endl; char buf[4096]; - uint32 offset1(0); - MSH_pack(buf, offset1, tstString); + size_t offset1(0); + offset1 = MSH_pack(buf, offset1, tstString); cout << "packed: " << endl; hexdump(buf, offset1); string newString; - uint32 offset2(0); - MSH_unpack(buf, offset2, newString); + size_t offset2(0); + offset2 = MSH_unpack(buf, offset2, newString); cout << "unpacked: " << newString << endl; ASSERTSTR (offset1 == offset2 && tstString == newString, "Failure 1 in strings"); @@ -132,13 +126,13 @@ int main (int /*argc*/, char** /*argv[]*/) bzero(buf, 4096); offset1 = 0; - MSH_pack(buf, offset1, bs1); + offset1 = MSH_pack(buf, offset1, bs1); cout << "packed:" << endl; hexdump(buf, offset1); LOFAR::bitset<35> bs2; offset2 = 0; - MSH_unpack(buf, offset2, bs2); + offset2 = MSH_unpack(buf, offset2, bs2); cout << "size = " << offset2 << endl; cout << "unpacked: " << bs2 << endl; ASSERTSTR (offset1 == offset2, "Failure in offset var of bitsets"); @@ -156,13 +150,13 @@ int main (int /*argc*/, char** /*argv[]*/) bzero(buf, 4096); offset1 = 0; - MSH_pack(&buf[0], offset1, dbs1); + offset1 = MSH_pack(&buf[0], offset1, dbs1); cout << "packed:" << endl; hexdump(buf, offset1); boost::dynamic_bitset<> dbs2; offset2 = 0; - MSH_unpack(&buf[0], offset2, dbs2); + offset2 = MSH_unpack(&buf[0], offset2, dbs2); cout << "unpacked: " << dbs2 << endl; cout << "size = " << dbs2.size() << endl; cout << "offset1 = " << offset1 << endl; @@ -205,21 +199,20 @@ int main (int /*argc*/, char** /*argv[]*/) iter++; } - uint32 mapsize; + size_t mapsize; mapsize = MSH_size(ms1); -// MSH_SIZE_MAP_STRING_CLASS(mapsize, ms1, SubArray); cout << "size = " << mapsize << endl; bzero(buf, 4096); offset = 0; - MSH_pack(buf, offset, ms1); -// MSH_PACK_MAP_STRING_CLASS(buf, offset, ms1, SubArray); + offset = MSH_pack(buf, offset, ms1); + ASSERTSTR (offset == mapsize, "Size error in map<string, SubArray>"); cout << "packed:" << endl; - hexdump(buf, mapsize); + hexdump(buf, offset); map<string, SubArray> ms2; offset = 0; - MSH_unpack(buf, offset, ms2); + offset = MSH_unpack(buf, offset, ms2); cout << "Unpacked map<string, SubArray>: " << endl; map<string, SubArray>::iterator iter2 = ms2.begin(); map<string, SubArray>::iterator end2 = ms2.end(); @@ -243,19 +236,20 @@ int main (int /*argc*/, char** /*argv[]*/) iternc++; } - uint32 mapncsize; + size_t mapncsize; mapncsize = MSH_size(msanc1); cout << "size = " << mapncsize << endl; bzero(buf, 4096); offset = 0; - MSH_pack(buf, offset, msanc1); + offset = MSH_pack(buf, offset, msanc1); + ASSERTSTR (offset == mapncsize, "Size error in map<string, SubArrayNC*>"); cout << "packed:" << endl; - hexdump(buf, mapncsize); + hexdump(buf, offset); map<string, SubArrayNC*> msanc2; offset = 0; - MSH_unpack(buf, offset, msanc2); + offset = MSH_unpack(buf, offset, msanc2); cout << "Unpacked map<string, SubArrayNC*>: " << endl; iternc = msanc2.begin(); endnc = msanc2.end(); @@ -281,19 +275,20 @@ int main (int /*argc*/, char** /*argv[]*/) itersv++; } - uint32 svsize; + size_t svsize; svsize = MSH_size(sv1); cout << "size = " << svsize << endl; bzero(buf, 4096); offset1 = 0; - MSH_pack(buf, offset1, sv1); + offset1 = MSH_pack(buf, offset1, sv1); + ASSERTSTR (offset1 == svsize, "Size error in vector<string>"); cout << "packed:" << endl; hexdump(buf, svsize); vector<string> sv2; offset2 = 0; - MSH_unpack(buf, offset2, sv2); + offset2 = MSH_unpack(buf, offset2, sv2); cout << "Unpacked vector<string>" << endl; itersv = sv2.begin(); endsv = sv2.end(); @@ -321,19 +316,20 @@ int main (int /*argc*/, char** /*argv[]*/) iterdv++; } - uint32 dvsize; + size_t dvsize; dvsize = MSH_size(dv1); cout << "size = " << dvsize << endl; bzero(buf, 4096); - offset = 0; - MSH_pack(buf, offset, dv1); + offset1 = 0; + offset1 = MSH_pack(buf, offset1, dv1); + ASSERTSTR (offset1 == dvsize, "Size error in vector<double>"); cout << "packed:" << endl; hexdump(buf, dvsize); vector<double> dv2; - offset = 0; - MSH_unpack(buf, offset, dv2); + offset2 = 0; + offset2 = MSH_unpack(buf, offset2, dv2); cout << "Unpacked vector<double>" << endl; iterdv = dv2.begin(); enddv = dv2.end();