mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Replace custom isc_u?intNN_t types with C99 u?intNN_t types
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/json.h>
|
||||
#include <isc/mem.h>
|
||||
@@ -1365,12 +1366,12 @@ cache_dumparg {
|
||||
void *arg; /* type dependent argument */
|
||||
int ncounters; /* for general statistics */
|
||||
int *counterindices; /* for general statistics */
|
||||
isc_uint64_t *countervalues; /* for general statistics */
|
||||
uint64_t *countervalues; /* for general statistics */
|
||||
isc_result_t result;
|
||||
} cache_dumparg_t;
|
||||
|
||||
static void
|
||||
getcounter(isc_statscounter_t counter, isc_uint64_t val, void *arg) {
|
||||
getcounter(isc_statscounter_t counter, uint64_t val, void *arg) {
|
||||
cache_dumparg_t *dumparg = arg;
|
||||
|
||||
REQUIRE(counter < dumparg->ncounters);
|
||||
@@ -1379,7 +1380,7 @@ getcounter(isc_statscounter_t counter, isc_uint64_t val, void *arg) {
|
||||
|
||||
static void
|
||||
getcounters(isc_stats_t *stats, isc_statsformat_t type, int ncounters,
|
||||
int *indices, isc_uint64_t *values)
|
||||
int *indices, uint64_t *values)
|
||||
{
|
||||
cache_dumparg_t dumparg;
|
||||
|
||||
@@ -1396,7 +1397,7 @@ getcounters(isc_stats_t *stats, isc_statsformat_t type, int ncounters,
|
||||
void
|
||||
dns_cache_dumpstats(dns_cache_t *cache, FILE *fp) {
|
||||
int indices[dns_cachestatscounter_max];
|
||||
isc_uint64_t values[dns_cachestatscounter_max];
|
||||
uint64_t values[dns_cachestatscounter_max];
|
||||
|
||||
REQUIRE(VALID_CACHE(cache));
|
||||
|
||||
@@ -1424,34 +1425,34 @@ dns_cache_dumpstats(dns_cache_t *cache, FILE *fp) {
|
||||
fprintf(fp, "%20u %s\n", dns_db_nodecount(cache->db),
|
||||
"cache database nodes");
|
||||
fprintf(fp, "%20" PRIu64 " %s\n",
|
||||
(isc_uint64_t) dns_db_hashsize(cache->db),
|
||||
(uint64_t) dns_db_hashsize(cache->db),
|
||||
"cache database hash buckets");
|
||||
|
||||
fprintf(fp, "%20" PRIu64 " %s\n",
|
||||
(isc_uint64_t) isc_mem_total(cache->mctx),
|
||||
(uint64_t) isc_mem_total(cache->mctx),
|
||||
"cache tree memory total");
|
||||
fprintf(fp, "%20" PRIu64 " %s\n",
|
||||
(isc_uint64_t) isc_mem_inuse(cache->mctx),
|
||||
(uint64_t) isc_mem_inuse(cache->mctx),
|
||||
"cache tree memory in use");
|
||||
fprintf(fp, "%20" PRIu64 " %s\n",
|
||||
(isc_uint64_t) isc_mem_maxinuse(cache->mctx),
|
||||
(uint64_t) isc_mem_maxinuse(cache->mctx),
|
||||
"cache tree highest memory in use");
|
||||
|
||||
fprintf(fp, "%20" PRIu64 " %s\n",
|
||||
(isc_uint64_t) isc_mem_total(cache->hmctx),
|
||||
(uint64_t) isc_mem_total(cache->hmctx),
|
||||
"cache heap memory total");
|
||||
fprintf(fp, "%20" PRIu64 " %s\n",
|
||||
(isc_uint64_t) isc_mem_inuse(cache->hmctx),
|
||||
(uint64_t) isc_mem_inuse(cache->hmctx),
|
||||
"cache heap memory in use");
|
||||
fprintf(fp, "%20" PRIu64 " %s\n",
|
||||
(isc_uint64_t) isc_mem_maxinuse(cache->hmctx),
|
||||
(uint64_t) isc_mem_maxinuse(cache->hmctx),
|
||||
"cache heap highest memory in use");
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBXML2
|
||||
#define TRY0(a) do { xmlrc = (a); if (xmlrc < 0) goto error; } while(0)
|
||||
static int
|
||||
renderstat(const char *name, isc_uint64_t value, xmlTextWriterPtr writer) {
|
||||
renderstat(const char *name, uint64_t value, xmlTextWriterPtr writer) {
|
||||
int xmlrc;
|
||||
|
||||
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counter"));
|
||||
@@ -1469,7 +1470,7 @@ error:
|
||||
int
|
||||
dns_cache_renderxml(dns_cache_t *cache, xmlTextWriterPtr writer) {
|
||||
int indices[dns_cachestatscounter_max];
|
||||
isc_uint64_t values[dns_cachestatscounter_max];
|
||||
uint64_t values[dns_cachestatscounter_max];
|
||||
int xmlrc;
|
||||
|
||||
REQUIRE(VALID_CACHE(cache));
|
||||
@@ -1516,7 +1517,7 @@ isc_result_t
|
||||
dns_cache_renderjson(dns_cache_t *cache, json_object *cstats) {
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
int indices[dns_cachestatscounter_max];
|
||||
isc_uint64_t values[dns_cachestatscounter_max];
|
||||
uint64_t values[dns_cachestatscounter_max];
|
||||
json_object *obj;
|
||||
|
||||
REQUIRE(VALID_CACHE(cache));
|
||||
|
Reference in New Issue
Block a user