Skip to content
Snippets Groups Projects
Commit d5dc9a46 authored by Giovanna Lazzari Miotto's avatar Giovanna Lazzari Miotto :mushroom:
Browse files

chore: Change orbit count to signed 32-bit

parent fefe3aca
No related branches found
No related tags found
1 merge request!103feature: Introduce VCU128 processors and so much more
Pipeline #7274749 passed
......@@ -104,9 +104,11 @@ OrbitProcessor::FillOrbitMetadata OrbitProcessor::FillOrbit(orbit_trailer *trail
char *wr_ptr, const char *rd_end_ptr,
const char *wr_end_ptr,
bool is_dropped_orbit) {
std::pair<uint32_t, bool> orbit_header = std::pair<uint32_t, bool>{ProcessOrbitHeader(rd_ptr)};
uint32_t orbit = uint32_t{orbit_header.first};
if (orbit <= 0) return {0, 0, 0};
std::pair<uint32_t, bool> orbit_header = ProcessOrbitHeader(rd_ptr);
auto orbit = static_cast<int>(orbit_header.first);
if (orbit <= 0) {
return {0, 0, 0};
}
//.second is the warning test enable bit
rd_ptr += 32; // +32 to account for orbit header
if (cmsswHeaders) {
......@@ -141,7 +143,7 @@ OrbitProcessor::FillOrbitMetadata OrbitProcessor::FillOrbit(orbit_trailer *trail
WriteMemRegion writeable_block(&wr_ptr, wr_end_ptr);
assert(writeable_block.CheckBounds(GetPacketSize())); // Max size a decoded block can use
BxMetadata meta{orbit_header.second, bx, orbit};
BxMetadata meta{orbit_header.second, static_cast<uint32_t>(bx), orbit};
const int ret_counts = ProcessBlock(readable_block, writeable_block, meta);
if (ret_counts == -1) {
......
#ifndef ORBIT_PROCESSOR_H
#define ORBIT_PROCESSOR_H
#include <cassert>
#include "config.h"
#include "controls.h"
#include "format.h"
......@@ -42,7 +44,7 @@ class OrbitProcessor : public Processor {
protected:
struct FillOrbitMetadata {
uint32_t counts;
uint32_t orbit;
int orbit;
uint32_t filled_bxs;
};
......@@ -67,7 +69,7 @@ class OrbitProcessor : public Processor {
struct BxMetadata {
uint32_t header;
uint32_t bx;
uint32_t orbit;
int orbit;
};
template <typename T, uint32_t N>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment