Redo the encoding of error codes

This commit is contained in:
Nigel Tao committed 2018-06-10 21:22:41 +10:00
1 parent 2ac2424e77
commit 43bb14e886
29 files changed
+1069 -1021

No files matched your search

+8 -1
View File
@@ -69,7 +69,14 @@ typedef struct {
// --------
// A status code is either zero (OK), positive (a recoverable suspension or
// pause in processing) or negative (a non-recoverable error).
// pause in processing) or negative (a non-recoverable error). Its bits:
// - bit 31 (the sign bit) indicates unrecoverable-ness: an error.
// - bits 30 .. 24 are a package-namespaced numeric code
// - bits 23 .. 21 are reserved.
// - bits 20 .. 0 are the packageid (a namespace) as a base38 value.
//
// Do not manipulate these bits directly; they are private implementation
// details. Use methods such as wuffs_base__status__is_error instead.
typedef int32_t wuffs_base__status;
#define WUFFS_BASE__STATUS_OK 0 // 0x00000000