aboutsummaryrefslogtreecommitdiffstats
path: root/native/src/defines.h
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2012-02-03 21:24:53 +0900
committerTadashi G. Takaoka <takaoka@google.com>2012-02-06 09:41:41 +0900
commit09baa36f7d1298e54a291b0d486cf366a3c3257c (patch)
treeafb4a50f61d222f522b8a065d33226f2989cc31d /native/src/defines.h
parent9f491e34ac2c96c3d18f30f9710b1a3ecab173e7 (diff)
downloadlatinime-09baa36f7d1298e54a291b0d486cf366a3c3257c.tar.gz
latinime-09baa36f7d1298e54a291b0d486cf366a3c3257c.tar.xz
latinime-09baa36f7d1298e54a291b0d486cf366a3c3257c.zip
Use C++ template for min/max
To be more friendly for off-device regression test. Change-Id: I7edf4c9de73915aad9c1760ace7df3177ed3c4e9
Diffstat (limited to 'native/src/defines.h')
-rw-r--r--native/src/defines.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/native/src/defines.h b/native/src/defines.h
index 02c1fe0a2..9f237c589 100644
--- a/native/src/defines.h
+++ b/native/src/defines.h
@@ -240,8 +240,8 @@ static void prof_out(void) {
#define MIN_USER_TYPED_LENGTH_FOR_MULTIPLE_WORD_SUGGESTION 3
#define MIN_USER_TYPED_LENGTH_FOR_EXCESSIVE_CHARACTER_SUGGESTION 3
-#define min(a,b) ((a)<(b)?(a):(b))
-#define max(a,b) ((a)>(b)?(a):(b))
+template<typename T> inline T min(T a, T b) { return a < b ? a : b; }
+template<typename T> inline T max(T a, T b) { return a > b ? a : b; }
// The ratio of neutral area radius to sweet spot radius.
#define NEUTRAL_AREA_RADIUS_RATIO 1.3f