Commit 74f4eea3 authored by David Frank's avatar David Frank
Browse files

Replace std::make_(un)signed_t with as(Un)signed

parent 3558eb04
Pipeline #530840 passed with stages
in 33 minutes and 49 seconds
#include "DetectorDescriptor.h"
#include <iostream>
#include "TypeCasts.hpp"
namespace elsa
{
......@@ -62,7 +62,7 @@ namespace elsa
std::optional<Geometry> DetectorDescriptor::getGeometryAt(const index_t index) const
{
// Cast to size_t to silence warnings
auto i = std::make_unsigned_t<std::size_t>(index);
auto i = asUnsigned(index);
if (_geometry.size() <= i)
return {};
......
#include "PartitionDescriptor.h"
#include "Error.h"
#include "TypeCasts.hpp"
#include <unordered_map>
#include <type_traits>
......@@ -68,11 +69,11 @@ namespace elsa
if (it != sizeToIndex.end()) {
_indexMap[i] = it->second;
auto index = std::make_unsigned_t<index_t>(it->second);
auto index = asSigned(it->second);
numCoeffs = _blockDescriptors[index]->getNumberOfCoefficients();
} else {
sizeToIndex.insert({slicesInBlock[i], _blockDescriptors.size()});
_indexMap[i] = std::make_signed_t<long>(_blockDescriptors.size());
_indexMap[i] = asUnsigned(_blockDescriptors.size());
_blockDescriptors.push_back(generateDescriptorOfPartition(slicesInBlock[i]));
numCoeffs = _blockDescriptors.back()->getNumberOfCoefficients();
}
......@@ -96,7 +97,7 @@ namespace elsa
if (i < 0 || i >= getNumberOfBlocks())
throw InvalidArgumentError("BlockDescriptor: index i is out of bounds");
auto index = std::make_unsigned_t<long>(_indexMap[i]);
auto index = asUnsigned(_indexMap[i]);
return *_blockDescriptors[index];
}
......
......@@ -31,14 +31,14 @@ namespace elsa
.all()
&& "PlanarDetectorDescriptor::computeRayToDetector: Assumption detectorCoord in "
"bounds, wrong");
assert(std::make_unsigned_t<std::size_t>(poseIndex) < _geometry.size()
assert(asUnsigned(poseIndex) < _geometry.size()
&& "PlanarDetectorDescriptor::computeRayToDetector: Assumption poseIndex smaller "
"than number of poses, wrong");
auto dim = getNumberOfDimensions();
// get the pose of trajectory
auto geometry = _geometry[std::make_unsigned_t<index_t>(poseIndex)];
auto geometry = _geometry[asUnsigned(poseIndex)];
auto projInvMatrix = geometry.getInverseProjectionMatrix();
......
#pragma once
#include "DetectorDescriptor.h"
#include "TypeCasts.hpp"
namespace elsa
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment