Minor cleanup for formatting, reverse verify condition usage

Verify condition needed to only fire off if false not the other way around.
This commit is contained in:
2024-02-23 09:36:23 -05:00
parent 9b3bc6fd68
commit a00ba8a152
21 changed files with 103 additions and 86 deletions

View File

@ -5,7 +5,7 @@ import "core:os"
ensure :: proc( condition : b32, msg : string, location := #caller_location )
{
if ! condition {
if condition {
return
}
log( msg, LogLevel.Warning, location )
@ -13,16 +13,16 @@ ensure :: proc( condition : b32, msg : string, location := #caller_location )
}
// TODO(Ed) : Setup exit codes!
fatal :: proc ( msg : string, exit_code : int = -1, location := #caller_location )
fatal :: proc( msg : string, exit_code : int = -1, location := #caller_location )
{
log( msg, LogLevel.Fatal, location )
runtime.debug_trap()
os.exit( exit_code )
}
verify :: proc ( condition : b32, msg : string, exit_code : int = -1, location := #caller_location )
verify :: proc( condition : b32, msg : string, exit_code : int = -1, location := #caller_location )
{
if ! condition {
if condition {
return
}
log( msg, LogLevel.Fatal, location )