[bind10-dev] IntElement type
Danny Mayer
mayer at pdmconsulting.net
Tue Jul 2 03:29:16 UTC 2013
On 7/1/2013 4:16 AM, fujiwara at jprs.co.jp wrote:
> C++ Element interface offers create(value), getValue(&variable),
> setValue(value) for integer, double, boolean, string, vector, map
> values.
>
> integer values or variables have many different types:
> (unsigned | signed) (char | short | int | long | long long)
> (uint | int ) (8 | 16 | 32 | 64) t
>
> We decided to change the type of IntElement from long int to int64_t.
>
> getValue(&integer_variable) method requires integer variable which
> type is same as intElement.
>
> Due to C++ overloading problem, mixing int64_t and native types (long
> long int, long int) does not work well.
>
> There are two choices.
>
> 1. Suppose "long long int" is 64bit signed integer.
> Change the type of IntElement from long int to long long int.
> Prepare create(long int) and create(int).
>
> 2. Change the type of IntElement from long int to int64_t.
> Add static cast to int64_t where compile errors occur.
>
> Which do you like better, "long long int" and "int64_t" ?
>
Personally I find the int64_t provides an exact definition of the size
of the datatype. long int, long long, etc. aren't very clear. On
different compilers I have found the long has different meanings.
Danny
> --
> Kazunori Fujiwara, JPRS <fujiwara at jprs.co.jp>
> _______________________________________________
> bind10-dev mailing list
> bind10-dev at lists.isc.org
> https://lists.isc.org/mailman/listinfo/bind10-dev
>
>
More information about the bind10-dev
mailing list