Changeset: 5f213eef5840 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5f213eef5840
Modified Files:
clients/examples/C/streamcat.c
clients/mapiclient/dump.c
clients/mapiclient/mclient.c
clients/mapiclient/msqldump.c
clients/mapilib/mapi.c
gdk/gdk_atoms.c
gdk/gdk_logger.c
gdk/gdk_logger_old.c
monetdb5/modules/atoms/streams.c
monetdb5/modules/mal/mal_io.c
monetdb5/modules/mal/tokenizer.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_result.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/snapshot.c
tools/merovingian/utils/control.c
Branch: Jan2022
Log Message:
Compare enum to enum, not to int.
diffs (truncated from 618 to 300 lines):
diff --git a/clients/examples/C/streamcat.c b/clients/examples/C/streamcat.c
--- a/clients/examples/C/streamcat.c
+++ b/clients/examples/C/streamcat.c
@@ -163,7 +163,7 @@ int cmd_read(char *argv[])
croak(1, "Unknown opener '%s'", opener_name);
s = opener(filename);
- if (s == NULL || mnstr_errnr(s)) {
+ if (s == NULL || mnstr_errnr(s) != MNSTR_NO__ERROR) {
char *msg = mnstr_error(s);
croak(2, "Opener %s failed: %s", opener_name, msg ? msg : "<no
error message>");
}
@@ -199,7 +199,7 @@ int cmd_read(char *argv[])
}
if (wrapper != NULL)
s = wrapper(s, parms);
- if (s == NULL || mnstr_errnr(s)) {
+ if (s == NULL || mnstr_errnr(s) != MNSTR_NO__ERROR) {
char *msg = mnstr_error(s);
croak(2, "Opener %s failed: %s", opener_name, msg ? msg
: "<no error message>");
}
@@ -268,7 +268,7 @@ int cmd_write(char *argv[])
croak(1, "Unknown opener '%s'", opener_name);
s = opener(filename);
- if (s == NULL || mnstr_errnr(s)) {
+ if (s == NULL || mnstr_errnr(s) != MNSTR_NO__ERROR) {
char *msg = mnstr_error(NULL);
croak(2, "Opener %s failed: %s", opener_name, msg ? msg : "");
}
@@ -312,7 +312,7 @@ int cmd_write(char *argv[])
}
if (wrapper != NULL)
s = wrapper(s, parms);
- if (s == NULL || mnstr_errnr(s)) {
+ if (s == NULL || mnstr_errnr(s) != MNSTR_NO__ERROR) {
char *msg = mnstr_error(s);
croak(2, "Opener %s failed: %s", opener_name, msg ? msg
: "<no error message>");
}
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -641,7 +641,7 @@ dump_foreign_keys(Mapi mid, const char *
if (tname == NULL && tid == NULL)
mnstr_printf(toConsole, ";\n");
- if (mnstr_errnr(toConsole))
+ if (mnstr_errnr(toConsole) != MNSTR_NO__ERROR)
goto bailout;
}
if (mapi_error(mid))
@@ -656,12 +656,12 @@ bailout:
mapi_explain_result(hdl, stderr);
else if (mapi_error(mid))
mapi_explain_query(hdl, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
mapi_close_handle(hdl);
} else if (mapi_error(mid))
mapi_explain(mid, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
return 1;
@@ -962,7 +962,7 @@ dump_column_definition(Mapi mid, stream
free(c_type);
free(c_type_digits);
free(c_type_scale);
- if (mnstr_errnr(toConsole))
+ if (mnstr_errnr(toConsole) != MNSTR_NO__ERROR)
goto bailout;
}
if (mapi_error(mid))
@@ -1023,7 +1023,7 @@ dump_column_definition(Mapi mid, stream
mnstr_printf(toConsole, ", ");
dquoted_print(toConsole, c_column, NULL);
cnt++;
- if (mnstr_errnr(toConsole))
+ if (mnstr_errnr(toConsole) != MNSTR_NO__ERROR)
goto bailout;
}
if (cnt)
@@ -1085,7 +1085,7 @@ dump_column_definition(Mapi mid, stream
} else
mnstr_printf(toConsole, ", ");
dquoted_print(toConsole, c_column, NULL);
- if (mnstr_errnr(toConsole))
+ if (mnstr_errnr(toConsole) != MNSTR_NO__ERROR)
goto bailout;
}
if (cnt)
@@ -1116,12 +1116,12 @@ bailout:
mapi_explain_result(hdl, stderr);
else if (mapi_error(mid))
mapi_explain_query(hdl, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
mapi_close_handle(hdl);
} else if (mapi_error(mid))
mapi_explain(mid, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
if (query != NULL)
free(query);
@@ -1396,7 +1396,7 @@ describe_table(Mapi mid, const char *sch
} else
mnstr_printf(toConsole, ", ");
dquoted_print(toConsole, c_name, NULL);
- if (mnstr_errnr(toConsole))
+ if (mnstr_errnr(toConsole) != MNSTR_NO__ERROR)
goto bailout;
}
mapi_close_handle(hdl);
@@ -1458,12 +1458,12 @@ bailout:
mapi_explain_result(hdl, stderr);
else if (mapi_error(mid))
mapi_explain_query(hdl, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
mapi_close_handle(hdl);
} else if (mapi_error(mid))
mapi_explain(mid, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
bailout2:
if (view)
@@ -1565,7 +1565,7 @@ describe_sequence(Mapi mid, const char *
mnstr_printf(toConsole, " CACHE %s", cacheinc);
mnstr_printf(toConsole, " %sCYCLE;\n", strcmp(cycle, "true") ==
0 ? "" : "NO ");
comment_on(toConsole, "SEQUENCE", schema, name, NULL, remark);
- if (mnstr_errnr(toConsole)) {
+ if (mnstr_errnr(toConsole) != MNSTR_NO__ERROR) {
mapi_close_handle(hdl);
hdl = NULL;
goto bailout;
@@ -1587,12 +1587,12 @@ bailout:
mapi_explain_result(hdl, stderr);
else if (mapi_error(mid))
mapi_explain_query(hdl, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
mapi_close_handle(hdl);
} else if (mapi_error(mid))
mapi_explain(mid, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
if (sname != NULL)
free(sname);
@@ -1833,7 +1833,7 @@ dump_table_data(Mapi mid, const char *sc
mnstr_write(toConsole, "\n", 1, 1);
}
}
- if (mnstr_errnr(toConsole))
+ if (mnstr_errnr(toConsole) != MNSTR_NO__ERROR)
goto bailout;
}
if (mapi_error(mid))
@@ -1855,12 +1855,12 @@ bailout:
mapi_explain_result(hdl, stderr);
else if (mapi_error(mid))
mapi_explain_query(hdl, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
mapi_close_handle(hdl);
} else if (mapi_error(mid))
mapi_explain(mid, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
if (sname != NULL)
free(sname);
@@ -2384,12 +2384,12 @@ bailout:
mapi_explain_result(hdl, stderr);
else if (mapi_error(mid))
mapi_explain_query(hdl, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
mapi_close_handle(hdl);
} else if (mapi_error(mid))
mapi_explain(mid, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
return 1;
}
@@ -2469,7 +2469,7 @@ dump_functions(Mapi mid, stream *toConso
if (hdl == NULL || mapi_error(mid))
goto bailout;
prev_sid = 0;
- while (!mnstr_errnr(toConsole) && mapi_fetch_row(hdl) != 0) {
+ while (mnstr_errnr(toConsole) == MNSTR_NO__ERROR && mapi_fetch_row(hdl)
!= 0) {
long sid = strtol(mapi_fetch_field(hdl, 0), NULL, 10);
const char *schema = mapi_fetch_field(hdl, 1);
char *fid = strdup(mapi_fetch_field(hdl, 2));
@@ -2492,7 +2492,7 @@ dump_functions(Mapi mid, stream *toConso
if (to_free)
free(to_free);
- return mnstr_errnr(toConsole) != 0;
+ return mnstr_errnr(toConsole) != MNSTR_NO__ERROR;
bailout:
if (hdl) {
@@ -2500,12 +2500,12 @@ bailout:
mapi_explain_result(hdl, stderr);
else if (mapi_error(mid))
mapi_explain_query(hdl, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
mapi_close_handle(hdl);
} else if (mapi_error(mid))
mapi_explain(mid, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
if (to_free)
free(to_free);
@@ -2930,7 +2930,7 @@ dump_database(Mapi mid, stream *toConsol
goto bailout;
while (rc == 0 &&
- !mnstr_errnr(toConsole) &&
+ mnstr_errnr(toConsole) == MNSTR_NO__ERROR &&
mapi_fetch_row(hdl) != 0) {
char *id = strdup(mapi_fetch_field(hdl, 0));
char *schema = strdup(mapi_fetch_field(hdl, 1));
@@ -2978,7 +2978,7 @@ dump_database(Mapi mid, stream *toConsol
goto bailout;
while (rc == 0 &&
- !mnstr_errnr(toConsole) &&
+ mnstr_errnr(toConsole) == MNSTR_NO__ERROR &&
mapi_fetch_row(hdl) != 0) {
const char *schema1 = mapi_fetch_field(hdl, 0);
const char *tname1 = mapi_fetch_field(hdl, 1);
@@ -3110,7 +3110,7 @@ dump_database(Mapi mid, stream *toConsol
goto bailout;
while (rc == 0 &&
- !mnstr_errnr(toConsole) &&
+ mnstr_errnr(toConsole) == MNSTR_NO__ERROR &&
mapi_fetch_row(hdl) != 0) {
char *id = strdup(mapi_fetch_field(hdl, 0));
char *schema = strdup(mapi_fetch_field(hdl, 1));
@@ -3210,7 +3210,7 @@ dump_database(Mapi mid, stream *toConsol
if (maxvalue)
mnstr_printf(toConsole, " MAXVALUE %s",
maxvalue);
mnstr_printf(toConsole, " %sCYCLE;\n", strcmp(cycle,
"true") == 0 ? "" : "NO ");
- if (mnstr_errnr(toConsole)) {
+ if (mnstr_errnr(toConsole) != MNSTR_NO__ERROR) {
mapi_close_handle(hdl);
hdl = NULL;
goto bailout2;
@@ -3351,12 +3351,12 @@ bailout:
mapi_explain_result(hdl, stderr);
else if (mapi_error(mid))
mapi_explain_query(hdl, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
mapi_close_handle(hdl);
} else if (mapi_error(mid))
mapi_explain(mid, stderr);
- else if (!mnstr_errnr(toConsole))
+ else if (mnstr_errnr(toConsole) == MNSTR_NO__ERROR)
fprintf(stderr, "malloc failure\n");
bailout2:
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -842,7 +842,7 @@ XMLrenderer(MapiHdl hdl)
if (name != NULL && *name != 0)
XMLprattr("name", name);
mnstr_printf(toConsole, ">\n");
- while (!mnstr_errnr(toConsole) && (fields = fetch_row(hdl)) != 0) {
+ while (mnstr_errnr(toConsole) == MNSTR_NO__ERROR && (fields =
fetch_row(hdl)) != 0) {
mnstr_printf(toConsole, "<row>");
for (i = 0; i < fields; i++) {
char *data = mapi_fetch_field(hdl, i);
@@ -879,7 +879,7 @@ EXPANDEDrenderer(MapiHdl hdl)
if (w > fieldw)
fieldw = w;
}
- while (!mnstr_errnr(toConsole) && (fields = fetch_row(hdl)) != 0) {
+ while (mnstr_errnr(toConsole) == MNSTR_NO__ERROR && (fields =
fetch_row(hdl)) != 0) {
int valuew = 0, len;
++rec;
for (i = 0; i < fields; i++) {
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]