2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Replace custom isc_boolean_t with C standard bool type

This commit is contained in:
Ondřej Surý
2018-04-17 08:29:14 -07:00
parent cb6a185c69
commit 994e656977
546 changed files with 10785 additions and 10367 deletions

View File

@@ -16,6 +16,7 @@
#include <ctype.h>
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <inttypes.h>
#include <stdlib.h>
@@ -43,8 +44,8 @@ static isc_result_t bind_ttl(isc_textregion_t *source, uint32_t *ttl);
* Helper for dns_ttl_totext().
*/
static isc_result_t
ttlfmt(unsigned int t, const char *s, isc_boolean_t verbose,
isc_boolean_t space, isc_buffer_t *target)
ttlfmt(unsigned int t, const char *s, bool verbose,
bool space, isc_buffer_t *target)
{
char tmp[60];
unsigned int len;
@@ -72,8 +73,8 @@ ttlfmt(unsigned int t, const char *s, isc_boolean_t verbose,
* Derived from bind8 ns_format_ttl().
*/
isc_result_t
dns_ttl_totext(uint32_t src, isc_boolean_t verbose,
isc_boolean_t upcase, isc_buffer_t *target)
dns_ttl_totext(uint32_t src, bool verbose,
bool upcase, isc_buffer_t *target)
{
unsigned secs, mins, hours, days, weeks, x;
@@ -86,24 +87,24 @@ dns_ttl_totext(uint32_t src, isc_boolean_t verbose,
x = 0;
if (weeks != 0) {
RETERR(ttlfmt(weeks, "week", verbose, ISC_TF(x > 0), target));
RETERR(ttlfmt(weeks, "week", verbose, (x > 0), target));
x++;
}
if (days != 0) {
RETERR(ttlfmt(days, "day", verbose, ISC_TF(x > 0), target));
RETERR(ttlfmt(days, "day", verbose, (x > 0), target));
x++;
}
if (hours != 0) {
RETERR(ttlfmt(hours, "hour", verbose, ISC_TF(x > 0), target));
RETERR(ttlfmt(hours, "hour", verbose, (x > 0), target));
x++;
}
if (mins != 0) {
RETERR(ttlfmt(mins, "minute", verbose, ISC_TF(x > 0), target));
RETERR(ttlfmt(mins, "minute", verbose, (x > 0), target));
x++;
}
if (secs != 0 ||
(weeks == 0 && days == 0 && hours == 0 && mins == 0)) {
RETERR(ttlfmt(secs, "second", verbose, ISC_TF(x > 0), target));
RETERR(ttlfmt(secs, "second", verbose, (x > 0), target));
x++;
}
INSIST (x > 0);