Skip to content

Commit

Permalink
Fix -Wformat gcc warnings.
Browse files Browse the repository at this point in the history
BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17254 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
andi5 committed Jul 4, 2008
1 parent b3f9fe8 commit fead1da
Show file tree
Hide file tree
Showing 38 changed files with 92 additions and 91 deletions.
2 changes: 1 addition & 1 deletion src/app-utils/gfec.c
Expand Up @@ -169,7 +169,7 @@ static int error_in_scm_eval = FALSE;
static void
error_handler(const char *msg)
{
g_warning(msg);
g_warning("%s", msg);
error_in_scm_eval = TRUE;
}

Expand Down
2 changes: 1 addition & 1 deletion src/backend/file/io-utils.c
Expand Up @@ -48,7 +48,7 @@ static const gchar *emacs_trailer =
void
write_emacs_trailer(FILE *out)
{
fprintf(out, emacs_trailer);
fprintf(out, "%s", emacs_trailer);
}

static void
Expand Down
2 changes: 1 addition & 1 deletion src/bin/gnucash-bin.c
Expand Up @@ -141,7 +141,7 @@ static void
update_message(const gchar *msg)
{
gnc_update_splash_screen(msg, GNC_SPLASH_PERCENTAGE_UNKNOWN);
g_message(msg);
g_message("%s", msg);
}

static void
Expand Down
6 changes: 3 additions & 3 deletions src/business/business-gnome/dialog-billterms.c
Expand Up @@ -260,12 +260,12 @@ verify_term_ok (NewBillTerm *nbt)
num = gnc_numeric_zero ();
if (gnc_numeric_negative_p (num)) {
message = _("Negative amounts are not allowed.");
gnc_error_dialog (nbt->dialog, message);
gnc_error_dialog (nbt->dialog, "%s", message);
return FALSE;
}
if (gnc_numeric_compare (num, gnc_numeric_create (100, 1)) > 0) {
message = _("Percentage amount must be between 0 and 100.");
gnc_error_dialog (nbt->dialog, message);
gnc_error_dialog (nbt->dialog, "%s", message);
return FALSE;
}
return TRUE;
Expand All @@ -288,7 +288,7 @@ new_billterm_ok_cb (NewBillTerm *nbt)
name = gtk_entry_get_text (GTK_ENTRY (nbt->name_entry));
if (name == NULL || *name == '\0') {
message = _("You must provide a name for this Billing Term.");
gnc_error_dialog (nbt->dialog, message);
gnc_error_dialog (nbt->dialog, "%s", message);
return FALSE;
}
if (gncBillTermLookupByName (btw->book, name)) {
Expand Down
2 changes: 1 addition & 1 deletion src/business/business-gnome/dialog-customer.c
Expand Up @@ -277,7 +277,7 @@ gnc_customer_window_ok_cb (GtkWidget *widget, gpointer data)
check_entry_nonempty (cw->dialog, cw->addr3_entry, NULL) &&
check_entry_nonempty (cw->dialog, cw->addr4_entry, NULL)) {
const char *msg = _("You must enter a billing address.");
gnc_error_dialog (cw->dialog, msg);
gnc_error_dialog (cw->dialog, "%s", msg);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/business/business-gnome/dialog-employee.c
Expand Up @@ -227,7 +227,7 @@ gnc_employee_window_ok_cb (GtkWidget *widget, gpointer data)
check_entry_nonempty (ew->dialog, ew->addr3_entry, NULL) &&
check_entry_nonempty (ew->dialog, ew->addr4_entry, NULL)) {
const char *msg = _("You must enter an address.");
gnc_error_dialog (ew->dialog, msg);
gnc_error_dialog (ew->dialog, "%s", msg);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/business/business-gnome/dialog-invoice.c
Expand Up @@ -519,7 +519,7 @@ gnc_invoice_window_deleteCB (GtkWidget *widget, gpointer data)
else
msg = g_strdup (message);

result = gnc_verify_dialog (iw_get_window(iw), FALSE, msg);
result = gnc_verify_dialog (iw_get_window(iw), FALSE, "%s", msg);
g_free (msg);

if (!result)
Expand Down
4 changes: 2 additions & 2 deletions src/business/business-gnome/dialog-job.c
Expand Up @@ -128,7 +128,7 @@ gnc_job_verify_ok (JobWindow *jw)
res = gtk_entry_get_text (GTK_ENTRY (jw->name_entry));
if (safe_strcmp (res, "") == 0) {
const char *message = _("The Job must be given a name.");
gnc_error_dialog(jw->dialog, message);
gnc_error_dialog(jw->dialog, "%s", message);
return FALSE;
}

Expand All @@ -137,7 +137,7 @@ gnc_job_verify_ok (JobWindow *jw)
res = gncOwnerGetName (&(jw->owner));
if (res == NULL || safe_strcmp (res, "") == 0) {
const char *message = _("You must choose an owner for this job.");
gnc_error_dialog(jw->dialog, message);
gnc_error_dialog(jw->dialog, "%s", message);
return FALSE;
}

Expand Down
2 changes: 1 addition & 1 deletion src/business/business-gnome/dialog-order.c
Expand Up @@ -288,7 +288,7 @@ gnc_order_window_close_order_cb (GtkWidget *widget, gpointer data)
"Are you sure you want to close it out before "
"you invoice all the entries?");

if (gnc_verify_dialog (ow->dialog, FALSE, message) == FALSE)
if (gnc_verify_dialog (ow->dialog, FALSE, "%s", message) == FALSE)
return;
}

Expand Down
8 changes: 4 additions & 4 deletions src/business/business-gnome/dialog-payment.c
Expand Up @@ -227,31 +227,31 @@ gnc_payment_ok_cb (GtkWidget *widget, gpointer data)
if (gnc_numeric_check (amount) || !gnc_numeric_positive_p (amount)) {
text = _("You must enter the amount of the payment. "
"The payment amount must be greater than zero.");
gnc_error_dialog (pw->dialog, text);
gnc_error_dialog (pw->dialog, "%s", text);
return;
}

/* Verify the user has selected an owner */
gnc_owner_get_owner (pw->owner_choice, &(pw->owner));
if (pw->owner.owner.undefined == NULL) {
text = _("You must select a company for payment processing.");
gnc_error_dialog (pw->dialog, text);
gnc_error_dialog (pw->dialog, "%s", text);
return;
}

/* Verify the user has selected a transfer account */
acc = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(pw->acct_tree));
if (!acc) {
text = _("You must select a transfer account from the account tree.");
gnc_error_dialog (pw->dialog, text);
gnc_error_dialog (pw->dialog, "%s", text);
return;
}

/* Verify the "post" account */
text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(pw->post_combo));
if (!text || safe_strcmp (text, "") == 0) {
text = _("You must enter an account name for posting.");
gnc_error_dialog (pw->dialog, text);
gnc_error_dialog (pw->dialog, "%s", text);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/business/business-gnome/dialog-vendor.c
Expand Up @@ -214,7 +214,7 @@ gnc_vendor_window_ok_cb (GtkWidget *widget, gpointer data)
check_entry_nonempty (vw->dialog, vw->addr3_entry, NULL) &&
check_entry_nonempty (vw->dialog, vw->addr4_entry, NULL)) {
const char *msg = _("You must enter a payment address.");
gnc_error_dialog (vw->dialog, msg);
gnc_error_dialog (vw->dialog, "%s", msg);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/business/business-ledger/gncEntryLedgerControl.c
Expand Up @@ -599,7 +599,7 @@ gnc_entry_ledger_check_close_internal (GtkWidget *parent,
if (!gnc_entry_ledger_verify_can_save (ledger))
return FALSE;

if (dontask || gnc_verify_dialog (parent, TRUE, message))
if (dontask || gnc_verify_dialog (parent, TRUE, "%s", message))
gnc_entry_ledger_save (ledger, TRUE);
else
gnc_entry_ledger_cancel_cursor_changes (ledger);
Expand Down
10 changes: 5 additions & 5 deletions src/business/dialog-tax-table/dialog-tax-table.c
Expand Up @@ -110,7 +110,7 @@ new_tax_table_ok_cb (NewTaxTable *ntt)
name = gtk_entry_get_text (GTK_ENTRY (ntt->name_entry));
if (name == NULL || *name == '\0') {
message = _("You must provide a name for this Tax Table.");
gnc_error_dialog (ntt->dialog, message);
gnc_error_dialog (ntt->dialog, "%s", message);
return FALSE;
}
if (gncTaxTableLookupByName (ttw->book, name)) {
Expand All @@ -127,22 +127,22 @@ new_tax_table_ok_cb (NewTaxTable *ntt)
amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (ntt->amount_entry));
if (gnc_numeric_negative_p (amount)) {
message = _("Negative amounts are not allowed.");
gnc_error_dialog (ntt->dialog, message);
gnc_error_dialog (ntt->dialog, "%s", message);
return FALSE;
}
if (ntt->type == GNC_AMT_TYPE_PERCENT &&
gnc_numeric_compare (amount,
gnc_numeric_create (100, 1)) > 0) {
message = _("Percentage amount must be between 0 and 100.");
gnc_error_dialog (ntt->dialog, message);
gnc_error_dialog (ntt->dialog, "%s", message);
return FALSE;
}

/* verify the account */
acc = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(ntt->acct_tree));
if (acc == NULL) {
message = _("You must choose a Tax Account.");
gnc_error_dialog (ntt->dialog, message);
gnc_error_dialog (ntt->dialog, "%s", message);
return FALSE;
}

Expand Down Expand Up @@ -579,7 +579,7 @@ tax_table_delete_entry_cb (GtkButton *button, TaxTableWindow *ttw)
if (g_list_length (gncTaxTableGetEntries (ttw->current_table)) <= 1) {
char *message = _("You cannot remove the last entry from the tax table. "
"Try deleting the tax table if you want to do that.");
gnc_error_dialog (ttw->dialog, message);
gnc_error_dialog (ttw->dialog, "%s", message);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/gnome-search/dialog-search.c
Expand Up @@ -153,7 +153,7 @@ gnc_search_dialog_select_cb (GtkButton *button, GNCSearchWindow *sw)

if (sw->selected_item == NULL && sw->allow_clear == FALSE) {
char *msg = _("You must select an item from the list");
gnc_error_dialog (sw->dialog, msg);
gnc_error_dialog (sw->dialog, "%s", msg);
return;
}

Expand Down
18 changes: 9 additions & 9 deletions src/gnome-utils/dialog-account.c
Expand Up @@ -415,7 +415,7 @@ gnc_ui_to_account(AccountWindow *aw)
if (!gnc_account_create_opening_balance (account, balance, date, aw->book))
{
const char *message = _("Could not create opening balance.");
gnc_error_dialog(aw->dialog, message);
gnc_error_dialog(aw->dialog, "%s", message);
}
}
else
Expand Down Expand Up @@ -707,7 +707,7 @@ gnc_common_ok (AccountWindow *aw)
name = gtk_entry_get_text(GTK_ENTRY(aw->name_entry));
if (safe_strcmp(name, "") == 0) {
const char *message = _("The account must be given a name.");
gnc_error_dialog(aw->dialog, message);
gnc_error_dialog(aw->dialog, "%s", message);
LEAVE("bad name");
return FALSE;
}
Expand All @@ -729,23 +729,23 @@ gnc_common_ok (AccountWindow *aw)
if ((account != NULL) &&
!guid_equal(&aw->account, xaccAccountGetGUID (account))) {
const char *message = _("There is already an account with that name.");
gnc_error_dialog(aw->dialog, message);
gnc_error_dialog(aw->dialog, "%s", message);
LEAVE("duplicate name");
return FALSE;
}

/* Parent check, probably not needed, but be safe */
if (!gnc_filter_parent_accounts(parent, aw)) {
const char *message = _("You must choose a valid parent account.");
gnc_error_dialog(aw->dialog, message);
gnc_error_dialog(aw->dialog, "%s", message);
LEAVE("invalid parent");
return FALSE;
}

/* check for valid type */
if (aw->type == ACCT_TYPE_INVALID) {
const char *message = _("You must select an account type.");
gnc_error_dialog(aw->dialog, message);
gnc_error_dialog(aw->dialog, "%s", message);
LEAVE("invalid type");
return FALSE;
}
Expand All @@ -754,7 +754,7 @@ gnc_common_ok (AccountWindow *aw)
if (!xaccAccountTypesCompatible (aw->type, xaccAccountGetType (parent))) {
const char *message = _("The selected account type is incompatible with "
"the one of the selected parent.");
gnc_error_dialog(aw->dialog, message);
gnc_error_dialog(aw->dialog, "%s", message);
LEAVE("incompatible types");
return FALSE;
}
Expand All @@ -764,7 +764,7 @@ gnc_common_ok (AccountWindow *aw)
gnc_general_select_get_selected (GNC_GENERAL_SELECT (aw->commodity_edit));
if (!commodity) {
const char *message = _("You must choose a commodity.");
gnc_error_dialog(aw->dialog, message);
gnc_error_dialog(aw->dialog, "%s", message);
LEAVE("invalid commodity");
return FALSE;
}
Expand Down Expand Up @@ -817,7 +817,7 @@ gnc_new_account_ok (AccountWindow *aw)
{
const char *message = _("You must enter a valid opening balance "
"or leave it blank.");
gnc_error_dialog(aw->dialog, message);
gnc_error_dialog(aw->dialog, "%s", message);
LEAVE(" ");
return;
}
Expand All @@ -841,7 +841,7 @@ gnc_new_account_ok (AccountWindow *aw)
{
const char *message = _("You must select a transfer account or choose"
" the opening balances equity account.");
gnc_error_dialog(aw->dialog, message);
gnc_error_dialog(aw->dialog, "%s", message);
LEAVE(" ");
return;
}
Expand Down
8 changes: 4 additions & 4 deletions src/gnome-utils/dialog-transfer.c
Expand Up @@ -1252,7 +1252,7 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
const char *message = _("You must specify an account to transfer from, "
"or to, or both, for this transaction. "
"Otherwise, it will not be recorded.");
gnc_error_dialog(xferData->dialog, message);
gnc_error_dialog(xferData->dialog, "%s", message);
LEAVE("bad account");
return;
}
Expand All @@ -1261,7 +1261,7 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
{
const char *message = _("You can't transfer from and to the same "
"account!");
gnc_error_dialog(xferData->dialog, message);
gnc_error_dialog(xferData->dialog, "%s", message);
LEAVE("same account");
return;
}
Expand All @@ -1288,7 +1288,7 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
const char *message = _("You can't transfer from a non-currency account. "
"Try reversing the \"from\" and \"to\" accounts "
"and making the \"amount\" negative.");
gnc_error_dialog(xferData->dialog, message);
gnc_error_dialog(xferData->dialog, "%s", message);
LEAVE("non-currency");
return;
}
Expand All @@ -1311,7 +1311,7 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
if (gnc_numeric_zero_p (amount))
{
const char *message = _("You must enter an amount to transfer.");
gnc_error_dialog(xferData->dialog, message);
gnc_error_dialog(xferData->dialog, "%s", message);
LEAVE("invalid from amount");
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/gnome-utils/druid-gconf-setup.c
Expand Up @@ -505,15 +505,15 @@ druid_gconf_finish_page_finish (GnomeDruidPage *druidpage,
case HOW_INSTALL:
if (!druid_gconf_install_keys(&error)) {
keep_going = FALSE;
gnc_error_dialog(NULL, error->message);
gnc_error_dialog(NULL, "%s", error->message);
g_error_free(error);
}
break;

default:
if (!druid_gconf_update_path(&error)) {
keep_going = FALSE;
gnc_error_dialog(NULL, error->message);
gnc_error_dialog(NULL, "%s", error->message);
g_error_free(error);
}
break;
Expand Down Expand Up @@ -587,7 +587,7 @@ gnc_gnome_install_gconf_schemas (void)
/* Kill the backend daemon. When it restarts it will find our changes */
if (!g_spawn_command_line_sync("gconftool-2 --shutdown", NULL, NULL,
NULL, &error)) {
gnc_warning_dialog(NULL, error->message);
gnc_warning_dialog(NULL, "%s", error->message);
g_error_free(error);
}
}
Expand Down

0 comments on commit fead1da

Please sign in to comment.