Nits for 1.5.10

W.C.A. Wijngaards wouter at nlnetlabs.nl
Fri Sep 30 09:39:24 UTC 2016


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Dag-Erling,

Thank you for the fixes, I have applied the patch(es).  Those casts
are usually made after other tools complain about it, but they look
better this way.

Best regards, Wouter

On 29/09/16 20:36, Dag-Erling Smørgrav via Unbound-users wrote:
> The following are changes I had to make to integrate 1.5.10 into
> FreeBSD head, rebased to unbound trunk.
> 
> 1) lz_type() must either have a prototype or be declared static.
> Since it isn't used outside its compilation unit, I chose the
> latter.
> 
> Index: services/localzone.c 
> ===================================================================
>
> 
- --- services/localzone.c	(revision 3874)
> +++ services/localzone.c	(working copy) @@ -1411,7 +1411,7 @@ 
> log_nametypeclass(0, txt, qinfo->qname, qinfo->qtype,
> qinfo->qclass); }
> 
> -enum localzone_type +static enum localzone_type lz_type(uint8_t
> *taglist, size_t taglen, uint8_t *taglist2, size_t taglen2, uint8_t
> *tagactions, size_t tagactionssize, enum localzone_type lzt, struct
> comm_reply* repinfo, struct rbtree_t* override_tree, int* tag,
> 
> 2) Unnecessary casts, some of which discard qualifiers and
> therefore break the build at higher warning levels.  Note that
> needlessly discarding a const qualifier can prevent certain
> optimizations.
> 
> Index: smallapp/unbound-anchor.c 
> ===================================================================
>
> 
- --- smallapp/unbound-anchor.c	(revision 3874)
> +++ smallapp/unbound-anchor.c	(working copy) @@ -420,7 +420,7 @@ { 
> const char* builtin_cert = get_builtin_cert(); STACK_OF(X509)* sk; 
> -	BIO *bio = BIO_new_mem_buf((void*)builtin_cert, +	BIO *bio =
> BIO_new_mem_buf(builtin_cert, (int)strlen(builtin_cert)); if(!bio)
> { if(verb) printf("out of memory\n"); Index: smallapp/worker_cb.c 
> ===================================================================
>
> 
- --- smallapp/worker_cb.c	(revision 3874)
> +++ smallapp/worker_cb.c	(working copy) @@ -225,8 +225,8 @@
> 
> int order_lock_cmp(const void* e1, const void* e2) { -
> struct order_id* o1 = (struct order_id*)e1; -        struct
> order_id* o2 = (struct order_id*)e2; +        const struct
> order_id* o1 = e1; +        const struct order_id* o2 = e2; 
> if(o1->thr < o2->thr) return -1; if(o1->thr > o2->thr) return 1; 
> if(o1->instance < o2->instance) return -1; @@ -237,7 +237,7 @@ int 
> codeline_cmp(const void* a, const void* b) { -        return
> strcmp((const char*)a, (const char*)b); +        return strcmp(a,
> b); }
> 
> int replay_var_compare(const void* ATTR_UNUSED(a), const void*
> ATTR_UNUSED(b))
> 
> DES
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJX7jLHAAoJEJ9vHC1+BF+N0/cP/AruQkmJ5z9KEGRnsRRTBxYx
dks0WO/YtPeTVBxEg6pCbldHQsekJFnSu3/RJEG3jibni0lJt1lg5AD/xJwNzwXS
9rlAaGbHNKcfvDXNmH1dqI8Qn2VRjhO+1dZfh8Lp07hgwPlaEYZxyCMa0MMjupmG
wDTgnIyOrcTi3Morv3JDGbkCP2Kn9bt4DWqQK3ieeCzHEd+uhOt3KIlrfgKNRRii
nRiAHVqODgeVBj0jEAgKzAa4EqnMwiGAio7fUCYB6JMDC9Uw6PmoM5aOZMN+IFfq
mZZ1cd8FuF+dahLnC82L0qgNsNYgQmm5v2UNygTBPKn1TkwvKZib9pz/b9+/UCFs
4Q46tMW3Ec5T/0FLtqDPdUDIaJtWGl0uGcBm2XD43QXQwlpDA3KuVj66nn9mFMiK
7Mfjgp7ktPS6sHuzReLdVWGvgBkkMBibZ4RCHhoi/2xd8GikTNorOb30ib7o5Atx
ErJ/nFZvk1pvzZCUDN5P4/hISvBv86DSnMgBBwJzVeeWAZqbryQhIB5MUhaNOBIr
H9omMi0P2f4GeIpJ2Yp5Zsf+dHNWGqBfpij7SImb6aBJgdbxng/9MxXT98nobnUu
5097MaLsutzjb/OV2kn5xdtwALvNvD+ZAw3JOYaAsAnfoU9gA0hmyF5nzJk1XNmR
Gcy+Cd6vSLp3dH5QR9P/
=Q6R2
-----END PGP SIGNATURE-----



More information about the Unbound-users mailing list