Changeset: e798345b70e8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e798345b70e8
Modified Files:
clients/mapiclient/dump.c
clients/mapiclient/mclient.c
monetdb5/mal/mal_exception.c
monetdb5/modules/atoms/blob.c
monetdb5/modules/atoms/inet.c
monetdb5/modules/mal/mal_io.c
monetdb5/modules/mal/mal_mapi.c
monetdb5/modules/mal/txtsim.c
sql/backends/monet5/sql.c
Branch: Jan2022
Log Message:
More const
diffs (132 lines):
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -204,7 +204,7 @@ comment_on(stream *toConsole, const char
return 0;
}
-static char *actions[] = {
+static const char *actions[] = {
0,
"CASCADE",
"RESTRICT",
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2926,7 +2926,7 @@ struct privdata {
#define READSIZE (1 << 16)
//#define READSIZE (1 << 20)
-static char alpha[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+static const char alpha[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
static char *
@@ -3136,7 +3136,7 @@ main(int argc, char **argv)
bool autocommit = true; /* autocommit mode default on */
bool user_set_as_flag = false;
bool passwd_set_as_flag = false;
- static struct option long_options[] = {
+ static const struct option long_options[] = {
{"autocommit", 0, 0, 'a'},
{"database", 1, 0, 'd'},
{"dump", 0, 0, 'D'},
diff --git a/monetdb5/mal/mal_exception.c b/monetdb5/mal/mal_exception.c
--- a/monetdb5/mal/mal_exception.c
+++ b/monetdb5/mal/mal_exception.c
@@ -14,7 +14,7 @@
#include "mal_exception.h"
#include "mal_private.h"
-static char *exceptionNames[] = {
+static const char *exceptionNames[] = {
/* 0 */ "MALException",
/* 1 */ "IllegalArgumentException",
/* 2 */ "OutOfBoundsException",
diff --git a/monetdb5/modules/atoms/blob.c b/monetdb5/modules/atoms/blob.c
--- a/monetdb5/modules/atoms/blob.c
+++ b/monetdb5/modules/atoms/blob.c
@@ -59,7 +59,7 @@ blobsize(size_t nitems)
return (var_t) (offsetof(blob, data) + nitems);
}
-static char hexit[] = "0123456789ABCDEF";
+static const char hexit[] = "0123456789ABCDEF";
/*
* @- Wrapping section
diff --git a/monetdb5/modules/atoms/inet.c b/monetdb5/modules/atoms/inet.c
--- a/monetdb5/modules/atoms/inet.c
+++ b/monetdb5/modules/atoms/inet.c
@@ -61,7 +61,7 @@ typedef struct _inet {
#endif
#define in_setnil(i) (i)->q1 = (i)->q2 = (i)->q3 = (i)->q4 = (i)->mask =
(i)->filler1 = (i)->filler2 = 0; (i)->isnil = 1
-static inet inet_nil = {{{0,0,0,0,0,0,0,1}}};
+static const inet inet_nil = {{{0,0,0,0,0,0,0,1}}};
/**
* Creates a new inet from the given string.
diff --git a/monetdb5/modules/mal/mal_io.c b/monetdb5/modules/mal/mal_io.c
--- a/monetdb5/modules/mal/mal_io.c
+++ b/monetdb5/modules/mal/mal_io.c
@@ -210,9 +210,9 @@ IOprint_val(Client cntxt, MalBlkPtr mb,
}
-static char toofew_error[80] = OPERATION_FAILED " At least %d parameter(s)
expected.\n";
-static char format_error[80] = OPERATION_FAILED " Error in format before param
%d.\n";
-static char type_error[80] = OPERATION_FAILED " Illegal type in param %d.\n";
+static const char toofew_error[80] = OPERATION_FAILED " At least %d
parameter(s) expected.\n";
+static const char format_error[80] = OPERATION_FAILED " Error in format before
param %d.\n";
+static const char type_error[80] = OPERATION_FAILED " Illegal type in param
%d.\n";
#define return_error(x)
\
do {
\
@@ -221,7 +221,7 @@ static char type_error[80] = OPERATION_F
throw(MAL,"io.printf", x,argc); \
} while (0)
-static char niltext[4] = "nil";
+static const char niltext[4] = "nil";
static str
IOprintf_(str *res, str format, ...)
diff --git a/monetdb5/modules/mal/mal_mapi.c b/monetdb5/modules/mal/mal_mapi.c
--- a/monetdb5/modules/mal/mal_mapi.c
+++ b/monetdb5/modules/mal/mal_mapi.c
@@ -88,7 +88,7 @@
#define SERVERMAXUSERS 5
-static char seedChars[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
+static const char seedChars[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
diff --git a/monetdb5/modules/mal/txtsim.c b/monetdb5/modules/mal/txtsim.c
--- a/monetdb5/modules/mal/txtsim.c
+++ b/monetdb5/modules/mal/txtsim.c
@@ -214,7 +214,7 @@ levenshteinbasic2_impl(int *result, str
#define SoundexKey "Z000" /* default key for soundex code */
/* set letter values */
-static int Code[] = { 0, 1, 2, 3, 0, 1, 2, 0, 0, 2, 2, 4, 5, 5, 0,
+static const int Code[] = { 0, 1, 2, 3, 0, 1, 2, 0, 0, 2, 2, 4, 5, 5, 0,
1, 2, 6, 2, 3, 0, 1, 0, 2, 0, 2
};
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -2968,8 +2968,8 @@ bat2return(MalStkPtr stk, InstrPtr pci,
}
}
-static char fwftsep[2] = {STREAM_FWF_FIELD_SEP, '\0'};
-static char fwfrsep[2] = {STREAM_FWF_RECORD_SEP, '\0'};
+static const char fwftsep[2] = {STREAM_FWF_FIELD_SEP, '\0'};
+static const char fwfrsep[2] = {STREAM_FWF_RECORD_SEP, '\0'};
/* str mvc_import_table_wrap(int *res, sql_table **t, unsigned char* *T,
unsigned char* *R, unsigned char* *S, unsigned char* *N, str *fname, lng *sz,
lng *offset, int *besteffort, str *fixed_width, int *onclient, int *escape); */
str
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list