ref: renamed types.h to Types.h for match naming convention; also added Align.h and Bytes.h with helpers

This commit is contained in:
karina
2026-04-25 09:56:17 +04:00
parent b606fa23d0
commit e49af76aef
11 changed files with 78 additions and 7 deletions
+19
View File
@@ -0,0 +1,19 @@
#pragma once
#include <Types.h>
static inline UInt64 AlignUp64(UInt64 value, UInt64 alignment) {
return (value + alignment - 1) & ~(alignment - 1);
}
static inline UInt64 AlignDown64(UInt64 value, UInt64 alignment) {
return value & ~(alignment - 1);
}
static inline UInt32 AlignUp32(UInt32 value, UInt32 alignment) {
return (value + alignment - 1) & ~(alignment - 1);
}
static inline UInt32 AlignDown32(UInt32 value, UInt32 alignment) {
return value & ~(alignment - 1);
}
+10
View File
@@ -0,0 +1,10 @@
#pragma once
#include <Types.h>
static inline UInt32 BytesSwap32(UInt32 value) {
return __builtin_bswap32(value);
}
static inline UInt64 BytesSwap64(UInt64 value) {
return __builtin_bswap64(value);
}
+1 -1
View File
@@ -1,5 +1,5 @@
#pragma once
#include <types.h>
#include <Types.h>
#include <Lib/VAArgs.h>
void* StringSet(BytePointer destination, ASCII value, Size count);