Changeset: b47fa7146247 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b47fa7146247
Modified Files:
        ctest/tools/embedded/backup.c
        ctest/tools/embedded/mapi.c
        tools/embedded/monetdb_embedded.c
Branch: default
Log Message:

fixed compilation with strict flags


diffs (88 lines):

diff --git a/ctest/tools/embedded/backup.c b/ctest/tools/embedded/backup.c
--- a/ctest/tools/embedded/backup.c
+++ b/ctest/tools/embedded/backup.c
@@ -13,7 +13,7 @@ extern int dump_database(Mapi mid, strea
 #define error(msg) {fprintf(stderr, "Failure: %s\n", msg); return -1;}
 
 int
-main() 
+main(void) 
 {
        char* err = NULL;
        Mapi mid = (Mapi)malloc(sizeof(struct MapiStruct));
diff --git a/ctest/tools/embedded/mapi.c b/ctest/tools/embedded/mapi.c
--- a/ctest/tools/embedded/mapi.c
+++ b/ctest/tools/embedded/mapi.c
@@ -38,7 +38,7 @@ mapi_close_handle(MapiHdl hdl)
 {
        if (hdl) {
                if (hdl->mapi_row) {
-                       for (int i=0; i<hdl->result->ncols; i++) {
+                       for (size_t i=0; i<hdl->result->ncols; i++) {
                                if (hdl->mapi_row[i])
                                        MAPIfree(hdl->mapi_row[i]);
                        }
@@ -46,9 +46,6 @@ mapi_close_handle(MapiHdl hdl)
                }
 
                char *msg = monetdb_cleanup_result(hdl->mid->conn, hdl->result);
-               Mapi mid = hdl->mid;
-
-
                MAPIfree(hdl);
                if (msg)
                        hdl->mid->msg = msg;
@@ -71,7 +68,7 @@ mapi_fetch_row(MapiHdl hdl)
 char *
 mapi_fetch_field(MapiHdl hdl, int fnr)
 {
-       if (hdl && fnr < hdl->result->ncols && hdl->current_row > 0 && 
hdl->current_row <= hdl->result->nrows) {
+       if (hdl && fnr < (int)hdl->result->ncols && hdl->current_row > 0 && 
hdl->current_row <= hdl->result->nrows) {
                monetdb_column *rcol = NULL;
                if (monetdb_result_fetch(hdl->mid->conn, hdl->result,  &rcol, 
fnr) == NULL) {
                        size_t r = hdl->current_row - 1;
@@ -164,7 +161,7 @@ mapi_fetch_field(MapiHdl hdl, int fnr)
 char *
 mapi_get_type(MapiHdl hdl, int fnr)
 {
-       if (hdl && fnr < hdl->result->ncols) {
+       if (hdl && fnr < (int)hdl->result->ncols) {
                monetdb_column *rcol = NULL;
                if (monetdb_result_fetch(hdl->mid->conn, hdl->result,  &rcol, 
fnr) == NULL) {
                        switch(rcol->type) {
diff --git a/tools/embedded/monetdb_embedded.c 
b/tools/embedded/monetdb_embedded.c
--- a/tools/embedded/monetdb_embedded.c
+++ b/tools/embedded/monetdb_embedded.c
@@ -664,7 +664,7 @@ monetdb_append(monetdb_connection conn, 
 
        /* small number of rows */
        if (input[0]->count <= 16) {
-               int i, cnt = (int)input[0]->count;
+               size_t i, cnt = input[0]->count;
                node *n;
 
                for (i = 0, n = t->columns.set->h; i < column_count && n; i++, 
n = n->next) {
@@ -674,12 +674,12 @@ monetdb_append(monetdb_connection conn, 
                        int w = 1;
 
                        if (mtype < 0) {
-                               msg = createException(SQL, 
"embedded.monetdb_append", "Cannot find type for column %d", i);
+                               msg = createException(SQL, 
"embedded.monetdb_append", "Cannot find type for column %zu", i);
                                goto cleanup;
                        }
                        if (mtype >= TYPE_bit && mtype <= TYPE_dbl) {
                                w = BATatoms[mtype].size;
-                               for (int j=0; j<cnt; j++, v+=w){
+                               for (size_t j=0; j<cnt; j++, v+=w){
                                        if 
(store_funcs.append_col(m->session->tr, c, v, mtype) != 0) {
                                                msg = createException(SQL, 
"embedded.monetdb_append", "Cannot append values");
                                                goto cleanup;
@@ -688,7 +688,7 @@ monetdb_append(monetdb_connection conn, 
                        } else if (mtype == TYPE_str) {
                                char **d = (char**)v;
 
-                               for (int j=0; j<cnt; j++){
+                               for (size_t j=0; j<cnt; j++){
                                        char *s = d[j];
                                        if (!s)
                                                s = (char*)str_nil;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to