rid warnings from modern MSVC
This commit is contained in:
1 parent
e710e27948
commit
3e064dfeb7
8 files changed
+36
-23
No files matched your search
+1
-1
@@ -131,7 +131,7 @@ int sigar_parse_proc_args(sigar_t *sigar, WCHAR *buf,
|
||||
for (i=0; i<num; i++) {
|
||||
SIGAR_W2A(args[i], arg, SIGAR_CMDLINE_MAX);
|
||||
SIGAR_PROC_ARGS_GROW(procargs);
|
||||
procargs->data[procargs->number++] = strdup(arg);
|
||||
procargs->data[procargs->number++] = sigar_strdup(arg);
|
||||
}
|
||||
|
||||
GlobalFree(args);
|
||||
|
||||
@@ -2410,7 +2410,7 @@ sigar_net_interface_list_get(sigar_t *sigar,
|
||||
}
|
||||
|
||||
if (iflist) {
|
||||
iflist->data[iflist->number++] = strdup(name);
|
||||
iflist->data[iflist->number++] = sigar_strdup(name);
|
||||
}
|
||||
|
||||
key = netif_hash(name);
|
||||
|
||||
+8
-8
@@ -660,13 +660,13 @@ gl_putc(int c)
|
||||
CharToOemBuff((char const *)&c,&ch,1);
|
||||
#endif
|
||||
|
||||
write(1, &ch, 1);
|
||||
sigar_write(1, &ch, 1);
|
||||
}
|
||||
#if defined(unix) || defined(MSDOS) || defined(WIN32) || defined(R__MWERKS)
|
||||
#ifdef TIOCSETP /* BSD in RAW mode, map NL to NL,CR */
|
||||
if (ch == '\n') {
|
||||
ch = '\r';
|
||||
write(1, &ch, 1);
|
||||
sigar_write(1, &ch, 1);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -684,11 +684,11 @@ gl_puts(char *buf)
|
||||
{
|
||||
char *OemBuf = (char *)malloc(2*len);
|
||||
CharToOemBuff(buf,OemBuf,len);
|
||||
write(1, OemBuf, len);
|
||||
sigar_write(1, OemBuf, len);
|
||||
free(OemBuf);
|
||||
}
|
||||
#else
|
||||
write(1, buf, len);
|
||||
sigar_write(1, buf, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -702,11 +702,11 @@ gl_error(char *buf)
|
||||
{
|
||||
char *OemBuf = (char *)malloc(2*len);
|
||||
CharToOemBuff(buf,OemBuf,len);
|
||||
write(2, OemBuf, len);
|
||||
sigar_write(2, OemBuf, len);
|
||||
free(OemBuf);
|
||||
}
|
||||
#else
|
||||
write(2, buf, len);
|
||||
sigar_write(2, buf, len);
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
@@ -718,7 +718,7 @@ gl_init()
|
||||
if (gl_init_done < 0) { /* -1 only on startup */
|
||||
hist_init();
|
||||
}
|
||||
if (isatty(0) == 0 || isatty(1) == 0)
|
||||
if (sigar_isatty(0) == 0 || sigar_isatty(1) == 0)
|
||||
gl_notty = 1;
|
||||
gl_char_init();
|
||||
gl_init_done = 1;
|
||||
@@ -756,7 +756,7 @@ SIGAR_DECLARE(void)
|
||||
sigar_getline_windowchanged()
|
||||
{
|
||||
#ifdef TIOCGWINSZ
|
||||
if (isatty(0)) {
|
||||
if (sigar_isatty(0)) {
|
||||
static char lenv[32], cenv[32];
|
||||
struct winsize wins;
|
||||
ioctl(0, TIOCGWINSZ, &wins);
|
||||
|
||||
+7
-7
@@ -531,7 +531,7 @@ static int ptql_branch_list_destroy(ptql_branch_list_t *branches)
|
||||
static int ptql_branch_init_any(ptql_parse_branch_t *parsed,
|
||||
ptql_branch_t *branch)
|
||||
{
|
||||
branch->data.str = strdup(parsed->attr);
|
||||
branch->data.str = sigar_strdup(parsed->attr);
|
||||
branch->data_size = strlen(parsed->attr);
|
||||
return SIGAR_OK;
|
||||
}
|
||||
@@ -654,14 +654,14 @@ static int ptql_branch_init_pid(ptql_parse_branch_t *parsed,
|
||||
}
|
||||
else if (strEQ(parsed->attr, "PidFile")) {
|
||||
branch->flags = PTQL_PID_FILE;
|
||||
branch->data.str = strdup(parsed->value);
|
||||
branch->data.str = sigar_strdup(parsed->value);
|
||||
branch->data_size = strlen(parsed->value);
|
||||
return SIGAR_OK;
|
||||
}
|
||||
else if (strEQ(parsed->attr, "Service")) {
|
||||
branch->flags = PTQL_PID_SERVICE;
|
||||
#ifdef WIN32
|
||||
branch->data.str = strdup(parsed->value);
|
||||
branch->data.str = sigar_strdup(parsed->value);
|
||||
branch->data_size = strlen(parsed->value);
|
||||
#endif
|
||||
return SIGAR_OK;
|
||||
@@ -1148,7 +1148,7 @@ static int ptql_branch_add(ptql_parse_branch_t *parsed,
|
||||
}
|
||||
else {
|
||||
if ((ptr = getenv(parsed->value+1))) {
|
||||
branch->value.str = strdup(ptr);
|
||||
branch->value.str = sigar_strdup(ptr);
|
||||
}
|
||||
else {
|
||||
branch->value.str = NULL;
|
||||
@@ -1212,7 +1212,7 @@ static int ptql_branch_add(ptql_parse_branch_t *parsed,
|
||||
case PTQL_VALUE_TYPE_ANY:
|
||||
branch->match.str = ptql_op_str[branch->op_name];
|
||||
if (!is_set) {
|
||||
branch->value.str = strdup(parsed->value);
|
||||
branch->value.str = sigar_strdup(parsed->value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1233,14 +1233,14 @@ static int ptql_branch_compare(const void *b1, const void *b2)
|
||||
SIGAR_DECLARE(int) sigar_ptql_query_create(sigar_ptql_query_t **queryp,
|
||||
char *ptql)
|
||||
{
|
||||
char *ptr, *ptql_copy = strdup(ptql);
|
||||
char *ptr, *ptql_copy = sigar_strdup(ptql);
|
||||
int status = SIGAR_OK;
|
||||
int has_ref = 0;
|
||||
sigar_ptql_query_t *query =
|
||||
*queryp = malloc(sizeof(*query));
|
||||
|
||||
#ifdef PTQL_DEBUG
|
||||
query->ptql = strdup(ptql);
|
||||
query->ptql = sigar_strdup(ptql);
|
||||
#endif
|
||||
|
||||
ptql = ptql_copy;
|
||||
|
||||
Reference in new issue
Block a user