Changeset: 3a16ec3447d2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3a16ec3447d2
Modified Files:
        .editorconfig
        tools/merovingian/client/monetdb.c
        tools/merovingian/daemon/argvcmds.c
        tools/merovingian/daemon/client.c
        tools/merovingian/daemon/connections.c
        tools/merovingian/daemon/controlrunner.c
        tools/merovingian/daemon/discoveryrunner.c
        tools/merovingian/daemon/forkmserver.c
        tools/merovingian/daemon/handlers.c
        tools/merovingian/daemon/merovingian.c
        tools/merovingian/daemon/merovingian.h
        tools/merovingian/daemon/multiplex-funnel.c
        tools/merovingian/daemon/proxy.c
        tools/merovingian/daemon/snapshot.c
        tools/merovingian/utils/control.c
        tools/merovingian/utils/control.h
        tools/merovingian/utils/database.c
        tools/merovingian/utils/glob.c
        tools/merovingian/utils/properties.c
        tools/merovingian/utils/utils.c
        tools/monetdbe/monetdbe.c
        tools/monetdbe/monetdbe.h
        tools/mserver/monet_version.c.in
        tools/mserver/mserver5.c
        tools/mserver/shutdowntest.c
Branch: default
Log Message:

Use 8-space tabs in tools directory.


diffs (truncated from 6360 to 300 lines):

diff --git a/.editorconfig b/.editorconfig
--- a/.editorconfig
+++ b/.editorconfig
@@ -24,7 +24,7 @@ indent_style = space
 indent_size = 2
 trim_trailing_whitespace = true
 
-[{clients,common,gdk,geom}/**.{c,h}{,.in}]
+[{clients,common,gdk,geom,tools}/**.{c,h}{,.in}]
 tab_width = 8
 max_line_length = 72
 
diff --git a/tools/merovingian/client/monetdb.c 
b/tools/merovingian/client/monetdb.c
--- a/tools/merovingian/client/monetdb.c
+++ b/tools/merovingian/client/monetdb.c
@@ -257,7 +257,7 @@ MEROgetStatus(sabdb **ret, char *databas
                database = "#all";
 
        e = control_send(&buf, mero_host, mero_port,
-                       database, "status", true, mero_pass);
+                        database, "status", true, mero_pass);
        if (e != NULL)
                return(e);
 
@@ -274,7 +274,7 @@ MEROgetStatus(sabdb **ret, char *databas
                        e = msab_deserialise(&stats, p);
                        if (e != NULL) {
                                printf("WARNING: failed to parse response from "
-                                               "monetdbd: %s\n", e);
+                                      "monetdbd: %s\n", e);
                                free(e);
                                swpos--;
                                continue;
@@ -326,20 +326,20 @@ printStatus(sabdb *stats, int mode, int 
                char *uri;
 
                switch (stats->state) {
-                       case SABdbStarting:
-                               state = 'B';
+               case SABdbStarting:
+                       state = 'B';
                        break;
-                       case SABdbRunning:
-                               state = 'R';
+               case SABdbRunning:
+                       state = 'R';
                        break;
-                       case SABdbCrashed:
-                               state = 'C';
+               case SABdbCrashed:
+                       state = 'C';
                        break;
-                       case SABdbInactive:
-                               state = 'S';
+               case SABdbInactive:
+                       state = 'S';
                        break;
-                       default:
-                               state = ' ';
+               default:
+                       state = ' ';
                        break;
                }
                /* override if locked for brevity */
@@ -352,8 +352,8 @@ printStatus(sabdb *stats, int mode, int 
                        t = localtime(&uplog.laststart);
                        strftime(info, sizeof(info), "starting up since 
%Y-%m-%d %H:%M:%S", t);
                } else if (uplog.lastcrash != -1 &&
-                               stats->state != SABdbRunning &&
-                               uplog.crashavg1 == 1)
+                          stats->state != SABdbRunning &&
+                          uplog.crashavg1 == 1)
                {
                        struct tm *t;
                        t = localtime(&uplog.lastcrash);
@@ -361,21 +361,21 @@ printStatus(sabdb *stats, int mode, int 
                }
 
                switch (stats->state) {
-                       case SABdbRunning:
-                       case SABdbStarting:
-                               secondsToString(uptime, sizeof(uptime), 
time(NULL) - uplog.laststart, 1);
-                               break;
-                       case SABdbCrashed:
-                               secondsToString(uptime, sizeof(uptime), 
time(NULL) - uplog.lastcrash, 1);
+               case SABdbRunning:
+               case SABdbStarting:
+                       secondsToString(uptime, sizeof(uptime), time(NULL) - 
uplog.laststart, 1);
+                       break;
+               case SABdbCrashed:
+                       secondsToString(uptime, sizeof(uptime), time(NULL) - 
uplog.lastcrash, 1);
+                       break;
+               case SABdbInactive:
+                       if (uplog.laststop != -1) {
+                               secondsToString(uptime, sizeof(uptime), 
time(NULL) - uplog.laststop, 1);
                                break;
-                       case SABdbInactive:
-                               if (uplog.laststop != -1) {
-                                       secondsToString(uptime, sizeof(uptime), 
time(NULL) - uplog.laststop, 1);
-                                       break;
-                               } /* else fall through */
-                       default:
-                               uptime[0] = '\0';
-                               break;
+                       } /* else fall through */
+               default:
+                       uptime[0] = '\0';
+                       break;
                }
 
                /* cut too long names */
@@ -383,16 +383,16 @@ printStatus(sabdb *stats, int mode, int 
                abbreviateString(dbname, stats->dbname, dbwidth);
                uri = malloc(sizeof(char) * (uriwidth + 1));
                abbreviateString(uri,
-                               info[0] != '\0' ? info : stats->uri ? 
stats->uri : "",
-                               uriwidth);
+                                info[0] != '\0' ? info : stats->uri ? 
stats->uri : "",
+                                uriwidth);
                /* dbname | state | health | uri/crash */
                printf("%-*s  %c%c%3s", dbwidth, dbname,
-                               locked ? locked : state, locked ? state : ' ', 
uptime);
+                      locked ? locked : state, locked ? state : ' ', uptime);
                free(dbname);
                if (uplog.startcntr) {
                        secondsToString(avg, sizeof(avg), uplog.avguptime, 1);
                        printf("  %3d%% %3s",
-                                       100 - (uplog.crashcntr * 100 / 
uplog.startcntr), avg);
+                              100 - (uplog.crashcntr * 100 / uplog.startcntr), 
avg);
                } else {
                        printf("           ");
                }
@@ -406,20 +406,20 @@ printStatus(sabdb *stats, int mode, int 
                struct tm *t;
 
                switch (stats->state) {
-                       case SABdbStarting:
-                               state = "starting up";
+               case SABdbStarting:
+                       state = "starting up";
                        break;
-                       case SABdbRunning:
-                               state = "running";
+               case SABdbRunning:
+                       state = "running";
                        break;
-                       case SABdbCrashed:
-                               state = "crashed";
+               case SABdbCrashed:
+                       state = "crashed";
                        break;
-                       case SABdbInactive:
-                               state = "stopped";
+               case SABdbInactive:
+                       state = "stopped";
                        break;
-                       default:
-                               state = "unknown";
+               default:
+                       state = "unknown";
                        break;
                }
 
@@ -433,12 +433,12 @@ printStatus(sabdb *stats, int mode, int 
                if (entry == NULL) {
                        printf(" (none)");
                } else while (entry != NULL) {
-                       printf(" %s", entry->val);
-                       entry = entry->next;
-               }
+                               printf(" %s", entry->val);
+                               entry = entry->next;
+                       }
                printf("\n");
                printf("  start count: %d\n  stop count: %d\n  crash count: 
%d\n",
-                               uplog.startcntr, uplog.stopcntr, 
uplog.crashcntr);
+                      uplog.startcntr, uplog.stopcntr, uplog.crashcntr);
                if (stats->state == SABdbRunning) {
                        secondsToString(up, sizeof(up), time(NULL) - 
uplog.laststart, 999);
                        printf("  current uptime: %s\n", up);
@@ -471,11 +471,11 @@ printStatus(sabdb *stats, int mode, int 
                }
                printf("  last stop: %s\n", up);
                printf("  average of crashes in the last start attempt: %d\n",
-                               uplog.crashavg1);
+                      uplog.crashavg1);
                printf("  average of crashes in the last 10 start attempts: 
%.2f\n",
-                               uplog.crashavg10);
+                      uplog.crashavg10);
                printf("  average of crashes in the last 30 start attempts: 
%.2f\n",
-                               uplog.crashavg30);
+                      uplog.crashavg30);
        } else {
                /* this shows most used properties, and is shown also for modes
                 * that are added but we don't understand (yet) */
@@ -487,40 +487,40 @@ printStatus(sabdb *stats, int mode, int 
                /* dbname, status -- since, crash averages */
 
                switch (stats->state) {
-                       case SABdbStarting:
-                               snprintf(buf, sizeof(buf), "starting ");
-                               off = sizeof("starting ") - 1;
-                               /* fall through */
-                       case SABdbRunning:
-                               t = localtime(&uplog.laststart);
-                               off += strftime(buf + off, sizeof(buf) - off,
-                                                               "up since 
%Y-%m-%d %H:%M:%S, ", t);
-                               secondsToString(up, sizeof(up), time(NULL) - 
uplog.laststart, 999);
-                               strcpy(buf + off, up);
+               case SABdbStarting:
+                       snprintf(buf, sizeof(buf), "starting ");
+                       off = sizeof("starting ") - 1;
+                       /* fall through */
+               case SABdbRunning:
+                       t = localtime(&uplog.laststart);
+                       off += strftime(buf + off, sizeof(buf) - off,
+                                       "up since %Y-%m-%d %H:%M:%S, ", t);
+                       secondsToString(up, sizeof(up), time(NULL) - 
uplog.laststart, 999);
+                       strcpy(buf + off, up);
                        break;
-                       case SABdbCrashed:
-                               t = localtime(&uplog.lastcrash);
-                               strftime(buf, sizeof(buf), "crashed (started on 
%Y-%m-%d %H:%M:%S)", t);
+               case SABdbCrashed:
+                       t = localtime(&uplog.lastcrash);
+                       strftime(buf, sizeof(buf), "crashed (started on 
%Y-%m-%d %H:%M:%S)", t);
                        break;
-                       case SABdbInactive:
-                               snprintf(buf, sizeof(buf), "not running");
+               case SABdbInactive:
+                       snprintf(buf, sizeof(buf), "not running");
                        break;
-                       default:
-                               snprintf(buf, sizeof(buf), "unknown");
+               default:
+                       snprintf(buf, sizeof(buf), "unknown");
                        break;
                }
                if (stats->locked)
                        strcat(buf, ", locked");
                printf("database %s, %s\n", stats->dbname, buf);
                printf("  crash average: %d.00 %.2f %.2f (over 1, 15, 30 
starts) "
-                               "in total %d crashes\n",
-                               uplog.crashavg1, uplog.crashavg10, 
uplog.crashavg30,
-                               uplog.crashcntr);
+                      "in total %d crashes\n",
+                      uplog.crashavg1, uplog.crashavg10, uplog.crashavg30,
+                      uplog.crashcntr);
                secondsToString(min, sizeof(min), uplog.minuptime, 1);
                secondsToString(avg, sizeof(avg), uplog.avguptime, 1);
                secondsToString(max, sizeof(max), uplog.maxuptime, 1);
                printf("  uptime stats (min/avg/max): %s/%s/%s over %d runs\n",
-                               min, avg, max, uplog.stopcntr);
+                      min, avg, max, uplog.stopcntr);
        }
 }
 
@@ -542,10 +542,12 @@ globMatchDBS(int *fails, int argc, char 
                        for (stats = *orig; stats != NULL; stats = stats->next) 
{
                                if (db_glob(argv[i], stats->dbname)) {
                                        matched = true;
-                                       /* move out of orig into w, such that 
we can't
-                                        * get double matches in the same 
output list
-                                        * (as side effect also avoids a double 
free
-                                        * later on) */
+                                       /* move out of orig into w, such
+                                        * that we can't get double
+                                        * matches in the same output
+                                        * list (as side effect also
+                                        * avoids a double free later
+                                        * on) */
                                        if (w == NULL) {
                                                top = w = stats;
                                        } else {
@@ -602,13 +604,13 @@ simple_argv_cmd(char *cmd, sabdb *dbs, c
                }
 
                ret = control_send(&out, mero_host, mero_port,
-                               dbs->dbname, merocmd, false, mero_pass);
+                                  dbs->dbname, merocmd, false, mero_pass);
 
                if (ret != NULL) {
                        if (premsg != NULL && !monetdb_quiet)
                                printf("FAILED\n");
                        fprintf(stderr, "%s: %s\n",
-                                       cmd, ret);
+                               cmd, ret);
                        free(ret);
                        exit(2);
                }
@@ -728,50 +730,50 @@ command_status(int argc, char *argv[])
                if (argv[i][0] == '-') {
                        for (p = argv[i] + 1; *p != '\0'; p++) {
                                switch (*p) {
-                                       case 'c':
-                                               mode = 0;
+                               case 'c':
+                                       mode = 0;
                                        break;
-                                       case 'l':
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to