From d107a4ce48207fbf1110061cd7c2ee4d7d90cbe6 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Wed, 16 Dec 2009 09:32:58 +0100 Subject: [PATCH] WL#5151: Conversion between different types when replicating Fixes to get it to compile on MacOSX. --- sql/field.cc | 9 +++++---- sql/rpl_utility.cc | 20 +++++++++----------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 477cdc0a993..1fa4b698e72 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -999,18 +999,19 @@ test_if_important_data(CHARSET_INFO *cs, const char *str, const char *strend) /** - Template function to compare two objects. + Function to compare two unsigned integers for their relative order. + Used below. In an anonymous namespace to not clash with definitions + in other files. */ namespace { - template - int compare(A_type a, B_type b) + int compare(unsigned int a, unsigned int b) { if (a < b) return -1; if (b < a) return 1; return 0; - } +} } /** diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 6d30a8bc99f..3a69c71b34c 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -19,18 +19,16 @@ #include "rpl_rli.h" /** - Template function to compare two objects. + Function to compare two size_t integers for their relative + order. Used below. */ -namespace { - template - int compare(Type a, Type b) - { - if (a < b) - return -1; - if (b < a) - return 1; - return 0; - } +int compare(size_t a, size_t b) +{ + if (a < b) + return -1; + if (b < a) + return 1; + return 0; }