Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add std:: namespace to getenv calls #926

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/umpire/ResourceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ResourceManager::ResourceManager()
{
UMPIRE_LOG(Debug, "() entering");

const char* env_enable_log{getenv("UMPIRE_LOG_LEVEL")};
const char* env_enable_log{std::getenv("UMPIRE_LOG_LEVEL")};
const bool enable_log{env_enable_log != nullptr};

util::initialize_io(enable_log);
Expand Down
5 changes: 3 additions & 2 deletions src/umpire/event/event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define UMPIRE_event_HPP

#include <cstdint>
#include <cstdlib>
#include <map>
#include <sstream>
#include <string>
Expand Down Expand Up @@ -57,9 +58,9 @@ namespace umpire {
namespace event {

namespace {
static const char* replay_env{getenv("UMPIRE_REPLAY")};
static const char* replay_env{std::getenv("UMPIRE_REPLAY")};
static const bool enable_replay{(replay_env != NULL)};
static const char* event_env{getenv("UMPIRE_EVENTS")};
static const char* event_env{std::getenv("UMPIRE_EVENTS")};
static const bool enable_event{(event_env != NULL)};
static const bool event_build_enabled{enable_replay || enable_event};
} // namespace
Expand Down
2 changes: 1 addition & 1 deletion src/umpire/util/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Logger::Logger() noexcept
m_is_enabled{false, false, false, false}
{
message::Level level{defaultLevel};
const char* enval = getenv(env_name);
const char* enval = std::getenv(env_name);

if (enval) {
for (int i = 0; i < message::Num_Levels; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion src/umpire/util/Macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
plog = axom::slic::Logger::getActiveLogger(); \
axom::slic::message::Level level; \
level = axom::slic::message::Level::Error; \
char* enval = getenv(env_name.c_str()); \
char* enval = std::getenv(env_name.c_str()); \
if (enval != NULL) { \
for (int i = 0; i < axom::slic::message::Level::Num_Levels; ++i) { \
if (strcasecmp(enval, axom::slic::message::MessageLevelName[i].c_str()) == 0) { \
Expand Down
2 changes: 1 addition & 1 deletion src/umpire/util/backtrace.inl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bool backtrace_enabled()
static bool initialized{false};

if (!initialized) {
const char* enval{getenv("UMPIRE_BACKTRACE")};
const char* enval{std::getenv("UMPIRE_BACKTRACE")};
if (enval) {
std::string env_str{enval};
std::transform(env_str.begin(), env_str.end(), env_str.begin(), ::toupper);
Expand Down
3 changes: 1 addition & 2 deletions src/umpire/util/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

#include "umpire/util/io.hpp"

#include <stdlib.h> // for getenv()

#include <cstdlib>
#include <fstream>
#include <iostream>
#include <ostream>
Expand Down