2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 16:15:27 +00:00

Megacommit of many files.

Mostly, several functions that take pointers as arguments, almost
always char * pointers, had those pointers qualified with "const".
Those that returned pointers to previously const-qualified arguments
had their return values qualified as const.  Some structure members
were qualified as const to retain that attribute from the variables
from which they were assigned.

Minor other ISC style cleanups.
This commit is contained in:
David Lawrence
2000-06-01 19:14:59 +00:00
parent 50bd180f4b
commit b8f0fedbe7
2 changed files with 40 additions and 30 deletions

View File

@@ -53,8 +53,8 @@
typedef void (*PFV)(void); typedef void (*PFV)(void);
typedef struct { typedef struct {
PFV pfv; PFV pfv;
char *func_name; const char *func_name;
} testspec_t; } testspec_t;
extern int T_debug; extern int T_debug;
@@ -78,14 +78,14 @@ t_fgetbs(FILE *fp);
isc_result_t isc_result_t
t_dns_result_fromtext(char *result); t_dns_result_fromtext(char *result);
int unsigned int
t_dc_method_fromtext(char *dc_method); t_dc_method_fromtext(char *dc_method);
int int
t_bustline(char *line, char **toks); t_bustline(char *line, char **toks);
int int
t_eval(char *filename, int (*func)(char **), int nargs); t_eval(const char *filename, int (*func)(char **), int nargs);
#endif /* TESTS_T_API_H */ #endif /* TESTS_T_API_H */

View File

@@ -38,7 +38,8 @@
#include "include/tests/t_api.h" #include "include/tests/t_api.h"
static char *Usage = "\t-a : run all tests\n" static const char *Usage =
"\t-a : run all tests\n"
"\t-b <dir> : chdir to dir before running tests" "\t-b <dir> : chdir to dir before running tests"
"\t-c <config_file> : use specified config file\n" "\t-c <config_file> : use specified config file\n"
"\t-d <debug_level> : set debug level to debug_level\n" "\t-d <debug_level> : set debug level to debug_level\n"
@@ -69,21 +70,32 @@ static char *Usage = "\t-a : run all tests\n"
#define T_TCTOUT 60 #define T_TCTOUT 60
int T_debug; int T_debug;
int T_timeout; int T_timeout;
pid_t T_pid; pid_t T_pid;
static char *T_config; static const char * T_config;
static char T_tvec[T_MAXTESTS / 8]; static char T_tvec[T_MAXTESTS / 8];
static char *T_env[T_MAXENV + 1]; static char * T_env[T_MAXENV + 1];
static char T_buf[T_BIGBUF]; static char T_buf[T_BIGBUF];
static char *T_dir; static char * T_dir;
static int t_initconf(char *path); static int
static int t_dumpconf(char *path); t_initconf(const char *path);
static int t_putinfo(const char *key, const char *info);
static char *t_getdate(char *buf, size_t buflen); static int
static void printhelp(void); t_dumpconf(const char *path);
static void printusage(void);
static int
t_putinfo(const char *key, const char *info);
static char *
t_getdate(char *buf, size_t buflen);
static void
printhelp(void);
static void
printusage(void);
static int T_int; static int T_int;
@@ -358,7 +370,7 @@ t_info(const char *format, ...) {
void void
t_result(int result) { t_result(int result) {
char *p; const char *p;
switch (result) { switch (result) {
case T_PASS: case T_PASS:
@@ -417,7 +429,7 @@ t_getenv(const char *name) {
*/ */
static int static int
t_initconf(char *path) { t_initconf(const char *path) {
int n; int n;
int rval; int rval;
@@ -457,7 +469,7 @@ t_initconf(char *path) {
*/ */
static int static int
t_dumpconf(char *path) { t_dumpconf(const char *path) {
int rval; int rval;
char **p; char **p;
FILE *fp; FILE *fp;
@@ -563,7 +575,7 @@ t_getdate(char *buf, size_t buflen) {
*/ */
struct dns_errormap { struct dns_errormap {
isc_result_t result; isc_result_t result;
char *text; const char *text;
} dns_errormap[] = { } dns_errormap[] = {
{ ISC_R_SUCCESS, "ISC_R_SUCCESS" }, { ISC_R_SUCCESS, "ISC_R_SUCCESS" },
{ ISC_R_EXISTS, "ISC_R_EXISTS" }, { ISC_R_EXISTS, "ISC_R_EXISTS" },
@@ -631,8 +643,8 @@ t_dns_result_fromtext(char *name) {
} }
struct dc_method_map { struct dc_method_map {
int dc_method; unsigned int dc_method;
char *text; const char *text;
} dc_method_map[] = { } dc_method_map[] = {
{ DNS_COMPRESS_NONE, "DNS_COMPRESS_NONE" }, { DNS_COMPRESS_NONE, "DNS_COMPRESS_NONE" },
@@ -643,10 +655,9 @@ struct dc_method_map {
{ 0, NULL } { 0, NULL }
}; };
int unsigned int
t_dc_method_fromtext(char *name) { t_dc_method_fromtext(char *name) {
unsigned int dc_method;
int dc_method;
struct dc_method_map *pmap; struct dc_method_map *pmap;
dc_method = DNS_COMPRESS_NONE; dc_method = DNS_COMPRESS_NONE;
@@ -666,7 +677,6 @@ t_dc_method_fromtext(char *name) {
int int
t_bustline(char *line, char **toks) { t_bustline(char *line, char **toks) {
int cnt; int cnt;
char *p; char *p;
@@ -703,7 +713,7 @@ printusage(void) {
} }
int int
t_eval(char *filename, int (*func)(char **), int nargs) { t_eval(const char *filename, int (*func)(char **), int nargs) {
FILE *fp; FILE *fp;
char *p; char *p;
int line; int line;