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:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user