From 2a1608c07549b7df8e80e190302a5871287ec5d4 Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Wed, 17 Sep 2008 15:16:33 -0700 Subject: [PATCH] Configure UL_AND_TIME without warnings The previous patch (commit 8b0ca902a6b323c69b35df5c4f913bc0e169700f) dealing with the possibilities of (unsigned long) and (vvp_time64_t) being either the same or different managed to redefine UL_AND_TIME64_DIFF in the 64-bit case. This does, of course, trigger a compiler warning. That warning is repeated on every .cc file with a #include "config.h", which is to say, just about every file. This patch inverts the sense of the preprocessor conditional, calling it UL_AND_TIME64_SAME. No more warnings! --- vvp/config.h.in | 5 ++--- vvp/vvp_net.cc | 2 +- vvp/vvp_net.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/vvp/config.h.in b/vvp/config.h.in index fe7e0d3b5..0a41bd44f 100644 --- a/vvp/config.h.in +++ b/vvp/config.h.in @@ -65,14 +65,13 @@ # include #endif -# define UL_AND_TIME64_DIFF 1 #if SIZEOF_UNSIGNED >= 8 typedef unsigned vvp_time64_t; # define TIME_FMT "" #else # if SIZEOF_UNSIGNED_LONG >= 8 typedef unsigned long vvp_time64_t; -# define UL_AND_TIME64_DIFF 0 +# define UL_AND_TIME64_SAME # define TIME_FMT "l" # else # if SIZEOF_UNSIGNED_LONG_LONG > SIZEOF_UNSIGNED_LONG @@ -80,7 +79,7 @@ typedef unsigned long long vvp_time64_t; # define TIME_FMT "ll" # else typedef unsigned long vvp_time64_t; -# define UL_AND_TIME64_DIFF 0 +# define UL_AND_TIME64_SAME # define TIME_FMT "l" # endif # endif diff --git a/vvp/vvp_net.cc b/vvp/vvp_net.cc index 18dc3bd8f..1a8ab4c86 100644 --- a/vvp/vvp_net.cc +++ b/vvp/vvp_net.cc @@ -1209,7 +1209,7 @@ bool vector4_to_value(const vvp_vector4_t&vec, unsigned long&val) return true; } -#if UL_AND_TIME64_DIFF +#ifndef UL_AND_TIME64_SAME bool vector4_to_value(const vvp_vector4_t&vec, vvp_time64_t&val) { vvp_time64_t res = 0; diff --git a/vvp/vvp_net.h b/vvp/vvp_net.h index 622af0d4c..97070e65e 100644 --- a/vvp/vvp_net.h +++ b/vvp/vvp_net.h @@ -394,7 +394,7 @@ template extern T coerce_to_width(const T&that, unsigned width); */ extern bool vector4_to_value(const vvp_vector4_t&a, long&val, bool is_signed, bool is_arithmetic =true); extern bool vector4_to_value(const vvp_vector4_t&a, unsigned long&val); -#if UL_AND_TIME64_DIFF +#ifndef UL_AND_TIME64_SAME extern bool vector4_to_value(const vvp_vector4_t&a, vvp_time64_t&val); #endif extern bool vector4_to_value(const vvp_vector4_t&a, double&val, bool is_signed);