Commit fc48bf26 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

preprocessor: write error messages to cerr instead of cout, replace \n with endl

parent 9eb7c00d
......@@ -800,7 +800,7 @@ DynamicModel::writeModelEquationsCode(string &file_name, const string &bin_basen
code_file.open(main_name.c_str(), ios::out | ios::binary | ios::ate);
if (!code_file.is_open())
{
cout << "Error : Can't open file \"" << main_name << "\" for writing\n";
cerr << "Error : Can't open file \"" << main_name << "\" for writing" << endl;
exit(EXIT_FAILURE);
}
......@@ -1076,7 +1076,7 @@ DynamicModel::writeModelEquationsCode_Block(string &file_name, const string &bin
code_file.open(main_name.c_str(), ios::out | ios::binary | ios::ate);
if (!code_file.is_open())
{
cout << "Error : Can't open file \"" << main_name << "\" for writing\n";
cerr << "Error : Can't open file \"" << main_name << "\" for writing" << endl;
exit(EXIT_FAILURE);
}
//Temporary variables declaration
......@@ -1768,7 +1768,7 @@ DynamicModel::Write_Inf_To_Bin_File_Block(const string &dynamic_basename, const
SaveCode.open((bin_basename + "_dynamic.bin").c_str(), ios::out | ios::binary);
if (!SaveCode.is_open())
{
cout << "Error : Can't open file \"" << bin_basename << "_dynamic.bin\" for writing\n";
cerr << "Error : Can't open file \"" << bin_basename << "_dynamic.bin\" for writing" << endl;
exit(EXIT_FAILURE);
}
u_count_int = 0;
......
......@@ -1594,7 +1594,7 @@ ModelTree::Write_Inf_To_Bin_File(const string &basename,
SaveCode.open(bin_basename.c_str(), ios::out | ios::binary);
if (!SaveCode.is_open())
{
cout << "Error : Can't open file \"" << bin_basename << "\" for writing\n";
cerr << "Error : Can't open file \"" << bin_basename << "\" for writing" << endl;
exit(EXIT_FAILURE);
}
u_count_int = 0;
......
......@@ -412,7 +412,7 @@ StaticModel::writeModelEquationsCode(const string file_name, const string bin_ba
code_file.open(main_name.c_str(), ios::out | ios::binary | ios::ate);
if (!code_file.is_open())
{
cout << "Error : Can't open file \"" << main_name << "\" for writing\n";
cerr << "Error : Can't open file \"" << main_name << "\" for writing" << endl;
exit(EXIT_FAILURE);
}
int count_u;
......@@ -596,7 +596,7 @@ StaticModel::writeModelEquationsCode_Block(const string file_name, const string
code_file.open(main_name.c_str(), ios::out | ios::binary | ios::ate);
if (!code_file.is_open())
{
cout << "Error : Can't open file \"" << main_name << "\" for writing\n";
cerr << "Error : Can't open file \"" << main_name << "\" for writing" << endl;
exit(EXIT_FAILURE);
}
//Temporary variables declaration
......@@ -990,7 +990,7 @@ StaticModel::Write_Inf_To_Bin_File_Block(const string &static_basename, const st
SaveCode.open((bin_basename + "_static.bin").c_str(), ios::out | ios::binary);
if (!SaveCode.is_open())
{
cout << "Error : Can't open file \"" << bin_basename << "_static.bin\" for writing\n";
cerr << "Error : Can't open file \"" << bin_basename << "_static.bin\" for writing" << endl;
exit(EXIT_FAILURE);
}
u_count_int = 0;
......
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