Changeset: 2139662f0ee4 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2139662f0ee4
Modified Files:
        clients/mapilib/mapi.c
        sql/backends/monet5/sql_result.c
Branch: protocol
Log Message:

Consistent indentation.


diffs (truncated from 737 to 300 lines):

diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -1361,8 +1361,8 @@ mapi_explain_result(MapiHdl hdl, FILE *f
        Mapi mid;
 
        if (hdl == NULL ||
-           hdl->result == NULL ||
-           hdl->result->errorstr == NULL)
+               hdl->result == NULL ||
+               hdl->result->errorstr == NULL)
                return MOK;
        assert(hdl);
        assert(hdl->result);
@@ -1504,7 +1504,7 @@ new_result(MapiHdl hdl)
        struct MapiResultSet *result;
 
        assert((hdl->lastresult == NULL && hdl->result == NULL) ||
-              (hdl->result != NULL && hdl->lastresult != NULL && 
hdl->lastresult->next == NULL));
+                  (hdl->result != NULL && hdl->lastresult != NULL && 
hdl->lastresult->next == NULL));
 
        if (hdl->mid->trace == MAPI_TRACE)
                printf("allocating new result set\n");
@@ -1566,15 +1566,15 @@ close_result(MapiHdl hdl)
                printf("closing result set\n");
        if (result->tableid >= 0 && result->querytype != Q_PREPARE) {
                if (mid->active &&
-                   result->next == NULL &&
-                   !mid->active->needmore &&
-                   read_into_cache(mid->active, -1) != MOK)
+                       result->next == NULL &&
+                       !mid->active->needmore &&
+                       read_into_cache(mid->active, -1) != MOK)
                        return MERROR;
                assert(hdl->npending_close == 0 ||
-                      (hdl->npending_close > 0 && hdl->pending_close != NULL));
+                          (hdl->npending_close > 0 && hdl->pending_close != 
NULL));
                if (mid->active &&
-                   (mid->active->active != result ||
-                    result->cache.tuplecount < result->row_count))
+                       (mid->active->active != result ||
+                        result->cache.tuplecount < result->row_count))
                {
                        /* results for which we got all tuples at the initial
                         * response, need not to be closed as the server already
@@ -1594,7 +1594,7 @@ close_result(MapiHdl hdl)
                                mapi_log_record(mid, msg);
                                mid->active = hdl;
                                if (mnstr_printf(mid->to, "%s", msg) < 0 ||
-                                   mnstr_flush(mid->to)) {
+                                       mnstr_flush(mid->to)) {
                                        close_connection(mid);
                                        mapi_setError(mid, 
mnstr_error(mid->to), "mapi_close_handle", MTIMEOUT);
                                        break;
@@ -1612,7 +1612,7 @@ close_result(MapiHdl hdl)
                                mapi_log_record(mid, msg);
                                mid->active = hdl;
                                if (mnstr_printf(mid->to, "%s", msg) < 0 ||
-                                   mnstr_flush(mid->to)) {
+                                       mnstr_flush(mid->to)) {
                                        close_connection(mid);
                                        mapi_setError(mid, 
mnstr_error(mid->to), "mapi_close_handle", MTIMEOUT);
                                } else
@@ -1622,8 +1622,8 @@ close_result(MapiHdl hdl)
                result->tableid = -1;
        }
        if (mid->active == hdl &&
-           hdl->active == result && 
-           read_into_cache(hdl, -1) != MOK) {
+               hdl->active == result && 
+               read_into_cache(hdl, -1) != MOK) {
                return MERROR;
        }
        if( hdl->active == result)
@@ -1712,11 +1712,11 @@ mapi_next_result(MapiHdl hdl)
                if (close_result(hdl) != MOK)
                        return MERROR;
                if (hdl->result &&
-                   (hdl->result->querytype == -1 ||
+                       (hdl->result->querytype == -1 ||
                         /* basically exclude Q_PARSE and Q_BLOCK */
                         (hdl->result->querytype >= Q_TABLE &&
                          hdl->result->querytype <= Q_PREPARE) ||
-                    hdl->result->errorstr != NULL))
+                        hdl->result->errorstr != NULL))
                        return 1;
        }
        return hdl->needmore ? MMORE : MOK;
@@ -1754,7 +1754,7 @@ mapi_more_results(MapiHdl hdl)
                        /* basically exclude Q_PARSE and Q_BLOCK */
                        (hdl->result->querytype >= Q_TABLE &&
                         hdl->result->querytype <= Q_PREPARE) ||
-                   result->errorstr != NULL)
+                       result->errorstr != NULL)
                        return 1;
        }
        /* no more results */
@@ -1834,7 +1834,7 @@ finish_handle(MapiHdl hdl)
                        mapi_log_record(mid, msg);
                        mid->active = hdl;
                        if (mnstr_printf(mid->to, "%s", msg) < 0 ||
-                           mnstr_flush(mid->to)) {
+                               mnstr_flush(mid->to)) {
                                close_connection(mid);
                                mapi_setError(mid, mnstr_error(mid->to), 
"finish_handle", MTIMEOUT);
                                break;
@@ -2084,9 +2084,9 @@ mapi_mapiuri(const char *url, const char
        }
        if (strncmp(url, "mapi:monetdb://", sizeof("mapi:monetdb://") - 1) != 
0) {
                mapi_setError(mid,
-                             "url has unsupported scheme, "
-                             "expecting mapi:monetdb://...",
-                             "mapi_mapiuri", MERROR);
+                                 "url has unsupported scheme, "
+                                 "expecting mapi:monetdb://...",
+                                 "mapi_mapiuri", MERROR);
                return mid;
        }
        if ((uri = strdup(url + sizeof("mapi:monetdb://") - 1)) == NULL) {
@@ -2110,9 +2110,9 @@ mapi_mapiuri(const char *url, const char
                if ((p = strchr(uri, ':')) == NULL) {
                        free(uri);
                        mapi_setError(mid,
-                                     "URI must contain a port number after "
-                                     "the hostname",
-                                     "mapi_mapiuri", MERROR);
+                                         "URI must contain a port number after 
"
+                                         "the hostname",
+                                         "mapi_mapiuri", MERROR);
                        return mid;
                }
                *p++ = 0;
@@ -2127,8 +2127,8 @@ mapi_mapiuri(const char *url, const char
                if (port <= 0) {
                        free(uri);
                        mapi_setError(mid,
-                                     "URI contains invalid port",
-                                     "mapi_mapiuri", MERROR);
+                                         "URI contains invalid port",
+                                         "mapi_mapiuri", MERROR);
                        return mid;
                }
        }
@@ -2330,7 +2330,7 @@ mapi_reconnect(Mapi mid)
                                snprintf(buf, sizeof(buf),
                                         "/tmp/.s.monetdb.%d", port);
                                if (stat(buf, &st) != -1 &&
-                                   S_ISSOCK(st.st_mode))
+                                       S_ISSOCK(st.st_mode))
                                        host = buf;
                                else
 #endif
@@ -2369,7 +2369,7 @@ mapi_reconnect(Mapi mid)
                                                if (snprintf(buf, sizeof(buf), 
"/tmp/%s", e->d_name) >= (int) sizeof(buf))
                                                        continue; /* ignore 
long name */
                                                if (stat(buf, &st) != -1 &&
-                                                   S_ISSOCK(st.st_mode)) {
+                                                       S_ISSOCK(st.st_mode)) {
                                                        socks[i].owner = 
st.st_uid;
                                                        socks[i++].port = 
atoi(e->d_name + 11);
                                                }
@@ -2382,7 +2382,7 @@ mapi_reconnect(Mapi mid)
                                         * a matching owner */
                                        for (i = 0; i < len; i++) {
                                                if (socks[i].port != 0 &&
-                                                   socks[i].owner == me) {
+                                                       socks[i].owner == me) {
                                                        /* try this server for 
the database */
                                                        snprintf(buf, 
sizeof(buf), "/tmp/.s.monetdb.%d", socks[i].port);
                                                        if (mid->hostname)
@@ -2835,25 +2835,25 @@ mapi_reconnect(Mapi mid)
                                // so the server knows which protocol to use
                                retval = snprintf(buf, BLOCK, 
"%s:%s:%s:%s:%s:%s:%s%s:%zu:\n",
        #ifdef WORDS_BIGENDIAN
-                                    "BIG",
+                                       "BIG",
        #else
-                                    "LIT",
+                                       "LIT",
        #endif
-                                    mid->username, hash, mid->language,
-                                    mid->database == NULL ? "" : mid->database,
-                                    prot_version == prot10 ? "PROT10" : 
"PROT10COMPR",
-                                    comp == COMPRESSION_SNAPPY ? "SNAPPY" : 
(comp == COMPRESSION_LZ4 ? "LZ4" : ""),
-                                    mid->compute_column_widths ? 
"COMPUTECOLWIDTH" : "",
-                                   mid->blocksize);
+                                       mid->username, hash, mid->language,
+                                       mid->database == NULL ? "" : 
mid->database,
+                                       prot_version == prot10 ? "PROT10" : 
"PROT10COMPR",
+                                       comp == COMPRESSION_SNAPPY ? "SNAPPY" : 
(comp == COMPRESSION_LZ4 ? "LZ4" : ""),
+                                       mid->compute_column_widths ? 
"COMPUTECOLWIDTH" : "",
+                                       mid->blocksize);
                        } else {
                                retval = snprintf(buf, BLOCK, 
"%s:%s:%s:%s:%s:\n",
        #ifdef WORDS_BIGENDIAN
-                                    "BIG",
+                                       "BIG",
        #else
-                                    "LIT",
+                                       "LIT",
        #endif
-                                    mid->username, hash, mid->language,
-                                    mid->database == NULL ? "" : 
mid->database);
+                                       mid->username, hash, mid->language,
+                                       mid->database == NULL ? "" : 
mid->database);
                        }
                        if (retval >= BLOCK) {;
                                mapi_setError(mid, "combination of database 
name and user name too long", "mapi_reconnect", MERROR);
@@ -3165,8 +3165,8 @@ mapi_disconnect(Mapi mid)
                mapi_hdl_check(hdl, funcname);                          \
                if (fnr < 0) {                                          \
                        return mapi_setError(hdl->mid,                  \
-                                            "Illegal field number",    \
-                                            funcname, MERROR);         \
+                                                "Illegal field number",        
\
+                                                funcname, MERROR);             
\
                }                                                       \
                /* make sure there is enough space */                   \
                if (fnr >= hdl->maxbindings)                            \
@@ -3178,8 +3178,8 @@ mapi_disconnect(Mapi mid)
                mapi_hdl_check(hdl, funcname);                          \
                if (fnr < 0) {                                          \
                        return mapi_setError(hdl->mid,                  \
-                                            "Illegal param number",    \
-                                            funcname, MERROR);         \
+                                                "Illegal param number",        
\
+                                                funcname, MERROR);             
\
                }                                                       \
                if (fnr >= hdl->maxparams)                              \
                        mapi_extend_params(hdl, fnr);                   \
@@ -3212,7 +3212,7 @@ MapiMsg
 mapi_bind_numeric(MapiHdl hdl, int fnr, int scale, int prec, void *ptr)
 {
        if (mapi_bind_var(hdl, fnr, MAPI_NUMERIC, ptr))
-                return hdl->mid->error;
+               return hdl->mid->error;
 
        hdl->bindings[fnr].scale = scale;
        hdl->bindings[fnr].precision = prec;
@@ -3269,7 +3269,7 @@ MapiMsg
 mapi_param_numeric(MapiHdl hdl, int fnr, int scale, int prec, void *ptr)
 {
        if (mapi_param_type(hdl, fnr, MAPI_NUMERIC, MAPI_NUMERIC, ptr))
-                return hdl->mid->error;
+               return hdl->mid->error;
 
        hdl->params[fnr].scale = scale;
        hdl->params[fnr].precision = prec;
@@ -3322,7 +3322,7 @@ mapi_Xcommand(Mapi mid, const char *cmdn
        if (mid->active && read_into_cache(mid->active, 0) != MOK)
                return MERROR;
        if (mnstr_printf(mid->to, "X" "%s %s\n", cmdname, cmdvalue) < 0 ||
-           mnstr_flush(mid->to)) {
+               mnstr_flush(mid->to)) {
                close_connection(mid);
                mapi_setError(mid, mnstr_error(mid->to), "mapi_Xcommand", 
MTIMEOUT);
                return MERROR;
@@ -3782,7 +3782,7 @@ mapi_cache_freeup_internal(struct MapiRe
        for (i = 0; i < result->cache.writer - k; i++) {
                if (result->cache.line[i].rows) {
                        if (result->cache.line[i].rows[0] == '[' ||
-                           result->cache.line[i].rows[0] == '=')
+                               result->cache.line[i].rows[0] == '=')
                                n++;
                        free(result->cache.line[i].rows);
                }
@@ -3803,8 +3803,8 @@ mapi_cache_freeup_internal(struct MapiRe
                result->cache.line[i + k].lens = 0;
                result->cache.line[i].fldcnt = result->cache.line[i + k].fldcnt;
                if (result->cache.line[i].rows &&
-                   (result->cache.line[i].rows[0] == '[' ||
-                    result->cache.line[i].rows[0] == '=')) {
+                       (result->cache.line[i].rows[0] == '[' ||
+                        result->cache.line[i].rows[0] == '=')) {
                        result->cache.line[i].tuplerev = 
result->cache.tuplecount;
                        
result->cache.line[result->cache.tuplecount++].tupleindex = i;
                }
@@ -3816,7 +3816,7 @@ mapi_cache_freeup_internal(struct MapiRe
        for ( /*i = result->cache.writer - k */ ; i < k /*result->cache.writer 
*/ ; i++) {
                if (result->cache.line[i].rows) {
                        if (result->cache.line[i].rows[0] == '[' ||
-                           result->cache.line[i].rows[0] == '=')
+                               result->cache.line[i].rows[0] == '=')
                                n++;
                        free(result->cache.line[i].rows);
                }
@@ -3858,7 +3858,7 @@ mapi_extend_cache(struct MapiResultSet *
        }
 
        /* extend row cache */
-      retry:;
+         retry:;
        if (oldsize == 0)
                incr = 100;
        else
@@ -3867,8 +3867,8 @@ mapi_extend_cache(struct MapiResultSet *
                incr = 20000;
        newsize = oldsize + incr;
        if (result->cache.rowlimit > 0 &&
-           newsize > result->cache.rowlimit &&
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to