Skip to content

Commit

Permalink
Update: GNU code style
Browse files Browse the repository at this point in the history
  • Loading branch information
octoflar committed Jun 14, 2024
1 parent 4bdf424 commit 64ec7c3
Show file tree
Hide file tree
Showing 43 changed files with 7,713 additions and 6,378 deletions.
49 changes: 26 additions & 23 deletions src/main/cxx-filtered/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,43 @@

#include <string>

namespace especia {
namespace especia
{

/// The project name.
const std::string project_name = "@PROJECT_NAME@"; // NOLINT
/// The project name.
const std::string project_name = "@PROJECT_NAME@"; // NOLINT

/// The project title.
const std::string project_title = "@PROJECT_TITLE@"; // NOLINT
/// The project title.
const std::string project_title = "@PROJECT_TITLE@"; // NOLINT

/// The project version.
const std::string project_version = "@PROJECT_VERSION@"; // NOLINT
/// The project version.
const std::string project_version = "@PROJECT_VERSION@"; // NOLINT

/// The project version control tag.
const std::string project_version_tag = "@PROJECT_VERSION_TAG@"; // NOLINT
/// The project version control tag.
const std::string project_version_tag = "@PROJECT_VERSION_TAG@"; // NOLINT

/// The project digital object identifier (DOI).
const std::string project_doi = "@PROJECT_DOI@"; // NOLINT
/// The project digital object identifier (DOI).
const std::string project_doi = "@PROJECT_DOI@"; // NOLINT

/// A project digital object identifier (DOI) HTML snippet.
const std::string project_doi_html = "@PROJECT_DOI_HTML@"; // NOLINT
/// A project digital object identifier (DOI) HTML snippet.
const std::string project_doi_html = "@PROJECT_DOI_HTML@"; // NOLINT

/// The project URL.
const std::string project_url = "@PROJECT_URL@"; // NOLINT
/// The project URL.
const std::string project_url = "@PROJECT_URL@"; // NOLINT

/// The project name and version identifier.
const std::string project_long_name = "@PROJECT_NAME@-@PROJECT_VERSION@ @PROJECT_VERSION_TAG@"; // NOLINT
/// The project name and version identifier.
const std::string project_long_name
= "@PROJECT_NAME@-@PROJECT_VERSION@ @PROJECT_VERSION_TAG@"; // NOLINT

/// The composite name of the operating system the project is compiled for.
const std::string system_name = "@CMAKE_SYSTEM@"; // NOLINT
/// The composite name of the operating system the project is compiled for.
const std::string system_name = "@CMAKE_SYSTEM@"; // NOLINT

/// The vendor of the C++ compiler used to compile the project.
const std::string cxx_compiler = "@CMAKE_CXX_COMPILER_ID@"; // NOLINT
/// The vendor of the C++ compiler used to compile the project.
const std::string cxx_compiler = "@CMAKE_CXX_COMPILER_ID@"; // NOLINT

/// The version of the C++ compiler used to compile the project.
const std::string cxx_compiler_version = "@CMAKE_CXX_COMPILER_VERSION@"; // NOLINT
/// The version of the C++ compiler used to compile the project.
const std::string cxx_compiler_version
= "@CMAKE_CXX_COMPILER_VERSION@"; // NOLINT
}

#endif // ESPECIA_CONFIG_H
44 changes: 27 additions & 17 deletions src/main/cxx/apps/azafran.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

using namespace std;


/// Especia to infer the variation of the fine-structure constant.
///
/// @param argc The number of command line arguments.
Expand All @@ -26,23 +25,34 @@ using namespace std;
/// @param argv[7] The trace modulus.
/// @return an exit code
///
/// @remark Usage: azafran {seed} {parents} {population} {step} {accuracy} {stop} {trace} < {model file} [> {result file}]
/// @remark Usage: azafran {seed} {parents} {population} {step} {accuracy}
/// {stop} {trace} < {model file} [> {result file}]
///
/// @attention A usage message is written to standard output, if no command line arguments (excluding the
/// program name) are supplied. In this case the returned exit code is zero.
int main(int argc, char *argv[]) {
typedef especia::Model<especia::Many_Multiplet> Model;
/// @attention A usage message is written to standard output, if no command
/// line arguments (excluding the program name) are supplied. In this case the
/// returned exit code is zero.
int
main (int argc, char *argv[])
{
typedef especia::Model<especia::Many_Multiplet> Model;

try {
return especia::Runner(argc, argv).run<Model>();
} catch (logic_error &e) {
cerr << e.what() << endl;
return especia::Exit_Codes::logic_error;
} catch (runtime_error &e) {
cerr << e.what() << endl;
return especia::Exit_Codes::runtime_error;
} catch (exception &e) {
cerr << e.what() << endl;
return especia::Exit_Codes::unspecific_exception;
try
{
return especia::Runner (argc, argv).run<Model> ();
}
catch (logic_error &e)
{
cerr << e.what () << endl;
return especia::Exit_Codes::logic_error;
}
catch (runtime_error &e)
{
cerr << e.what () << endl;
return especia::Exit_Codes::runtime_error;
}
catch (exception &e)
{
cerr << e.what () << endl;
return especia::Exit_Codes::unspecific_exception;
}
}
44 changes: 27 additions & 17 deletions src/main/cxx/apps/curcuma.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

using namespace std;


/// Especia to analyse intergalactic metal lines.
///
/// @param argc The number of command line arguments.
Expand All @@ -25,23 +24,34 @@ using namespace std;
/// @param argv[7] The trace modulus.
/// @return an exit code
///
/// @remark Usage: curcuma {seed} {parents} {population} {step} {accuracy} {stop} {trace} < {model file} [> {result file}]
/// @remark Usage: curcuma {seed} {parents} {population} {step} {accuracy}
/// {stop} {trace} < {model file} [> {result file}]
///
/// @attention A usage message is written to standard output, if no command line arguments (excluding the
/// program name) are supplied. In this case the returned exit code is zero.
int main(int argc, char *argv[]) {
typedef especia::Model<especia::Intergalactic_Doppler> Model;
/// @attention A usage message is written to standard output, if no command
/// line arguments (excluding the program name) are supplied. In this case the
/// returned exit code is zero.
int
main (int argc, char *argv[])
{
typedef especia::Model<especia::Intergalactic_Doppler> Model;

try {
return especia::Runner(argc, argv).run<Model>();
} catch (logic_error &e) {
cerr << e.what() << endl;
return especia::Exit_Codes::logic_error;
} catch (runtime_error &e) {
cerr << e.what() << endl;
return especia::Exit_Codes::runtime_error;
} catch (exception &e) {
cerr << e.what() << endl;
return especia::Exit_Codes::unspecific_exception;
try
{
return especia::Runner (argc, argv).run<Model> ();
}
catch (logic_error &e)
{
cerr << e.what () << endl;
return especia::Exit_Codes::logic_error;
}
catch (runtime_error &e)
{
cerr << e.what () << endl;
return especia::Exit_Codes::runtime_error;
}
catch (exception &e)
{
cerr << e.what () << endl;
return especia::Exit_Codes::unspecific_exception;
}
}
24 changes: 15 additions & 9 deletions src/main/cxx/apps/ecom.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,22 @@ using namespace std;
/// @return an exit code.
///
/// @remark Usage: ecom < {result file} [> {target file}]
int main() {
bool found = false;
string s;
int
main ()
{
bool found = false;
string s;

while (getline(cin, s)) {
if (found and s != "</command>") {
cout << s << endl;
} else {
found = (s == "<command>");
while (getline (cin, s))
{
if (found and s != "</command>")
{
cout << s << endl;
}
else
{
found = (s == "<command>");
}
}
return 0;
return 0;
}
24 changes: 15 additions & 9 deletions src/main/cxx/apps/edat.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,23 @@ using namespace std;
/// @return an exit code.
///
/// @remark Usage: edat < {result file} [> {target file}]
int main() {
bool found = false;
string s;
int
main ()
{
bool found = false;
string s;

while (getline(cin, s)) {
if (found and s != "</data>") {
cout << s << endl;
} else {
found = (s == "<data>");
while (getline (cin, s))
{
if (found and s != "</data>")
{
cout << s << endl;
}
else
{
found = (s == "<data>");
}
}

return 0;
return 0;
}
24 changes: 15 additions & 9 deletions src/main/cxx/apps/elog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,23 @@ using namespace std;
/// @return an exit code.
///
/// @remark Usage: elog < {result file} [> {target file}]
int main() {
bool found = false;
string s;
int
main ()
{
bool found = false;
string s;

while (getline(cin, s)) {
if (found and s != "</log>") {
cout << s << endl;
} else {
found = (s == "<log>");
while (getline (cin, s))
{
if (found and s != "</log>")
{
cout << s << endl;
}
else
{
found = (s == "<log>");
}
}

return 0;
return 0;
}
33 changes: 20 additions & 13 deletions src/main/cxx/apps/emes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,28 @@ using namespace std;
/// @return an exit code.
///
/// @remark Usage: emes < {result file} [> {target file}]
int main() {
bool found = false;
string s;
int
main ()
{
bool found = false;
string s;

while (getline(cin, s)) {
if (found and not (s == "</message>"
// for compatibility with former versions
or s == "</mesg>")) {
cout << s << endl;
} else {
found = (s == "<message>"
// for compatibility with former versions
or s == "<mesg>");
while (getline (cin, s))
{
if (found
and not(s == "</message>"
// for compatibility with former versions
or s == "</mesg>"))
{
cout << s << endl;
}
else
{
found = (s == "<message>"
// for compatibility with former versions
or s == "<mesg>");
}
}

return 0;
return 0;
}
33 changes: 20 additions & 13 deletions src/main/cxx/apps/emod.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,28 @@ using namespace std;
/// @return an exit code.
///
/// @remark Usage: emod < {result file} [> {target file}]
int main() {
bool found = false;
string s;
int
main ()
{
bool found = false;
string s;

while (getline(cin, s)) {
if (found and not (s == "</model>"
// for compatibility with former versions
or s == "</job>" or s == "</input>")) {
cout << s << endl;
} else {
found = (s == "<model>"
// for compatibility with former versions
or s == "<job>" or s == "<input>");
while (getline (cin, s))
{
if (found
and not(s == "</model>"
// for compatibility with former versions
or s == "</job>" or s == "</input>"))
{
cout << s << endl;
}
else
{
found = (s == "<model>"
// for compatibility with former versions
or s == "<job>" or s == "<input>");
}
}

return 0;
return 0;
}
Loading

0 comments on commit 64ec7c3

Please sign in to comment.