Mark some functions as __printflike() and/or taking const char * arguments
instead of char *. MFC after: 2 weeks
This commit is contained in:
parent
0e618921c1
commit
110fc843a0
@ -64,7 +64,7 @@ enum S { COMMAND, COMPARE, GET, PUT, REMOVE, SEQ, SEQFLAG, KEY, DATA };
|
||||
void compare __P((DBT *, DBT *));
|
||||
DBTYPE dbtype __P((char *));
|
||||
void dump __P((DB *, int));
|
||||
void err __P((const char *, ...));
|
||||
void err __P((const char *, ...)) __printflike(1, 2);
|
||||
void get __P((DB *, DBT *));
|
||||
void getdata __P((DB *, DBT *, DBT *));
|
||||
void put __P((DB *, DBT *, DBT *));
|
||||
|
@ -98,6 +98,10 @@ static u_char host_addr[16]; /* IPv4 or IPv6 */
|
||||
static void addrsort __P((char **, int));
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
static void dprintf(char *, int) __printflike(1, 0);
|
||||
#endif
|
||||
|
||||
#if PACKETSZ > 1024
|
||||
#define MAXPACKET PACKETSZ
|
||||
#else
|
||||
|
@ -71,7 +71,7 @@ static const char rcsid[] =
|
||||
#define FLOATING_POINT
|
||||
|
||||
static int __sprint __P((FILE *, struct __suio *));
|
||||
static int __sbprintf __P((FILE *, const char *, va_list));
|
||||
static int __sbprintf __P((FILE *, const char *, va_list)) __printflike(2, 0);
|
||||
static char * __ultoa __P((u_long, char *, int, int, char *));
|
||||
static char * __uqtoa __P((u_quad_t, char *, int, int, char *));
|
||||
static void __find_arguments __P((const char *, va_list, void ***));
|
||||
|
@ -59,6 +59,9 @@
|
||||
|
||||
#define MAX_THREAD_CMDS 10
|
||||
|
||||
static void log_error(const char *, ...) __printflike(1, 2);
|
||||
static void log_trace (const char *, ...) __printflike(1, 2);
|
||||
static void log (const char *, ...) __printflike(1, 2);
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Types
|
||||
|
@ -150,11 +150,11 @@ int cam_get_device(const char *path, char *dev_name,
|
||||
/*
|
||||
* Buffer encoding/decoding routines, from the old SCSI library.
|
||||
*/
|
||||
int csio_decode(struct ccb_scsiio *csio, char *fmt, ...);
|
||||
int csio_decode(struct ccb_scsiio *csio, char *fmt, ...) __printflike(2, 3);
|
||||
int csio_decode_visit(struct ccb_scsiio *csio, char *fmt,
|
||||
void (*arg_put)(void *, int, void *, int, char *),
|
||||
void *puthook);
|
||||
int buff_decode(u_int8_t *buff, size_t len, char *fmt, ...);
|
||||
int buff_decode(u_int8_t *buff, size_t len, char *fmt, ...) __printflike(3, 4);
|
||||
int buff_decode_visit(u_int8_t *buff, size_t len, char *fmt,
|
||||
void (*arg_put)(void *, int, void *, int, char *),
|
||||
void *puthook);
|
||||
@ -166,7 +166,7 @@ int csio_build_visit(struct ccb_scsiio *csio, u_int8_t *data_ptr,
|
||||
int timeout, char *cmd_spec,
|
||||
int (*arg_get)(void *hook, char *field_name),
|
||||
void *gethook);
|
||||
int csio_encode(struct ccb_scsiio *csio, char *fmt, ...);
|
||||
int csio_encode(struct ccb_scsiio *csio, char *fmt, ...) __printflike(2, 3);
|
||||
int buff_encode_visit(u_int8_t *buff, size_t len, char *fmt,
|
||||
int (*arg_get)(void *hook, char *field_name),
|
||||
void *gethook);
|
||||
|
@ -27,6 +27,8 @@
|
||||
#include <pwd.h>
|
||||
#include "libdisk.h"
|
||||
|
||||
static void msgDebug(char *, ...) __printflike(1, 2);
|
||||
|
||||
/* Clone these two from sysinstall because we need our own copies
|
||||
* due to link order problems with `crunch'. Feh!
|
||||
*/
|
||||
|
@ -59,6 +59,9 @@
|
||||
|
||||
#define MAX_THREAD_CMDS 10
|
||||
|
||||
static void log_error(const char *, ...) __printflike(1, 2);
|
||||
static void log_trace (const char *, ...) __printflike(1, 2);
|
||||
static void log (const char *, ...) __printflike(1, 2);
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Types
|
||||
|
@ -70,7 +70,7 @@ struct __kvm {
|
||||
/*
|
||||
* Functions used internally by kvm, but across kvm modules.
|
||||
*/
|
||||
void _kvm_err __P((kvm_t *kd, const char *program, const char *fmt, ...));
|
||||
void _kvm_err __P((kvm_t *kd, const char *program, const char *fmt, ...)) __printflike(3, 4);
|
||||
void _kvm_freeprocs __P((kvm_t *kd));
|
||||
void _kvm_freevtop __P((kvm_t *));
|
||||
int _kvm_initvtop __P((kvm_t *));
|
||||
@ -78,5 +78,5 @@ int _kvm_kvatop __P((kvm_t *, u_long, u_long *));
|
||||
void *_kvm_malloc __P((kvm_t *kd, size_t));
|
||||
void *_kvm_realloc __P((kvm_t *kd, void *, size_t));
|
||||
void _kvm_syserr
|
||||
__P((kvm_t *kd, const char *program, const char *fmt, ...));
|
||||
__P((kvm_t *kd, const char *program, const char *fmt, ...)) __printflike(3, 4);
|
||||
int _kvm_uvatop __P((kvm_t *, const struct proc *, u_long, u_long *));
|
||||
|
@ -435,7 +435,7 @@ ncp_args_parseopt(struct ncp_args *na, int opt, char *optarg, ncp_setopt_t *set_
|
||||
* the rest - requester error;
|
||||
*/
|
||||
void
|
||||
ncp_error(char *fmt, int error,...) {
|
||||
ncp_error(const char *fmt, int error, ...) {
|
||||
va_list ap;
|
||||
|
||||
fprintf(stderr, "%s: ", __progname);
|
||||
|
@ -48,9 +48,9 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
int NgMkSockNode(const char *, int *, int *);
|
||||
int NgNameNode(int, const char *, const char *, ...);
|
||||
int NgNameNode(int, const char *, const char *, ...) __printflike(3, 4);
|
||||
int NgSendMsg(int, const char *, int, int, const void *, size_t);
|
||||
int NgSendAsciiMsg(int, const char *, const char *, ...);
|
||||
int NgSendAsciiMsg(int, const char *, const char *, ...) __printflike(3, 4);
|
||||
int NgSendReplyMsg(int, const char *,
|
||||
const struct ng_mesg *, const void *, size_t);
|
||||
int NgRecvMsg(int, struct ng_mesg *, size_t, char *);
|
||||
|
@ -59,6 +59,9 @@
|
||||
|
||||
#define MAX_THREAD_CMDS 10
|
||||
|
||||
static void log_error(const char *, ...) __printflike(1, 2);
|
||||
static void log_trace (const char *, ...) __printflike(1, 2);
|
||||
static void log (const char *, ...) __printflike(1, 2);
|
||||
|
||||
/*------------------------------------------------------------
|
||||
* Types
|
||||
|
@ -168,7 +168,7 @@ NWCCODE NWDisableTTS(NWCONN_HANDLE);
|
||||
NWCCODE NWEnableTTS(NWCONN_HANDLE);
|
||||
NWCCODE NWDisableFileServerLogin(NWCONN_HANDLE);
|
||||
NWCCODE NWEnableFileServerLogin(NWCONN_HANDLE);
|
||||
void ncp_error(char *, int,...);
|
||||
void ncp_error(const char *, int, ...) __printf0like(1, 3);
|
||||
char *ncp_printb(char *, int, const struct ncp_bitname *);
|
||||
void nw_keyhash(const u_char *, const u_char *, int, u_char *);
|
||||
void nw_encrypt(const u_char *, const u_char *, u_char *);
|
||||
|
Loading…
x
Reference in New Issue
Block a user