Use some unused variables

This commit is contained in:
Richard Cohen
2023-01-25 13:13:12 +00:00
parent 78ec20515b
commit 1c6679720b
4 changed files with 11 additions and 8 deletions

View File

@@ -196,7 +196,10 @@ gui_to_fi (FinCalcDialog *fcd)
{
gnc_numeric out;
gboolean result = string_to_gnc_numeric (text, &out);
npp = gnc_numeric_convert (out, 1, GNC_HOW_RND_TRUNC);
if (result)
npp = gnc_numeric_convert (out, 1, GNC_HOW_RND_TRUNC);
else
npp = gnc_numeric_zero ();
}
else
npp = gnc_numeric_zero ();

View File

@@ -219,7 +219,7 @@ GncDbiBackend<Type>::set_standard_connection_options (dbi_conn conn,
{
const char *msg = nullptr;
auto err = dbi_conn_error(conn, &msg);
PERR("Error setting port option to %d: %s", uri.m_portnum, msg);
PERR("Error (%d) setting port option to %d: %s", err, uri.m_portnum, msg);
throw std::runtime_error(msg);
}
}

View File

@@ -250,7 +250,6 @@ destroy_database (gchar* url)
gchar* port = NULL;
auto pgsql = "pgsql";
dbi_conn conn = NULL;
auto errfmt = "Unable to delete tables in %s: %s";
gint fail = 0;
dbi_result tables;
StrVec tblnames;
@@ -272,7 +271,7 @@ destroy_database (gchar* url)
port = g_strdup_printf ("%d", portnum);
if (conn == NULL)
{
g_printf (errfmt, url, "failed to create connection");
g_printf ("delete tables in %s: failed to create connection", url);
return;
}
fail = dbi_conn_set_option (conn, "host", host);
@@ -289,7 +288,7 @@ destroy_database (gchar* url)
g_free (port);
if (fail != 0)
{
g_printf (errfmt, url, "failed to set an option");
g_printf ("delete tables in %s: failed to set an option", url);
dbi_conn_close (conn);
return;
}
@@ -298,7 +297,7 @@ destroy_database (gchar* url)
{
const gchar* error;
gint errnum = dbi_conn_error (conn, &error);
g_printf (errfmt, url, error);
g_printf ("delete tables in %s: failed to connect (error %d): %s", url, errnum, error);
dbi_conn_close (conn);
return;
}
@@ -314,6 +313,7 @@ destroy_database (gchar* url)
std::string query{"DROP TABLE "};
query += table;
dbi_result rslt = dbi_conn_query (conn, query.c_str());
dbi_result_free(rslt);
});
}

View File

@@ -356,8 +356,8 @@ namespace IANAParser
std::ifstream ifs;
auto tzname = name;
if (tzname.empty())
if (auto tzenv = getenv("TZ"))
tzname = std::string(std::getenv("TZ"));
if (auto tzenv = std::getenv("TZ"))
tzname = std::string(tzenv);
//std::cout << "Testing tzname " << tzname << "\n";
if (!tzname.empty())
{