libfirmware gets efi::size (#4354)
This commit is contained in:
parent
c8d1d7ebae
commit
2b2eb04aba
|
@ -5,6 +5,8 @@
|
|||
* @author Andrey Belomutskiy, (c) 2012-2021
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "bmw_n73.h"
|
||||
|
||||
void setEngineProteusBMW_N73_GDI() {
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "engine_configuration.h"
|
||||
|
||||
void setEngineProteusBMW_N73_GDI();
|
||||
|
||||
void setEngineProteusGearboxManInTheMiddle();
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
* @author Andrey Belomutskiy, (c) 2012-2021
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "hyundai.h"
|
||||
#include "map.h"
|
||||
|
||||
static void commonGenesisCoupe() {
|
||||
strncpy(config->luaScript, R"(
|
||||
|
|
|
@ -7,8 +7,5 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "engine_configuration.h"
|
||||
|
||||
void setGenesisCoupeBK1();
|
||||
|
||||
void setGenesisCoupeBK2();
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 8fcca4c0ce715a3c44ad13bb1a1a9316dbe63605
|
||||
Subproject commit 7fea28f1c1b1fde209258e97824b8b16ef0ace19
|
|
@ -92,30 +92,6 @@ float limitRateOfChange(float newValue, float oldValue, float incrLimitPerSec, f
|
|||
#define IS_NEGATIVE_ZERO(value) (__builtin_signbit(value) && value==0)
|
||||
#define fixNegativeZero(value) (IS_NEGATIVE_ZERO(value) ? 0 : value)
|
||||
|
||||
// C++ helpers go here
|
||||
namespace efi
|
||||
{
|
||||
template <typename T, size_t N>
|
||||
constexpr size_t size(const T(&)[N]) {
|
||||
return N;
|
||||
}
|
||||
|
||||
// Zero the passed object
|
||||
template <typename T>
|
||||
constexpr void clear(T* obj) {
|
||||
// The cast to void* is to prevent errors like:
|
||||
// clearing an object of non-trivial type 'struct persistent_config_s'; use assignment or value-initialization instead
|
||||
// This is technically wrong, but we know config objects only ever actually
|
||||
// contain integral types, though they may be wrapped in a scaled_channel
|
||||
memset(reinterpret_cast<void*>(obj), 0, sizeof(T));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr void clear(T& obj) {
|
||||
clear(&obj);
|
||||
}
|
||||
} // namespace efi
|
||||
|
||||
#define assertIsInBounds(length, array, msg) efiAssertVoid(OBD_PCM_Processor_Fault, std::is_unsigned_v<decltype(length)> && (length) < efi::size(array), msg)
|
||||
|
||||
#define assertIsInBoundsWithResult(length, array, msg, failedResult) efiAssert(OBD_PCM_Processor_Fault, std::is_unsigned_v<decltype(length)> && (length) < efi::size(array), msg, failedResult)
|
||||
|
|
Loading…
Reference in New Issue