Changeset: dd0de32b8487 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dd0de32b8487
Modified Files:
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_gencode.h
        sql/server/sql_scan.c
Branch: Apr2019
Log Message:

Adjust some types.


diffs (78 lines):

diff --git a/sql/backends/monet5/sql_gencode.c 
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -610,7 +610,7 @@ sql_relation2stmt(backend *be, sql_rel *
 }
 
 int
-backend_dumpstmt(backend *be, MalBlkPtr mb, sql_rel *r, int top, int add_end, 
char *query)
+backend_dumpstmt(backend *be, MalBlkPtr mb, sql_rel *r, int top, int add_end, 
const char *query)
 {
        mvc *c = be->mvc;
        InstrPtr q, querylog = NULL;
diff --git a/sql/backends/monet5/sql_gencode.h 
b/sql/backends/monet5/sql_gencode.h
--- a/sql/backends/monet5/sql_gencode.h
+++ b/sql/backends/monet5/sql_gencode.h
@@ -19,7 +19,7 @@
 
 sql5_export Symbol backend_dumpproc(backend *be, Client c, cq *q, sql_rel *r);
 sql5_export int backend_callinline(backend *be, Client c);
-sql5_export int backend_dumpstmt(backend *be, MalBlkPtr mb, sql_rel *r, int 
top, int addend, char *query);
+sql5_export int backend_dumpstmt(backend *be, MalBlkPtr mb, sql_rel *r, int 
top, int addend, const char *query);
 sql5_export void backend_call(backend *be, Client c, cq *q);
 sql5_export void initSQLreferences(void);
 sql5_export int monet5_resolve_function(ptr M, sql_func *f);
diff --git a/sql/server/sql_scan.c b/sql/server/sql_scan.c
--- a/sql/server/sql_scan.c
+++ b/sql/server/sql_scan.c
@@ -31,9 +31,9 @@ query_cleaned(const char *query)
 {
        char *q, *r;
        int quote = 0;          /* inside quotes ('..', "..", {..}) */
-       int bs = 0;             /* seen a backslash in a quoted string */
-       int incomment1 = 0;     /* inside traditional C style comment */
-       int incomment2 = 0;     /* inside comment starting with --  */
+       bool bs = false;                /* seen a backslash in a quoted string 
*/
+       bool incomment1 = false;        /* inside traditional C style comment */
+       bool incomment2 = false;        /* inside comment starting with --  */
        r = GDKmalloc(strlen(query) + 1);
        if(!r)
                return NULL;
@@ -41,11 +41,11 @@ query_cleaned(const char *query)
        for (q = r; *query; query++) {
                if (incomment1) {
                        if (*query == '/' && query[-1] == '*') {
-                               incomment1 = 0;
+                               incomment1 = false;
                        }
                } else if (incomment2) {
                        if (*query == '\n') {
-                               incomment2 = 0;
+                               incomment2 = false;
                                /* add newline only if comment doesn't
                                 * occupy whole line */
                                if (q > r && q[-1] != '\n')
@@ -53,9 +53,9 @@ query_cleaned(const char *query)
                        }
                } else if (quote) {
                        if (bs) {
-                               bs = 0;
+                               bs = false;
                        } else if (*query == '\\') {
-                               bs = 1;
+                               bs = true;
                        } else if (*query == quote) {
                                quote = 0;
                        }
@@ -67,9 +67,9 @@ query_cleaned(const char *query)
                        quote = '}';
                        *q++ = *query;
                } else if (*query == '-' && query[1] == '-') {
-                       incomment2 = 1;
+                       incomment2 = true;
                } else if (*query == '/' && query[1] == '*') {
-                       incomment1 = 1;
+                       incomment1 = true;
                } else if (*query == '\n') {
                        /* collapse newlines */
                        if (q > r && q[-1] != '\n')
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to