[Dar-libdar_api] Re: [Dar-discussions] Re: problem testing infinint value
For full, incremental, compressed and encrypted backups or archives
Brought to you by:
edrusb
|
From: Denis C. <dar...@fr...> - 2004-06-25 20:29:30
|
Johnathan Burchill wrote:
> On June 24, 2004 01:36 pm, Denis Corbin wrote:
>
>
[...]
>
> Ah! The missing code was
>
> #ifdef HAVE_CONFIG_H
> #include <config.h>
> #endif
>
> And it has to be at the beginning of the .cpp files.
> Thanks for the suggestion!
Do you mean
#include <dar/config.h>
?
>
> [...]
>
>
>>for what it seems, the constant '1' in the expression, is cast as "long"
>>before being given to the limitint constructor. This is wrong because
>>there limitint is *unsigned* and cannot be built from *signed* integers.
>
>
> [...]
>
>>To fix the problem, I suggest an explicit cast:
>>
>> if (st.errored == libdar::infinint((U_I)1) plural = " ";
>>
>>U_I is a libdar macro, system independent, matching an unsigned integer.
>>(see "libdar/integers.hpp"), but if you prefer you can safely replace it
>>by "unsigned int".
>
>
> Signed long integers I can pass to the infinint constructor, and it work
> okay. They must get cast implicitly by the library.
yes, probably.
>
> [...]
>
>
>>Cheers,
>>Denis.
>>
>>P.S.: it should be more appropriate to post to lidar-api mailing-list
>>rather than to this general discussion mailing-list for such problems.
>>Thanks.
>
>
> No problem --- I should have considered this in the first place.
No problem ;-)
>
> [...]
>
> Cheers,
> JB
>
Cheers,
Denis.
|