Skip to content

Commit 32e2b93

Browse files
author
Daniel Kroening
committed
fstream now takes std::string
1 parent 7250494 commit 32e2b93

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/cegis/cegis-util/cbmc_runner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace
2020
{
2121
bool exists(const std::string &name)
2222
{
23-
return std::ifstream(name.c_str()).good();
23+
return std::ifstream(name).good();
2424
}
2525

2626
std::string get_goto_file_name(const size_t index)

src/cegis/genetic/concrete_test_runner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void implement_deserialise(std::string &source)
5151

5252
}
5353

54-
void write_file(const char * const path, const std::string &content)
54+
void write_file(const std::string &path, const std::string &content)
5555
{
5656
std::ofstream ofs(path);
5757
ofs << content;
@@ -71,7 +71,7 @@ void prepare_executable(bool &executable_compiled,
7171
std::string source;
7272
implement_deserialise(source);
7373
source+=source_code_provider();
74-
write_file(source_file_name.c_str(), source);
74+
write_file(source_file_name, source);
7575
std::string compile_command(COMPILE_COMMAND);
7676
compile_command+=source_file_name;
7777
compile_command+=ARTIFACT_SEPARATOR;

src/cegis/genetic/dynamic_test_runner_helper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void close_fitness_tester_library(fitness_lib_handlet &handle)
2424

2525
namespace
2626
{
27-
void write_file(const char * const path, const std::string &content)
27+
void write_file(const std::string &path, const std::string &content)
2828
{
2929
std::ofstream ofs(path);
3030
ofs << content;
@@ -51,7 +51,7 @@ void *prepare_fitness_tester_library(fitness_lib_handlet &handle,
5151
{
5252
const temporary_filet source_file(SOURCE_FILE_PREFIX, SOURCE_FILE_SUFFIX);
5353
const std::string source_file_name(source_file());
54-
write_file(source_file_name.c_str(), source_code_provider());
54+
write_file(source_file_name, source_code_provider());
5555
std::string compile_command;
5656
if (configt::ansi_ct::preprocessort::CLANG == config.ansi_c.preprocessor)
5757
compile_command+=CLANG_COMPILE_COMMAND;

0 commit comments

Comments
 (0)