From 128d46d9adaccfab4bb69963b0715ddf762e1ad8 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Sun, 3 Jul 2011 16:08:36 +1000 Subject: [PATCH] Use explicit sized integer types for sign_types When we used size_t/ssize_t they conflicted with the system's word sized integers. This should work well for all the numeric types we're likely to see. --- types.hpp | 48 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/types.hpp b/types.hpp index 5e5d8c40..2f823aaa 100644 --- a/types.hpp +++ b/types.hpp @@ -58,27 +58,51 @@ template struct sign_types; -template <> struct sign_types { - typedef signed int with_sign; - typedef unsigned int without_sign; +template <> struct sign_types { + typedef int8_t with_sign; + typedef uint8_t without_sign; }; -template <> struct sign_types { - typedef signed int with_sign; - typedef unsigned int without_sign; +template <> struct sign_types { + typedef int8_t with_sign; + typedef uint8_t without_sign; }; -template <> struct sign_types { - typedef ssize_t with_sign; - typedef size_t without_sign; +template <> struct sign_types { + typedef int16_t with_sign; + typedef uint16_t without_sign; }; -template <> struct sign_types { - typedef ssize_t with_sign; - typedef size_t without_sign; +template <> struct sign_types { + typedef int16_t with_sign; + typedef uint16_t without_sign; +}; + + +template <> struct sign_types { + typedef int32_t with_sign; + typedef uint32_t without_sign; +}; + + +template <> struct sign_types { + typedef int32_t with_sign; + typedef uint32_t without_sign; +}; + + +template <> struct sign_types { + typedef signed long with_sign; + typedef unsigned long without_sign; +}; + + +template <> struct sign_types { + typedef signed long with_sign; + typedef unsigned long without_sign; };