Commit 08c26e9f authored by Ilya Prokhorov's avatar Ilya Prokhorov

Warnings fixed, old code removed

parent 699f7306
......@@ -21,7 +21,7 @@ SET(CMAKE_LINKER x86_64-apple-darwin19-ld)
SET(ENV{OSXCROSS_MP_INC} 1)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
set(CMAKE_CXX_STANDARD 17)
......
#include "Data.h"
#include "FSCUtils.h"
#include <sstream>
using namespace FlameSteelCore;
using namespace FlameSteelCore::Utils;
Data::Data() {
......@@ -28,7 +31,14 @@ shared_ptr<Data> Data::fromFilePath(shared_ptr<string> filePath) {
if (buffer)
{
fread (buffer, 1, length, file);
auto readBytes = fread (buffer, 1, length, file);
if (readBytes != length) {
string errorString = "FlameSteelCore::Data read from file:";
stringstream stderrString;
stderrString << stderr << endl;
errorString += stderrString.str();
throwRuntimeException(errorString);
}
}
data->data = buffer;
......@@ -37,4 +47,4 @@ shared_ptr<Data> Data::fromFilePath(shared_ptr<string> filePath) {
}
return data;
};
\ No newline at end of file
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment