Skip to content

Commit

Permalink
Get rid of more GCC warnings about unused parameters
Browse files Browse the repository at this point in the history
  modified:   storage/connect/array.cpp
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/user_connect.cc
  modified:   storage/connect/user_connect.h
  • Loading branch information
Buggynours committed May 10, 2015
1 parent 7c02f74 commit 445fc77
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 35 deletions.
4 changes: 2 additions & 2 deletions storage/connect/array.cpp
Expand Up @@ -186,7 +186,7 @@ ARRAY::ARRAY(PGLOBAL g, int type, int size, int length, int prec)
// The error message was built by PlgDBalloc
Type = TYPE_ERROR;
else if (type != TYPE_PCHAR)
Value = AllocateValue(g, type, Len, prec, NULL);
Value = AllocateValue(g, type, Len, prec);

Constant = TRUE;
} // end of ARRAY constructor
Expand Down Expand Up @@ -610,7 +610,7 @@ int ARRAY::Convert(PGLOBAL g, int k, PVAL vp)
// The error message was built by PlgDBalloc
return TYPE_ERROR;
else
Value = AllocateValue(g, Type, Len, prec, NULL);
Value = AllocateValue(g, Type, Len, prec);

/*********************************************************************/
/* Converting STRING to DATE can be done according to date format. */
Expand Down
39 changes: 19 additions & 20 deletions storage/connect/ha_connect.cc
Expand Up @@ -349,7 +349,7 @@ int GetConvSize(void) {return THDVAR(current_thd, conv_size);}
TYPCONV GetTypeConv(void) {return (TYPCONV)THDVAR(current_thd, type_conv);}
uint GetJsonGrpSize(void) {return THDVAR(current_thd, json_grp_size);}
uint GetWorkSize(void) {return THDVAR(current_thd, work_size);}
void SetWorkSize(uint n)
void SetWorkSize(uint)
{
// Changing the session variable value seems to be impossible here
// and should be done in a check function
Expand Down Expand Up @@ -664,7 +664,7 @@ static int connect_init_func(void *p)
@brief
Plugin clean up
*/
static int connect_done_func(void *p)
static int connect_done_func(void *)
{
int error= 0;
PCONNECT pc, pn;
Expand Down Expand Up @@ -822,8 +822,6 @@ ha_connect::~ha_connect(void)
/****************************************************************************/
static PCONNECT GetUser(THD *thd, PCONNECT xp)
{
const char *dbn= NULL;

if (!thd)
return NULL;

Expand All @@ -835,7 +833,7 @@ static PCONNECT GetUser(THD *thd, PCONNECT xp)
break;

if (!xp) {
xp= new user_connect(thd, dbn);
xp= new user_connect(thd);

if (xp->user_init()) {
delete xp;
Expand Down Expand Up @@ -908,7 +906,8 @@ const char *ha_connect::index_type(uint inx)
If all_parts is set, MySQL wants to know the flags for the combined
index, up to and including 'part'.
*/
ulong ha_connect::index_flags(uint inx, uint part, bool all_parts) const
//ong ha_connect::index_flags(uint inx, uint part, bool all_parts) const
ulong ha_connect::index_flags(uint, uint, bool) const
{
ulong flags= HA_READ_NEXT | HA_READ_RANGE |
HA_KEYREAD_ONLY | HA_KEY_SCAN_NOT_ROR;
Expand Down Expand Up @@ -2008,7 +2007,7 @@ int ha_connect::MakeRecord(char *buf)
/***********************************************************************/
/* Set row values from a MySQL pseudo record. Specific to MySQL. */
/***********************************************************************/
int ha_connect::ScanRecord(PGLOBAL g, uchar *buf)
int ha_connect::ScanRecord(PGLOBAL g, uchar *)
{
char attr_buffer[1024];
char data_buffer[1024];
Expand Down Expand Up @@ -2150,7 +2149,7 @@ int ha_connect::ScanRecord(PGLOBAL g, uchar *buf)
/* Check change in index column. Specific to MySQL. */
/* Should be elaborated to check for real changes. */
/***********************************************************************/
int ha_connect::CheckRecord(PGLOBAL g, const uchar *oldbuf, uchar *newbuf)
int ha_connect::CheckRecord(PGLOBAL g, const uchar *, uchar *newbuf)
{
return ScanRecord(g, newbuf);
} // end of dummy CheckRecord
Expand Down Expand Up @@ -2923,7 +2922,7 @@ bool ha_connect::get_error_message(int error, String* buf)
&dummy_errors);

if (trace)
htrc("GEM(%u): %s\n", len, g->Message);
htrc("GEM(%d): len=%u %s\n", error, len, g->Message);

msg[len]= '\0';
buf->copy(msg, (uint)strlen(msg), system_charset_info);
Expand Down Expand Up @@ -3019,7 +3018,7 @@ int ha_connect::open(const char *name, int mode, uint test_if_locked)
@brief
Make the indexes for this table
*/
int ha_connect::optimize(THD* thd, HA_CHECK_OPT* check_opt)
int ha_connect::optimize(THD* thd, HA_CHECK_OPT*)
{
int rc= 0;
PGLOBAL& g= xp->g;
Expand Down Expand Up @@ -3223,7 +3222,7 @@ int ha_connect::update_row(const uchar *old_data, uchar *new_data)
@see
sql_acl.cc, sql_udf.cc, sql_delete.cc, sql_insert.cc and sql_select.cc
*/
int ha_connect::delete_row(const uchar *buf)
int ha_connect::delete_row(const uchar *)
{
int rc= 0;
DBUG_ENTER("ha_connect::delete_row");
Expand Down Expand Up @@ -3503,7 +3502,8 @@ int ha_connect::index_last(uchar *buf)
/****************************************************************************/
/* This is called to get more rows having the same index value. */
/****************************************************************************/
int ha_connect::index_next_same(uchar *buf, const uchar *key, uint keylen)
//t ha_connect::index_next_same(uchar *buf, const uchar *key, uint keylen)
int ha_connect::index_next_same(uchar *buf, const uchar *, uint)
{
int rc;
DBUG_ENTER("ha_connect::index_next_same");
Expand Down Expand Up @@ -3693,7 +3693,7 @@ int ha_connect::rnd_next(uchar *buf)
@see
filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc
*/
void ha_connect::position(const uchar *record)
void ha_connect::position(const uchar *)
{
DBUG_ENTER("ha_connect::position");
//if (((PTDBASE)tdbp)->GetDef()->Indexable())
Expand Down Expand Up @@ -3876,7 +3876,7 @@ int ha_connect::info(uint flag)
@see
ha_innodb.cc
*/
int ha_connect::extra(enum ha_extra_function operation)
int ha_connect::extra(enum ha_extra_function /*operation*/)
{
DBUG_ENTER("ha_connect::extra");
DBUG_RETURN(0);
Expand Down Expand Up @@ -4484,7 +4484,7 @@ int ha_connect::external_lock(THD *thd, int lock_type)
@see
get_lock_data() in lock.cc
*/
THR_LOCK_DATA **ha_connect::store_lock(THD *thd,
THR_LOCK_DATA **ha_connect::store_lock(THD *,
THR_LOCK_DATA **to,
enum thr_lock_type lock_type)
{
Expand Down Expand Up @@ -4955,7 +4955,7 @@ static int init_table_share(THD* thd,
@note
this function is no more called in case of CREATE .. SELECT
*/
static int connect_assisted_discovery(handlerton *hton, THD* thd,
static int connect_assisted_discovery(handlerton *, THD* thd,
TABLE_SHARE *table_s,
HA_CREATE_INFO *create_info)
{
Expand All @@ -4967,8 +4967,8 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
#if defined(WIN32)
char *nsp= NULL, *cls= NULL;
#endif // WIN32
int port= 0, hdr= 0, mxr __attribute__((unused))= 0, mxe= 0, rc= 0;
int cop __attribute__((unused))= 0, pty= 2, lrecl= 0, lvl= 0;
int port= 0, hdr= 0, mxr= 0, mxe= 0, rc= 0, lvl= 0;
int cop __attribute__((unused))= 0, pty= 2, lrecl= 0;
#if defined(ODBC_SUPPORT)
POPARM sop = NULL;
char *ucnc = NULL;
Expand Down Expand Up @@ -6464,8 +6464,7 @@ ha_connect::check_if_supported_inplace_alter(TABLE *altered_table,
@note: This function is no more called by check_if_supported_inplace_alter
*/

bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes)
bool ha_connect::check_if_incompatible_data(HA_CREATE_INFO *, uint)
{
DBUG_ENTER("ha_connect::check_if_incompatible_data");
// TO DO: really implement and check it.
Expand Down
8 changes: 4 additions & 4 deletions storage/connect/mycat.cc
@@ -1,4 +1,4 @@
/* Copyright (C) Olivier Bertrand 2004 - 2014
/* Copyright (C) Olivier Bertrand 2004 - 2015
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -18,7 +18,7 @@
/* ------------- */
/* Version 1.4 */
/* */
/* Author: Olivier Bertrand 2012 - 2014 */
/* Author: Olivier Bertrand 2012 - 2015 */
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
Expand Down Expand Up @@ -478,7 +478,7 @@ void MYCAT::SetPath(PGLOBAL g, LPCSTR *datapath, const char *path)
/* Look for a table descriptor matching the name and type. */
/***********************************************************************/
PRELDEF MYCAT::GetTableDesc(PGLOBAL g, LPCSTR name,
LPCSTR type, PRELDEF *prp)
LPCSTR type, PRELDEF *)
{
if (trace)
printf("GetTableDesc: name=%s am=%s\n", name, SVP(type));
Expand Down Expand Up @@ -589,7 +589,7 @@ PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode, LPCSTR type)
/***********************************************************************/
/* ClearDB: Terminates Database usage. */
/***********************************************************************/
void MYCAT::ClearDB(PGLOBAL g)
void MYCAT::ClearDB(PGLOBAL)
{
} // end of ClearDB

Expand Down
26 changes: 21 additions & 5 deletions storage/connect/tabxml.cpp
Expand Up @@ -118,7 +118,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
FLD_LENGTH, FLD_SCALE, FLD_NULL, FLD_FORMAT};
static unsigned int length[] = {0, 6, 8, 10, 10, 6, 6, 0};
char *op, colname[65], fmt[129], buf[512];
int i, j, lvl, rc, n = 0;
int i, j, lvl, n = 0;
int ncol = sizeof(buftyp) / sizeof(int);
bool ok = true;
PXCL xcol, xcp, fxcp = NULL, pxcp = NULL;
Expand Down Expand Up @@ -164,7 +164,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
txmp = new(g) TDBXML(tdp);

if (txmp->Initialize(g))
return NULL;
goto err;

xcol = new(g) XMCOL;
colname[64] = 0;
Expand Down Expand Up @@ -224,8 +224,16 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
if (vp->atp) {
strncpy(colname, vp->atp->GetName(g), sizeof(colname));
strncat(xcol->Name, colname, 64);
rc = vp->atp->GetText(g, buf, sizeof(buf));
strncat(fmt, "@", sizeof(fmt));

switch (vp->atp->GetText(g, buf, sizeof(buf))) {
case RC_INFO:
PushWarning(g, txmp);
case RC_OK:
strncat(fmt, "@", sizeof(fmt));
break;
default:
goto err;
} // enswitch rc

if (j)
strncat(fmt, colname, sizeof(fmt));
Expand Down Expand Up @@ -273,7 +281,15 @@ PQRYRES XMLColumns(PGLOBAL g, char *dp, char *tab, PTOS topt, bool info)
} else
ok = true;

rc = node->GetContent(g, buf, sizeof(buf));
switch (node->GetContent(g, buf, sizeof(buf))) {
case RC_INFO:
PushWarning(g, txmp);
case RC_OK:
break;
default:
goto err;
} // enswitch rc

} // endif atp;

xcol->Len = strlen(buf);
Expand Down
6 changes: 3 additions & 3 deletions storage/connect/user_connect.cc
@@ -1,4 +1,4 @@
/* Copyright (C) Olivier Bertrand 2004 - 2014
/* Copyright (C) Olivier Bertrand 2004 - 2015
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -28,7 +28,7 @@
*/

/****************************************************************************/
/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2014 */
/* Author: Olivier Bertrand -- bertrandop@gmail.com -- 2004-2015 */
/****************************************************************************/
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
Expand Down Expand Up @@ -63,7 +63,7 @@ void SetWorkSize(uint);
/****************************************************************************/
/* Constructor. */
/****************************************************************************/
user_connect::user_connect(THD *thd, const char *dbn)
user_connect::user_connect(THD *thd)
{
thdp= thd;
next= NULL;
Expand Down
2 changes: 1 addition & 1 deletion storage/connect/user_connect.h
Expand Up @@ -45,7 +45,7 @@ class user_connect
friend int connect_done_func(void *);
public:
// Constructor
user_connect(THD *thd, const char *dbn);
user_connect(THD *thd);

// Destructor
virtual ~user_connect();
Expand Down

0 comments on commit 445fc77

Please sign in to comment.