xref: /openbsd-src/usr.bin/dig/lib/isc/serial.c (revision 1fb015a8af3a7e9b85db2510147a155826ef04d9)
15185a700Sflorian /*
25185a700Sflorian  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
35185a700Sflorian  *
45185a700Sflorian  * Permission to use, copy, modify, and/or distribute this software for any
55185a700Sflorian  * purpose with or without fee is hereby granted, provided that the above
65185a700Sflorian  * copyright notice and this permission notice appear in all copies.
75185a700Sflorian  *
85185a700Sflorian  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
95185a700Sflorian  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
105185a700Sflorian  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
115185a700Sflorian  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
125185a700Sflorian  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
135185a700Sflorian  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
145185a700Sflorian  * PERFORMANCE OF THIS SOFTWARE.
155185a700Sflorian  */
165185a700Sflorian 
17*1fb015a8Sflorian /* $Id: serial.c,v 1.4 2020/09/14 08:40:44 florian Exp $ */
185185a700Sflorian 
195185a700Sflorian /*! \file */
205185a700Sflorian 
215185a700Sflorian #include <isc/serial.h>
225185a700Sflorian 
23*1fb015a8Sflorian int
isc_serial_gt(uint32_t a,uint32_t b)245185a700Sflorian isc_serial_gt(uint32_t a, uint32_t b) {
25*1fb015a8Sflorian 	return (((int32_t)(a - b) > 0) ? 1 : 0);
265185a700Sflorian }
275185a700Sflorian 
28*1fb015a8Sflorian int
isc_serial_ge(uint32_t a,uint32_t b)295185a700Sflorian isc_serial_ge(uint32_t a, uint32_t b) {
30*1fb015a8Sflorian 	return ((a == b) ? 1 : isc_serial_gt(a, b));
315185a700Sflorian }
32