Expand on the use of defines and non_null/nullable
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-03-23 12:56:12 +01:00
parent 0031804fe8
commit 9eca4fa9bb
17 changed files with 114 additions and 124 deletions

View File

@@ -16,21 +16,21 @@ export float Arbutils_Random_GetFloat(ArbUt::Random* p) { return p->GetFloat();
/// @brief Returns a random double between 0.0 and 1.0 using a random object.
export double Arbutils_Random_GetDouble(ArbUt::Random* p) { return p->GetDouble(); }
/// @brief Returns a random a random 32 bit integer using a random object.
export int32_t Arbutils_Random_Get(ArbUt::Random* p) { return p->Get(); }
export i32 Arbutils_Random_Get(ArbUt::Random* p) { return p->Get(); }
/// @brief Gets a random 32 bit integer with a given max. Returns a status code where 0 is Ok, and passes the output to the out parameter.
export uint8_t Arbutils_Random_GetWithMax(ArbUt::Random* p, int32_t max, int32_t& out) { Try(out = p->Get(max);) }
export u8 Arbutils_Random_GetWithMax(ArbUt::Random* p, i32 max, i32& out) { Try(out = p->Get(max);) }
/// @brief Gets a random 32 bit integer with a given min and max. Returns a status code where 0 is Ok, and passes the output to the out parameter.
export uint8_t Arbutils_Random_GetInLimits(ArbUt::Random* p, int32_t min, int32_t max, int32_t& out) {
export u8 Arbutils_Random_GetInLimits(ArbUt::Random* p, i32 min, i32 max, i32& out) {
Try(out = p->Get(min, max);)
}
/// @brief Returns a random a random 32 bit unsigned integer using a random object.
export uint32_t Arbutils_Random_GetUnsigned(ArbUt::Random* p) { return p->GetUnsigned(); }
export u32 Arbutils_Random_GetUnsigned(ArbUt::Random* p) { return p->GetUnsigned(); }
/// @brief Gets a random 32 bit unsigned integer with a given max. Returns a status code where 0 is Ok, and passes the output to the out parameter.
export uint8_t Arbutils_Random_GetUnsignedWithMax(ArbUt::Random* p, uint32_t max, uint32_t& out) {
export u8 Arbutils_Random_GetUnsignedWithMax(ArbUt::Random* p, u32 max, u32& out) {
Try(out = p->GetUnsigned(max);)
}
/// @brief Gets a random 32 bit unsigned integer with a given min and max. Returns a status code where 0 is Ok, and passes the output to the out parameter.
export uint8_t Arbutils_Random_GetUnsignedInLimits(ArbUt::Random* p, uint32_t min, uint32_t max, uint32_t& out) {
export u8 Arbutils_Random_GetUnsignedInLimits(ArbUt::Random* p, u32 min, u32 max, u32& out) {
Try(out = p->GetUnsigned(min, max);)
}