chiark / gitweb /
util.h etc.: Provide MAX_RAW and MIN_RAW; etc.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 3 Oct 2014 19:22:18 +0000 (20:22 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 8 Oct 2014 17:25:19 +0000 (18:25 +0100)
commit4b069e8acec2f685b59fbfeee10da9e882145943
tree99d33ae3c973f030c88dd0226f8b4edaf6e41837
parentbb97cc9dc940ae223385dd10c417ac33c2f92614
util.h etc.: Provide MAX_RAW and MIN_RAW; etc.

MAX and MIN are unsuitable for use where a constant expression is
required.  Provide MAX_RAW and MIN_RAW which are suitable but might
evaluate the left argument twice.

Remove max() in ipaddr.c and replace the call with one to MAX (not
MAX_RAW.  (The old max macro there is operator-priority-unsafe but
there is only one call site and it happens to be OK.)

We ae going to use MAX_RAW later.

No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
ipaddr.c
util.h