[libgda] Removing libgda warnings



commit d954f1e39a840d9c65c0c9606262f65ad8fcaa2a
Author: Daniel Espinosa <esodan gmail com>
Date:   Mon Jul 9 11:48:45 2018 -0500

    Removing libgda warnings

 libgda/sql-parser/gda-statement-struct.c |  1 +
 libgda/sql-parser/lemon.c                | 17 ++---------------
 libgda/sqlite/gen_emb_string.c           |  6 +++---
 tests/test-bin-converter.c               |  2 +-
 4 files changed, 7 insertions(+), 19 deletions(-)
---
diff --git a/libgda/sql-parser/gda-statement-struct.c b/libgda/sql-parser/gda-statement-struct.c
index 33c2ab4b9..f3c422ad3 100644
--- a/libgda/sql-parser/gda-statement-struct.c
+++ b/libgda/sql-parser/gda-statement-struct.c
@@ -1490,6 +1490,7 @@ gda_sql_any_part_copy (GdaSqlAnyPart *src) {
        GdaSqlAnyPart *cp = g_new0(GdaSqlAnyPart, 1);
        cp->type = src->type;
        cp->parent = src->parent;
+       return cp;
 }
 void
 gda_sql_any_part_free (GdaSqlAnyPart *anyp) {
diff --git a/libgda/sql-parser/lemon.c b/libgda/sql-parser/lemon.c
index ed241f2a2..ac7aa7ba9 100644
--- a/libgda/sql-parser/lemon.c
+++ b/libgda/sql-parser/lemon.c
@@ -39,19 +39,6 @@ static int showPrecedenceConflict = 0;
 static const char **made_files = NULL;
 static int made_files_count = 0;
 static int successful_exit = 0;
-static void LemonAtExit(void)
-{
-    /* if we failed, delete (most) files we made, to unconfuse build tools. */
-    int i;
-    for (i = 0; i < made_files_count; i++) {
-        if (!successful_exit) {
-            remove(made_files[i]);
-        }
-    }
-    free(made_files);
-    made_files_count = 0;
-    made_files = NULL;
-}
 
 static char *msort(char*,char**,int(*)(const char*,const char*));
 
@@ -2566,7 +2553,7 @@ void Parse(struct lemon *gp)
     gp->errorcnt++;
     return;
   }
-  if( fread(filebuf,1,filesize,fp)!=filesize ){
+  if( fread(filebuf,1,filesize,fp)!= (uint) filesize ){
     ErrorMsg(ps.filename,0,"Can't read in all %d bytes of this file.",
       filesize);
     free(filebuf);
@@ -3359,7 +3346,7 @@ PRIVATE char *append_str(const char *zText, int n, int p1, int p2){
     }
     n = lemonStrlen(zText);
   }
-  if( n+sizeof(zInt)*2+used >= alloced ){
+  if( n+sizeof(zInt)*2+used >= (uint) alloced ){
     alloced = n + sizeof(zInt)*2 + used + 200;
     z = (char *) realloc(z,  alloced);
   }
diff --git a/libgda/sqlite/gen_emb_string.c b/libgda/sqlite/gen_emb_string.c
index 612cd4548..4f40b0e4f 100644
--- a/libgda/sqlite/gen_emb_string.c
+++ b/libgda/sqlite/gen_emb_string.c
@@ -107,7 +107,7 @@ main (int argc,char** argv)
                
                /* copy the file into the buffer: */
                n_read = fread (buffer + buffer_index, 1, fsize, file);
-               if (n_read != fsize) {
+               if (n_read != (uint) fsize) {
                        fprintf (stderr, "Reading error");
                        fclose (file);
                        return 1;
@@ -116,8 +116,8 @@ main (int argc,char** argv)
                /* alter buffer */
                int added = 0;
                int real_added = 0;
-               for (i = buffer_index; i < buffer_index + n_read + added; i++) {
-                       if (buffer_index + n_read + added + 2 >= maxlen) {
+               for (i = buffer_index; (uint) i < buffer_index + n_read + added; i++) {
+                       if (buffer_index + n_read + added + 2 >= (uint) maxlen) {
                                fprintf (stderr, "Max buffer size reached\nIncrease MAXSIZE constant and 
re-run\n");
                                fclose (file);
                                return 1;
diff --git a/tests/test-bin-converter.c b/tests/test-bin-converter.c
index cc264ca9a..088640baf 100644
--- a/tests/test-bin-converter.c
+++ b/tests/test-bin-converter.c
@@ -67,6 +67,6 @@ main (int argc, char** argv)
        gda_binary_free (bin);
        gda_binary_free (bin2);
 
-       g_print ("Ok (file size: %d)\n", bin_length);
+       g_print ("Ok (file size: %ld)\n", bin_length);
        return EXIT_SUCCESS;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]