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>
Tue, 21 Oct 2014 00:07:09 +0000 (01:07 +0100)
commitc9c047dcc6d21b98144fb15f654e4d8f4f10f2de
tree99d33ae3c973f030c88dd0226f8b4edaf6e41837
parent56c8ed69eff8342f692c427ce3d2cab6fd557001
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