Skip to content

Commit 4890204

Browse files
committed
Update internal write_goto_binary to return void
This function always returned `false` and was not exposed in the header file. Therefore we can freely update it to return `void` without causing problems for users of the serialisation code.
1 parent 021f3d1 commit 4890204

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/goto-programs/write_goto_binary.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,14 @@ static void write_goto_functions_binary(
121121
}
122122

123123
/// Writes a goto program to disc, using goto binary format
124-
bool write_goto_binary(
124+
static void write_goto_binary(
125125
std::ostream &out,
126126
const symbol_table_baset &symbol_table,
127127
const goto_functionst &goto_functions,
128128
irep_serializationt &irepconverter)
129129
{
130130
write_symbol_table_binary(out, symbol_table, irepconverter);
131131
write_goto_functions_binary(out, goto_functions, irepconverter);
132-
return false;
133132
}
134133

135134
/// Writes a goto program to disc
@@ -160,15 +159,19 @@ bool write_goto_binary(
160159
irep_serializationt irepconverter(irepc);
161160

162161
if(version < GOTO_BINARY_VERSION)
162+
{
163163
throw invalid_command_line_argument_exceptiont(
164164
"version " + std::to_string(version) + " no longer supported",
165165
"supported version = " + std::to_string(GOTO_BINARY_VERSION));
166-
else if(version > GOTO_BINARY_VERSION)
166+
}
167+
if(version > GOTO_BINARY_VERSION)
168+
{
167169
throw invalid_command_line_argument_exceptiont(
168170
"unknown goto binary version " + std::to_string(version),
169171
"supported version = " + std::to_string(GOTO_BINARY_VERSION));
170-
else
171-
return write_goto_binary(out, symbol_table, goto_functions, irepconverter);
172+
}
173+
write_goto_binary(out, symbol_table, goto_functions, irepconverter);
174+
return false;
172175
}
173176

174177
/// Writes a goto program to disc

0 commit comments

Comments
 (0)