Skip to content

Commit

Permalink
Just replaced (void) with static_cast<void>
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanisham committed May 31, 2024
1 parent 9b67db8 commit a911056
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/vm/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static void errorFn(WrenVM* vm, const WrenErrorType errorType, const char* modul
std::cerr << boost::format("runtime [%1%:%2%] ") % module % line;
} else {
std::cerr << rang::fg::red << "Error: " << rang::fg::reset << msg << std::endl;
if (std::getenv("FAN_LIB") == NULL) {
if (std::getenv("FAN_LIB") == nullptr) {
std::cerr << rang::fg::blue << "\nHELP: " << rang::fg::reset
<< "Fan requires the " << rang::fg::yellow << "FAN_LIB " << rang::fg::reset
<< "environment variable to be set with the path to Fan's standard library.\n"
Expand Down Expand Up @@ -196,7 +196,7 @@ WrenLoadModuleResult loadModuleFn(WrenVM* vm, const char* name) {
searchPath.replace_extension(".fan");
if (!std::filesystem::exists(searchPath)) {
const std::string fmt = (boost::format("File %1% wasn't found.") % searchPath).str();
std::cerr << fmt << std::endl;
std::cerr << rang::fg::red << "Error: " << rang::fg::reset << fmt << std::endl;
mod.source = nullptr;
return mod;
}
Expand All @@ -211,7 +211,7 @@ WrenLoadModuleResult loadModuleFn(WrenVM* vm, const char* name) {
const long fsize = ftell(file);
fseek(file, 0, SEEK_SET);
auto string = new char[fsize + 1];
(void)fread(string, fsize, 1, file);
static_cast<void>(fread(string, fsize, 1, file));
string[fsize] = 0;
mod.source = string;
mod.onComplete = &loadModuleComplete;
Expand Down Expand Up @@ -434,7 +434,7 @@ void vm::Runtime::setEntryPoint(const std::string& target) {

vm::Runtime::~Runtime() {
curl_global_cleanup();
// wrenFreeVM ran further down the page in the shared pointer's "deleter" labmda.
// wrenFreeVM ran further down the page in the shared pointer's "deleter" lambda.
}

vm::Runtime::Runtime() {
Expand Down
2 changes: 1 addition & 1 deletion src/vm/std/fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void lib::fs::fileRead(WrenVM* vm) {
fseek(*file, 0, SEEK_SET);
try {
const auto string = new char[fsize + 1];
(void)fread(string, fsize, 1, *file);
static_cast<void>(fread(string, fsize, 1, *file));
string[fsize] = 0;
wrenSetSlotString(vm, 0, string);
delete[] string;
Expand Down

0 comments on commit a911056

Please sign in to comment.