From 316aa16b3abb4f75a8800b756423d4520f39aafd Mon Sep 17 00:00:00 2001
From: Lukas Werner <lks.werner@fau.de>
Date: Tue, 6 Mar 2018 13:57:03 +0100
Subject: [PATCH] Changed type of filename timestep width

---
 src/pe/raytracing/Raytracer.cpp |  4 ++--
 src/pe/raytracing/Raytracer.h   | 16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/pe/raytracing/Raytracer.cpp b/src/pe/raytracing/Raytracer.cpp
index 9c76af29b..ff9d5a775 100644
--- a/src/pe/raytracing/Raytracer.cpp
+++ b/src/pe/raytracing/Raytracer.cpp
@@ -115,7 +115,7 @@ Raytracer::Raytracer(const shared_ptr<BlockStorage> forest, const BlockDataID st
       WALBERLA_ABORT("Cannot enable local image output without image_output_directory parameter being set.");
    }
       
-   filenameTimestepWidth_ = config.getParameter<int8_t>("filenameTimestepWidth", int8_t(5));
+   filenameTimestepWidth_ = config.getParameter<uint8_t>("filenameTimestepWidth", uint8_t(5));
    
    cameraPosition_ = config.getParameter<Vec3>("cameraPosition");
    lookAtPoint_ = config.getParameter<Vec3>("lookAt");
@@ -152,7 +152,7 @@ void Raytracer::setupView_() {
  */
 void Raytracer::setupFilenameRankWidth_() {
    int numProcesses = mpi::MPIManager::instance()->numProcesses();
-   filenameRankWidth_ = int8_c(log10(numProcesses))+1;
+   filenameRankWidth_ = uint8_c(log10(numProcesses))+1;
 }
 
 /*!\brief Generates the filename for output files.
diff --git a/src/pe/raytracing/Raytracer.h b/src/pe/raytracing/Raytracer.h
index 55809cc0d..dccf710f5 100644
--- a/src/pe/raytracing/Raytracer.h
+++ b/src/pe/raytracing/Raytracer.h
@@ -101,10 +101,10 @@ private:
    bool localImageOutputEnabled_; //!< Enable / disable writing images of the local process to file.
    std::string imageOutputDirectory_; //!< Path to the image output directory.
    
-   int8_t filenameTimestepWidth_; /*!< Width of the timestep number in output filenames.
-                                  * Use e.g. 5 for ranges from 1 to 99 999: Will result in
-                                  * filenames like image_00001.png up to image_99999.png. */
-   int8_t filenameRankWidth_;  //!< Width of the mpi rank part in a filename.
+   uint8_t filenameTimestepWidth_; /*!< Width of the timestep number in output filenames.
+                                   * Use e.g. 5 for ranges from 1 to 99 999: Will result in
+                                   * filenames like image_00001.png up to image_99999.png. */
+   uint8_t filenameRankWidth_;  //!< Width of the mpi rank part in a filename.
    std::function<ShadingParameters (const BodyID)> bodyToShadingParamsFunction_; /*!< Function which returns a 
                                                                                   * ShadingParameters struct
                                                                                   * given the specified body. */
@@ -139,7 +139,7 @@ public:
    inline bool getImageOutputEnabled() const;
    inline bool getLocalImageOutputEnabled() const;
    inline const std::string& getImageOutputDirectory() const;
-   inline int8_t getFilenameTimestepWidth() const;
+   inline uint8_t getFilenameTimestepWidth() const;
    //@}
 
    /*!\name Set functions */
@@ -150,7 +150,7 @@ public:
    inline void setImageOutputEnabled(const bool enabled);
    inline void setLocalImageOutputEnabled(const bool enabled);
    inline void setImageOutputDirectory(const std::string& path);
-   inline void setFilenameTimestepWidth(int8_t width);
+   inline void setFilenameTimestepWidth(uint8_t width);
    //@}
    
    /*!\name Functions */
@@ -283,7 +283,7 @@ inline const std::string& Raytracer::getImageOutputDirectory() const {
 /*!\brief Returns width of the timestep number in output filenames.
  * \return Width of the timestep part in filenames.
  */
-inline int8_t Raytracer::getFilenameTimestepWidth() const {
+inline uint8_t Raytracer::getFilenameTimestepWidth() const {
    return filenameTimestepWidth_;
 }
 
@@ -343,7 +343,7 @@ inline void Raytracer::setImageOutputDirectory(const std::string& path) {
 /*!\brief Set width of timestep number in output filenames.
  * \param width Width of timestep part in a filename.
  */
-inline void Raytracer::setFilenameTimestepWidth(int8_t width) {
+inline void Raytracer::setFilenameTimestepWidth(uint8_t width) {
    filenameTimestepWidth_ = width;
 }
    
-- 
GitLab