From 29a5373086ab4436c2c6cd327f1303c9ed565349 Mon Sep 17 00:00:00 2001 From: stefanf Date: Wed, 22 Sep 2004 16:56:49 +0000 Subject: [PATCH] Prefer C99's __func__ over GCC's __FUNCTION__. --- lib/libc/locale/collate.c | 6 +++--- lib/libdevinfo/devinfo.c | 2 +- lib/libncp/ncpl_subr.c | 8 ++++---- lib/libnetgraph/sock.c | 2 +- lib/libstand/stand.h | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/libc/locale/collate.c b/lib/libc/locale/collate.c index a4eec6b33c17..90c78efad2e6 100644 --- a/lib/libc/locale/collate.c +++ b/lib/libc/locale/collate.c @@ -202,14 +202,14 @@ __collate_substitute(s) delta += delta / 8; dest_str = malloc(dest_len = delta); if (dest_str == NULL) - __collate_err(EX_OSERR, __FUNCTION__); + __collate_err(EX_OSERR, __func__); len = 0; while (*s) { nlen = len + strlen(__collate_substitute_table[*s]); if (dest_len <= nlen) { dest_str = reallocf(dest_str, dest_len = nlen + delta); if (dest_str == NULL) - __collate_err(EX_OSERR, __FUNCTION__); + __collate_err(EX_OSERR, __func__); } (void)strcpy(dest_str + len, __collate_substitute_table[*s++]); len = nlen; @@ -246,7 +246,7 @@ __collate_strdup(s) u_char *t = strdup(s); if (t == NULL) - __collate_err(EX_OSERR, __FUNCTION__); + __collate_err(EX_OSERR, __func__); return (t); } diff --git a/lib/libdevinfo/devinfo.c b/lib/libdevinfo/devinfo.c index 03186291ddb4..50bc375db68d 100644 --- a/lib/libdevinfo/devinfo.c +++ b/lib/libdevinfo/devinfo.c @@ -84,7 +84,7 @@ static int devinfo_generation = 0; #if 0 # define debug(fmt, args...) \ - fprintf(stderr, "%s:" fmt "\n", __FUNCTION__ , ##args) + fprintf(stderr, "%s:" fmt "\n", __func__ , ##args) #else # define debug(fmt, args...) #endif diff --git a/lib/libncp/ncpl_subr.c b/lib/libncp/ncpl_subr.c index 0dd191faf398..186314386f90 100644 --- a/lib/libncp/ncpl_subr.c +++ b/lib/libncp/ncpl_subr.c @@ -254,19 +254,19 @@ ncp_initlib(void){ if (errno == ENOENT) fprintf(stderr, "Kernel module ncp is not loaded.\n"); else - fprintf(stderr, "%s: kernel module is old, please recompile it.\n", __FUNCTION__); + fprintf(stderr, "%s: kernel module is old, please recompile it.\n", __func__); return error; } if (NCP_VERSION != kv) { - fprintf(stderr, "%s: kernel module version(%d) don't match library(%d).\n", __FUNCTION__, kv, NCP_VERSION); + fprintf(stderr, "%s: kernel module version(%d) don't match library(%d).\n", __func__, kv, NCP_VERSION); return EINVAL; } if ((error = ncp_nls_setrecode(0)) != 0) { - fprintf(stderr, "%s: can't initialise recode\n", __FUNCTION__); + fprintf(stderr, "%s: can't initialise recode\n", __func__); return error; } if ((error = ncp_nls_setlocale("")) != 0) { - fprintf(stderr, "%s: can't initialise locale\n", __FUNCTION__); + fprintf(stderr, "%s: can't initialise locale\n", __func__); return error; } ncp_initialized++; diff --git a/lib/libnetgraph/sock.c b/lib/libnetgraph/sock.c index 070abea9852d..1aeafcc8a1f9 100644 --- a/lib/libnetgraph/sock.c +++ b/lib/libnetgraph/sock.c @@ -196,7 +196,7 @@ NgNameNode(int cs, const char *path, const char *fmt, ...) if (NgSendMsg(cs, path, NGM_GENERIC_COOKIE, NGM_NAME, &ngn, sizeof(ngn)) < 0) { if (_gNgDebugLevel >= 1) - NGLOGX("%s: failed", __FUNCTION__); + NGLOGX("%s: failed", __func__); return (-1); } diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h index 219b2df46976..eba6a0ce6ab9 100644 --- a/lib/libstand/stand.h +++ b/lib/libstand/stand.h @@ -68,8 +68,8 @@ #include #include -#define CHK(fmt, args...) printf("%s(%d): " fmt "\n", __FUNCTION__, __LINE__ , ##args) -#define PCHK(fmt, args...) {printf("%s(%d): " fmt "\n", __FUNCTION__, __LINE__ , ##args); getchar();} +#define CHK(fmt, args...) printf("%s(%d): " fmt "\n", __func__, __LINE__ , ##args) +#define PCHK(fmt, args...) {printf("%s(%d): " fmt "\n", __func__, __LINE__ , ##args); getchar();} #ifndef NULL #define NULL 0