Fixed compiler warnings from gcc 7.4.1

- Fixed possible error in rocksdb/rdb_datadic.cc
This commit is contained in:
Monty 2020-01-29 16:41:04 +02:00
parent cd2c0e013c
commit 4d61f1247a
47 changed files with 282 additions and 197 deletions

View File

@ -16,6 +16,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include <mysql/plugin_auth_common.h> #include <mysql/plugin_auth_common.h>
struct param { struct param {
@ -62,7 +63,7 @@ typedef struct st_mysql_server_auth_info
#include "auth_pam_base.c" #include "auth_pam_base.c"
int main(int argc, char **argv) int main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
{ {
struct param param; struct param param;
MYSQL_SERVER_AUTH_INFO info; MYSQL_SERVER_AUTH_INFO info;
@ -70,7 +71,8 @@ int main(int argc, char **argv)
int res; int res;
char a_buf[MYSQL_USERNAME_LENGTH + 1 + 1024]; char a_buf[MYSQL_USERNAME_LENGTH + 1 + 1024];
(void) setreuid(0, 0); if ((res= setreuid(0, 0)))
fprintf(stderr, "Got error %d from setreuid()\n", (int) errno);
if (read(0, &field, 1) < 1) if (read(0, &field, 1) < 1)
return -1; return -1;

View File

@ -15,7 +15,7 @@
#define N 3 #define N 3
int pam_sm_authenticate(pam_handle_t *pamh, int flags, int pam_sm_authenticate(pam_handle_t *pamh, int flags __attribute__((unused)),
int argc, const char *argv[]) int argc, const char *argv[])
{ {
struct pam_conv *conv; struct pam_conv *conv;
@ -72,8 +72,10 @@ ret:
return retval; return retval;
} }
int pam_sm_setcred(pam_handle_t *pamh, int flags, int pam_sm_setcred(pam_handle_t *pamh __attribute__((unused)),
int argc, const char *argv[]) int flags __attribute__((unused)),
int argc __attribute__((unused)),
const char *argv[] __attribute__((unused)))
{ {
return PAM_SUCCESS; return PAM_SUCCESS;

View File

@ -6115,7 +6115,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
/* As all updated tables are temporary, nothing will be logged */ /* As all updated tables are temporary, nothing will be logged */
set_current_stmt_binlog_format_row(); set_current_stmt_binlog_format_row();
} }
else if (IF_WSREP((!WSREP(this) || else if (IF_WSREP((!WSREP_NNULL(this) ||
wsrep_cs().mode() == wsrep_cs().mode() ==
wsrep::client_state::m_local),1)) wsrep::client_state::m_local),1))
{ {

View File

@ -80,6 +80,7 @@ COLBLK::COLBLK(PCOL col1, PTDB tdbp)
htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this); htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this);
if (tdbp) if (tdbp)
{
// Attach the new column to the table block // Attach the new column to the table block
if (!tdbp->GetColumns()) if (!tdbp->GetColumns())
tdbp->SetColumns(this); tdbp->SetColumns(this);
@ -88,7 +89,7 @@ COLBLK::COLBLK(PCOL col1, PTDB tdbp)
colp->Next = this; colp->Next = this;
} // endelse } // endelse
}
} // end of COLBLK copy constructor } // end of COLBLK copy constructor
/***********************************************************************/ /***********************************************************************/

View File

@ -646,6 +646,7 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted)
// return 0; // return 0;
if (tdbp->GetKindex()) if (tdbp->GetKindex())
{
if (((XXBASE*)tdbp->GetKindex())->GetID() == id) { if (((XXBASE*)tdbp->GetKindex())->GetID() == id) {
tdbp->GetKindex()->Reset(); // Same index tdbp->GetKindex()->Reset(); // Same index
return (tdbp->GetKindex()->IsMul()) ? 2 : 1; return (tdbp->GetKindex()->IsMul()) ? 2 : 1;
@ -653,6 +654,7 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted)
tdbp->GetKindex()->Close(); tdbp->GetKindex()->Close();
tdbp->SetKindex(NULL); tdbp->SetKindex(NULL);
} // endif colp } // endif colp
}
for (xdp= dfp->GetIndx(); xdp; xdp= xdp->GetNext()) for (xdp= dfp->GetIndx(); xdp; xdp= xdp->GetNext())
if (xdp->GetID() == id) if (xdp->GetID() == id)

View File

@ -349,6 +349,7 @@ int MAPFAM::ReadBuffer(PGLOBAL g)
if ((rc = GetNext(g)) != RC_OK) if ((rc = GetNext(g)) != RC_OK)
return rc; return rc;
/* falls through */
case RC_NF: case RC_NF:
// Skip this record // Skip this record
if ((rc = SkipRecord(g, false)) != RC_OK) if ((rc = SkipRecord(g, false)) != RC_OK)

View File

@ -841,6 +841,7 @@ int DBFFAM::DeleteRecords(PGLOBAL g, int irc)
if (irc == RC_OK) { if (irc == RC_OK) {
// T_Stream is the temporary stream or the table file stream itself // T_Stream is the temporary stream or the table file stream itself
if (!T_Stream) if (!T_Stream)
{
if (UseTemp) { if (UseTemp) {
if (OpenTempFile(g)) if (OpenTempFile(g))
return RC_FX; return RC_FX;
@ -850,7 +851,7 @@ int DBFFAM::DeleteRecords(PGLOBAL g, int irc)
} else } else
T_Stream = Stream; T_Stream = Stream;
}
*Tdbp->GetLine() = '*'; *Tdbp->GetLine() = '*';
Modif++; // Modified line in Delete mode Modif++; // Modified line in Delete mode
} // endif irc } // endif irc

View File

@ -135,7 +135,7 @@ bool FIXFAM::AllocateBuffer(PGLOBAL g)
// The buffer must be prepared depending on column types // The buffer must be prepared depending on column types
int n = 0; int n = 0;
bool b = false; bool b = false;
PDOSDEF defp = (PDOSDEF)Tdbp->GetDef(); PDOSDEF defp __attribute__((unused))= (PDOSDEF)Tdbp->GetDef();
// PCOLDEF cdp; // PCOLDEF cdp;
PBINCOL colp; PBINCOL colp;

View File

@ -647,7 +647,7 @@ int ZBKFAM::WriteBuffer(PGLOBAL g)
int ZBKFAM::DeleteRecords(PGLOBAL g, int irc) int ZBKFAM::DeleteRecords(PGLOBAL g, int irc)
{ {
if (irc == RC_EF) { if (irc == RC_EF) {
LPCSTR name = Tdbp->GetName(); LPCSTR name __attribute__((unused)) = Tdbp->GetName();
PDOSDEF defp = (PDOSDEF)Tdbp->GetDef(); PDOSDEF defp = (PDOSDEF)Tdbp->GetDef();
defp->SetBlock(0); defp->SetBlock(0);
@ -673,7 +673,7 @@ void ZBKFAM::CloseTableFile(PGLOBAL g, bool)
int rc = RC_OK; int rc = RC_OK;
if (Tdbp->GetMode() == MODE_INSERT) { if (Tdbp->GetMode() == MODE_INSERT) {
LPCSTR name = Tdbp->GetName(); LPCSTR name __attribute__((unused))= Tdbp->GetName();
PDOSDEF defp = (PDOSDEF)Tdbp->GetDef(); PDOSDEF defp = (PDOSDEF)Tdbp->GetDef();
if (CurNum && !Closing) { if (CurNum && !Closing) {
@ -1021,6 +1021,7 @@ bool ZLBFAM::AllocateBuffer(PGLOBAL g)
#else #else
sprintf(g->Message, MSG(READ_ERROR), To_File, _strerror(NULL)); sprintf(g->Message, MSG(READ_ERROR), To_File, _strerror(NULL));
#endif #endif
/* falls through */
case RC_NF: case RC_NF:
return TRUE; return TRUE;
} // endswitch } // endswitch
@ -1355,7 +1356,7 @@ void ZLBFAM::CloseTableFile(PGLOBAL g, bool)
int rc = RC_OK; int rc = RC_OK;
if (Tdbp->GetMode() == MODE_INSERT) { if (Tdbp->GetMode() == MODE_INSERT) {
LPCSTR name = Tdbp->GetName(); LPCSTR name __attribute__((unused))= Tdbp->GetName();
PDOSDEF defp = (PDOSDEF)Tdbp->GetDef(); PDOSDEF defp = (PDOSDEF)Tdbp->GetDef();
// Closing is True if last Write was in error // Closing is True if last Write was in error

View File

@ -1547,13 +1547,14 @@ int BLKFAM::WriteBuffer(PGLOBAL g)
// T_Stream is the temporary stream or the table file stream itself // T_Stream is the temporary stream or the table file stream itself
if (!T_Stream) if (!T_Stream)
{
if (UseTemp /*&& Tdbp->GetMode() == MODE_UPDATE*/) { if (UseTemp /*&& Tdbp->GetMode() == MODE_UPDATE*/) {
if (OpenTempFile(g)) if (OpenTempFile(g))
return RC_FX; return RC_FX;
} else } else
T_Stream = Stream; T_Stream = Stream;
}
if (UseTemp) { if (UseTemp) {
/*****************************************************************/ /*****************************************************************/
/* We are using a temporary file. Before writing the updated */ /* We are using a temporary file. Before writing the updated */

View File

@ -302,6 +302,7 @@ int VCTFAM::Cardinality(PGLOBAL g)
return 1; return 1;
if (Block < 0) if (Block < 0)
{
if (Split) { if (Split) {
// Separate column files and no pre setting of Block and Last // Separate column files and no pre setting of Block and Last
// This allows to see a table modified externally, but Block // This allows to see a table modified externally, but Block
@ -347,7 +348,7 @@ int VCTFAM::Cardinality(PGLOBAL g)
return -1; // Error return -1; // Error
} // endif split } // endif split
}
return (Block) ? ((Block - 1) * Nrec + Last) : 0; return (Block) ? ((Block - 1) * Nrec + Last) : 0;
} // end of Cardinality } // end of Cardinality
@ -1163,7 +1164,7 @@ bool VCTFAM::ResetTableSize(PGLOBAL g, int block, int last)
if (!Header) { if (!Header) {
// Update catalog values for Block and Last // Update catalog values for Block and Last
PVCTDEF defp = (PVCTDEF)Tdbp->GetDef(); PVCTDEF defp = (PVCTDEF)Tdbp->GetDef();
LPCSTR name = Tdbp->GetName(); LPCSTR name __attribute__((unused))= Tdbp->GetName();
defp->SetBlock(Block); defp->SetBlock(Block);
defp->SetLast(Last); defp->SetLast(Last);

View File

@ -91,7 +91,6 @@ static bool ZipFile(PGLOBAL g, ZIPUTIL *zutp, PCSZ fn, PCSZ entry, char *buf)
static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf) static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf)
{ {
char filename[_MAX_PATH]; char filename[_MAX_PATH];
int rc;
/*********************************************************************/ /*********************************************************************/
/* pat is a multiple file name with wildcard characters */ /* pat is a multiple file name with wildcard characters */
@ -102,6 +101,7 @@ static bool ZipFiles(PGLOBAL g, ZIPUTIL *zutp, PCSZ pat, char *buf)
char drive[_MAX_DRIVE], direc[_MAX_DIR]; char drive[_MAX_DRIVE], direc[_MAX_DIR];
WIN32_FIND_DATA FileData; WIN32_FIND_DATA FileData;
HANDLE hSearch; HANDLE hSearch;
int rc;
_splitpath(filename, drive, direc, NULL, NULL); _splitpath(filename, drive, direc, NULL, NULL);

View File

@ -1220,15 +1220,19 @@ bool FILTER::Eval(PGLOBAL g)
int i; // n = 0; int i; // n = 0;
//PSUBQ subp = NULL; //PSUBQ subp = NULL;
PARRAY ap = NULL; PARRAY ap = NULL;
PDBUSER dup = PlgGetUser(g); PDBUSER dup __attribute__((unused)) = PlgGetUser(g);
if (Opc <= OP_XX) if (Opc <= OP_XX)
{
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
{
// Evaluate the object and eventually convert it. // Evaluate the object and eventually convert it.
if (Arg(i)->Eval(g)) if (Arg(i)->Eval(g))
return TRUE; return TRUE;
else if (Test[i].Conv) else if (Test[i].Conv)
Val(i)->SetValue_pval(Arg(i)->GetValue()); Val(i)->SetValue_pval(Arg(i)->GetValue());
}
}
if (trace(1)) if (trace(1))
htrc(" Filter: op=%d type=%d %d B_T=%d %d val=%p %p\n", htrc(" Filter: op=%d type=%d %d B_T=%d %d val=%p %p\n",

View File

@ -240,12 +240,11 @@ YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
#ifdef NOT_USED
static int yy_start_stack_ptr = 0; static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0; static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0; static int *yy_start_stack = 0;
static void yy_push_state YY_PROTO(( int new_state )); #endif
static void yy_pop_state YY_PROTO(( void ));
static int yy_top_state YY_PROTO(( void ));
static void *yy_flex_alloc YY_PROTO(( unsigned int )); static void *yy_flex_alloc YY_PROTO(( unsigned int ));
static void *yy_flex_realloc YY_PROTO(( void *, unsigned int )); static void *yy_flex_realloc YY_PROTO(( void *, unsigned int ));
@ -267,11 +266,13 @@ extern char *yytext;
static void yy_flex_strncpy YY_PROTO(( char *, const char *, int )); static void yy_flex_strncpy YY_PROTO(( char *, const char *, int ));
#endif #endif
#ifdef NOT_USED
#ifdef __cplusplus #ifdef __cplusplus
static int yyinput YY_PROTO(( void )); static int yyinput YY_PROTO(( void ));
#else #else
static int input YY_PROTO(( void )); static int input YY_PROTO(( void ));
#endif #endif
#endif
static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
@ -1060,6 +1061,8 @@ register char *yy_bp;
} }
#ifdef NOT_USED
#ifdef __cplusplus #ifdef __cplusplus
static int yyinput() static int yyinput()
#else #else
@ -1126,7 +1129,7 @@ static int input()
return c; return c;
} }
#endif /* NOT_USED */
#ifdef YY_USE_PROTOS #ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file ) void yyrestart( FILE *input_file )
@ -1266,6 +1269,7 @@ FILE *file;
} }
#ifdef NOT_USED
#ifdef YY_USE_PROTOS #ifdef YY_USE_PROTOS
static void yy_push_state( int new_state ) static void yy_push_state( int new_state )
#else #else
@ -1297,7 +1301,6 @@ int new_state;
BEGIN(new_state); BEGIN(new_state);
} }
static void yy_pop_state() static void yy_pop_state()
{ {
if ( --yy_start_stack_ptr < 0 ) if ( --yy_start_stack_ptr < 0 )
@ -1311,6 +1314,7 @@ static int yy_top_state()
{ {
return yy_start_stack[yy_start_stack_ptr - 1]; return yy_start_stack[yy_start_stack_ptr - 1];
} }
#endif /* NOT_USED */
#ifdef YY_USE_PROTOS #ifdef YY_USE_PROTOS

View File

@ -790,7 +790,7 @@ static int connect_init_func(void *p)
@brief @brief
Plugin clean up Plugin clean up
*/ */
static int connect_done_func(void *) int connect_done_func(void *)
{ {
int error= 0; int error= 0;
PCONNECT pc, pn; PCONNECT pc, pn;

View File

@ -1340,6 +1340,7 @@ BOOL WritePrivateProfileSection(LPCSTR section,
* Note that when the buffer is big enough then the return value may be any * Note that when the buffer is big enough then the return value may be any
* value between 1 and len-1 (or len in Win95), including len-2. * value between 1 and len-1 (or len in Win95), including len-2.
*/ */
#ifdef NOT_USED
static DWORD static DWORD
GetPrivateProfileSectionNames(LPSTR buffer, DWORD size, LPCSTR filename) GetPrivateProfileSectionNames(LPSTR buffer, DWORD size, LPCSTR filename)
{ {
@ -1356,7 +1357,7 @@ GetPrivateProfileSectionNames(LPSTR buffer, DWORD size, LPCSTR filename)
LeaveCriticalSection(&PROFILE_CritSect); LeaveCriticalSection(&PROFILE_CritSect);
return ret; return ret;
} // end of GetPrivateProfileSectionNames } // end of GetPrivateProfileSectionNames
#endif
/************************************************************************ /************************************************************************
* Program to test the above * Program to test the above

View File

@ -154,7 +154,7 @@ PJSON ParseJson(PGLOBAL g, char *s, int len, int *ptyp, bool *comma)
b = false; b = false;
break; break;
} // endif b } // endif b
/* falls through */
default: default:
if (jsp) if (jsp)
goto tryit; goto tryit;

View File

@ -247,7 +247,7 @@ my_bool JSNX::ParseJpath(PGLOBAL g)
{ {
char *p, *p1 = NULL, *p2 = NULL, *pbuf = NULL; char *p, *p1 = NULL, *p2 = NULL, *pbuf = NULL;
int i; int i;
my_bool a, mul = false; my_bool a;
if (Parsed) if (Parsed)
return false; // Already done return false; // Already done
@ -379,6 +379,7 @@ void JSNX::SetJsonValue(PGLOBAL g, PVAL vp, PJVAL val, int n)
case TYPE_NULL: case TYPE_NULL:
vp->SetNull(true); vp->SetNull(true);
/* falls through */
default: default:
vp->Reset(); vp->Reset();
} // endswitch Type } // endswitch Type
@ -424,7 +425,6 @@ PVAL JSNX::GetColumnValue(PGLOBAL g, PJSON row, int i)
/*********************************************************************************/ /*********************************************************************************/
PJVAL JSNX::GetRowValue(PGLOBAL g, PJSON row, int i, my_bool b) PJVAL JSNX::GetRowValue(PGLOBAL g, PJSON row, int i, my_bool b)
{ {
my_bool expd = false;
PJAR arp; PJAR arp;
PJVAL val = NULL; PJVAL val = NULL;
@ -763,7 +763,7 @@ my_bool JSNX::WriteValue(PGLOBAL g, PJVAL jvalp)
PSZ JSNX::Locate(PGLOBAL g, PJSON jsp, PJVAL jvp, int k) PSZ JSNX::Locate(PGLOBAL g, PJSON jsp, PJVAL jvp, int k)
{ {
PSZ str = NULL; PSZ str = NULL;
my_bool b = false, err = true; my_bool err = true;
g->Message[0] = 0; g->Message[0] = 0;
@ -885,7 +885,7 @@ my_bool JSNX::LocateValue(PJVAL jvp)
PSZ JSNX::LocateAll(PGLOBAL g, PJSON jsp, PJVAL jvp, int mx) PSZ JSNX::LocateAll(PGLOBAL g, PJSON jsp, PJVAL jvp, int mx)
{ {
PSZ str = NULL; PSZ str = NULL;
my_bool b = false, err = true; my_bool err = true;
PJPN jnp; PJPN jnp;
if (!jsp) { if (!jsp) {
@ -1352,7 +1352,7 @@ static PBSON MakeBinResult(PGLOBAL g, UDF_ARGS *args, PJSON top, ulong len, int
bsnp->Pretty = pretty; bsnp->Pretty = pretty;
if (bsnp->Filename = (char*)args->args[0]) { if ((bsnp->Filename = (char*)args->args[0])) {
bsnp->Filename = MakePSZ(g, args, 0); bsnp->Filename = MakePSZ(g, args, 0);
strncpy(bsnp->Msg, bsnp->Filename, BMX); strncpy(bsnp->Msg, bsnp->Filename, BMX);
} else } else
@ -1773,7 +1773,7 @@ static char *GetJsonFile(PGLOBAL g, char *fn)
#endif #endif
if (h == -1) { if (h == -1) {
sprintf(g->Message, "Error %d opening %s", errno, fn); sprintf(g->Message, "Error %d opening %-.1024s", errno, fn);
return NULL; return NULL;
} // endif h } // endif h
@ -1785,7 +1785,7 @@ static char *GetJsonFile(PGLOBAL g, char *fn)
if ((str = (char*)PlgDBSubAlloc(g, NULL, len + 1))) { if ((str = (char*)PlgDBSubAlloc(g, NULL, len + 1))) {
if ((n = read(h, str, len)) < 0) { if ((n = read(h, str, len)) < 0) {
sprintf(g->Message, "Error %d reading %d bytes from %s", errno, len, fn); sprintf(g->Message, "Error %d reading %d bytes from %-.1024s", errno, len, fn);
return NULL; return NULL;
} // endif n } // endif n
@ -3480,7 +3480,7 @@ char *jsonget_string(UDF_INIT *initid, UDF_ARGS *args, char *result,
} catch (int n) { } catch (int n) {
if (trace(1)) if (trace(1))
htrc("Exception %d: %s\n", n, g->Message); htrc("Exception %d: %-.256s\n", n, g->Message);
PUSH_WARNING(g->Message); PUSH_WARNING(g->Message);
str = NULL; str = NULL;
@ -3755,12 +3755,13 @@ my_bool jsonlocate_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
strcpy(message, "Third argument is not an integer (rank)"); strcpy(message, "Third argument is not an integer (rank)");
return true; return true;
} else if (args->arg_count > 3) } else if (args->arg_count > 3)
{
if (args->arg_type[3] != INT_RESULT) { if (args->arg_type[3] != INT_RESULT) {
strcpy(message, "Fourth argument is not an integer (memory)"); strcpy(message, "Fourth argument is not an integer (memory)");
return true; return true;
} else } else
more += (ulong)*(longlong*)args->args[2]; more += (ulong)*(longlong*)args->args[2];
}
CalcLen(args, false, reslen, memlen); CalcLen(args, false, reslen, memlen);
// TODO: calculate this // TODO: calculate this
@ -3838,7 +3839,7 @@ char *jsonlocate(UDF_INIT *initid, UDF_ARGS *args, char *result,
} catch (int n) { } catch (int n) {
if (trace(1)) if (trace(1))
htrc("Exception %d: %s\n", n, g->Message); htrc("Exception %d: %-.256s\n", n, g->Message);
PUSH_WARNING(g->Message); PUSH_WARNING(g->Message);
*error = 1; *error = 1;
@ -3882,12 +3883,13 @@ my_bool json_locate_all_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
strcpy(message, "Third argument is not an integer (Depth)"); strcpy(message, "Third argument is not an integer (Depth)");
return true; return true;
} else if (args->arg_count > 3) } else if (args->arg_count > 3)
{
if (args->arg_type[3] != INT_RESULT) { if (args->arg_type[3] != INT_RESULT) {
strcpy(message, "Fourth argument is not an integer (memory)"); strcpy(message, "Fourth argument is not an integer (memory)");
return true; return true;
} else } else
more += (ulong)*(longlong*)args->args[2]; more += (ulong)*(longlong*)args->args[2];
}
CalcLen(args, false, reslen, memlen); CalcLen(args, false, reslen, memlen);
// TODO: calculate this // TODO: calculate this
@ -3963,7 +3965,7 @@ char *json_locate_all(UDF_INIT *initid, UDF_ARGS *args, char *result,
} catch (int n) { } catch (int n) {
if (trace(1)) if (trace(1))
htrc("Exception %d: %s\n", n, g->Message); htrc("Exception %d: %-.256s\n", n, g->Message);
PUSH_WARNING(g->Message); PUSH_WARNING(g->Message);
*error = 1; *error = 1;
@ -4243,7 +4245,7 @@ char *handle_item(UDF_INIT *initid, UDF_ARGS *args, char *result,
} catch (int n) { } catch (int n) {
if (trace(1)) if (trace(1))
htrc("Exception %d: %s\n", n, g->Message); htrc("Exception %d: %-.256s\n", n, g->Message);
PUSH_WARNING(g->Message); PUSH_WARNING(g->Message);
str = NULL; str = NULL;
@ -5178,7 +5180,7 @@ char *jbin_object_delete(UDF_INIT *initid, UDF_ARGS *args, char *result,
PCSZ key; PCSZ key;
PJOB jobp; PJOB jobp;
PJVAL jvp = MakeValue(g, args, 0, &top); PJVAL jvp = MakeValue(g, args, 0, &top);
PJSON jsp = jvp->GetJson(); PJSON jsp __attribute__((unused)) = jvp->GetJson();
if (CheckPath(g, args, top, jvp, 2)) if (CheckPath(g, args, top, jvp, 2))
PUSH_WARNING(g->Message); PUSH_WARNING(g->Message);
@ -5889,7 +5891,7 @@ long long countin(UDF_INIT *initid, UDF_ARGS *args, char *result,
memcpy(str2, args->args[1], lg); memcpy(str2, args->args[1], lg);
str2[lg] = 0; str2[lg] = 0;
while (s = strstr(s, str2)) { while ((s = strstr(s, str2))) {
n++; n++;
s += lg; s += lg;
} // endwhile } // endwhile

View File

@ -211,7 +211,7 @@ static xmlStrdupFunc Strdup;
void xmlMyFree(void *mem) void xmlMyFree(void *mem)
{ {
if (trace(1)) { if (trace(1)) {
htrc("%.4d Freeing at %p %s\n", ++m, mem, s); htrc("%.4d Freeing at %p %-.256s\n", ++m, mem, s);
*s = 0; *s = 0;
} // endif trace } // endif trace
Free(mem); Free(mem);
@ -221,7 +221,7 @@ void *xmlMyMalloc(size_t size)
{ {
void *p = Malloc(size); void *p = Malloc(size);
if (trace(1)) { if (trace(1)) {
htrc("%.4d Allocating %.5d at %p %s\n", ++m, size, p, s); htrc("%.4d Allocating %.5d at %p %-.256s\n", ++m, size, p, s);
*s = 0; *s = 0;
} // endif trace } // endif trace
return p; return p;
@ -231,7 +231,7 @@ void *xmlMyMallocAtomic(size_t size)
{ {
void *p = MallocA(size); void *p = MallocA(size);
if (trace(1)) { if (trace(1)) {
htrc("%.4d Atom alloc %.5d at %p %s\n", ++m, size, p, s); htrc("%.4d Atom alloc %.5d at %p %-.256s\n", ++m, size, p, s);
*s = 0; *s = 0;
} // endif trace } // endif trace
return p; return p;
@ -241,7 +241,7 @@ void *xmlMyRealloc(void *mem, size_t size)
{ {
void *p = Realloc(mem, size); void *p = Realloc(mem, size);
if (trace(1)) { if (trace(1)) {
htrc("%.4d ReAlloc %.5d to %p from %p %s\n", ++m, size, p, mem, s); htrc("%.4d ReAlloc %.5d to %p from %p %-.256s\n", ++m, size, p, mem, s);
*s = 0; *s = 0;
} // endif trace } // endif trace
return p; return p;
@ -251,7 +251,7 @@ char *xmlMyStrdup(const char *str)
{ {
char *p = Strdup(str); char *p = Strdup(str);
if (trace(1)) { if (trace(1)) {
htrc("%.4d Duplicating to %p from %p %s %s\n", ++m, p, str, str, s); htrc("%.4d Duplicating to %p from %p %-.256s %-.256s\n", ++m, p, str, str, s);
*s = 0; *s = 0;
} // endif trace } // endif trace
return p; return p;
@ -378,7 +378,7 @@ bool LIBXMLDOC::Initialize(PGLOBAL g, PCSZ entry, bool zipped)
if (zipped && InitZip(g, entry)) if (zipped && InitZip(g, entry))
return true; return true;
int n = xmlKeepBlanksDefault(1); int n __attribute__((unused))= xmlKeepBlanksDefault(1);
return MakeNSlist(g); return MakeNSlist(g);
} // end of Initialize } // end of Initialize
@ -448,7 +448,7 @@ bool LIBXMLDOC::NewDoc(PGLOBAL g, PCSZ ver)
void LIBXMLDOC::AddComment(PGLOBAL g, char *txtp) void LIBXMLDOC::AddComment(PGLOBAL g, char *txtp)
{ {
if (trace(1)) if (trace(1))
htrc("AddComment: %s\n", txtp); htrc("AddComment: %-.256s\n", txtp);
xmlNodePtr cp = xmlNewDocComment(Docp, BAD_CAST txtp); xmlNodePtr cp = xmlNewDocComment(Docp, BAD_CAST txtp);
xmlAddChild((xmlNodePtr)Docp, cp); xmlAddChild((xmlNodePtr)Docp, cp);
@ -476,7 +476,7 @@ PXNODE LIBXMLDOC::GetRoot(PGLOBAL g)
PXNODE LIBXMLDOC::NewRoot(PGLOBAL g, char *name) PXNODE LIBXMLDOC::NewRoot(PGLOBAL g, char *name)
{ {
if (trace(1)) if (trace(1))
htrc("NewRoot: %s\n", name); htrc("NewRoot: %-.256s\n", name);
xmlNodePtr root = xmlNewDocNode(Docp, NULL, BAD_CAST name, NULL); xmlNodePtr root = xmlNewDocNode(Docp, NULL, BAD_CAST name, NULL);
@ -494,7 +494,7 @@ PXNODE LIBXMLDOC::NewRoot(PGLOBAL g, char *name)
PXNODE LIBXMLDOC::NewPnode(PGLOBAL g, char *name) PXNODE LIBXMLDOC::NewPnode(PGLOBAL g, char *name)
{ {
if (trace(1)) if (trace(1))
htrc("NewNode: %s\n", name); htrc("NewNode: %-.256s\n", name);
xmlNodePtr nop; xmlNodePtr nop;
@ -535,7 +535,7 @@ int LIBXMLDOC::DumpDoc(PGLOBAL g, char *ofn)
FILE *of; FILE *of;
if (trace(1)) if (trace(1))
htrc("DumpDoc: %s\n", ofn); htrc("DumpDoc: %-.256s\n", ofn);
if (!(of= global_fopen(g, MSGID_CANNOT_OPEN, ofn, "w"))) if (!(of= global_fopen(g, MSGID_CANNOT_OPEN, ofn, "w")))
return -1; return -1;
@ -554,8 +554,8 @@ int LIBXMLDOC::DumpDoc(PGLOBAL g, char *ofn)
xmlNodePtr Rootp; xmlNodePtr Rootp;
// Save the modified document // Save the modified document
fprintf(of, "<?xml version=\"1.0\" encoding=\"%s\"?>\n", Encoding); fprintf(of, "<?xml version=\"1.0\" encoding=\"%-.256s\"?>\n", Encoding);
fprintf(of, "<!-- Created by CONNECT %s -->\n", version); fprintf(of, "<!-- Created by CONNECT %-.256s -->\n", version);
if (!(Rootp = xmlDocGetRootElement(Docp))) if (!(Rootp = xmlDocGetRootElement(Docp)))
return 1; return 1;
@ -631,7 +631,7 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp)
xmlNodeSetPtr nl; xmlNodeSetPtr nl;
if (trace(1)) if (trace(1))
htrc("GetNodeList: %s np=%p\n", xp, np); htrc("GetNodeList: %-.256s np=%p\n", xp, np);
if (!Ctxp) { if (!Ctxp) {
// Init Xpath // Init Xpath
@ -648,7 +648,7 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp)
strcpy(g->Message, MSG(XPATH_CNTX_ERR)); strcpy(g->Message, MSG(XPATH_CNTX_ERR));
if (trace(1)) if (trace(1))
htrc("Context error: %s\n", g->Message); htrc("Context error: %-.256s\n", g->Message);
return NULL; return NULL;
} // endif xpathCtx } // endif xpathCtx
@ -656,7 +656,7 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp)
// Register namespaces from list (if any) // Register namespaces from list (if any)
for (PNS nsp = Namespaces; nsp; nsp = nsp->Next) { for (PNS nsp = Namespaces; nsp; nsp = nsp->Next) {
if (trace(1)) if (trace(1))
htrc("Calling xmlXPathRegisterNs Prefix=%s Uri=%s\n", htrc("Calling xmlXPathRegisterNs Prefix=%-.256s Uri=%-.512s\n",
nsp->Prefix, nsp->Uri); nsp->Prefix, nsp->Uri);
if (xmlXPathRegisterNs(Ctxp, BAD_CAST nsp->Prefix, if (xmlXPathRegisterNs(Ctxp, BAD_CAST nsp->Prefix,
@ -664,7 +664,7 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp)
sprintf(g->Message, MSG(REGISTER_ERR), nsp->Prefix, nsp->Uri); sprintf(g->Message, MSG(REGISTER_ERR), nsp->Prefix, nsp->Uri);
if (trace(1)) if (trace(1))
htrc("Ns error: %s\n", g->Message); htrc("Ns error: %-.256s\n", g->Message);
return NULL; return NULL;
} // endif Registering } // endif Registering
@ -699,14 +699,14 @@ xmlNodeSetPtr LIBXMLDOC::GetNodeList(PGLOBAL g, xmlNodePtr np, char *xp)
Ctxp->node = np; Ctxp->node = np;
if (trace(1)) if (trace(1))
htrc("Calling xmlXPathEval %s Ctxp=%p\n", xp, Ctxp); htrc("Calling xmlXPathEval %-.256s Ctxp=%p\n", xp, Ctxp);
// Evaluate table xpath // Evaluate table xpath
if (!(Xop = xmlXPathEval(BAD_CAST xp, Ctxp))) { if (!(Xop = xmlXPathEval(BAD_CAST xp, Ctxp))) {
sprintf(g->Message, MSG(XPATH_EVAL_ERR), xp); sprintf(g->Message, MSG(XPATH_EVAL_ERR), xp);
if (trace(1)) if (trace(1))
htrc("Path error: %s\n", g->Message); htrc("Path error: %-.256s\n", g->Message);
return NULL; return NULL;
} else } else
@ -882,14 +882,14 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len)
} // endif p1 } // endif p1
} else { } else {
sprintf(g->Message, "Truncated %s content", Nodep->name); sprintf(g->Message, "Truncated %-.256s content", Nodep->name);
rc = RC_INFO; rc = RC_INFO;
} // endif len } // endif len
*p2 = 0; *p2 = 0;
if (trace(1)) if (trace(1))
htrc("GetText buf='%s' len=%d\n", buf, len); htrc("GetText buf='%-.256s' len=%d\n", buf, len);
xmlFree(Content); xmlFree(Content);
Content = NULL; Content = NULL;
@ -897,7 +897,7 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len)
*buf = '\0'; *buf = '\0';
if (trace(1)) if (trace(1))
htrc("GetContent: %s\n", buf); htrc("GetContent: %-.256s\n", buf);
return rc; return rc;
} // end of GetContent } // end of GetContent
@ -908,12 +908,12 @@ RCODE XML2NODE::GetContent(PGLOBAL g, char *buf, int len)
bool XML2NODE::SetContent(PGLOBAL g, char *txtp, int len) bool XML2NODE::SetContent(PGLOBAL g, char *txtp, int len)
{ {
if (trace(1)) if (trace(1))
htrc("SetContent: %s\n", txtp); htrc("SetContent: %-.256s\n", txtp);
xmlChar *buf = xmlEncodeEntitiesReentrant(Docp, BAD_CAST txtp); xmlChar *buf = xmlEncodeEntitiesReentrant(Docp, BAD_CAST txtp);
if (trace(1)) if (trace(1))
htrc("SetContent: %s -> %s\n", txtp, buf); htrc("SetContent: %-.256s -> %-.256s\n", txtp, buf);
xmlNodeSetContent(Nodep, buf); xmlNodeSetContent(Nodep, buf);
xmlFree(buf); xmlFree(buf);
@ -942,7 +942,7 @@ PXNODE XML2NODE::Clone(PGLOBAL g, PXNODE np)
PXLIST XML2NODE::GetChildElements(PGLOBAL g, char *xp, PXLIST lp) PXLIST XML2NODE::GetChildElements(PGLOBAL g, char *xp, PXLIST lp)
{ {
if (trace(1)) if (trace(1))
htrc("GetChildElements: %s\n", xp); htrc("GetChildElements: %-.256s\n", xp);
return SelectNodes(g, (xp) ? xp : (char*)"*", lp); return SelectNodes(g, (xp) ? xp : (char*)"*", lp);
} // end of GetChildElements } // end of GetChildElements
@ -953,7 +953,7 @@ PXLIST XML2NODE::GetChildElements(PGLOBAL g, char *xp, PXLIST lp)
PXLIST XML2NODE::SelectNodes(PGLOBAL g, char *xp, PXLIST lp) PXLIST XML2NODE::SelectNodes(PGLOBAL g, char *xp, PXLIST lp)
{ {
if (trace(1)) if (trace(1))
htrc("SelectNodes: %s\n", xp); htrc("SelectNodes: %-.256s\n", xp);
xmlNodeSetPtr nl = ((PXDOC2)Doc)->GetNodeList(g, Nodep, xp); xmlNodeSetPtr nl = ((PXDOC2)Doc)->GetNodeList(g, Nodep, xp);
@ -971,7 +971,7 @@ PXLIST XML2NODE::SelectNodes(PGLOBAL g, char *xp, PXLIST lp)
PXNODE XML2NODE::SelectSingleNode(PGLOBAL g, char *xp, PXNODE np) PXNODE XML2NODE::SelectSingleNode(PGLOBAL g, char *xp, PXNODE np)
{ {
if (trace(1)) if (trace(1))
htrc("SelectSingleNode: %s\n", xp); htrc("SelectSingleNode: %-.256s\n", xp);
xmlNodeSetPtr nl = ((PXDOC2)Doc)->GetNodeList(g, Nodep, xp); xmlNodeSetPtr nl = ((PXDOC2)Doc)->GetNodeList(g, Nodep, xp);
@ -995,7 +995,7 @@ PXATTR XML2NODE::GetAttribute(PGLOBAL g, char *name, PXATTR ap)
xmlAttrPtr atp; xmlAttrPtr atp;
if (trace(1)) if (trace(1))
htrc("GetAttribute: %s\n", SVP(name)); htrc("GetAttribute: %-.256s\n", SVP(name));
if (name) if (name)
atp = xmlHasProp(Nodep, BAD_CAST name); atp = xmlHasProp(Nodep, BAD_CAST name);
@ -1024,7 +1024,7 @@ PXNODE XML2NODE::AddChildNode(PGLOBAL g, PCSZ name, PXNODE np)
char *p, *pn, *pf = NULL, *nmp = PlugDup(g, name); char *p, *pn, *pf = NULL, *nmp = PlugDup(g, name);
if (trace(1)) if (trace(1))
htrc("AddChildNode: %s\n", name); htrc("AddChildNode: %-.256s\n", name);
// Is a prefix specified // Is a prefix specified
if ((pn = strchr(nmp, ':'))) { if ((pn = strchr(nmp, ':'))) {
@ -1075,7 +1075,7 @@ PXNODE XML2NODE::AddChildNode(PGLOBAL g, PCSZ name, PXNODE np)
PXATTR XML2NODE::AddProperty(PGLOBAL g, char *name, PXATTR ap) PXATTR XML2NODE::AddProperty(PGLOBAL g, char *name, PXATTR ap)
{ {
if (trace(1)) if (trace(1))
htrc("AddProperty: %s\n", name); htrc("AddProperty: %-.256s\n", name);
xmlAttrPtr atp = xmlNewProp(Nodep, BAD_CAST name, NULL); xmlAttrPtr atp = xmlNewProp(Nodep, BAD_CAST name, NULL);
@ -1098,7 +1098,7 @@ PXATTR XML2NODE::AddProperty(PGLOBAL g, char *name, PXATTR ap)
void XML2NODE::AddText(PGLOBAL g, PCSZ txtp) void XML2NODE::AddText(PGLOBAL g, PCSZ txtp)
{ {
if (trace(1)) if (trace(1))
htrc("AddText: %s\n", txtp); htrc("AddText: %-.256s\n", txtp);
// This is to avoid a blank line when inserting a new line // This is to avoid a blank line when inserting a new line
xmlNodePtr np = xmlGetLastChild(Nodep); xmlNodePtr np = xmlGetLastChild(Nodep);
@ -1158,7 +1158,7 @@ void XML2NODE::DeleteChild(PGLOBAL g, PXNODE dnp)
err: err:
if (trace(1)) if (trace(1))
htrc("DeleteChild: errmsg=%s\n", xerr->message); htrc("DeleteChild: errmsg=%-.256s\n", xerr->message);
xmlResetError(xerr); xmlResetError(xerr);
} // end of DeleteChild } // end of DeleteChild
@ -1260,7 +1260,7 @@ RCODE XML2ATTR::GetText(PGLOBAL g, char *buf, int len)
if (strlen((char*)txt) >= (unsigned)len) { if (strlen((char*)txt) >= (unsigned)len) {
memcpy(buf, txt, len - 1); memcpy(buf, txt, len - 1);
buf[len - 1] = 0; buf[len - 1] = 0;
sprintf(g->Message, "Truncated %s content", Atrp->name); sprintf(g->Message, "Truncated %-.256s content", Atrp->name);
rc = RC_INFO; rc = RC_INFO;
} else } else
strcpy(buf, (const char*)txt); strcpy(buf, (const char*)txt);
@ -1270,7 +1270,7 @@ RCODE XML2ATTR::GetText(PGLOBAL g, char *buf, int len)
*buf = '\0'; *buf = '\0';
if (trace(1)) if (trace(1))
htrc("GetText: %s\n", buf); htrc("GetText: %-.256s\n", buf);
return rc; return rc;
} // end of GetText } // end of GetText
@ -1281,7 +1281,7 @@ RCODE XML2ATTR::GetText(PGLOBAL g, char *buf, int len)
bool XML2ATTR::SetText(PGLOBAL g, char *txtp, int len) bool XML2ATTR::SetText(PGLOBAL g, char *txtp, int len)
{ {
if (trace(1)) if (trace(1))
htrc("SetText: %s %d\n", txtp, len); htrc("SetText: %-.256s %d\n", txtp, len);
xmlSetProp(Parent, Atrp->name, BAD_CAST txtp); xmlSetProp(Parent, Atrp->name, BAD_CAST txtp);
return false; return false;

View File

@ -190,7 +190,7 @@ bool CloseMemMap(void *memory, size_t dwSize)
{ {
if (memory) { if (memory) {
// All this must be redesigned // All this must be redesigned
int rc = msync((char*)memory, dwSize, MS_SYNC); int rc __attribute__((unused))= msync((char*)memory, dwSize, MS_SYNC);
return (munmap((char*)memory, dwSize) < 0) ? true : false; return (munmap((char*)memory, dwSize) < 0) ? true : false;
} else } else
return false; return false;

View File

@ -140,7 +140,7 @@ PQRYRES MyColumns(PGLOBAL g, THD *thd, const char *host, const char *db,
PCSZ fmt; PCSZ fmt;
char *fld, *colname, *chset, v, buf[128], uns[16], zero[16]; char *fld, *colname, *chset, v, buf[128], uns[16], zero[16];
int i, n, nf = 0, ncol = sizeof(buftyp) / sizeof(int); int i, n, nf = 0, ncol = sizeof(buftyp) / sizeof(int);
int len, type, prec, rc, k = 0; int len, type, prec, rc;
bool b; bool b;
PQRYRES qrp; PQRYRES qrp;
PCOLRES crp; PCOLRES crp;

View File

@ -66,6 +66,7 @@ int MYSQLtoPLG(char *typname, char *var)
break; break;
case TPC_SKIP: case TPC_SKIP:
*var = 'K'; *var = 'K';
/* falls through */
default: // TPC_NO default: // TPC_NO
type = TYPE_ERROR; type = TYPE_ERROR;
} // endswitch xconv } // endswitch xconv
@ -237,13 +238,14 @@ int MYSQLtoPLG(int mytype, char *var)
break; break;
case TPC_SKIP: case TPC_SKIP:
*var = 'K'; // Skip *var = 'K'; // Skip
/* falls through */
default: // TPC_NO default: // TPC_NO
type = TYPE_ERROR; type = TYPE_ERROR;
} // endswitch xconv } // endswitch xconv
return type; return type;
} // endif var } // endif var
/* falls through */
default: default:
type = TYPE_ERROR; type = TYPE_ERROR;
} // endswitch mytype } // endswitch mytype

View File

@ -430,6 +430,7 @@ char *ExtractFromPath(PGLOBAL g, char *pBuff, char *FileName, OPVAL op)
/* Because this function is only used for catalog name checking, */ /* Because this function is only used for catalog name checking, */
/* it must be case insensitive. */ /* it must be case insensitive. */
/***********************************************************************/ /***********************************************************************/
#ifdef NOT_USED
static bool PlugCheckPattern(PGLOBAL g, LPCSTR string, LPCSTR pat) static bool PlugCheckPattern(PGLOBAL g, LPCSTR string, LPCSTR pat)
{ {
if (pat && strlen(pat)) { if (pat && strlen(pat)) {
@ -443,6 +444,7 @@ static bool PlugCheckPattern(PGLOBAL g, LPCSTR string, LPCSTR pat)
return true; return true;
} // end of PlugCheckPattern } // end of PlugCheckPattern
#endif
/***********************************************************************/ /***********************************************************************/
/* PlugEvalLike: evaluates a LIKE clause. */ /* PlugEvalLike: evaluates a LIKE clause. */

View File

@ -147,7 +147,7 @@ PGLOBAL PlugInit(LPCSTR Language, uint worksize)
PGLOBAL g; PGLOBAL g;
if (trace(2)) if (trace(2))
htrc("PlugInit: Language='%s'\n", htrc("PlugInit: Language='%-.256s'\n",
((!Language) ? "Null" : (char*)Language)); ((!Language) ? "Null" : (char*)Language));
try { try {
@ -216,15 +216,15 @@ LPSTR PlugRemoveType(LPSTR pBuff, LPCSTR FileName)
_splitpath(FileName, drive, direc, fname, ftype); _splitpath(FileName, drive, direc, fname, ftype);
if (trace(2)) { if (trace(2)) {
htrc("after _splitpath: FileName=%s\n", FileName); htrc("after _splitpath: FileName=%-.256s\n", FileName);
htrc("drive=%s dir=%s fname=%s ext=%s\n", htrc("drive=%-.256s dir=%-.256s fname=%-.256s ext=%-.256s\n",
SVP(drive), direc, fname, ftype); SVP(drive), direc, fname, ftype);
} // endif trace } // endif trace
_makepath(pBuff, drive, direc, fname, ""); _makepath(pBuff, drive, direc, fname, "");
if (trace(2)) if (trace(2))
htrc("buff='%s'\n", pBuff); htrc("buff='%-.256s'\n", pBuff);
return pBuff; return pBuff;
} // end of PlugRemoveType } // end of PlugRemoveType
@ -257,7 +257,7 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath)
#endif #endif
if (trace(2)) if (trace(2))
htrc("prefix=%s fn=%s path=%s\n", prefix, FileName, defpath); htrc("prefix=%-.256s fn=%-.256s path=%-.256s\n", prefix, FileName, defpath);
if (!strncmp(FileName, "//", 2) || !strncmp(FileName, "\\\\", 2)) { if (!strncmp(FileName, "//", 2) || !strncmp(FileName, "\\\\", 2)) {
strcpy(pBuff, FileName); // Remote file strcpy(pBuff, FileName); // Remote file
@ -274,7 +274,7 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath)
if (*FileName == '~') { if (*FileName == '~') {
if (_fullpath(pBuff, FileName, _MAX_PATH)) { if (_fullpath(pBuff, FileName, _MAX_PATH)) {
if (trace(2)) if (trace(2))
htrc("pbuff='%s'\n", pBuff); htrc("pbuff='%-.256s'\n", pBuff);
return pBuff; return pBuff;
} else } else
@ -309,12 +309,12 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath)
_splitpath(tmpdir, defdrv, defdir, NULL, NULL); _splitpath(tmpdir, defdrv, defdir, NULL, NULL);
if (trace(2)) { if (trace(2)) {
htrc("after _splitpath: FileName=%s\n", FileName); htrc("after _splitpath: FileName=%-.256s\n", FileName);
#if defined(__WIN__) #if defined(__WIN__)
htrc("drive=%s dir=%s fname=%s ext=%s\n", drive, direc, fname, ftype); htrc("drive=%-.256s dir=%-.256s fname=%-.256s ext=%-.256s\n", drive, direc, fname, ftype);
htrc("defdrv=%s defdir=%s\n", defdrv, defdir); htrc("defdrv=%-.256s defdir=%-.256s\n", defdrv, defdir);
#else #else
htrc("dir=%s fname=%s ext=%s\n", direc, fname, ftype); htrc("dir=%-.256s fname=%-.256s ext=%-.256s\n", direc, fname, ftype);
#endif #endif
} // endif trace } // endif trace
@ -336,11 +336,11 @@ LPCSTR PlugSetPath(LPSTR pBuff, LPCSTR prefix, LPCSTR FileName, LPCSTR defpath)
_makepath(newname, drive, direc, fname, ftype); _makepath(newname, drive, direc, fname, ftype);
if (trace(2)) if (trace(2))
htrc("newname='%s'\n", newname); htrc("newname='%-.256s'\n", newname);
if (_fullpath(pBuff, newname, _MAX_PATH)) { if (_fullpath(pBuff, newname, _MAX_PATH)) {
if (trace(2)) if (trace(2))
htrc("pbuff='%s'\n", pBuff); htrc("pbuff='%-.256s'\n", pBuff);
return pBuff; return pBuff;
} else } else
@ -365,22 +365,22 @@ char *PlugReadMessage(PGLOBAL g, int mid, char *m)
PlugSetPath(msgfile, NULL, buff, msg_path); PlugSetPath(msgfile, NULL, buff, msg_path);
if (!(mfile = fopen(msgfile, "rt"))) { if (!(mfile = fopen(msgfile, "rt"))) {
sprintf(stmsg, "Fail to open message file %s", msgfile); sprintf(stmsg, "Fail to open message file %-.256s", msgfile);
goto err; goto err;
} // endif mfile } // endif mfile
for (;;) for (;;)
if (!fgets(buff, 256, mfile)) { if (!fgets(buff, 256, mfile)) {
sprintf(stmsg, "Cannot get message %d %s", mid, SVP(m)); sprintf(stmsg, "Cannot get message %d %-.256s", mid, SVP(m));
goto fin; goto fin;
} else } else
if (atoi(buff) == mid) if (atoi(buff) == mid)
break; break;
if (sscanf(buff, " %*d %s \"%[^\"]", msgid, stmsg) < 2) { if (sscanf(buff, " %*d %-.256s \"%[^\"]", msgid, stmsg) < 2) {
// Old message file // Old message file
if (!sscanf(buff, " %*d \"%[^\"]", stmsg)) { if (!sscanf(buff, " %*d \"%[^\"]", stmsg)) {
sprintf(stmsg, "Bad message file for %d %s", mid, SVP(m)); sprintf(stmsg, "Bad message file for %d %-.256s", mid, SVP(m));
goto fin; goto fin;
} else } else
m = NULL; m = NULL;
@ -485,7 +485,7 @@ bool AllocSarea(PGLOBAL g, uint size)
if (g->Sarea) if (g->Sarea)
htrc("Work area of %u allocated at %p\n", size, g->Sarea); htrc("Work area of %u allocated at %p\n", size, g->Sarea);
else else
htrc("SareaAlloc: %s\n", g->Message); htrc("SareaAlloc: %-.256s\n", g->Message);
} // endif trace } // endif trace
@ -567,11 +567,11 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size)
PCSZ pname = "Work"; PCSZ pname = "Work";
sprintf(g->Message, sprintf(g->Message,
"Not enough memory in %s area for request of %u (used=%d free=%d)", "Not enough memory in %-.256s area for request of %u (used=%d free=%d)",
pname, (uint)size, pph->To_Free, pph->FreeBlk); pname, (uint)size, pph->To_Free, pph->FreeBlk);
if (trace(1)) if (trace(1))
htrc("PlugSubAlloc: %s\n", g->Message); htrc("PlugSubAlloc: %-.256s\n", g->Message);
DoThrow(1234); DoThrow(1234);
} /* endif size OS32 code */ } /* endif size OS32 code */

View File

@ -350,8 +350,6 @@ RECFM TABDEF::GetTableFormat(const char* type)
bool TABDEF::Define(PGLOBAL g, PCATLG cat, bool TABDEF::Define(PGLOBAL g, PCATLG cat,
LPCSTR name, LPCSTR schema, LPCSTR am) LPCSTR name, LPCSTR schema, LPCSTR am)
{ {
int poff = 0;
Hc = ((MYCAT*)cat)->GetHandler(); Hc = ((MYCAT*)cat)->GetHandler();
Name = (PSZ)name; Name = (PSZ)name;
Schema = (PSZ)Hc->GetDBName(schema); Schema = (PSZ)Hc->GetDBName(schema);
@ -430,6 +428,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g)
case RECFM_CSV: case RECFM_CSV:
case RECFM_FMT: case RECFM_FMT:
nlg+= nof; nlg+= nof;
/* falls through */
case RECFM_DIR: case RECFM_DIR:
case RECFM_XML: case RECFM_XML:
poff= loff + (pcf->Flags & U_VIRTUAL ? 0 : 1); poff= loff + (pcf->Flags & U_VIRTUAL ? 0 : 1);
@ -472,6 +471,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g)
switch (trf ) { switch (trf ) {
case RECFM_VCT: case RECFM_VCT:
cdp->SetOffset(0); // Not to have shift cdp->SetOffset(0); // Not to have shift
/* falls through */
case RECFM_BIN: case RECFM_BIN:
// BIN/VEC are packed by default // BIN/VEC are packed by default
if (nof) { if (nof) {

View File

@ -569,8 +569,6 @@ int TDBDOS::ResetTableOpt(PGLOBAL g, bool dop, bool dox)
MaxSize = -1; // Size must be recalculated MaxSize = -1; // Size must be recalculated
Cardinal = -1; // as well as Cardinality Cardinal = -1; // as well as Cardinality
PTXF xp = Txfp;
To_Filter = NULL; // Disable filtering To_Filter = NULL; // Disable filtering
//To_BlkIdx = NULL; // and index filtering //To_BlkIdx = NULL; // and index filtering
To_BlkFil = NULL; // and block filtering To_BlkFil = NULL; // and block filtering
@ -642,7 +640,7 @@ int TDBDOS::MakeBlockValues(PGLOBAL g)
PDOSDEF defp = (PDOSDEF)To_Def; PDOSDEF defp = (PDOSDEF)To_Def;
PDOSCOL colp = NULL; PDOSCOL colp = NULL;
PDBUSER dup = PlgGetUser(g); PDBUSER dup = PlgGetUser(g);
PCATLG cat = defp->GetCat(); PCATLG cat __attribute__((unused))= defp->GetCat();
//void *memp = cat->GetDescp(); //void *memp = cat->GetDescp();
if ((nrec = defp->GetElemt()) < 2) { if ((nrec = defp->GetElemt()) < 2) {
@ -1005,14 +1003,14 @@ bool TDBDOS::GetBlockValues(PGLOBAL g)
{ {
char filename[_MAX_PATH]; char filename[_MAX_PATH];
int i, lg, n[NZ]; int i, lg, n[NZ];
int nrec, block = 0, last = 0, allocblk = 0; int nrec, block = 0, last = 0;
int len; int len;
bool newblk = false; bool newblk = false;
size_t ndv, nbm, nbk, blk; size_t ndv, nbm, nbk, blk;
FILE *opfile; FILE *opfile;
PCOLDEF cdp; PCOLDEF cdp;
PDOSDEF defp = (PDOSDEF)To_Def; PDOSDEF defp = (PDOSDEF)To_Def;
PCATLG cat = defp->GetCat(); PCATLG cat __attribute__((unused))= defp->GetCat();
PDBUSER dup = PlgGetUser(g); PDBUSER dup = PlgGetUser(g);
#if 0 #if 0
@ -1294,7 +1292,7 @@ PBF TDBDOS::InitBlockFilter(PGLOBAL g, PFIL filp)
} // endif blk } // endif blk
int i, op = filp->GetOpc(), opm = filp->GetOpm(), n = 0; int i, op = filp->GetOpc(), opm = filp->GetOpm();
bool cnv[2]; bool cnv[2];
PCOL colp; PCOL colp;
PXOB arg[2] = {NULL,NULL}; PXOB arg[2] = {NULL,NULL};
@ -1337,12 +1335,13 @@ PBF TDBDOS::InitBlockFilter(PGLOBAL g, PFIL filp)
bfp = new(g) BLKSPCIN(g, this, op, opm, arg, Txfp->Nrec); bfp = new(g) BLKSPCIN(g, this, op, opm, arg, Txfp->Nrec);
} else if (blk && Txfp->Nrec > 1 && colp->IsClustered()) } else if (blk && Txfp->Nrec > 1 && colp->IsClustered())
{
// Clustered column and constant array // Clustered column and constant array
if (colp->GetClustered() == 2) if (colp->GetClustered() == 2)
bfp = new(g) BLKFILIN2(g, this, op, opm, arg); bfp = new(g) BLKFILIN2(g, this, op, opm, arg);
else else
bfp = new(g) BLKFILIN(g, this, op, opm, arg); bfp = new(g) BLKFILIN(g, this, op, opm, arg);
}
} // endif this } // endif this
#if 0 #if 0
@ -1419,12 +1418,10 @@ PBF TDBDOS::CheckBlockFilari(PGLOBAL g, PXOB *arg, int op, bool *cnv)
//bool conv = false, xdb2 = false, ok = false, b[2]; //bool conv = false, xdb2 = false, ok = false, b[2];
//PXOB *xarg1, *xarg2 = NULL, xp[2]; //PXOB *xarg1, *xarg2 = NULL, xp[2];
int i, n = 0, type[2] = {0,0}; int i, n = 0, type[2] = {0,0};
bool conv = false, xdb2 = false, ok = false; bool conv = false, xdb2 = false;
PXOB *xarg2 = NULL, xp[2]; PXOB xp[2];
PCOL colp; PCOL colp;
//LSTVAL *vlp = NULL; PBF bfp = NULL;
//SFROW *sfr[2];
PBF *fp = NULL, bfp = NULL;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
switch (arg[i]->GetType()) { switch (arg[i]->GetType()) {
@ -1655,7 +1652,7 @@ int TDBDOS::TestBlock(PGLOBAL g)
int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add) int TDBDOS::MakeIndex(PGLOBAL g, PIXDEF pxdf, bool add)
{ {
int k, n, rc = RC_OK; int k, n, rc = RC_OK;
bool fixed, doit, sep, b = (pxdf != NULL); bool fixed, doit, sep;
PCOL *keycols, colp; PCOL *keycols, colp;
PIXDEF xdp, sxp = NULL; PIXDEF xdp, sxp = NULL;
PKPDEF kdp; PKPDEF kdp;
@ -2831,6 +2828,7 @@ bool DOSCOL::SetBitMap(PGLOBAL g)
bool DOSCOL::CheckSorted(PGLOBAL g) bool DOSCOL::CheckSorted(PGLOBAL g)
{ {
if (Sorted) if (Sorted)
{
if (OldVal) { if (OldVal) {
// Verify whether this column is sorted all right // Verify whether this column is sorted all right
if (OldVal->CompareValue(Value) > 0) { if (OldVal->CompareValue(Value) > 0) {
@ -2843,7 +2841,7 @@ bool DOSCOL::CheckSorted(PGLOBAL g)
} else } else
OldVal = AllocateValue(g, Value); OldVal = AllocateValue(g, Value);
}
return false; return false;
} // end of CheckSorted } // end of CheckSorted

View File

@ -312,12 +312,13 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info)
} else if (*p == q) { } else if (*p == q) {
if (phase == 0) { if (phase == 0) {
if (blank) if (blank)
{
if (++nerr > mxr) { if (++nerr > mxr) {
sprintf(g->Message, MSG(MISPLACED_QUOTE), num_read); sprintf(g->Message, MSG(MISPLACED_QUOTE), num_read);
goto err; goto err;
} else } else
goto skip; goto skip;
}
n = 0; n = 0;
phase = digit = 1; phase = digit = 1;
} else if (phase == 1) { } else if (phase == 1) {
@ -342,12 +343,13 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info)
} else { } else {
if (phase == 2) if (phase == 2)
{
if (++nerr > mxr) { if (++nerr > mxr) {
sprintf(g->Message, MSG(MISPLACED_QUOTE), num_read); sprintf(g->Message, MSG(MISPLACED_QUOTE), num_read);
goto err; goto err;
} else } else
goto skip; goto skip;
}
// isdigit cannot be used here because of debug assert // isdigit cannot be used here because of debug assert
if (!strchr("0123456789", *p)) { if (!strchr("0123456789", *p)) {
if (!digit && *p == dechar) if (!digit && *p == dechar)
@ -363,12 +365,13 @@ PQRYRES CSVColumns(PGLOBAL g, PCSZ dp, PTOS topt, bool info)
} // endif's *p } // endif's *p
if (phase == 1) if (phase == 1)
{
if (++nerr > mxr) { if (++nerr > mxr) {
sprintf(g->Message, MSG(UNBALANCE_QUOTE), num_read); sprintf(g->Message, MSG(UNBALANCE_QUOTE), num_read);
goto err; goto err;
} else } else
goto skip; goto skip;
}
if (n) { if (n) {
len[i] = MY_MAX(len[i], n); len[i] = MY_MAX(len[i], n);
type = (digit || n == 0 || (dec && n == 1)) ? TYPE_STRING type = (digit || n == 0 || (dec && n == 1)) ? TYPE_STRING
@ -742,6 +745,7 @@ bool TDBCSV::OpenDB(PGLOBAL g)
PCSVCOL colp; PCSVCOL colp;
if (!Fields) // May have been set in TABFMT::OpenDB if (!Fields) // May have been set in TABFMT::OpenDB
{
if (Mode != MODE_UPDATE && Mode != MODE_INSERT) { if (Mode != MODE_UPDATE && Mode != MODE_INSERT) {
for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next) for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next)
if (!colp->IsSpecial() && !colp->IsVirtual()) if (!colp->IsSpecial() && !colp->IsVirtual())
@ -754,7 +758,7 @@ bool TDBCSV::OpenDB(PGLOBAL g)
for (cdp = tdp->GetCols(); cdp; cdp = cdp->GetNext()) for (cdp = tdp->GetCols(); cdp; cdp = cdp->GetNext())
if (!cdp->IsSpecial() && !cdp->IsVirtual()) if (!cdp->IsSpecial() && !cdp->IsVirtual())
Fields++; Fields++;
}
Offset = (int*)PlugSubAlloc(g, NULL, sizeof(int) * Fields); Offset = (int*)PlugSubAlloc(g, NULL, sizeof(int) * Fields);
Fldlen = (int*)PlugSubAlloc(g, NULL, sizeof(int) * Fields); Fldlen = (int*)PlugSubAlloc(g, NULL, sizeof(int) * Fields);
@ -775,6 +779,7 @@ bool TDBCSV::OpenDB(PGLOBAL g)
} // endfor i } // endfor i
if (Field) if (Field)
{
// Prepare writing fields // Prepare writing fields
if (Mode != MODE_UPDATE) { if (Mode != MODE_UPDATE) {
for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next) for (colp = (PCSVCOL)Columns; colp; colp = (PCSVCOL)colp->Next)
@ -797,7 +802,7 @@ bool TDBCSV::OpenDB(PGLOBAL g)
Fldlen[i] = len; Fldlen[i] = len;
Fldtyp[i] = IsTypeNum(cdp->GetType()); Fldtyp[i] = IsTypeNum(cdp->GetType());
} // endif cdp } // endif cdp
}
} // endif Use } // endif Use
if (Header) { if (Header) {
@ -1047,6 +1052,7 @@ bool TDBCSV::PrepareWriting(PGLOBAL g)
strcat(To_Line, sep); strcat(To_Line, sep);
if (Field[i]) if (Field[i])
{
if (!strlen(Field[i])) { if (!strlen(Field[i])) {
// Generally null fields are not quoted // Generally null fields are not quoted
if (Quoted > 2) if (Quoted > 2)
@ -1075,7 +1081,7 @@ bool TDBCSV::PrepareWriting(PGLOBAL g)
else else
strcat(To_Line, Field[i]); strcat(To_Line, Field[i]);
}
} // endfor i } // endfor i
#if defined(_DEBUG) #if defined(_DEBUG)
@ -1135,6 +1141,7 @@ int TDBCSV::CheckWrite(PGLOBAL g)
n += (Quoted > 2 ? 2 : 0); n += (Quoted > 2 ? 2 : 0);
else if (strchr(Field[i], Sep) || (Qot && *Field[i] == Qot) else if (strchr(Field[i], Sep) || (Qot && *Field[i] == Qot)
|| Quoted > 1 || (Quoted == 1 && !Fldtyp[i])) || Quoted > 1 || (Quoted == 1 && !Fldtyp[i]))
{
if (!Qot) { if (!Qot) {
sprintf(g->Message, MSG(SEP_IN_FIELD), i + 1); sprintf(g->Message, MSG(SEP_IN_FIELD), i + 1);
return -1; return -1;
@ -1147,7 +1154,7 @@ int TDBCSV::CheckWrite(PGLOBAL g)
n += 2; // Outside quotes n += 2; // Outside quotes
} // endif } // endif
}
if ((nlen += n) > maxlen) { if ((nlen += n) > maxlen) {
strcpy(g->Message, MSG(LINE_TOO_LONG)); strcpy(g->Message, MSG(LINE_TOO_LONG));
return -1; return -1;

View File

@ -255,11 +255,13 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt)
jsp = (tjsp->GetDoc()) ? tjsp->GetDoc()->GetValue(0) : NULL; jsp = (tjsp->GetDoc()) ? tjsp->GetDoc()->GetValue(0) : NULL;
} else { } else {
if (!(tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0))) if (!(tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0)))
{
if (!mgo) { if (!mgo) {
sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty); sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty);
return 0; return 0;
} else } else
tdp->Lrecl = 8192; // Should be enough tdp->Lrecl = 8192; // Should be enough
}
tdp->Ending = GetIntegerTableOption(g, topt, "Ending", CRLF); tdp->Ending = GetIntegerTableOption(g, topt, "Ending", CRLF);
@ -1328,7 +1330,7 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
{ {
char *p, *p1 = NULL, *p2 = NULL, *pbuf = NULL; char *p, *p1 = NULL, *p2 = NULL, *pbuf = NULL;
int i; int i;
bool a, mul = false; bool a;
if (Parsed) if (Parsed)
return false; // Already done return false; // Already done
@ -1427,6 +1429,7 @@ PSZ JSONCOL::GetJpath(PGLOBAL g, bool proj)
return NULL; return NULL;
for (p1 = p2 = mgopath; *p1; p1++) for (p1 = p2 = mgopath; *p1; p1++)
{
if (i) { // Inside [] if (i) { // Inside []
if (isdigit(*p1)) { if (isdigit(*p1)) {
if (!proj) if (!proj)
@ -1464,12 +1467,12 @@ PSZ JSONCOL::GetJpath(PGLOBAL g, bool proj)
p2--; // Suppress last :* p2--; // Suppress last :*
break; break;
} // endif p2 } // endif p2
/* falls through */
default: default:
*p2++ = *p1; *p2++ = *p1;
break; break;
} // endswitch p1; } // endswitch p1;
}
*p2 = 0; *p2 = 0;
return mgopath; return mgopath;
} else } else
@ -1558,7 +1561,6 @@ void JSONCOL::ReadColumn(PGLOBAL g)
PVAL JSONCOL::GetColumnValue(PGLOBAL g, PJSON row, int i) PVAL JSONCOL::GetColumnValue(PGLOBAL g, PJSON row, int i)
{ {
int n = Nod - 1; int n = Nod - 1;
bool expd = false;
PJAR arp; PJAR arp;
PJVAL val = NULL; PJVAL val = NULL;
@ -2119,13 +2121,14 @@ int TDBJSON::Cardinality(PGLOBAL g)
if (!g) if (!g)
return (Xcol || Multiple) ? 0 : 1; return (Xcol || Multiple) ? 0 : 1;
else if (Cardinal < 0) else if (Cardinal < 0)
{
if (!Multiple) { if (!Multiple) {
if (MakeDocument(g) == RC_OK) if (MakeDocument(g) == RC_OK)
Cardinal = Doc->size(); Cardinal = Doc->size();
} else } else
return 10; return 10;
}
return Cardinal; return Cardinal;
} // end of Cardinality } // end of Cardinality

View File

@ -671,7 +671,7 @@ TDBDIR::TDBDIR(PSZ fpat) : TDBASE((PTABDEF)NULL)
/***********************************************************************/ /***********************************************************************/
char* TDBDIR::Path(PGLOBAL g) char* TDBDIR::Path(PGLOBAL g)
{ {
PCATLG cat = PlgGetCatalog(g); PCATLG cat __attribute__((unused))= PlgGetCatalog(g);
PTABDEF defp = (PTABDEF)To_Def; PTABDEF defp = (PTABDEF)To_Def;
#if defined(__WIN__) #if defined(__WIN__)
@ -708,8 +708,9 @@ PCOL TDBDIR::MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n)
int TDBDIR::GetMaxSize(PGLOBAL g) int TDBDIR::GetMaxSize(PGLOBAL g)
{ {
if (MaxSize < 0) { if (MaxSize < 0) {
int rc, n = -1; int n = -1;
#if defined(__WIN__) #if defined(__WIN__)
int rc;
// Start searching files in the target directory. // Start searching files in the target directory.
hSearch = FindFirstFile(Path(g), &FileData); hSearch = FindFirstFile(Path(g), &FileData);
@ -1041,12 +1042,13 @@ int TDBSDR::GetMaxSize(PGLOBAL g)
/***********************************************************************/ /***********************************************************************/
int TDBSDR::FindInDir(PGLOBAL g) int TDBSDR::FindInDir(PGLOBAL g)
{ {
int rc, n = 0; int n = 0;
size_t m = strlen(Direc); size_t m = strlen(Direc);
// Start searching files in the target directory. // Start searching files in the target directory.
#if defined(__WIN__) #if defined(__WIN__)
HANDLE h; HANDLE h;
int rc;
#if defined(PATHMATCHSPEC) #if defined(PATHMATCHSPEC)
if (!*Drive) if (!*Drive)

View File

@ -202,7 +202,7 @@ bool OcrSrcCols(PGLOBAL g, PQRYRES qrp, const char *col,
/**********************************************************************/ /**********************************************************************/
/* Replace the columns of the colist by the rank and occur columns. */ /* Replace the columns of the colist by the rank and occur columns. */
/**********************************************************************/ /**********************************************************************/
for (i = 0, pcrp = &qrp->Colresp; crp = *pcrp; ) { for (i = 0, pcrp = &qrp->Colresp; (crp = *pcrp); ) {
for (k = 0, pn = colist; k < m; k++, pn += (strlen(pn) + 1)) for (k = 0, pn = colist; k < m; k++, pn += (strlen(pn) + 1))
if (!stricmp(pn, crp->Name)) if (!stricmp(pn, crp->Name))
break; break;

View File

@ -187,7 +187,7 @@ PQRYRES PIVAID::MakePivotColumns(PGLOBAL g)
} // endif picol } // endif picol
// Prepare the column list // Prepare the column list
for (pcrp = &Qryp->Colresp; crp = *pcrp; ) for (pcrp = &Qryp->Colresp; (crp = *pcrp); )
if (SkipColumn(crp, skc)) { if (SkipColumn(crp, skc)) {
// Ignore this column // Ignore this column
*pcrp = crp->Next; *pcrp = crp->Next;
@ -340,7 +340,7 @@ int PIVAID::Qcompare(int *i1, int *i2)
bool PIVOTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) bool PIVOTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
{ {
char *p1, *p2; char *p1, *p2;
PHC hc = ((MYCAT*)Cat)->GetHandler(); PHC hc __attribute__((unused))= ((MYCAT*)Cat)->GetHandler();
if (PRXDEF::DefineAM(g, am, poff)) if (PRXDEF::DefineAM(g, am, poff))
return TRUE; return TRUE;
@ -748,7 +748,9 @@ int TDBPIVOT::ReadDB(PGLOBAL g)
colp->ReadColumn(g); colp->ReadColumn(g);
for (colp = Columns; colp; colp = colp->GetNext()) for (colp = Columns; colp; colp = colp->GetNext())
{
if (colp->GetAmType() == TYPE_AM_SRC) if (colp->GetAmType() == TYPE_AM_SRC)
{
if (FileStatus) { if (FileStatus) {
if (((PSRCCOL)colp)->CompareLast()) { if (((PSRCCOL)colp)->CompareLast()) {
newrow = (RowFlag) ? TRUE : FALSE; newrow = (RowFlag) ? TRUE : FALSE;
@ -757,7 +759,8 @@ int TDBPIVOT::ReadDB(PGLOBAL g)
} else } else
((PSRCCOL)colp)->SetColumn(); ((PSRCCOL)colp)->SetColumn();
}
}
FileStatus = 1; FileStatus = 1;
} // endif RowFlag } // endif RowFlag

View File

@ -169,12 +169,13 @@ int TDBVIR::TestFilter(PFIL filp, bool nop)
if (!nop) switch (op) { if (!nop) switch (op) {
case OP_LT: l1--; case OP_LT: l1--;
/* falls through */
case OP_LE: limit = l1; break; case OP_LE: limit = l1; break;
default: ok = false; default: ok = false;
} // endswitch op } // endswitch op
else switch (op) { else switch (op) {
case OP_GE: l1--; case OP_GE: l1--;
/* falls through */
case OP_GT: limit = l1; break; case OP_GT: limit = l1; break;
default: ok = false; default: ok = false;
} // endswitch op } // endswitch op

View File

@ -218,8 +218,10 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
while (true) { while (true) {
if (!vp->atp && if (!vp->atp &&
!(node = (vp->nl) ? vp->nl->GetItem(g, vp->k++, tdp->Usedom ? node : NULL) !(node = (vp->nl) ? vp->nl->GetItem(g, vp->k++, tdp->Usedom ?
node : NULL)
: NULL)) : NULL))
{
if (j) { if (j) {
vp = lvlp[--j]; vp = lvlp[--j];
@ -234,7 +236,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
continue; continue;
} else } else
break; break;
}
xcol->Name[vp->n] = 0; xcol->Name[vp->n] = 0;
fmt[vp->m] = 0; fmt[vp->m] = 0;
@ -248,6 +250,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
switch (vp->atp->GetText(g, buf, sizeof(buf))) { switch (vp->atp->GetText(g, buf, sizeof(buf))) {
case RC_INFO: case RC_INFO:
PushWarning(g, txmp); PushWarning(g, txmp);
/* falls through */
case RC_OK: case RC_OK:
strncat(fmt, "@", XLEN(fmt)); strncat(fmt, "@", XLEN(fmt));
break; break;
@ -308,6 +311,7 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info)
switch (node->GetContent(g, buf, sizeof(buf))) { switch (node->GetContent(g, buf, sizeof(buf))) {
case RC_INFO: case RC_INFO:
PushWarning(g, txmp); PushWarning(g, txmp);
/* falls through */
case RC_OK: case RC_OK:
xcol->Cbn = !strlen(buf); xcol->Cbn = !strlen(buf);
break; break;
@ -1271,6 +1275,7 @@ int TDBXML::ReadDB(PGLOBAL g)
bool TDBXML::CheckRow(PGLOBAL g, bool b) bool TDBXML::CheckRow(PGLOBAL g, bool b)
{ {
if (NewRow && Mode == MODE_INSERT) if (NewRow && Mode == MODE_INSERT)
{
if (Rowname) { if (Rowname) {
TabNode->AddText(g, "\n\t"); TabNode->AddText(g, "\n\t");
RowNode = TabNode->AddChildNode(g, Rowname, RowNode); RowNode = TabNode->AddChildNode(g, Rowname, RowNode);
@ -1278,6 +1283,7 @@ bool TDBXML::CheckRow(PGLOBAL g, bool b)
strcpy(g->Message, MSG(NO_ROW_NODE)); strcpy(g->Message, MSG(NO_ROW_NODE));
return true; return true;
} // endif Rowname } // endif Rowname
}
if (Colname && (NewRow || b)) if (Colname && (NewRow || b))
Clist = RowNode->SelectNodes(g, Colname, Clist); Clist = RowNode->SelectNodes(g, Colname, Clist);
@ -1525,11 +1531,13 @@ bool XMLCOL::ParseXpath(PGLOBAL g, bool mode)
// Analyze the Xpath for this column // Analyze the Xpath for this column
for (i = 0, p = pbuf; (p2 = strchr(p, '/')); i++, p = p2 + 1) { for (i = 0, p = pbuf; (p2 = strchr(p, '/')); i++, p = p2 + 1) {
if (Tdbp->Mulnode && !strncmp(p, Tdbp->Mulnode, p2 - p)) if (Tdbp->Mulnode && !strncmp(p, Tdbp->Mulnode, p2 - p))
{
if (!Tdbp->Xpand && mode) { if (!Tdbp->Xpand && mode) {
strcpy(g->Message, MSG(CONCAT_SUBNODE)); strcpy(g->Message, MSG(CONCAT_SUBNODE));
return true; return true;
} else } else
Inod = i; // Index of multiple node Inod = i; // Index of multiple node
}
if (mode) { if (mode) {
// For Update or Insert the Xpath must be explicit // For Update or Insert the Xpath must be explicit
@ -1776,10 +1784,12 @@ void XMLCOL::WriteColumn(PGLOBAL g)
break; break;
if (ColNode) if (ColNode)
{
if (Type) if (Type)
ValNode = ColNode->SelectSingleNode(g, Xname, Vxnp); ValNode = ColNode->SelectSingleNode(g, Xname, Vxnp);
else else
AttNode = ColNode->GetAttribute(g, Xname, Vxap); AttNode = ColNode->GetAttribute(g, Xname, Vxap);
}
if (TopNode || ValNode || AttNode) if (TopNode || ValNode || AttNode)
break; // We found the good column break; // We found the good column
@ -1793,6 +1803,7 @@ void XMLCOL::WriteColumn(PGLOBAL g)
/*********************************************************************/ /*********************************************************************/
if (ColNode == NULL) { if (ColNode == NULL) {
if (TopNode == NULL) if (TopNode == NULL)
{
if (Tdbp->Clist) { if (Tdbp->Clist) {
Tdbp->RowNode->AddText(g, "\n\t\t"); Tdbp->RowNode->AddText(g, "\n\t\t");
ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname); ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname);
@ -1800,7 +1811,7 @@ void XMLCOL::WriteColumn(PGLOBAL g)
TopNode = ColNode; TopNode = ColNode;
} else } else
TopNode = Tdbp->RowNode; TopNode = Tdbp->RowNode;
}
for (; k < Nod && TopNode; k++) { for (; k < Nod && TopNode; k++) {
if (!done) { if (!done) {
TopNode->AddText(g, "\n\t\t"); TopNode->AddText(g, "\n\t\t");
@ -2015,6 +2026,7 @@ void XMULCOL::WriteColumn(PGLOBAL g)
} // endfor k } // endfor k
if (ColNode) if (ColNode)
{
if (Inod == Nod) { if (Inod == Nod) {
/***************************************************************/ /***************************************************************/
/* The node value can be multiple. */ /* The node value can be multiple. */
@ -2032,11 +2044,13 @@ void XMULCOL::WriteColumn(PGLOBAL g)
ValNode = Nlx->GetItem(g, Tdbp->Nsub, Vxnp); ValNode = Nlx->GetItem(g, Tdbp->Nsub, Vxnp);
} else // Inod != Nod } else // Inod != Nod
{
if (Type) if (Type)
ValNode = ColNode->SelectSingleNode(g, Xname, Vxnp); ValNode = ColNode->SelectSingleNode(g, Xname, Vxnp);
else else
AttNode = ColNode->GetAttribute(g, Xname, Vxap); AttNode = ColNode->GetAttribute(g, Xname, Vxap);
}
}
if (TopNode || ValNode || AttNode) if (TopNode || ValNode || AttNode)
break; // We found the good column break; // We found the good column
else if (Tdbp->Clist) else if (Tdbp->Clist)
@ -2049,6 +2063,7 @@ void XMULCOL::WriteColumn(PGLOBAL g)
/*********************************************************************/ /*********************************************************************/
if (ColNode == NULL) { if (ColNode == NULL) {
if (TopNode == NULL) if (TopNode == NULL)
{
if (Tdbp->Clist) { if (Tdbp->Clist) {
Tdbp->RowNode->AddText(g, "\n\t\t"); Tdbp->RowNode->AddText(g, "\n\t\t");
ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname); ColNode = Tdbp->RowNode->AddChildNode(g, Tdbp->Colname);
@ -2056,6 +2071,7 @@ void XMULCOL::WriteColumn(PGLOBAL g)
TopNode = ColNode; TopNode = ColNode;
} else } else
TopNode = Tdbp->RowNode; TopNode = Tdbp->RowNode;
}
for (; k < Nod && TopNode; k++) { for (; k < Nod && TopNode; k++) {
if (!done) { if (!done) {

View File

@ -112,7 +112,7 @@ bool user_connect::user_init()
if (g) if (g)
printf("%s\n", g->Message); printf("%s\n", g->Message);
int rc= PlugExit(g); int rc __attribute__((unused))= PlugExit(g);
g= NULL; g= NULL;
if (dup) if (dup)

View File

@ -35,7 +35,7 @@
//typedef struct _global *PGLOBAL; //typedef struct _global *PGLOBAL;
typedef class user_connect *PCONNECT; typedef class user_connect *PCONNECT;
typedef class ha_connect *PHC; typedef class ha_connect *PHC;
static int connect_done_func(void *); int connect_done_func(void *);
/*****************************************************************************/ /*****************************************************************************/
/* The CONNECT users. There should be one by connected users. */ /* The CONNECT users. There should be one by connected users. */

View File

@ -559,12 +559,14 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp)
// Check whether the unique index is unique indeed // Check whether the unique index is unique indeed
if (!Mul) if (!Mul)
{
if (Ndif < Num_K) { if (Ndif < Num_K) {
strcpy(g->Message, MSG(INDEX_NOT_UNIQ)); strcpy(g->Message, MSG(INDEX_NOT_UNIQ));
brc = true; brc = true;
goto err; goto err;
} else } else
PlgDBfree(Offset); // Not used anymore PlgDBfree(Offset); // Not used anymore
}
// Restore kcp list // Restore kcp list
To_LastCol->Next = addcolp; To_LastCol->Next = addcolp;
@ -1209,7 +1211,7 @@ bool XINDEX::MapInit(PGLOBAL g)
PCOL colp; PCOL colp;
PXCOL prev = NULL, kcp = NULL; PXCOL prev = NULL, kcp = NULL;
PDOSDEF defp = (PDOSDEF)Tdbp->To_Def; PDOSDEF defp = (PDOSDEF)Tdbp->To_Def;
PDBUSER dup = PlgGetUser(g); PDBUSER dup __attribute__((unused))= PlgGetUser(g);
/*********************************************************************/ /*********************************************************************/
/* Get the estimated table size. */ /* Get the estimated table size. */
@ -2043,11 +2045,12 @@ int XINDXS::Range(PGLOBAL g, int limit, bool incl)
k = FastFind(); k = FastFind();
if (k < Num_K || Op != OP_EQ) if (k < Num_K || Op != OP_EQ)
{
if (limit) if (limit)
n = (Mul) ? k : kp->Val_K; n = (Mul) ? k : kp->Val_K;
else else
n = (Mul) ? Pof[kp->Val_K + 1] - k : 1; n = (Mul) ? Pof[kp->Val_K + 1] - k : 1;
}
} else { } else {
strcpy(g->Message, MSG(RANGE_NO_JOIN)); strcpy(g->Message, MSG(RANGE_NO_JOIN));
n = -1; // Logical error n = -1; // Logical error

View File

@ -28,6 +28,7 @@
#include <time.h> #include <time.h>
#include "zlib.h" #include "zlib.h"
#include "zip.h" #include "zip.h"
#include "my_attribute.h"
#ifdef STDC #ifdef STDC
# include <stddef.h> # include <stddef.h>
@ -518,14 +519,14 @@ local ZPOS64_T zip64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_f
if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize)
break; break;
for (i=(int)uReadSize-3; (i--)>0;) for (i=(int)uReadSize-3; (i--)>0;) {
if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
{ {
uPosFound = uReadPos+i; uPosFound = uReadPos+i;
break; break;
} }
}
if (uPosFound!=0) if (uPosFound!=0)
break; break;
} }
@ -1057,7 +1058,7 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename,
const void* extrafield_global, uInt size_extrafield_global, const void* extrafield_global, uInt size_extrafield_global,
const char* comment, int method, int level, int raw, const char* comment, int method, int level, int raw,
int windowBits,int memLevel, int strategy, int windowBits,int memLevel, int strategy,
const char* password, uLong crcForCrypting, const char* password, uLong crcForCrypting __attribute__((unused)),
uLong versionMadeBy, uLong flagBase, int zip64) uLong versionMadeBy, uLong flagBase, int zip64)
{ {
zip64_internal* zi; zip64_internal* zi;
@ -1066,11 +1067,10 @@ extern int ZEXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* filename,
uInt i; uInt i;
int err = ZIP_OK; int err = ZIP_OK;
# ifdef NOCRYPT #ifdef NOCRYPT
(crcForCrypting);
if (password != NULL) if (password != NULL)
return ZIP_PARAMERROR; return ZIP_PARAMERROR;
# endif #endif
if (file == NULL) if (file == NULL)
return ZIP_PARAMERROR; return ZIP_PARAMERROR;

View File

@ -4315,7 +4315,7 @@ grn_ii_remove(grn_ctx *ctx, const char *path)
if (!path || strlen(path) > PATH_MAX - 4) { return GRN_INVALID_ARGUMENT; } if (!path || strlen(path) > PATH_MAX - 4) { return GRN_INVALID_ARGUMENT; }
if ((rc = grn_io_remove(ctx, path))) { goto exit; } if ((rc = grn_io_remove(ctx, path))) { goto exit; }
grn_snprintf(buffer, PATH_MAX, PATH_MAX, grn_snprintf(buffer, PATH_MAX, PATH_MAX,
"%s.c", path); "%-.256s.c", path);
rc = grn_io_remove(ctx, buffer); rc = grn_io_remove(ctx, buffer);
exit : exit :
return rc; return rc;
@ -4331,12 +4331,12 @@ grn_ii_truncate(grn_ctx *ctx, grn_ii *ii)
uint32_t flags; uint32_t flags;
if ((io_segpath = grn_io_path(ii->seg)) && *io_segpath != '\0') { if ((io_segpath = grn_io_path(ii->seg)) && *io_segpath != '\0') {
if (!(segpath = GRN_STRDUP(io_segpath))) { if (!(segpath = GRN_STRDUP(io_segpath))) {
ERR(GRN_NO_MEMORY_AVAILABLE, "cannot duplicate path: <%s>", io_segpath); ERR(GRN_NO_MEMORY_AVAILABLE, "cannot duplicate path: <%-.256s>", io_segpath);
return GRN_NO_MEMORY_AVAILABLE; return GRN_NO_MEMORY_AVAILABLE;
} }
if ((io_chunkpath = grn_io_path(ii->chunk)) && *io_chunkpath != '\0') { if ((io_chunkpath = grn_io_path(ii->chunk)) && *io_chunkpath != '\0') {
if (!(chunkpath = GRN_STRDUP(io_chunkpath))) { if (!(chunkpath = GRN_STRDUP(io_chunkpath))) {
ERR(GRN_NO_MEMORY_AVAILABLE, "cannot duplicate path: <%s>", io_chunkpath); ERR(GRN_NO_MEMORY_AVAILABLE, "cannot duplicate path: <%-.256s>", io_chunkpath);
return GRN_NO_MEMORY_AVAILABLE; return GRN_NO_MEMORY_AVAILABLE;
} }
} else { } else {
@ -5144,7 +5144,7 @@ grn_ii_cursor_set_min(grn_ctx *ctx, grn_ii_cursor *c, grn_id min)
c->stat |= CHUNK_USED; c->stat |= CHUNK_USED;
GRN_LOG(ctx, GRN_LOG_DEBUG, GRN_LOG(ctx, GRN_LOG_DEBUG,
"[ii][cursor][min] skip: %p: min(%u->%u): chunk(%u->%u): " "[ii][cursor][min] skip: %p: min(%u->%u): chunk(%u->%u): "
"chunk-used(%s->%s)", "chunk-used(%-.256s->%-.256s)",
c, c,
old_min, min, old_min, min,
old_chunk, c->curr_chunk, old_chunk, c->curr_chunk,
@ -5205,7 +5205,7 @@ grn_ii_cursor_next_internal(grn_ctx *ctx, grn_ii_cursor *c,
} }
GRN_TEXT_PUTC(ctx, &buf, ')'); GRN_TEXT_PUTC(ctx, &buf, ')');
GRN_TEXT_PUTC(ctx, &buf, '\0'); GRN_TEXT_PUTC(ctx, &buf, '\0');
GRN_LOG(ctx, GRN_LOG_DEBUG, "posting(%d):%s", count, GRN_TEXT_VALUE(&buf)); GRN_LOG(ctx, GRN_LOG_DEBUG, "posting(%d):%-.256s", count, GRN_TEXT_VALUE(&buf));
GRN_OBJ_FIN(ctx, &buf); GRN_OBJ_FIN(ctx, &buf);
} }
*/ */
@ -6451,7 +6451,7 @@ grn_ii_column_update(grn_ctx *ctx, grn_ii *ii, grn_id rid, unsigned int section,
ERR(GRN_INVALID_ARGUMENT, ERR(GRN_INVALID_ARGUMENT,
"[ii][column][update][new] invalid object: " "[ii][column][update][new] invalid object: "
"<%.*s>: " "<%.*s>: "
"<%s>(%#x)", "<%-.256s>(%#x)",
name_size, name, name_size, name,
grn_obj_type_to_string(type), grn_obj_type_to_string(type),
type); type);
@ -6564,7 +6564,7 @@ grn_ii_column_update(grn_ctx *ctx, grn_ii *ii, grn_id rid, unsigned int section,
ERR(GRN_INVALID_ARGUMENT, ERR(GRN_INVALID_ARGUMENT,
"[ii][column][update][old] invalid object: " "[ii][column][update][old] invalid object: "
"<%.*s>: " "<%.*s>: "
"<%s>(%#x)", "<%-.256s>(%#x)",
name_size, name, name_size, name,
grn_obj_type_to_string(type), grn_obj_type_to_string(type),
type); type);
@ -7833,7 +7833,7 @@ grn_ii_select_cursor_open(grn_ctx *ctx,
default : default :
ERR(GRN_INVALID_ARGUMENT, ERR(GRN_INVALID_ARGUMENT,
"[ii][select][cursor][open] " "[ii][select][cursor][open] "
"EXACT, FUZZY, NEAR and NEAR2 are only supported mode: %s", "EXACT, FUZZY, NEAR and NEAR2 are only supported mode: %-.256s",
grn_operator_to_string(mode)); grn_operator_to_string(mode));
break; break;
} }
@ -7841,7 +7841,7 @@ grn_ii_select_cursor_open(grn_ctx *ctx,
cursor = GRN_CALLOC(sizeof(grn_ii_select_cursor)); cursor = GRN_CALLOC(sizeof(grn_ii_select_cursor));
if (!cursor) { if (!cursor) {
ERR(ctx->rc, ERR(ctx->rc,
"[ii][select][cursor][open] failed to allocate cursor: %s", "[ii][select][cursor][open] failed to allocate cursor: %-.256s",
ctx->errbuf); ctx->errbuf);
return NULL; return NULL;
} }
@ -7851,7 +7851,7 @@ grn_ii_select_cursor_open(grn_ctx *ctx,
if (!(cursor->tis = GRN_MALLOC(sizeof(token_info *) * string_len * 2))) { if (!(cursor->tis = GRN_MALLOC(sizeof(token_info *) * string_len * 2))) {
ERR(ctx->rc, ERR(ctx->rc,
"[ii][select][cursor][open] failed to allocate token info container: %s", "[ii][select][cursor][open] failed to allocate token info container: %-.256s",
ctx->errbuf); ctx->errbuf);
GRN_FREE(cursor); GRN_FREE(cursor);
return NULL; return NULL;
@ -7891,7 +7891,7 @@ grn_ii_select_cursor_open(grn_ctx *ctx,
case GRN_OP_NEAR : case GRN_OP_NEAR :
if (!(cursor->bt = bt_open(ctx, cursor->n_tis))) { if (!(cursor->bt = bt_open(ctx, cursor->n_tis))) {
ERR(ctx->rc, ERR(ctx->rc,
"[ii][select][cursor][open] failed to allocate btree: %s", "[ii][select][cursor][open] failed to allocate btree: %-.256s",
ctx->errbuf); ctx->errbuf);
grn_ii_select_cursor_close(ctx, cursor); grn_ii_select_cursor_close(ctx, cursor);
return NULL; return NULL;
@ -8114,7 +8114,7 @@ grn_ii_parse_regexp_query(grn_ctx *ctx,
if (char_len == 0) { if (char_len == 0) {
GRN_OBJ_FIN(ctx, &buffer); GRN_OBJ_FIN(ctx, &buffer);
ERR(GRN_INVALID_ARGUMENT, ERR(GRN_INVALID_ARGUMENT,
"%s invalid encoding character: <%.*s|%#x|>", "%-.256s invalid encoding character: <%.*s|%#x|>",
log_tag, log_tag,
(int)(current - string), string, (int)(current - string), string,
*current); *current);
@ -8515,7 +8515,7 @@ grn_ii_select_sequential_search(grn_ctx *ctx,
onig_error_code_to_str(message, onig_result, error_info); onig_error_code_to_str(message, onig_result, error_info);
GRN_LOG(ctx, GRN_LOG_WARNING, GRN_LOG(ctx, GRN_LOG_WARNING,
"[ii][select][sequential] " "[ii][select][sequential] "
"failed to create regular expression object: %s", "failed to create regular expression object: %-.256s",
message); message);
processed = GRN_FALSE; processed = GRN_FALSE;
} }
@ -10148,7 +10148,7 @@ grn_ii_buffer_open(grn_ctx *ctx, grn_ii *ii,
ii_buffer->block_buf = GRN_MALLOCN(grn_id, II_BUFFER_BLOCK_SIZE); ii_buffer->block_buf = GRN_MALLOCN(grn_id, II_BUFFER_BLOCK_SIZE);
if (ii_buffer->block_buf) { if (ii_buffer->block_buf) {
grn_snprintf(ii_buffer->tmpfpath, PATH_MAX, PATH_MAX, grn_snprintf(ii_buffer->tmpfpath, PATH_MAX, PATH_MAX,
"%sXXXXXX", grn_io_path(ii->seg)); "%-.256sXXXXXX", grn_io_path(ii->seg));
ii_buffer->block_buf_size = II_BUFFER_BLOCK_SIZE; ii_buffer->block_buf_size = II_BUFFER_BLOCK_SIZE;
ii_buffer->tmpfd = grn_mkstemp(ii_buffer->tmpfpath); ii_buffer->tmpfd = grn_mkstemp(ii_buffer->tmpfpath);
if (ii_buffer->tmpfd != -1) { if (ii_buffer->tmpfd != -1) {
@ -10161,7 +10161,7 @@ grn_ii_buffer_open(grn_ctx *ctx, grn_ii *ii,
} }
return ii_buffer; return ii_buffer;
} else { } else {
SERR("failed grn_mkstemp(%s)", SERR("failed grn_mkstemp(%-.256s)",
ii_buffer->tmpfpath); ii_buffer->tmpfpath);
} }
GRN_FREE(ii_buffer->block_buf); GRN_FREE(ii_buffer->block_buf);
@ -10308,7 +10308,7 @@ grn_ii_buffer_commit(grn_ctx *ctx, grn_ii_buffer *ii_buffer)
ii_buffer->tmpfpath, ii_buffer->tmpfpath,
O_RDONLY | GRN_OPEN_FLAG_BINARY); O_RDONLY | GRN_OPEN_FLAG_BINARY);
if (ii_buffer->tmpfd == -1) { if (ii_buffer->tmpfd == -1) {
ERRNO_ERR("failed to open path: <%s>", ii_buffer->tmpfpath); ERRNO_ERR("failed to open path: <%-.256s>", ii_buffer->tmpfpath);
return ctx->rc; return ctx->rc;
} }
{ {
@ -10358,10 +10358,10 @@ grn_ii_buffer_commit(grn_ctx *ctx, grn_ii_buffer *ii_buffer)
grn_close(ii_buffer->tmpfd); grn_close(ii_buffer->tmpfd);
if (grn_unlink(ii_buffer->tmpfpath) == 0) { if (grn_unlink(ii_buffer->tmpfpath) == 0) {
GRN_LOG(ctx, GRN_LOG_INFO, GRN_LOG(ctx, GRN_LOG_INFO,
"[ii][buffer][commit] removed temporary path: <%s>", "[ii][buffer][commit] removed temporary path: <%-.256s>",
ii_buffer->tmpfpath); ii_buffer->tmpfpath);
} else { } else {
ERRNO_ERR("[ii][buffer][commit] failed to remove temporary path: <%s>", ERRNO_ERR("[ii][buffer][commit] failed to remove temporary path: <%-.256s>",
ii_buffer->tmpfpath); ii_buffer->tmpfpath);
} }
ii_buffer->tmpfd = -1; ii_buffer->tmpfd = -1;
@ -10385,10 +10385,10 @@ grn_ii_buffer_close(grn_ctx *ctx, grn_ii_buffer *ii_buffer)
grn_close(ii_buffer->tmpfd); grn_close(ii_buffer->tmpfd);
if (grn_unlink(ii_buffer->tmpfpath) == 0) { if (grn_unlink(ii_buffer->tmpfpath) == 0) {
GRN_LOG(ctx, GRN_LOG_INFO, GRN_LOG(ctx, GRN_LOG_INFO,
"[ii][buffer][close] removed temporary path: <%s>", "[ii][buffer][close] removed temporary path: <%-.256s>",
ii_buffer->tmpfpath); ii_buffer->tmpfpath);
} else { } else {
ERRNO_ERR("[ii][buffer][close] failed to remove temporary path: <%s>", ERRNO_ERR("[ii][buffer][close] failed to remove temporary path: <%-.256s>",
ii_buffer->tmpfpath); ii_buffer->tmpfpath);
} }
} }
@ -11468,10 +11468,10 @@ grn_ii_builder_fin(grn_ctx *ctx, grn_ii_builder *builder)
grn_close(builder->fd); grn_close(builder->fd);
if (grn_unlink(builder->path) == 0) { if (grn_unlink(builder->path) == 0) {
GRN_LOG(ctx, GRN_LOG_INFO, GRN_LOG(ctx, GRN_LOG_INFO,
"[ii][builder][fin] removed path: <%s>", "[ii][builder][fin] removed path: <%-.256s>",
builder->path); builder->path);
} else { } else {
ERRNO_ERR("[ii][builder][fin] failed to remove path: <%s>", ERRNO_ERR("[ii][builder][fin] failed to remove path: <%-.256s>",
builder->path); builder->path);
} }
} }
@ -11779,10 +11779,10 @@ static grn_rc
grn_ii_builder_create_file(grn_ctx *ctx, grn_ii_builder *builder) grn_ii_builder_create_file(grn_ctx *ctx, grn_ii_builder *builder)
{ {
grn_snprintf(builder->path, PATH_MAX, PATH_MAX, grn_snprintf(builder->path, PATH_MAX, PATH_MAX,
"%sXXXXXX", grn_io_path(builder->ii->seg)); "%-.256sXXXXXX", grn_io_path(builder->ii->seg));
builder->fd = grn_mkstemp(builder->path); builder->fd = grn_mkstemp(builder->path);
if (builder->fd == -1) { if (builder->fd == -1) {
SERR("failed to create a temporary file: path = \"%s\"", SERR("failed to create a temporary file: path = \"%-.256s\"",
builder->path); builder->path);
return ctx->rc; return ctx->rc;
} }

View File

@ -750,7 +750,8 @@ static int test_when_accessed (struct file_info *key,
} }
static int file_info_free(void* arg, TREE_FREE mode, void *unused) static int file_info_free(void* arg, TREE_FREE mode __attribute__((unused)),
void *unused __attribute__((unused)))
{ {
struct file_info *fileinfo= arg; struct file_info *fileinfo= arg;
DBUG_ENTER("file_info_free"); DBUG_ENTER("file_info_free");

View File

@ -266,8 +266,9 @@ int Rdb_key_field_iterator::next() {
bool covered_column = true; bool covered_column = true;
if (m_covered_bitmap != nullptr && if (m_covered_bitmap != nullptr &&
m_field->real_type() == MYSQL_TYPE_VARCHAR && !m_fpi->m_covered) { m_field->real_type() == MYSQL_TYPE_VARCHAR && !m_fpi->m_covered) {
uint tmp= m_curr_bitmap_pos++;
covered_column = m_curr_bitmap_pos < MAX_REF_PARTS && covered_column = m_curr_bitmap_pos < MAX_REF_PARTS &&
bitmap_is_set(m_covered_bitmap, m_curr_bitmap_pos++); bitmap_is_set(m_covered_bitmap, tmp);
} }
if (m_fpi->m_unpack_func && covered_column) { if (m_fpi->m_unpack_func && covered_column) {

View File

@ -219,7 +219,7 @@ static size_t my_case_str_bin(CHARSET_INFO *cs __attribute__((unused)),
static size_t my_case_bin(CHARSET_INFO *cs __attribute__((unused)), static size_t my_case_bin(CHARSET_INFO *cs __attribute__((unused)),
const char *src, size_t srclen, const char *src, size_t srclen,
char *dst, size_t dstlen) char *dst, size_t dstlen __attribute__((unused)))
{ {
DBUG_ASSERT(srclen <= dstlen); DBUG_ASSERT(srclen <= dstlen);
memcpy(dst, src, srclen); memcpy(dst, src, srclen);

View File

@ -237,7 +237,7 @@ size_t my_casedn_str_8bit(CHARSET_INFO * cs,char *str)
size_t my_caseup_8bit(CHARSET_INFO * cs, const char *src, size_t srclen, size_t my_caseup_8bit(CHARSET_INFO * cs, const char *src, size_t srclen,
char *dst, size_t dstlen) char *dst, size_t dstlen __attribute__((unused)))
{ {
const char *end= src + srclen; const char *end= src + srclen;
register const uchar *map= cs->to_upper; register const uchar *map= cs->to_upper;
@ -249,7 +249,7 @@ size_t my_caseup_8bit(CHARSET_INFO * cs, const char *src, size_t srclen,
size_t my_casedn_8bit(CHARSET_INFO * cs, const char *src, size_t srclen, size_t my_casedn_8bit(CHARSET_INFO * cs, const char *src, size_t srclen,
char *dst, size_t dstlen) char *dst, size_t dstlen __attribute__((unused)))
{ {
const char *end= src + srclen; const char *end= src + srclen;
register const uchar *map=cs->to_lower; register const uchar *map=cs->to_lower;

View File

@ -1995,9 +1995,13 @@ err_return:
} }
enum json_types json_get_object_nkey(const char *js,const char *js_end, int nkey, enum json_types json_get_object_nkey(const char *js __attribute__((unused)),
const char **keyname, const char **keyname_end, const char *js_end __attribute__((unused)),
const char **value, int *value_len) int nkey __attribute__((unused)),
const char **keyname __attribute__((unused)),
const char **keyname_end __attribute__((unused)),
const char **value __attribute__((unused)),
int *value_len __attribute__((unused)))
{ {
return JSV_NOTHING; return JSV_NOTHING;
} }

View File

@ -367,7 +367,7 @@ MY_FUNCTION_NAME(strnxfrm)(CHARSET_INFO *cs,
static size_t static size_t
MY_FUNCTION_NAME(strnxfrm_internal)(CHARSET_INFO *cs, MY_FUNCTION_NAME(strnxfrm_internal)(CHARSET_INFO *cs __attribute__((unused)),
uchar *dst, uchar *de, uchar *dst, uchar *de,
uint *nweights, uint *nweights,
const uchar *src, const uchar *se) const uchar *src, const uchar *se)
@ -489,7 +489,7 @@ MY_FUNCTION_NAME(strnxfrm_nopad)(CHARSET_INFO *cs,
static size_t static size_t
MY_FUNCTION_NAME(strnxfrm_internal)(CHARSET_INFO *cs, MY_FUNCTION_NAME(strnxfrm_internal)(CHARSET_INFO *cs __attribute__((unused)),
uchar *dst, uchar *de, uchar *dst, uchar *de,
uint *nweights, uint *nweights,
const uchar *src, const uchar *src,

View File

@ -94,7 +94,7 @@ void test_byte_order()
#undef TEST #undef TEST
} }
int main(int argc, char **argv) int main(int argc __attribute__((unused)), char **argv __attribute__((unused)))
{ {
plan(68); plan(68);
test_byte_order(); test_byte_order();

View File

@ -477,6 +477,7 @@ void FAR *out_desc;
} }
Tracev((stderr, "inflate: codes ok\n")); Tracev((stderr, "inflate: codes ok\n"));
state->mode = LEN; state->mode = LEN;
/* falls through */
case LEN: case LEN:
/* use inflate_fast() if we have enough input and output */ /* use inflate_fast() if we have enough input and output */

View File

@ -740,6 +740,7 @@ int flush;
CRC2(state->check, hold); CRC2(state->check, hold);
INITBITS(); INITBITS();
state->mode = EXLEN; state->mode = EXLEN;
/* falls through */
case EXLEN: case EXLEN:
if (state->flags & 0x0400) { if (state->flags & 0x0400) {
NEEDBITS(16); NEEDBITS(16);
@ -753,6 +754,7 @@ int flush;
else if (state->head != Z_NULL) else if (state->head != Z_NULL)
state->head->extra = Z_NULL; state->head->extra = Z_NULL;
state->mode = EXTRA; state->mode = EXTRA;
/* falls through */
case EXTRA: case EXTRA:
if (state->flags & 0x0400) { if (state->flags & 0x0400) {
copy = state->length; copy = state->length;
@ -775,6 +777,7 @@ int flush;
} }
state->length = 0; state->length = 0;
state->mode = NAME; state->mode = NAME;
/* falls through */
case NAME: case NAME:
if (state->flags & 0x0800) { if (state->flags & 0x0800) {
if (have == 0) goto inf_leave; if (have == 0) goto inf_leave;
@ -796,6 +799,7 @@ int flush;
state->head->name = Z_NULL; state->head->name = Z_NULL;
state->length = 0; state->length = 0;
state->mode = COMMENT; state->mode = COMMENT;
/* falls through */
case COMMENT: case COMMENT:
if (state->flags & 0x1000) { if (state->flags & 0x1000) {
if (have == 0) goto inf_leave; if (have == 0) goto inf_leave;
@ -816,6 +820,7 @@ int flush;
else if (state->head != Z_NULL) else if (state->head != Z_NULL)
state->head->comment = Z_NULL; state->head->comment = Z_NULL;
state->mode = HCRC; state->mode = HCRC;
/* falls through */
case HCRC: case HCRC:
if (state->flags & 0x0200) { if (state->flags & 0x0200) {
NEEDBITS(16); NEEDBITS(16);
@ -839,6 +844,7 @@ int flush;
strm->adler = state->check = ZSWAP32(hold); strm->adler = state->check = ZSWAP32(hold);
INITBITS(); INITBITS();
state->mode = DICT; state->mode = DICT;
/* falls through */
case DICT: case DICT:
if (state->havedict == 0) { if (state->havedict == 0) {
RESTORE(); RESTORE();
@ -846,8 +852,10 @@ int flush;
} }
strm->adler = state->check = adler32(0L, Z_NULL, 0); strm->adler = state->check = adler32(0L, Z_NULL, 0);
state->mode = TYPE; state->mode = TYPE;
/* falls through */
case TYPE: case TYPE:
if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave; if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
/* falls through */
case TYPEDO: case TYPEDO:
if (state->last) { if (state->last) {
BYTEBITS(); BYTEBITS();
@ -898,8 +906,10 @@ int flush;
INITBITS(); INITBITS();
state->mode = COPY_; state->mode = COPY_;
if (flush == Z_TREES) goto inf_leave; if (flush == Z_TREES) goto inf_leave;
/* falls through */
case COPY_: case COPY_:
state->mode = COPY; state->mode = COPY;
/* falls through */
case COPY: case COPY:
copy = state->length; copy = state->length;
if (copy) { if (copy) {
@ -1039,8 +1049,10 @@ int flush;
Tracev((stderr, "inflate: codes ok\n")); Tracev((stderr, "inflate: codes ok\n"));
state->mode = LEN_; state->mode = LEN_;
if (flush == Z_TREES) goto inf_leave; if (flush == Z_TREES) goto inf_leave;
/* falls through */
case LEN_: case LEN_:
state->mode = LEN; state->mode = LEN;
/* falls through */
case LEN: case LEN:
if (have >= 6 && left >= 258) { if (have >= 6 && left >= 258) {
RESTORE(); RESTORE();
@ -1090,6 +1102,7 @@ int flush;
} }
state->extra = (unsigned)(here.op) & 15; state->extra = (unsigned)(here.op) & 15;
state->mode = LENEXT; state->mode = LENEXT;
/* falls through */
case LENEXT: case LENEXT:
if (state->extra) { if (state->extra) {
NEEDBITS(state->extra); NEEDBITS(state->extra);
@ -1100,6 +1113,7 @@ int flush;
Tracevv((stderr, "inflate: length %u\n", state->length)); Tracevv((stderr, "inflate: length %u\n", state->length));
state->was = state->length; state->was = state->length;
state->mode = DIST; state->mode = DIST;
/* falls through */
case DIST: case DIST:
for (;;) { for (;;) {
here = state->distcode[BITS(state->distbits)]; here = state->distcode[BITS(state->distbits)];
@ -1127,6 +1141,7 @@ int flush;
state->offset = (unsigned)here.val; state->offset = (unsigned)here.val;
state->extra = (unsigned)(here.op) & 15; state->extra = (unsigned)(here.op) & 15;
state->mode = DISTEXT; state->mode = DISTEXT;
/* falls through */
case DISTEXT: case DISTEXT:
if (state->extra) { if (state->extra) {
NEEDBITS(state->extra); NEEDBITS(state->extra);
@ -1143,6 +1158,7 @@ int flush;
#endif #endif
Tracevv((stderr, "inflate: distance %u\n", state->offset)); Tracevv((stderr, "inflate: distance %u\n", state->offset));
state->mode = MATCH; state->mode = MATCH;
/* falls through */
case MATCH: case MATCH:
if (left == 0) goto inf_leave; if (left == 0) goto inf_leave;
copy = out - left; copy = out - left;
@ -1218,6 +1234,7 @@ int flush;
} }
#ifdef GUNZIP #ifdef GUNZIP
state->mode = LENGTH; state->mode = LENGTH;
/* falls through */
case LENGTH: case LENGTH:
if (state->wrap && state->flags) { if (state->wrap && state->flags) {
NEEDBITS(32); NEEDBITS(32);
@ -1231,6 +1248,7 @@ int flush;
} }
#endif #endif
state->mode = DONE; state->mode = DONE;
/* falls through */
case DONE: case DONE:
ret = Z_STREAM_END; ret = Z_STREAM_END;
goto inf_leave; goto inf_leave;