Skip to content

Commit

Permalink
Fix includes
Browse files Browse the repository at this point in the history
  • Loading branch information
davschneller committed Nov 14, 2024
1 parent 3d2b5c5 commit 5103508
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
7 changes: 5 additions & 2 deletions args.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@
#include "utils/stringutils.h"

#include <algorithm>
#include <getopt.h>
#include <cctype>
#include <cstddef>
#include <iomanip>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>

// NOLINTNEXTLINE
#include <getopt.h>

namespace utils {

/**
Expand Down
18 changes: 10 additions & 8 deletions logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
#include <execinfo.h>
#include <functional>
#include <iostream>
#include <signal.h>
#include <sstream>
#include <stdlib.h>
#include <string>
#include <tuple>
#include <type_traits>
Expand All @@ -30,10 +32,6 @@
#endif // NDEBUG
#endif // LOG_LEVEL

#ifndef LOG_PREFIX
#define LOG_PREFIX ""
#endif // DEBUG_PRFIX

#ifndef LOG_ABORT
#ifdef MPI_VERSION
#define LOG_ABORT MPI_Abort(MPI_COMM_WORLD, 134)
Expand Down Expand Up @@ -157,10 +155,14 @@ class Logger {
stream->buffer << "- : ";
}
}
/**
* Copy constructor
*/
Logger(const Logger& o) : stream(o.stream) { stream->ref++; };

Logger(const Logger& o) : stream(o.stream) { stream->ref++; }

// for now, delete the move constructors/operators

Logger(Logger&& o) = delete;
auto operator=(Logger&& o) = delete;

~Logger() {
if (--stream->ref == 0) {
if (stream->rank == Logger::displayRank || stream->rank == -1 || Logger::logAll ||
Expand Down
1 change: 1 addition & 0 deletions path.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#ifndef UTILS_PATH_H_
#define UTILS_PATH_H_

#include <cstddef>
#include <string>
#include <sys/stat.h>
#include <utility>
Expand Down
8 changes: 7 additions & 1 deletion progress.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
#include "utils/logger.h"
#include "utils/stringutils.h"

#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <string>
#include <sys/ioctl.h>
#include <unistd.h>
Expand Down Expand Up @@ -182,11 +184,15 @@ class Progress {

// Try to get terminal size
#ifdef TIOCGSIZE
struct ttysize ts;
struct ttysize ts{};

// NOLINTNEXTLINE
ioctl(STDIN_FILENO, TIOCGSIZE, &ts);
m_barSize = ts.ts_cols;
#elif defined(TIOCGWINSZ)
struct winsize ts{};

// NOLINTNEXTLINE
ioctl(STDIN_FILENO, TIOCGWINSZ, &ts);
m_barSize = ts.ws_col;
#else
Expand Down
2 changes: 0 additions & 2 deletions stringutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <algorithm>
#include <cctype>
#include <cstring>
#include <functional>
#include <locale>
#include <sstream>
#include <string>
#include <vector>
Expand Down

0 comments on commit 5103508

Please sign in to comment.