MCPcopy Create free account
hub / github.com/WheretIB/nullc / GetAlignmentOffset

Function GetAlignmentOffset

NULLC/Callbacks.cpp:589–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587}
588
589unsigned int GetAlignmentOffset(const char *pos, unsigned int alignment)
590{
591 if(alignment > 16)
592 ThrowError(pos, "ERROR: alignment must be less than 16 bytes");
593 // If alignment is set and address is not aligned
594 if(alignment != 0 && varTop % alignment != 0)
595 return alignment - (varTop % alignment);
596 return 0;
597}
598
599void CheckForImmutable(TypeInfo* type, const char* pos)
600{

Callers 3

AddVariableFunction · 0.85
AddDefineVariableNodeFunction · 0.85
FunctionStartFunction · 0.85

Calls 1

ThrowErrorFunction · 0.85

Tested by

no test coverage detected