Prefer C99's __func__ over GCC's __FUNCTION__.
This commit is contained in:
parent
ff9af45a01
commit
e60b9f5130
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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++;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -68,8 +68,8 @@
|
||||
#include <sys/dirent.h>
|
||||
#include <string.h>
|
||||
|
||||
#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
|
||||
|
Loading…
Reference in New Issue
Block a user