Re: [Dar-discussions] Re: problem testing infinint value

Denis Corbin <[email protected]> Fri, 25 Jun 2004 22:31:28 +0200
Newsgroups gmane.comp.sysutils.backup.dar.libdar
Organization none
Message-ID <[email protected]>
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.



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com