summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjaortega <jaortega>2000-11-19 00:01:17 +0000
committerjaortega <jaortega>2000-11-19 00:01:17 +0000
commitb096c061eb3e2992830f37c361f9179738aba5eb (patch)
tree7a2d98d51439bedfda9264f17f4ed3e5c38fdcfc
parent8794638b9b3b29e49d9483cfd99ad46620fc7ebf (diff)
downloadmdk-b096c061eb3e2992830f37c361f9179738aba5eb.tar.gz
mdk-b096c061eb3e2992830f37c361f9179738aba5eb.tar.bz2
(mix_symbol_table_print) local symbols (e.g. 3B) are skipped
-rw-r--r--mixlib/mix_symbol_table.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/mixlib/mix_symbol_table.c b/mixlib/mix_symbol_table.c
index 7f3c4df..36c15a9 100644
--- a/mixlib/mix_symbol_table.c
+++ b/mixlib/mix_symbol_table.c
@@ -19,7 +19,7 @@
*
*/
-
+#include <ctype.h> /* isdigit */
#include "mix_symbol_table.h"
/* Create an empty table */
@@ -111,20 +111,31 @@ mix_symbol_table_is_defined(const mix_symbol_table_t *table, const gchar *sym)
}
/* Print table */
+#define is_local_sym_(sym) \
+ ((sym) && (strlen(sym)==2) && (sym[1] == 'B') && isdigit(sym[0]))
+
static void
print_sym_rows_(gpointer symbol, gpointer value, gpointer file)
{
- mix_word_t word = (mix_word_t)GPOINTER_TO_UINT(value);
- fprintf((FILE *)file, "%s: %s%ld\n", (gchar *)symbol,
- mix_word_is_negative(word)? "-":"", mix_word_magnitude(word));
+ char *s = (char *)symbol;
+ if (!is_local_sym_(s)) {
+ mix_word_t word = (mix_word_t)GPOINTER_TO_UINT(value);
+ fprintf((FILE *)file, "%s: %s%ld\n", s,
+ mix_word_is_negative(word)? "-":"",
+ mix_word_magnitude(word));
+ }
}
static void
print_sym_line_(gpointer symbol, gpointer value, gpointer file)
{
- mix_word_t word = (mix_word_t)GPOINTER_TO_UINT(value);
- fprintf((FILE *)file, ",%s =%s%ld", (gchar *)symbol,
- mix_word_is_negative(word)? "-":"", mix_word_magnitude(word));
+ char *s = (char *)symbol;
+ if (!is_local_sym_(s)) {
+ mix_word_t word = (mix_word_t)GPOINTER_TO_UINT(value);
+ fprintf((FILE *)file, ",%s =%s%ld", s,
+ mix_word_is_negative(word)? "-":"",
+ mix_word_magnitude(word));
+ }
}
void