summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-02-07 16:37:44 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-02-07 16:37:44 +0400
commit40398f3660273a646eb974092a9ddf6f881d700e (patch)
treec621e0d9c16cee544e71c0aafd044d60b453a353
parent8cfa84ca875ac464f5e37be88dc521bb2dd89091 (diff)
downloadmariadb-git-40398f3660273a646eb974092a9ddf6f881d700e.tar.gz
Fixing some of the compilation warnings.
-rw-r--r--storage/connect/CMakeLists.txt2
-rw-r--r--storage/connect/filamap.cpp2
-rw-r--r--storage/connect/filamdbf.cpp1
-rw-r--r--storage/connect/filamfix.cpp1
-rw-r--r--storage/connect/filamtxt.cpp2
-rw-r--r--storage/connect/filamvct.cpp1
-rw-r--r--storage/connect/filamzip.cpp1
-rw-r--r--storage/connect/ha_connect.cc27
-rw-r--r--storage/connect/ha_connect.h4
-rw-r--r--storage/connect/mycat.cc4
-rw-r--r--storage/connect/mycat.h4
-rw-r--r--storage/connect/myconn.cpp13
-rw-r--r--storage/connect/myconn.h5
-rw-r--r--storage/connect/plgdbsem.h2
-rw-r--r--storage/connect/tabmysql.cpp6
-rw-r--r--storage/connect/tabmysql.h4
-rw-r--r--storage/connect/tabxml.cpp2
17 files changed, 44 insertions, 37 deletions
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt
index e9a6770ba42..6f958495e57 100644
--- a/storage/connect/CMakeLists.txt
+++ b/storage/connect/CMakeLists.txt
@@ -39,7 +39,7 @@ add_definitions( -DHUGE_SUPPORT -DZIP_SUPPORT )
#
IF(UNIX)
if(WITH_WARNINGS)
- add_definitions(-Wall -Wfatal-errors -Wextra)
+ add_definitions(-Wall -Wfatal-errors -Wextra -Wmissing-declarations)
message(STATUS "CONNECT: GCC: All warnings enabled")
else()
add_definitions(--no-warnings)
diff --git a/storage/connect/filamap.cpp b/storage/connect/filamap.cpp
index e4bd2b59ec2..d1544848e5f 100644
--- a/storage/connect/filamap.cpp
+++ b/storage/connect/filamap.cpp
@@ -46,8 +46,6 @@
#include "filamap.h"
#include "tabdos.h"
-bool PushWarning(PGLOBAL, PTDBASE);
-
/* --------------------------- Class MAPFAM -------------------------- */
/***********************************************************************/
diff --git a/storage/connect/filamdbf.cpp b/storage/connect/filamdbf.cpp
index 268de657ed9..37125995069 100644
--- a/storage/connect/filamdbf.cpp
+++ b/storage/connect/filamdbf.cpp
@@ -70,7 +70,6 @@
/****************************************************************************/
PQRYRES PlgAllocResult(PGLOBAL, int, int, int, int *, int *,
unsigned int *, bool blank = true, bool nonull = false);
-bool PushWarning(PGLOBAL, PTDBASE);
extern "C" int trace; // The general trace value
diff --git a/storage/connect/filamfix.cpp b/storage/connect/filamfix.cpp
index e86da680969..11ba94e87a0 100644
--- a/storage/connect/filamfix.cpp
+++ b/storage/connect/filamfix.cpp
@@ -52,7 +52,6 @@
#endif
extern int num_read, num_there, num_eq[2]; // Statistics
-bool PushWarning(PGLOBAL g, PTDBASE tdbp);
/* --------------------------- Class FIXFAM -------------------------- */
diff --git a/storage/connect/filamtxt.cpp b/storage/connect/filamtxt.cpp
index 5e4c8575814..f5f8af959b2 100644
--- a/storage/connect/filamtxt.cpp
+++ b/storage/connect/filamtxt.cpp
@@ -58,8 +58,6 @@
extern int num_read, num_there, num_eq[2]; // Statistics
extern "C" int trace;
-bool PushWarning(PGLOBAL g, PTDBASE tdbp);
-
/* --------------------------- Class TXTFAM -------------------------- */
/***********************************************************************/
diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp
index 31f2496b390..9d4a20db10c 100644
--- a/storage/connect/filamvct.cpp
+++ b/storage/connect/filamvct.cpp
@@ -92,7 +92,6 @@ typedef struct _vecheader {
/***********************************************************************/
PVBLK AllocValBlock(PGLOBAL, void *, int, int, int, int,
bool check = true, bool blank = true);
-bool PushWarning(PGLOBAL, PTDBASE);
/* -------------------------- Class VCTFAM --------------------------- */
diff --git a/storage/connect/filamzip.cpp b/storage/connect/filamzip.cpp
index b3f3b2d5cff..19e8b200ed1 100644
--- a/storage/connect/filamzip.cpp
+++ b/storage/connect/filamzip.cpp
@@ -62,7 +62,6 @@
/* DB static variables. */
/***********************************************************************/
extern int num_read, num_there, num_eq[]; // Statistics
-bool PushWarning(PGLOBAL g, PTDBASE tdbp);
/* ------------------------------------------------------------------- */
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index ade617e3448..27f86385f46 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -160,14 +160,13 @@ PQRYRES CSVColumns(PGLOBAL g, char *fn, char sep, char q, int hdr, int mxr);
PQRYRES MyODBCCols(PGLOBAL g, char *tab, char *dsn);
#endif // ODBC_SUPPORT
#if defined(MYSQL_SUPPORT)
-PQRYRES MyColumns(PGLOBAL g, char *host, char *db, char *user, char *pwd,
- char *table, char *colpat, int port, bool key);
+#include "tabmysql.h"
#endif // MYSQL_SUPPORT
+
enum enum_field_types PLGtoMYSQL(int type, bool gdf);
#if defined(WIN32)
PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *classname, PWMIUT wp= NULL);
#endif // WIN32
-char GetTypeID(char *type);
bool check_string_char_length(LEX_STRING *str, const char *err_msg,
uint max_char_length, CHARSET_INFO *cs,
bool no_error);
@@ -630,7 +629,9 @@ PGLOBAL ha_connect::GetPlug(THD *thd)
/****************************************************************************/
/* Return the value of an option specified in the option list. */
/****************************************************************************/
-char *ha_connect::GetListOption(char *opname, const char *oplist, char *def)
+char *ha_connect::GetListOption(const char *opname,
+ const char *oplist,
+ const char *def)
{
char key[16], val[256];
char *pk, *pv, *pn;
@@ -1382,7 +1383,7 @@ int ha_connect::MakeRecord(char *buf)
if (xtrace > 1)
#if defined(MARIADB)
- printf("Maps: read=%p write=%p vcol=%p defr=%p defw=%p\n",
+ printf("Maps: read=%08X write=%08X vcol=%08X defr=%08X defw=%08X\n",
*table->read_set->bitmap, *table->write_set->bitmap,
*table->vcol_set->bitmap,
*table->def_read_set.bitmap, *table->def_write_set.bitmap);
@@ -1577,9 +1578,9 @@ int ha_connect::CheckRecord(PGLOBAL g, const uchar *oldbuf, uchar *newbuf)
/***********************************************************************/
/* Return the string representing an operator. */
/***********************************************************************/
-char *ha_connect::GetValStr(OPVAL vop, bool neg)
+const char *ha_connect::GetValStr(OPVAL vop, bool neg)
{
- char *val;
+ const char *val;
switch (vop) {
case OP_EQ:
@@ -3171,7 +3172,6 @@ bool ha_connect::add_fields(THD *thd, void *alt_info,
engine_option_value *create_options)
{
register Create_field *new_field;
- LEX *lex= thd->lex;
Alter_info *alter_info= (Alter_info*)alt_info;
Virtual_column_info *vcol_info= (Virtual_column_info *)vcolinfo;
@@ -3271,14 +3271,16 @@ bool ha_connect::add_fields(THD *thd, void *alt_info,
*/
bool ha_connect::pre_create(THD *thd, void *crt_info, void *alt_info)
{
- char ttp= '?', spc= ',', qch= 0, *typn= "DOS";
- char *fn, *dsn, *tab, *db, *host, *user, *pwd, *prt, *sep, *inf;
+ char ttp= '?', spc= ',', qch= 0;
+ const char *typn= "DOS";
+ const char *user;
+ char *host, *db, *pwd, *tab, *dsn;
+ char *fn, *prt, *sep, *inf;
#if defined(WIN32)
char *nsp= NULL, *cls= NULL;
#endif // WIN32
int port= MYSQL_PORT, hdr= 0, mxr= 0;
bool b= false, ok= false, info= false;
- LEX *lex= thd->lex;
LEX_STRING *comment, *name;
HA_CREATE_INFO *create_info= (HA_CREATE_INFO *)crt_info;
engine_option_value *pov;
@@ -3286,7 +3288,8 @@ bool ha_connect::pre_create(THD *thd, void *crt_info, void *alt_info)
PCOLRES crp;
PGLOBAL g= GetPlug(thd);
- fn= dsn= tab= db= host= user= pwd= prt= sep= inf= NULL;
+ fn= dsn= tab= db= host= pwd= prt= sep= inf= NULL;
+ user= NULL;
if (g) {
// Set default values
diff --git a/storage/connect/ha_connect.h b/storage/connect/ha_connect.h
index c33807f232b..fc8d4dafdd9 100644
--- a/storage/connect/ha_connect.h
+++ b/storage/connect/ha_connect.h
@@ -241,7 +241,7 @@ public:
*/
virtual const COND *cond_push(const COND *cond);
PFIL CheckCond(PGLOBAL g, PFIL filp, AMT tty, Item *cond);
-char *GetValStr(OPVAL vop, bool neg);
+const char *GetValStr(OPVAL vop, bool neg);
/**
Number of rows in table. It will only be called if
@@ -346,7 +346,7 @@ char *GetValStr(OPVAL vop, bool neg);
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
protected:
- char *GetListOption(char *opname, const char *oplist, char *def= NULL);
+ char *GetListOption(const char *opname, const char *oplist, const char *def= NULL);
char *encode(PGLOBAL g, char *cnm);
bool add_fields(THD *thd, void *alter_info,
LEX_STRING *field_name,
diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc
index 706f41780fe..8d7a5cdb682 100644
--- a/storage/connect/mycat.cc
+++ b/storage/connect/mycat.cc
@@ -182,7 +182,7 @@ PQRYRES PlgAllocResult(PGLOBAL g, int ncol, int maxres, int ids,
/* Get a unique char identifier for types. The letter used are: */
/* ABCDEF..I.KLM.O..R.T.VWXY.. */
/***********************************************************************/
-char GetTypeID(char *type)
+char GetTypeID(const char *type)
{
return (!type) ? 'D' // DOS (default)
: (!stricmp(type, "FMT")) ? 'T' // CSV
@@ -569,7 +569,7 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am)
/* Get a unique char identifier for types. The letter used are: */
/* ABCDEF..IJKLM.OPQRSTUVWXYZ and Allocate table definition class */
/*********************************************************************/
- tc= GetTypeID((char*)am);
+ tc= GetTypeID(am);
switch (tc) {
case 'F':
diff --git a/storage/connect/mycat.h b/storage/connect/mycat.h
index 63c304dd8d9..3019fa96b98 100644
--- a/storage/connect/mycat.h
+++ b/storage/connect/mycat.h
@@ -24,6 +24,8 @@
#include "block.h"
#include "catalog.h"
+char GetTypeID(const char *type);
+
/***********************************************************************/
/* MYCAT: class for managing the CONNECT plugin DB items. */
/***********************************************************************/
@@ -61,4 +63,4 @@ class MYCAT : public CATALOG {
ha_connect *Hc; // The Connect handler
}; // end of class MYCAT
-#endif __MYCAT__H
+#endif /* __MYCAT__H */
diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp
index 8120e87de88..1d0071b1851 100644
--- a/storage/connect/myconn.cpp
+++ b/storage/connect/myconn.cpp
@@ -94,7 +94,9 @@ int MYSQLC::GetResultSize(PGLOBAL g, PSZ sql)
/***********************************************************************/
/* Open a MySQL (remote) connection. */
/***********************************************************************/
-int MYSQLC::Open(PGLOBAL g, PSZ host, PSZ db, PSZ user, PSZ pwd, int pt)
+int MYSQLC::Open(PGLOBAL g, const char *host, const char *db,
+ const char *user, const char *pwd,
+ int pt)
{
m_DB = mysql_init(NULL);
@@ -182,7 +184,7 @@ int MYSQLC::KillQuery(ulong id)
{
char kill[20];
- sprintf(kill, "KILL QUERY %u", id);
+ sprintf(kill, "KILL QUERY %u", (unsigned int) id);
return (m_DB) ? mysql_query(m_DB, kill) : 1;
} // end of KillQuery
@@ -477,7 +479,7 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)
} // endif m_Row
for (crp = qrp->Colresp; crp; crp = crp->Next) {
- if (row = m_Row + (crp->Ncol - 1))
+ if ((row = m_Row + (crp->Ncol - 1))) {
if (*row)
crp->Kdata->SetValue((PSZ)*row, n);
else {
@@ -486,10 +488,11 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)
crp->Kdata->Reset(n);
} // endelse *row
+ }
- } // endfor crp
+ } // endfor crp
- } // endfor n
+ } // endfor n
qrp->Nblin = n;
return qrp;
diff --git a/storage/connect/myconn.h b/storage/connect/myconn.h
index 32bcfb802a1..cc07da31c38 100644
--- a/storage/connect/myconn.h
+++ b/storage/connect/myconn.h
@@ -59,8 +59,9 @@ class DllItem MYSQLC {
// int GetCurPos(void) {return (m_Res) ? N : 0;}
// int GetProgCur(void) {return N;}
int GetResultSize(PGLOBAL g, PSZ sql);
- int Open(PGLOBAL g, PSZ host, PSZ db, PSZ user = "root",
- PSZ pwd = "*", int pt = 0);
+ int Open(PGLOBAL g, const char *host, const char *db,
+ const char *user= "root", const char *pwd= "*",
+ int pt= 0);
ulong GetThreadID(void);
ulong ServerVersion(void);
const char *ServerInfo(void);
diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h
index 6da5917dcaa..0a412972ce1 100644
--- a/storage/connect/plgdbsem.h
+++ b/storage/connect/plgdbsem.h
@@ -521,3 +521,5 @@ DllExport void NewPointer(PTABS, void *, void *);
FILE *global_fopen(GLOBAL *g, int msgid, const char *path, const char *mode);
int global_open(GLOBAL *g, int msgid, const char *filename, int flags);
int global_open(GLOBAL *g, int msgid, const char *filename, int flags, int mode);
+
+bool PushWarning(PGLOBAL, PTDBASE);
diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp
index d2394b09b7b..4ed727d3bf0 100644
--- a/storage/connect/tabmysql.cpp
+++ b/storage/connect/tabmysql.cpp
@@ -78,8 +78,10 @@ PQRYRES PlgAllocResult(PGLOBAL g, int ncol, int maxres, int ids,
/* of a MySQL table that will be retrieved by GetData commands. */
/* key = TRUE when called from Create Table to get key informations. */
/************************************************************************/
-PQRYRES MyColumns(PGLOBAL g, char *host, char *db, char *user, char *pwd,
- char *table, char *colpat, int port, bool key)
+PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db,
+ const char *user, const char *pwd,
+ const char *table, const char *colpat,
+ int port, bool key)
{
static int dbtype[] = {DB_CHAR, DB_SHORT, DB_CHAR, DB_INT,
DB_INT, DB_SHORT, DB_CHAR, DB_CHAR};
diff --git a/storage/connect/tabmysql.h b/storage/connect/tabmysql.h
index bdd4a80377a..68fb9d89f24 100644
--- a/storage/connect/tabmysql.h
+++ b/storage/connect/tabmysql.h
@@ -137,3 +137,7 @@ class MYSQLCOL : public COLBLK {
int Rank; // Rank (position) number in the query
}; // end of class MYSQLCOL
+
+PQRYRES MyColumns(PGLOBAL g, const char *host, const char *db,
+ const char *user, const char *pwd,
+ const char *table, const char *colpat, int port, bool key);
diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp
index 68d1846d388..c4f20414afe 100644
--- a/storage/connect/tabxml.cpp
+++ b/storage/connect/tabxml.cpp
@@ -59,8 +59,6 @@ extern int trace;
#define XMLSUP "libxml2"
#endif // !WIN32
-bool PushWarning(PGLOBAL g, PTDBASE tdbp);
-
/* -------------- Implementation of the XMLDEF class ---------------- */
/***********************************************************************/