[ldns-users] b64_ntop() / b64_pton() nit

Dag-Erling Smørgrav des at des.no
Wed Apr 10 09:10:56 UTC 2013


Willem Toorop <willem at nlnetlabs.nl> writes:
> ldns uses its own ldns_b(32|64)_(pton|ntop) always, regardless the
> availability of b(32|64)_(pton|ntop). I'll prepare a correction...

Waitasec, I have more.

b64* and b32* are treated differently.  The former are handled directly
in configure.ac -> config.h, while the latter are handled in util.h.  In
addition, the code is always compiled, regardless of whether it will be
used.

The attached patch

 - moves the b64* prototypes from configure.ac to util.h.in

 - staticizes the *_ar() functions, which are only used internally

 - makes everything in b{32,64}_{ntop,pton}.c except the inclusion of
   config.h conditional on HAVE_B{32,64}_{NTOP,PTON}.

I would also suggest either removing the assertions in these four files,
or replacing the homegrown Assert() macro with the standard assert(),
which can be disabled by defining NDEBUG.

DES
-- 
Dag-Erling Smørgrav - des at des.no

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldns-ntop-pton.diff
Type: text/x-patch
Size: 5914 bytes
Desc: not available
URL: <http://lists.nlnetlabs.nl/pipermail/ldns-users/attachments/20130410/2ccc0940/attachment.bin>


More information about the ldns-users mailing list