Reduce compiler warnings by replacing strerror() with g_strerror() and similar glib replacements.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18798 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2010-03-03 20:46:20 +00:00
parent 04ffda604b
commit f6bf61feb5
6 changed files with 15 additions and 15 deletions

View File

@ -342,7 +342,7 @@ xml_session_end(QofBackend *be_start)
if (rv)
{
PWARN("Error on g_unlink(%s): %d: %s", be->lockfile,
errno, strerror(errno) ? strerror(errno) : "");
errno, g_strerror(errno) ? g_strerror(errno) : "");
}
}
@ -472,7 +472,7 @@ gnc_int_link_or_make_backup(FileBackend *be, const char *orig, const char *bkup)
{
qof_backend_set_error((QofBackend*)be, ERR_FILEIO_BACKUP_ERROR);
PWARN ("unable to make file backup from %s to %s: %s",
orig, bkup, strerror(errno) ? strerror(errno) : "");
orig, bkup, g_strerror(errno) ? g_strerror(errno) : "");
return FALSE;
}
}
@ -657,7 +657,7 @@ gnc_xml_be_write_to_file(FileBackend *fbe,
failed. Instead, we simply ignore this. */
PWARN("unable to chmod filename %s: %s",
tmp_name ? tmp_name : "(null)",
strerror(errno) ? strerror(errno) : "");
g_strerror(errno) ? g_strerror(errno) : "");
#if VFAT_DOESNT_SUCK /* chmod always fails on vfat/samba fs */
/* g_free(tmp_name); */
/* return FALSE; */
@ -686,7 +686,7 @@ gnc_xml_be_write_to_file(FileBackend *fbe,
qof_backend_set_error(be, ERR_BACKEND_READONLY);
PWARN("unable to unlink filename %s: %s",
datafile ? datafile : "(null)",
strerror(errno) ? strerror(errno) : "");
g_strerror(errno) ? g_strerror(errno) : "");
g_free(tmp_name);
LEAVE("");
return FALSE;
@ -703,7 +703,7 @@ gnc_xml_be_write_to_file(FileBackend *fbe,
qof_backend_set_error(be, ERR_BACKEND_PERM);
PWARN("unable to unlink temp filename %s: %s",
tmp_name ? tmp_name : "(null)",
strerror(errno) ? strerror(errno) : "");
g_strerror(errno) ? g_strerror(errno) : "");
g_free(tmp_name);
LEAVE("");
return FALSE;
@ -735,7 +735,7 @@ gnc_xml_be_write_to_file(FileBackend *fbe,
qof_backend_set_error(be, be_err);
PWARN("unable to unlink temp_filename %s: %s",
tmp_name ? tmp_name : "(null)",
strerror(errno) ? strerror(errno) : "");
g_strerror(errno) ? g_strerror(errno) : "");
/* already in an error just flow on through */
}
else

View File

@ -1371,7 +1371,7 @@ gz_thread_func(gz_thread_params_t *params)
else
{
g_warning("Could not read from pipe. The error is '%s' (errno %d)",
strerror(errno), errno);
g_strerror(errno) ? g_strerror(errno) : "", errno);
success = 0;
}
}
@ -1386,7 +1386,7 @@ gz_thread_func(gz_thread_params_t *params)
if (write(params->fd, buffer, gzval) < 0)
{
g_warning("Could not write to pipe. The error is '%s' (%d)",
strerror(errno), errno);
g_strerror(errno) ? g_strerror(errno) : "", errno);
success = 0;
}
}

View File

@ -169,7 +169,7 @@ xaccOpenLog (void)
{
int norr = errno;
printf ("Error: xaccOpenLog(): cannot open journal \n"
"\t %d %s\n", norr, strerror (norr));
"\t %d %s\n", norr, g_strerror (norr) ? g_strerror (norr) : "");
g_free (filename);
g_free (timestamp);

View File

@ -299,13 +299,13 @@ gnc_quote_source_add_new (const char *source_name, gboolean supported)
/* This name can be changed if/when support for this price source is
* integrated into gnucash. */
new_source->user_name = strdup(source_name);
new_source->user_name = g_strdup(source_name);
/* This name is permanent and must be kept the same if/when support
* for this price source is integrated into gnucash (i.e. for a
* nice user name). */
new_source->old_internal_name = strdup(source_name);
new_source->internal_name = strdup(source_name);
new_source->old_internal_name = g_strdup(source_name);
new_source->internal_name = g_strdup(source_name);
new_quote_sources = g_list_append(new_quote_sources, new_source);
return new_source;
}

View File

@ -338,7 +338,7 @@ gnc_validate_directory (const gchar *dirname)
" %s\n"
"Please correct the problem and restart GnuCash.\n"
"The reported error was '%s' (errno %d).\n"),
dirname, strerror(errno), errno);
dirname, g_strerror(errno) ? g_strerror(errno) : "", errno);
exit(1);
}
g_stat (dirname, &statbuf);
@ -370,7 +370,7 @@ gnc_validate_directory (const gchar *dirname)
"directory exists and is usable. Please correct the\n"
"problem and restart GnuCash. The reported error \n"
"was '%s' (errno %d)."),
dirname, strerror(errno), errno);
dirname, g_strerror(errno) ? g_strerror(errno) : "", errno);
exit(1);
}
}

View File

@ -510,7 +510,7 @@ gnc_print_date (Timespec ts)
static char buff[MAX_DATE_LENGTH];
time_t t;
t = ts.tv_sec + (ts.tv_nsec / 1000000000.0);
t = ts.tv_sec + (time_t)(ts.tv_nsec / 1000000000.0);
qof_print_date_buff (buff, MAX_DATE_LENGTH, t);