diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2004-06-07 20:16:19 +0000 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2004-06-07 20:16:19 +0000 |
commit | 28ed22f21927b6915a897756f6f5533830c7aba1 (patch) | |
tree | 5c05544f941ff62e1f2048622bfdc402138cce27 | |
parent | 15a76ff21fa9f405830829523d13da72504f7174 (diff) | |
download | mdk-28ed22f21927b6915a897756f6f5533830c7aba1.tar.gz mdk-28ed22f21927b6915a897756f6f5533830c7aba1.tar.bz2 |
(print_sym_rows_): align symbol values.
-rw-r--r-- | mixlib/mix_symbol_table.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/mixlib/mix_symbol_table.c b/mixlib/mix_symbol_table.c index debf04b..2ddec40 100644 --- a/mixlib/mix_symbol_table.c +++ b/mixlib/mix_symbol_table.c @@ -1,22 +1,22 @@ /* -*-c-*- -------------- mix_symbol_table.c : * Implementation of the functions declared in mix_symbol_table.h * ------------------------------------------------------------------ - * Copyright (C) 2000, 2001 Free Software Foundation, Inc. - * + * Copyright (C) 2000, 2001, 2004 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * + * */ #include <ctype.h> /* isdigit */ @@ -42,7 +42,7 @@ mix_symbol_table_new_from_file (FILE *file) { gchar sym[MIX_SYM_MAX_LEN + 1]; glong val; - + while ( getc (file) == ',' ) { if ( fscanf (file, "%s =%ld", sym, &val) != EOF ) @@ -111,11 +111,11 @@ mix_symbol_table_substract_table (mix_symbol_table_t *table, /* Add/remove symbols one by one */ gint -mix_symbol_table_add (mix_symbol_table_t *table, +mix_symbol_table_add (mix_symbol_table_t *table, const gchar *sym, mix_word_t value) { gpointer key, val; - + if ( table == NULL || sym == NULL ) return MIX_SYM_FAIL; if ( strlen (sym) > MIX_SYM_MAX_LEN ) return MIX_SYM_LONG; @@ -131,11 +131,11 @@ mix_symbol_table_add (mix_symbol_table_t *table, /* Add or modify symbol if it exists */ gint -mix_symbol_table_insert (mix_symbol_table_t *table, +mix_symbol_table_insert (mix_symbol_table_t *table, const gchar *sym, mix_word_t new_value) { gpointer key, val; - + if ( table == NULL || sym == NULL ) return MIX_SYM_FAIL; if ( strlen (sym) > MIX_SYM_MAX_LEN ) return MIX_SYM_LONG; @@ -166,7 +166,7 @@ print_sym_rows_ (gpointer symbol, gpointer value, gpointer file) char *s = (char *)symbol; if (skip_ && !is_local_sym_ (s)) { mix_word_t word = (mix_word_t)GPOINTER_TO_UINT (value); - fprintf((FILE *)file, "%s: %s%ld\n", s, + fprintf((FILE *)file, "%-20s: %s%ld\n", s, mix_word_is_negative (word)? "-":"", mix_word_magnitude (word)); } @@ -178,7 +178,7 @@ print_sym_line_ (gpointer symbol, gpointer value, gpointer file) char *s = (char *)symbol; if (skip_ && !is_local_sym_ (s)) { mix_word_t word = (mix_word_t)GPOINTER_TO_UINT (value); - fprintf((FILE *)file, ",%s =%s%ld", s, + fprintf((FILE *)file, ",%s =%s%ld", s, mix_word_is_negative (word)? "-":"", mix_word_magnitude (word)); } @@ -195,4 +195,4 @@ mix_symbol_table_print (const mix_symbol_table_t *table, gint mode, if ( mode == MIX_SYM_LINE ) putc (';', file); /* to mark end-of-table */ } - + |