diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2002-04-09 23:28:19 +0000 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2002-04-09 23:28:19 +0000 |
commit | fe26b7c09f86650d19b4be388c155af081388a67 (patch) | |
tree | 64cc907a55db92938bb7f3b555ca5cfdb7a93516 /mixgtk | |
parent | 6923e0f864b77944bc2d5d30c21d3fb89765b8a2 (diff) | |
download | mdk-fe26b7c09f86650d19b4be388c155af081388a67.tar.gz mdk-fe26b7c09f86650d19b4be388c155af081388a67.tar.bz2 |
portability fix: snprintf -> g_snprintf
Diffstat (limited to 'mixgtk')
-rw-r--r-- | mixgtk/mixgtk_cmd_dispatcher.c | 6 | ||||
-rw-r--r-- | mixgtk/mixgtk_device.c | 6 | ||||
-rw-r--r-- | mixgtk/mixgtk_input.c | 8 | ||||
-rw-r--r-- | mixgtk/mixgtk_mixal.c | 10 | ||||
-rw-r--r-- | mixgtk/mixgtk_mixvm.c | 18 |
5 files changed, 24 insertions, 24 deletions
diff --git a/mixgtk/mixgtk_cmd_dispatcher.c b/mixgtk/mixgtk_cmd_dispatcher.c index 01e549b..7ed4a11 100644 --- a/mixgtk/mixgtk_cmd_dispatcher.c +++ b/mixgtk/mixgtk_cmd_dispatcher.c @@ -1,9 +1,9 @@ /* -*-c-*- -------------- mixgtk_cmd_dispatcher.c : * Implementation of the functions declared in mixgtk_cmd_dispatcher.h * ------------------------------------------------------------------ - * Last change: Time-stamp: "2001-04-08 01:34:09 jao" + * $Id: mixgtk_cmd_dispatcher.c,v 1.15 2002/04/09 23:28:19 jao Exp $ * ------------------------------------------------------------------ - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -440,7 +440,7 @@ complete_command_ (void) NULL, NULL, NULL, "Completions:\n", -1); while (cmds) { - snprintf (BUFFER, 25, "%-12s", (const char*)cmds->data); + g_snprintf (BUFFER, 25, "%-12s", (const char*)cmds->data); ++k; gtk_text_insert (GTK_TEXT (dis_data_.log), NULL, NULL, NULL, BUFFER, -1); diff --git a/mixgtk/mixgtk_device.c b/mixgtk/mixgtk_device.c index b3d3b06..b3cf0c8 100644 --- a/mixgtk/mixgtk_device.c +++ b/mixgtk/mixgtk_device.c @@ -1,7 +1,7 @@ /* -*-c-*- ---------------- mixgtk_device.c : * actual types for mixgtk devices * ------------------------------------------------------------------ - * $Id: mixgtk_device.c,v 1.17 2002/03/29 16:30:49 jao Exp $ + * $Id: mixgtk_device.c,v 1.18 2002/04/09 23:28:19 jao Exp $ * ------------------------------------------------------------------ * Copyright (C) 2001, 2002 Free Software Foundation, Inc. * @@ -109,7 +109,7 @@ get_word_string_ (mix_word_t w, gboolean dec) enum {BUFF_SIZE = 17}; static gchar BUFFER[BUFF_SIZE] = { 0 }; if (dec) - snprintf (BUFFER, BUFF_SIZE, "%s%011ld", + g_snprintf (BUFFER, BUFF_SIZE, "%s%011ld", mix_word_is_negative (w)? "-" : "+", mix_word_magnitude (w)); else @@ -500,7 +500,7 @@ on_devapp_button_clicked () for (k = 0; k <= LAST_BIN_DEV_; ++k) mixgtk_device_set_format (k, IS_DEC (new_decs_, k)); decs_ = new_decs_; - snprintf (value, 20, "%d", decs_); + g_snprintf (value, 20, "%d", decs_); mixgtk_config_update (DEV_FORMAT_KEY_, value); } diff --git a/mixgtk/mixgtk_input.c b/mixgtk/mixgtk_input.c index 6a04a75..a516ced 100644 --- a/mixgtk/mixgtk_input.c +++ b/mixgtk/mixgtk_input.c @@ -1,9 +1,9 @@ /* -*-c-*- -------------- mixgtk_input.c : * Implementation of the functions declared in mixgtk_input.h * ------------------------------------------------------------------ - * Last change: Time-stamp: "01/04/01 15:24:36 jose" + * $Id: mixgtk_input.c,v 1.5 2002/04/09 23:28:19 jao Exp $ * ------------------------------------------------------------------ - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -72,13 +72,13 @@ set_word_ (mix_word_t word) gint k; gint val = mix_word_magnitude (word); gboolean neg = mix_word_is_negative (word); - snprintf (BUFFER, SIZE, "%s%d", neg ? "-" : "", val); + g_snprintf (BUFFER, SIZE, "%s%d", neg ? "-" : "", val); gtk_entry_set_text (GTK_ENTRY (childs_[DEC_]), BUFFER); gtk_entry_set_text (GTK_ENTRY (childs_[SIGN_]), neg ? "-" : "+"); for (k = 1; k < 6; ++k) { mix_byte_t b = mix_word_get_byte (word, k); - snprintf (BUFFER, SIZE, "%d", (int)b); + g_snprintf (BUFFER, SIZE, "%d", (int)b); gtk_entry_set_text (GTK_ENTRY (childs_[SIGN_ + k]), BUFFER); } } diff --git a/mixgtk/mixgtk_mixal.c b/mixgtk/mixgtk_mixal.c index 22039e3..7c7c402 100644 --- a/mixgtk/mixgtk_mixal.c +++ b/mixgtk/mixgtk_mixal.c @@ -1,9 +1,9 @@ /* -*-c-*- -------------- mixgtk_mixal.c : * Implementation of the functions declared in mixgtk_mixal.h * ------------------------------------------------------------------ - * Last change: Time-stamp: "2001-04-29 22:30:43 jao" + * $Id: mixgtk_mixal.c,v 1.14 2002/04/09 23:28:19 jao Exp $ * ------------------------------------------------------------------ - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,7 +64,7 @@ insert_symbol_ (gpointer symbol, gpointer value, gpointer list) gchar *text[] = {(gchar *)symbol, DEC, WORD}; mix_word_t w = (mix_word_t)GPOINTER_TO_INT (value); - snprintf (DEC, DEC_SIZE, "%s%ld", + g_snprintf (DEC, DEC_SIZE, "%s%ld", mix_word_is_negative (w)? "-" : "+", mix_word_magnitude (w)); mix_word_print_to_buffer (w, WORD); @@ -223,7 +223,7 @@ update_tips_ (const mix_symbol_table_t *table, if (mix_symbol_table_is_defined (table, tokens[k])) { mix_word_t val = mix_symbol_table_value (table, tokens[k]); - snprintf (BUFFER, SIZE, "[ %s = %s%ld ]", tokens[k], + g_snprintf (BUFFER, SIZE, "[ %s = %s%ld ]", tokens[k], mix_word_is_negative (val)? "-" : "+", mix_word_magnitude (val)); new_tip = g_strconcat (tip, " ", BUFFER, NULL); @@ -267,7 +267,7 @@ mixgtk_mixal_load_file (void) { const gchar *line = mix_src_file_get_line (file, k + 1); - snprintf (CONT, CONT_SIZE, "%03d: %s", k + 1, line); + g_snprintf (CONT, CONT_SIZE, "%03d: %s", k + 1, line); addr = mix_vm_get_lineno_address (vm_, k + 1); if (addr != MIX_VM_CELL_NO) { diff --git a/mixgtk/mixgtk_mixvm.c b/mixgtk/mixgtk_mixvm.c index 0d776fc..351b58e 100644 --- a/mixgtk/mixgtk_mixvm.c +++ b/mixgtk/mixgtk_mixvm.c @@ -1,9 +1,9 @@ /* -*-c-*- -------------- mixgtk_mixvm.c : * Implementation of the functions declared in mixgtk_mixvm.h * ------------------------------------------------------------------ - * Last change: Time-stamp: "2001-05-19 16:39:16 jao" + * $Id: mixgtk_mixvm.c,v 1.8 2002/04/09 23:28:19 jao Exp $ * ------------------------------------------------------------------ - * Copyright (C) 2001 Free Software Foundation, Inc. + * Copyright (C) 2001, 2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,7 +91,7 @@ update_register_ (mixgtk_widget_id_t reg) g_assert_not_reached (); } gtk_entry_set_text (reg_entries_[reg - MIXGTK_WIDGET_rA], BUFFER); - snprintf (BUFFER, 20, "%s%ld", mix_word_is_negative (tipval)? "-" : "", + g_snprintf (BUFFER, 20, "%s%ld", mix_word_is_negative (tipval)? "-" : "", mix_word_magnitude (tipval)); gtk_tooltips_set_tip (tips_, GTK_WIDGET (reg_entries_[reg - MIXGTK_WIDGET_rA]), @@ -254,7 +254,7 @@ mixgtk_mixvm_update_loc (void) g_assert (loc_entry_); locval = mix_vm_get_prog_count (vm_); - snprintf (BUFFER, SIZE, "%04d", mix_short_magnitude (locval)); + g_snprintf (BUFFER, SIZE, "%04d", mix_short_magnitude (locval)); gtk_entry_set_text (loc_entry_, BUFFER); } @@ -268,11 +268,11 @@ mixgtk_mixvm_update_times (void) g_assert (uptime_ && progtime_ && laptime_); mixgtk_cmd_dispatcher_get_times (&uptime, &progtime, &laptime); - snprintf (BUFFER, SIZE, "%d", uptime); + g_snprintf (BUFFER, SIZE, "%d", uptime); gtk_label_set_text (uptime_, BUFFER); - snprintf (BUFFER, SIZE, "%d", progtime); + g_snprintf (BUFFER, SIZE, "%d", progtime); gtk_label_set_text (progtime_, BUFFER); - snprintf (BUFFER, SIZE, "%d", laptime); + g_snprintf (BUFFER, SIZE, "%d", laptime); gtk_label_set_text (laptime_, BUFFER); } @@ -372,7 +372,7 @@ on_register_click (GtkWidget *w, GdkEvent *e, gpointer data) { if (w == GTK_WIDGET (reg_entries_[2 + k])) { - snprintf (BUFFER, SIZE, "Register I%d", k); + g_snprintf (BUFFER, SIZE, "Register I%d", k); mixgtk_input_short (BUFFER, mix_vm_get_rI (vm_, k), register_i_, GINT_TO_POINTER (k)); break; @@ -395,7 +395,7 @@ on_memory_cells_select_row (GtkCList *w, gint row, gint col, { enum {SIZE = 30}; static gchar BUFFER[SIZE]; - snprintf (BUFFER, SIZE, "Memory cell no. %d", row); + g_snprintf (BUFFER, SIZE, "Memory cell no. %d", row); mixgtk_input_word (BUFFER, mix_vm_get_addr_contents (vm_, mix_short_new (row)), mem_cell_, GINT_TO_POINTER (row)); |