From bd8343dd2726e4bb66acdf0908fcf9abe5298062 Mon Sep 17 00:00:00 2001 From: Sunny Bains Date: Wed, 20 Oct 2010 14:39:31 +1100 Subject: [PATCH] Bug #57588 - Compiler warning in InnoDB due to comparison between signed and unsigned For DATA_MBMINLEN(), cast the result of UNIV_EXPECT to ulint because in GCC it returns a long causing unsigned/signed comparison warnings. Approved by Jimmy Yang on IM. --- storage/innobase/include/data0type.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/storage/innobase/include/data0type.h b/storage/innobase/include/data0type.h index 850cf2e2975..f0be5ace306 100644 --- a/storage/innobase/include/data0type.h +++ b/storage/innobase/include/data0type.h @@ -174,8 +174,11 @@ store the charset-collation number; one byte is left unused, though */ /* Pack mbminlen, mbmaxlen to mbminmaxlen. */ #define DATA_MBMINMAXLEN(mbminlen, mbmaxlen) \ ((mbmaxlen) * DATA_MBMAX + (mbminlen)) -/* Get mbminlen from mbminmaxlen. */ -#define DATA_MBMINLEN(mbminmaxlen) UNIV_EXPECT(((mbminmaxlen) % DATA_MBMAX), 1) +/* Get mbminlen from mbminmaxlen. Cast the result of UNIV_EXPECT to ulint +because in GCC it returns a long. */ +#define DATA_MBMINLEN(mbminmaxlen) ((ulint) \ + UNIV_EXPECT(((mbminmaxlen) % DATA_MBMAX), \ + 1)) /* Get mbmaxlen from mbminmaxlen. */ #define DATA_MBMAXLEN(mbminmaxlen) ((mbminmaxlen) / DATA_MBMAX)