From 8aa76727d2066973992727aae1bffe27b5708ac2 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Thu, 19 Jan 2017 10:42:05 +0200 Subject: [PATCH] Remove explicit long indicator of size defines --- include/maxscale/protocol/mysql.h | 8 ++++---- query_classifier/qc_sqlite/qc_sqlite.c | 2 +- server/modules/filter/maxrows/maxrows.c | 2 +- server/modules/routing/binlogrouter/blr_master.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/maxscale/protocol/mysql.h b/include/maxscale/protocol/mysql.h index b8d068c5d..b75ecdf9f 100644 --- a/include/maxscale/protocol/mysql.h +++ b/include/maxscale/protocol/mysql.h @@ -70,10 +70,10 @@ MXS_BEGIN_DECLS #define GW_MYSQL_READ 0 #define GW_MYSQL_WRITE 1 -#define MYSQL_HEADER_LEN 4L -#define MYSQL_CHECKSUM_LEN 4L -#define MYSQL_EOF_PACKET_LEN 9L -#define MYSQL_OK_PACKET_MIN_LEN 11L +#define MYSQL_HEADER_LEN 4 +#define MYSQL_CHECKSUM_LEN 4 +#define MYSQL_EOF_PACKET_LEN 9 +#define MYSQL_OK_PACKET_MIN_LEN 11 /** * Offsets and sizes of various parts of the client packet. If the offset is diff --git a/query_classifier/qc_sqlite/qc_sqlite.c b/query_classifier/qc_sqlite/qc_sqlite.c index c84fa759f..030223c87 100644 --- a/query_classifier/qc_sqlite/qc_sqlite.c +++ b/query_classifier/qc_sqlite/qc_sqlite.c @@ -553,7 +553,7 @@ static bool parse_query(GWBUF* query) } else { - MXS_ERROR("Packet size %ld, provided buffer is %ld.", + MXS_ERROR("Packet size %u, provided buffer is %ld.", MYSQL_HEADER_LEN + MYSQL_GET_PAYLOAD_LEN(data), GWBUF_LENGTH(query)); } diff --git a/server/modules/filter/maxrows/maxrows.c b/server/modules/filter/maxrows/maxrows.c index 1e2fa9d3a..4a63cca2a 100644 --- a/server/modules/filter/maxrows/maxrows.c +++ b/server/modules/filter/maxrows/maxrows.c @@ -778,7 +778,7 @@ static int handle_rows(MAXROWS_SESSION_DATA *csdata) */ if (packetlen < MYSQL_EOF_PACKET_LEN) { - MXS_ERROR("EOF packet has size of %lu instead of %ld", packetlen, MYSQL_EOF_PACKET_LEN); + MXS_ERROR("EOF packet has size of %lu instead of %d", packetlen, MYSQL_EOF_PACKET_LEN); rv = send_ok_upstream(csdata); csdata->state = MAXROWS_EXPECTING_NOTHING; break; diff --git a/server/modules/routing/binlogrouter/blr_master.c b/server/modules/routing/binlogrouter/blr_master.c index 6d832f395..cfa09f5c6 100644 --- a/server/modules/routing/binlogrouter/blr_master.c +++ b/server/modules/routing/binlogrouter/blr_master.c @@ -2310,8 +2310,8 @@ bool blr_send_packet(ROUTER_SLAVE *slave, uint8_t *buf, uint32_t len, bool first } else { - MXS_ERROR("failed to allocate %ld bytes of memory when writing an" - " event.", datalen + MYSQL_HEADER_LEN); + MXS_ERROR("failed to allocate %u bytes of memory when writing an " + "event.", datalen + MYSQL_HEADER_LEN); rval = false; } return rval;