Skip to content

Commit

Permalink
1) efxc2Exception.cpp and efxc2Console.cpp - guarg in case "#pragma o…
Browse files Browse the repository at this point in the history
…nce" does not work.

2) efxc2Utils.cpp - remove an unused variable in "readall"
3) efxc2Console - make Shutdown a const function.
  • Loading branch information
JPeterMugaas committed May 24, 2024
1 parent cbb7beb commit f9cbb7f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

cmake_minimum_required (VERSION 3.21)

set(EFXC2_VERSION 0.0.11.235)
set(EFXC2_VERSION 0.0.11.236)
project (efxc2 VERSION ${EFXC2_VERSION}
DESCRIPTION "Enhanced fxc2"
HOMEPAGE_URL "https://github.com/JPeterMugaas/efxc2"
Expand Down
7 changes: 5 additions & 2 deletions efxc2Console.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
//--------------------------------------------------------------------------------------

#pragma once
#ifndef EFXC2CONSOLE_H_INCLUDED
#define EFXC2CONSOLE_H_INCLUDED
#include "efxc2.h"

namespace efxc2Console {
Expand All @@ -35,7 +37,7 @@ namespace efxc2Console {
}

#ifdef _WIN32
void Shutdown() {
void Shutdown() const {
(void)SetConsoleMode(std_output, stdout_orig_console_mode);
(void)SetConsoleMode(std_error, stderr_orig_console_mode);
#else
Expand Down Expand Up @@ -94,4 +96,5 @@ namespace efxc2Console {
}
};
const Console console;
}
}
#endif
6 changes: 5 additions & 1 deletion efxc2Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
//--------------------------------------------------------------------------------------

#pragma once

#ifndef EFXC2EXCEPTION_H_INCLUDED
#define EFXC2EXCEPTION_H_INCLUDED
#include "efxc2.h"

namespace efxc2Exception {
Expand All @@ -27,4 +30,5 @@ namespace efxc2Exception {
class NoInputFile : public ProgramExceptionBase {};
class CompileError : public ProgramExceptionBase {};
class PreprocessError : public ProgramExceptionBase {};
}
}
#endif
2 changes: 0 additions & 2 deletions efxc2Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ bool efxc2Utils::readAll(_In_ std::ifstream& in,
_Out_ efxc2Utils::M_BUFFER& dataptr) {
dataptr = std::make_shared<std::vector<char>>();
auto temp = std::make_unique<std::vector<char>>();
size_t used = 0;
size_t n = 0;
bool result = false;
if (dataptr != nullptr) {
Expand All @@ -191,7 +190,6 @@ bool efxc2Utils::readAll(_In_ std::ifstream& in,
if (n == 0) {
break;
}
used += n;
temp->resize(n);
(void)dataptr->insert(dataptr->end(), temp->begin(), temp->end());
}
Expand Down

0 comments on commit f9cbb7f

Please sign in to comment.