mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 08:55:11 +01:00
Add warnings as another status code category
This commit is contained in:
1 parent
54e5ea7f15
commit
9c04249bfe
12 files changed
+67
-45
No files matched your search
@@ -99,10 +99,10 @@ typedef struct {
|
||||
|
||||
// --------
|
||||
|
||||
// A status is either NULL (meaning OK or no error) or string message. That
|
||||
// message is human-readable, for programmers, but it is not for end users. It
|
||||
// is not localized, and does not contain additional contextual information
|
||||
// such as a source filename.
|
||||
// A status is either NULL (meaning OK) or a string message. That message is
|
||||
// human-readable, for programmers, but it is not for end users. It is not
|
||||
// localized, and does not contain additional contextual information such as a
|
||||
// source filename.
|
||||
//
|
||||
// Status strings are statically allocated and should never be free'd. They can
|
||||
// be compared by the == operator and not just by strcmp.
|
||||
@@ -112,7 +112,7 @@ typedef const char* wuffs_base__status;
|
||||
|
||||
static inline bool //
|
||||
wuffs_base__status__is_error(wuffs_base__status z) {
|
||||
return z && (*z != '$');
|
||||
return z && (*z == '?');
|
||||
}
|
||||
|
||||
static inline bool //
|
||||
@@ -125,6 +125,11 @@ wuffs_base__status__is_suspension(wuffs_base__status z) {
|
||||
return z && (*z == '$');
|
||||
}
|
||||
|
||||
static inline bool //
|
||||
wuffs_base__status__is_warning(wuffs_base__status z) {
|
||||
return z && (*z != '$') && (*z != '?');
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a
|
||||
|
||||
Reference in new issue
Block a user