cpukit/librtemscxx: reformat

Fixes #5453.
This commit is contained in:
Gedare Bloom
2026-02-05 14:55:29 -06:00
committed by Joel Sherrill
parent 6c47d4d000
commit 3480dc3644
4 changed files with 712 additions and 848 deletions
+17 -19
View File
@@ -43,26 +43,24 @@
#include <rtems/error.h>
namespace rtems
{
class runtime_error :
public std::runtime_error
{
const rtems_status_code sc;
public:
runtime_error(const rtems_status_code sc);
runtime_error(const rtems_status_code sc, const std::string& what);
runtime_error(const rtems_status_code sc, const char* what);
~runtime_error();
};
namespace rtems {
class runtime_error : public std::runtime_error {
const rtems_status_code sc;
/**
* Throw a rtems::runtime_error exception if the RTEMS status code is
* not RTEMS_SUCCESSFUL.
*/
void runtime_error_check(const rtems_status_code sc);
void runtime_error_check(const rtems_status_code sc, const std::string& what);
void runtime_error_check(const rtems_status_code sc, const char* what);
public:
runtime_error(const rtems_status_code sc);
runtime_error(const rtems_status_code sc, const std::string& what);
runtime_error(const rtems_status_code sc, const char* what);
~runtime_error();
};
/**
* Throw a rtems::runtime_error exception if the RTEMS status code is
* not RTEMS_SUCCESSFUL.
*/
void runtime_error_check(const rtems_status_code sc);
void runtime_error_check(const rtems_status_code sc, const std::string& what);
void runtime_error_check(const rtems_status_code sc, const char* what);
}; // namespace rtems
#endif
File diff suppressed because it is too large Load Diff
+22 -40
View File
@@ -27,53 +27,35 @@
#include <rtems/error.hpp>
namespace rtems
{
runtime_error::runtime_error(const rtems_status_code sc)
: std::runtime_error(::rtems_status_text(sc)),
sc(sc)
{
}
namespace rtems {
runtime_error::runtime_error(const rtems_status_code sc)
: std::runtime_error(::rtems_status_text(sc)), sc(sc) {}
runtime_error::runtime_error(const rtems_status_code sc,
const std::string& what)
: std::runtime_error(what + ": " + ::rtems_status_text(sc)),
sc(sc)
{
}
runtime_error::runtime_error(const rtems_status_code sc,
const std::string& what)
: std::runtime_error(what + ": " + ::rtems_status_text(sc)), sc(sc) {}
runtime_error::runtime_error(const rtems_status_code sc,
const char* what)
runtime_error::runtime_error(const rtems_status_code sc, const char* what)
: std::runtime_error(std::string(what) + ": " + ::rtems_status_text(sc)),
sc(sc)
{
}
sc(sc) {}
runtime_error::~runtime_error()
{
}
runtime_error::~runtime_error() {}
void
runtime_error_check(const rtems_status_code sc)
{
if (sc != RTEMS_SUCCESSFUL) {
throw runtime_error(sc);
}
void runtime_error_check(const rtems_status_code sc) {
if (sc != RTEMS_SUCCESSFUL) {
throw runtime_error(sc);
}
}
void
runtime_error_check(const rtems_status_code sc, const std::string& what)
{
if (sc != RTEMS_SUCCESSFUL) {
throw runtime_error(sc, what);
}
void runtime_error_check(const rtems_status_code sc, const std::string& what) {
if (sc != RTEMS_SUCCESSFUL) {
throw runtime_error(sc, what);
}
}
void
runtime_error_check(const rtems_status_code sc, const char* what)
{
if (sc != RTEMS_SUCCESSFUL) {
throw runtime_error(sc, what);
}
void runtime_error_check(const rtems_status_code sc, const char* what) {
if (sc != RTEMS_SUCCESSFUL) {
throw runtime_error(sc, what);
}
};
}
}; // namespace rtems
File diff suppressed because it is too large Load Diff