From 245427b08e34e7095bc2fa45952e44fed2d729d2 Mon Sep 17 00:00:00 2001 From: gambas Date: Wed, 2 Jan 2019 00:48:58 +0100 Subject: [PATCH] * Get rid of many gcc warnings. --- gb.db.odbc/src/main.c | 4 +--- gb.db.postgresql/src/main.c | 8 ++++++++ gb.gtk/src/main.cpp | 2 +- gb.qt4/src/CKey.cpp | 2 +- gb.qt4/src/main.cpp | 1 - main/gbc/gbc_trans.c | 4 ++-- main/gbc/gbc_trans.h | 2 +- main/gbc/gbi.c | 4 ++-- main/lib/db/gb.db/.component | 2 +- main/lib/db/gb.db/.project | 2 +- main/share/gb_common.h | 4 ++-- 11 files changed, 20 insertions(+), 15 deletions(-) diff --git a/gb.db.odbc/src/main.c b/gb.db.odbc/src/main.c index dcfd3cb41..baa7f1936 100644 --- a/gb.db.odbc/src/main.c +++ b/gb.db.odbc/src/main.c @@ -2350,12 +2350,10 @@ fflush(stderr); while (nReturn == SQL_SUCCESS || nReturn == SQL_SUCCESS_WITH_INFO) { - - tablenum = tablenum + 1; curtable->tablename = malloc(sizeof(szTableName)); curtable->next = malloc(sizeof(ODBC_TABLES)); - strncpy(curtable->tablename, (char *)szTableName, sizeof(szTableName)); + strcpy(curtable->tablename, (char *)szTableName); curtable = (ODBC_TABLES *) curtable->next; szTableName[0] = '\0'; szTableType[0] = '\0'; diff --git a/gb.db.postgresql/src/main.c b/gb.db.postgresql/src/main.c index 5481f01ff..50a349c93 100644 --- a/gb.db.postgresql/src/main.c +++ b/gb.db.postgresql/src/main.c @@ -42,6 +42,14 @@ #undef PACKAGE_URL #endif +#ifdef Max + #undef Max +#endif + +#ifdef Min + #undef Min +#endif + #include "gb.db.proto.h" #include "main.h" diff --git a/gb.gtk/src/main.cpp b/gb.gtk/src/main.cpp index 16fd92c39..5550e1276 100644 --- a/gb.gtk/src/main.cpp +++ b/gb.gtk/src/main.cpp @@ -107,7 +107,7 @@ bool MAIN_rtl = false; extern "C" { -GB_INTERFACE GB EXPORT; +const GB_INTERFACE *GB_PTR EXPORT; IMAGE_INTERFACE IMAGE EXPORT; GEOM_INTERFACE GEOM EXPORT; diff --git a/gb.qt4/src/CKey.cpp b/gb.qt4/src/CKey.cpp index ed0151228..b3849cb90 100644 --- a/gb.qt4/src/CKey.cpp +++ b/gb.qt4/src/CKey.cpp @@ -41,7 +41,7 @@ void CKEY_clear(int valid) if (CKEY_info.valid == 0) { GB.FreeString(&CKEY_info.text); - CLEAR(&CKEY_info); + CKEY_info = { 0 }; } } diff --git a/gb.qt4/src/main.cpp b/gb.qt4/src/main.cpp index 58e8f7c33..99241e3e2 100644 --- a/gb.qt4/src/main.cpp +++ b/gb.qt4/src/main.cpp @@ -113,7 +113,6 @@ /*#define DEBUG*/ extern "C" { - const GB_INTERFACE *GB_PTR EXPORT; IMAGE_INTERFACE IMAGE EXPORT; GEOM_INTERFACE GEOM EXPORT; diff --git a/main/gbc/gbc_trans.c b/main/gbc/gbc_trans.c index f819b1c96..f437cff18 100644 --- a/main/gbc/gbc_trans.c +++ b/main/gbc/gbc_trans.c @@ -825,10 +825,10 @@ bool TRANS_is_end_function(bool is_proc, PATTERN *look) } -char *TRANS_get_num_desc(int num) +char *TRANS_get_num_desc(ushort num) { static const char *num_desc[3] = { "first", "second", "third" }; - static char desc[6]; + static char desc[8]; if (num < 1) return NULL; diff --git a/main/gbc/gbc_trans.h b/main/gbc/gbc_trans.h index 3afe555de..132e63689 100644 --- a/main/gbc/gbc_trans.h +++ b/main/gbc/gbc_trans.h @@ -138,7 +138,7 @@ void TRANS_want(int reserved, char *msg); void TRANS_want_newline(void); //int TRANS_get_class(PATTERN pattern); bool TRANS_is_end_function(bool is_proc, PATTERN *look); -char *TRANS_get_num_desc(int num); +char *TRANS_get_num_desc(ushort num); #define TRANS_is(_reserved) (PATTERN_is(*JOB->current, (_reserved)) ? JOB->current++, TRUE : FALSE) #define TRANS_ignore(_reserved) (void)TRANS_is(_reserved) diff --git a/main/gbc/gbi.c b/main/gbc/gbi.c index 8b8eec8c1..df685f054 100644 --- a/main/gbc/gbi.c +++ b/main/gbc/gbi.c @@ -70,8 +70,8 @@ static char _root[PATH_MAX + 1] = { 0 }; static char _lib_path[PATH_MAX + 1]; static char _info_path[PATH_MAX + 1]; -static char _buffer[PATH_MAX + 1]; -static char _env[PATH_MAX + 16]; +static char _buffer[PATH_MAX + 16]; +static char _env[PATH_MAX + 32]; static FILE *out_info; static FILE *out_list; diff --git a/main/lib/db/gb.db/.component b/main/lib/db/gb.db/.component index c85abbbe6..a9a67ca4f 100644 --- a/main/lib/db/gb.db/.component +++ b/main/lib/db/gb.db/.component @@ -1,3 +1,3 @@ [Component] Key=gb.db -Version=3.11.90 +Version=3.12.0 diff --git a/main/lib/db/gb.db/.project b/main/lib/db/gb.db/.project index c3b795e89..737ba00d6 100644 --- a/main/lib/db/gb.db/.project +++ b/main/lib/db/gb.db/.project @@ -1,7 +1,7 @@ # Gambas Project File 3.0 Title=gb.db Startup=Main -Version=3.11.90 +Version=3.12.0 VersionFile=1 Component=gb.db TabSize=2 diff --git a/main/share/gb_common.h b/main/share/gb_common.h index eb8cce65d..c6cf53315 100644 --- a/main/share/gb_common.h +++ b/main/share/gb_common.h @@ -158,11 +158,11 @@ typedef #endif #ifndef PATH_MAX -#define PATH_MAX 4096 +#define PATH_MAX 4095 #endif #ifndef MAXPATHLEN -#define MAXPATHLEN 4096 +#define MAXPATHLEN 4095 #endif #define CLEAR(s) (memset(s, 0, sizeof(*s)))