Changeset: 1a66beefbd88 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1a66beefbd88
Modified Files:
        clients/mapilib/mapi.c
Branch: Oct2020
Log Message:

Add nonnull attribute to mapi_setError and fix calls.


diffs (45 lines):

diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -1056,6 +1056,10 @@ mapi_clrError(Mapi mid)
 
 static MapiMsg
 mapi_setError(Mapi mid, const char *msg, const char *action, MapiMsg error)
+       __attribute__((__nonnull__(2)));
+
+static MapiMsg
+mapi_setError(Mapi mid, const char *msg, const char *action, MapiMsg error)
 {
        assert(msg);
        REALLOC(mid->errorstr, strlen(msg) + 1);
@@ -2512,10 +2516,10 @@ mapi_reconnect(Mapi mid)
 
        if (!isa_block_stream(mid->to)) {
                mid->to = block_stream(mid->to);
-               check_stream(mid, mid->to, NULL, mid->error);
+               check_stream(mid, mid->to, "not a block stream", mid->error);
 
                mid->from = block_stream(mid->from);
-               check_stream(mid, mid->from, NULL, mid->error);
+               check_stream(mid, mid->from, "not a block stream", mid->error);
        }
 
   try_again_after_redirect:
@@ -4676,7 +4680,7 @@ mapi_fetch_line(MapiHdl hdl)
                                  result->tableid,
                                  result->cache.first + 
result->cache.tuplecount) < 0 ||
                    mnstr_flush(hdl->mid->to, MNSTR_FLUSH_DATA))
-                       check_stream(hdl->mid, hdl->mid->to, NULL, NULL);
+                       check_stream(hdl->mid, hdl->mid->to, "sending export 
command", NULL);
                reply = mapi_fetch_line_internal(hdl);
        }
        return reply;
@@ -5201,7 +5205,7 @@ mapi_fetch_all_rows(MapiHdl hdl)
                        if (mnstr_printf(mid->to, "X" "export %d %" PRId64 "\n",
                                          result->tableid, result->cache.first 
+ result->cache.tuplecount) < 0 ||
                            mnstr_flush(mid->to, MNSTR_FLUSH_DATA))
-                               check_stream(mid, mid->to, NULL, 0);
+                               check_stream(mid, mid->to, "sending export 
command", 0);
                }
                if (mid->active)
                        read_into_cache(mid->active, 0);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to