Configure UL_AND_TIME without warnings

The previous patch (commit 8b0ca902a6)
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!
This commit is contained in:
Larry Doolittle 2008-09-17 15:16:33 -07:00 committed by Stephen Williams
parent 411ee517ee
commit 2a1608c075
3 changed files with 4 additions and 5 deletions

View File

@ -65,14 +65,13 @@
# include <inttypes.h>
#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

View File

@ -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;

View File

@ -394,7 +394,7 @@ template <class T> 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);