Fix for compiler warnings
This commit is contained in:
@ -28,6 +28,7 @@
|
|||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
#include <buffer.h>
|
#include <buffer.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a GWBUF structure is a MySQL COM_QUERY packet
|
* Check if a GWBUF structure is a MySQL COM_QUERY packet
|
||||||
@ -75,6 +76,7 @@ char *ptr;
|
|||||||
ptr += 2; // Skip sequence id and COM_QUERY byte
|
ptr += 2; // Skip sequence id and COM_QUERY byte
|
||||||
*length = *length - 1;
|
*length = *length - 1;
|
||||||
*sql = ptr;
|
*sql = ptr;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -86,7 +88,7 @@ int length, newlength;
|
|||||||
GWBUF *addition;
|
GWBUF *addition;
|
||||||
|
|
||||||
if (!modutil_is_SQL(orig))
|
if (!modutil_is_SQL(orig))
|
||||||
return 0;
|
return NULL;
|
||||||
ptr = GWBUF_DATA(orig);
|
ptr = GWBUF_DATA(orig);
|
||||||
length = *ptr++;
|
length = *ptr++;
|
||||||
length += (*ptr++ << 8);
|
length += (*ptr++ << 8);
|
||||||
|
@ -259,7 +259,7 @@ struct timeval tv;
|
|||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
localtime_r(&tv.tv_sec, &t);
|
localtime_r(&tv.tv_sec, &t);
|
||||||
sprintf(t_buf, "%02d:%02d:%02d.%-3d %d/%02d/%d, ",
|
sprintf(t_buf, "%02d:%02d:%02d.%-3d %d/%02d/%d, ",
|
||||||
t.tm_hour, t.tm_min, t.tm_sec, tv.tv_usec / 1000,
|
t.tm_hour, t.tm_min, t.tm_sec, (int)(tv.tv_usec / 1000),
|
||||||
t.tm_mday, t.tm_mon + 1, 1900 + t.tm_year);
|
t.tm_mday, t.tm_mon + 1, 1900 + t.tm_year);
|
||||||
write(my_session->fd, t_buf, strlen(t_buf));
|
write(my_session->fd, t_buf, strlen(t_buf));
|
||||||
write(my_session->fd, ptr, length);
|
write(my_session->fd, ptr, length);
|
||||||
@ -285,7 +285,6 @@ struct timeval tv;
|
|||||||
static void
|
static void
|
||||||
diagnostic(FILTER *instance, void *fsession, DCB *dcb)
|
diagnostic(FILTER *instance, void *fsession, DCB *dcb)
|
||||||
{
|
{
|
||||||
QLA_INSTANCE *my_instance = (QLA_INSTANCE *)instance;
|
|
||||||
QLA_SESSION *my_session = (QLA_SESSION *)fsession;
|
QLA_SESSION *my_session = (QLA_SESSION *)fsession;
|
||||||
|
|
||||||
if (my_session)
|
if (my_session)
|
||||||
|
@ -164,7 +164,6 @@ int i;
|
|||||||
static void *
|
static void *
|
||||||
newSession(FILTER *instance, SESSION *session)
|
newSession(FILTER *instance, SESSION *session)
|
||||||
{
|
{
|
||||||
REGEX_INSTANCE *my_instance = (REGEX_INSTANCE *)instance;
|
|
||||||
REGEX_SESSION *my_session;
|
REGEX_SESSION *my_session;
|
||||||
|
|
||||||
if ((my_session = calloc(1, sizeof(REGEX_SESSION))) != NULL)
|
if ((my_session = calloc(1, sizeof(REGEX_SESSION))) != NULL)
|
||||||
|
Reference in New Issue
Block a user