Rename errors from "?msg" to "#msg"

This commit is contained in:
Nigel Tao committed 2019-02-23 17:06:24 +11:00
1 parent c341ac5078
commit 045f180a6c
16 files changed
+203 -203

No files matched your search

+3 -3
View File
@@ -157,12 +157,12 @@ typedef const char* wuffs_base__status;
static inline bool //
wuffs_base__status__is_complete(wuffs_base__status z) {
return (z == NULL) || ((*z != '$') && (*z != '?'));
return (z == NULL) || ((*z != '$') && (*z != '#'));
}
static inline bool //
wuffs_base__status__is_error(wuffs_base__status z) {
return z && (*z == '?');
return z && (*z == '#');
}
static inline bool //
@@ -177,7 +177,7 @@ wuffs_base__status__is_suspension(wuffs_base__status z) {
static inline bool //
wuffs_base__status__is_warning(wuffs_base__status z) {
return z && (*z != '$') && (*z != '?');
return z && (*z != '$') && (*z != '#');
}
// --------
+4 -4
View File
@@ -128,7 +128,7 @@ func Do(args []string) error {
pre := "warning"
if msg[0] == '$' {
pre = "suspension"
} else if msg[0] == '?' {
} else if msg[0] == '#' {
pre = "error"
}
b.printf("const char* wuffs_base__%s__%s = \"%sbase: %s\";\n",
@@ -190,7 +190,7 @@ type status struct {
}
func statusMsgIsError(msg string) bool {
return (len(msg) != 0) && (msg[0] == '?')
return (len(msg) != 0) && (msg[0] == '#')
}
func statusMsgIsSuspension(msg string) bool {
@@ -198,7 +198,7 @@ func statusMsgIsSuspension(msg string) bool {
}
func statusMsgIsWarning(msg string) bool {
return (len(msg) == 0) || (msg[0] != '$' && msg[0] != '?')
return (len(msg) == 0) || (msg[0] != '$' && msg[0] != '#')
}
type buffer []byte
@@ -676,7 +676,7 @@ func (g *gen) addStatus(qid t.QID, msg string, public bool) error {
category := "warning__"
if msg[0] == '$' {
category = "suspension__"
} else if msg[0] == '?' {
} else if msg[0] == '#' {
category = "error__"
}
z := status{
+1 -1
View File
@@ -70,7 +70,7 @@ const baseCorePublicH = "" +
"ceholder field. It isn't explicitly used, except that\n // without it, the sizeof a struct with no fields can differ across C/C++\n // compilers, and it is undefined behavior in C99. For example, gcc says that\n // the sizeof an empty struct is 0, and g++ says that it is 1. This leads to\n // ABI incompatibility if a Wuffs .c file is processed by one compiler and\n // its .h file with another compiler.\n //\n // Instead, we explicitly insert an otherwise unused field, so that the\n // sizeof this struct is always 1.\n uint8_t private_impl;\n} wuffs_base__utility;\n\n" +
"" +
"// --------\n\n// A status is either NULL (meaning OK) or a string message. That message is\n// human-readable, for programmers, but it is not for end users. It is not\n// localized, and does not contain additional contextual information such as a\n// source filename.\n//\n// Status strings are statically allocated and should never be free'd. They can\n// be compared by the == operator and not just by strcmp.\n//\n// Statuses come in four categories:\n// - OK: the request was completed, successfully.\n// - Warnings: the request was completed, unsuccessfully.\n// - Suspensions: the request was not completed, but can be re-tried.\n// - Errors: the request was not completed, permanently.\n//\n// When a function returns an incomplete status, a suspension means that that\n// function should be called again within a new context, such as after flushing\n// or re-filling an I/O buffer. An error means that an irrecoverable failure\n// state was reached.\ntypedef const char* wuffs_base__status;\n\n// !! INSERT wuffs_bas" +
"e__status names.\n\nstatic inline bool //\nwuffs_base__status__is_complete(wuffs_base__status z) {\n return (z == NULL) || ((*z != '$') && (*z != '?'));\n}\n\nstatic inline bool //\nwuffs_base__status__is_error(wuffs_base__status z) {\n return z && (*z == '?');\n}\n\nstatic inline bool //\nwuffs_base__status__is_ok(wuffs_base__status z) {\n return z == NULL;\n}\n\nstatic inline bool //\nwuffs_base__status__is_suspension(wuffs_base__status z) {\n return z && (*z == '$');\n}\n\nstatic inline bool //\nwuffs_base__status__is_warning(wuffs_base__status z) {\n return z && (*z != '$') && (*z != '?');\n}\n\n" +
"e__status names.\n\nstatic inline bool //\nwuffs_base__status__is_complete(wuffs_base__status z) {\n return (z == NULL) || ((*z != '$') && (*z != '#'));\n}\n\nstatic inline bool //\nwuffs_base__status__is_error(wuffs_base__status z) {\n return z && (*z == '#');\n}\n\nstatic inline bool //\nwuffs_base__status__is_ok(wuffs_base__status z) {\n return z == NULL;\n}\n\nstatic inline bool //\nwuffs_base__status__is_suspension(wuffs_base__status z) {\n return z && (*z == '$');\n}\n\nstatic inline bool //\nwuffs_base__status__is_warning(wuffs_base__status z) {\n return z && (*z != '$') && (*z != '#');\n}\n\n" +
"" +
"// --------\n\n// Flicks are a unit of time. One flick (frame-tick) is 1 / 705_600_000 of a\n// second. See https://github.com/OculusVR/Flicks\ntypedef int64_t wuffs_base__flicks;\n\n#define WUFFS_BASE__FLICKS_PER_SECOND ((uint64_t)705600000)\n#define WUFFS_BASE__FLICKS_PER_MILLISECOND ((uint64_t)705600)\n\n" +
"" +