From 5ca9fdb0428e1875fcaa0e8a33c8b1be5b05dd79 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Tue, 5 Apr 2022 16:53:21 -0400 Subject: [PATCH] Tweak (penv) formatting. Remove unused include from hash.c --- src/env.c | 9 ++++----- src/hash.c | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/env.c b/src/env.c index 516d5fa..fc3d6b2 100644 --- a/src/env.c +++ b/src/env.c @@ -234,11 +234,7 @@ void printEnv(struct Environment* env, int printPointers) if (env->table.elements[i].symbol == NULL) { continue; } - if (printPointers) { - printf("[%d]: `%s` %p :: ", i, env->table.elements[i].symbol, env->table.elements[i].symbol); - } else { - printf("[%d]: `%s` :: ", i, env->table.elements[i].symbol); - } + printf("%s: ", env->table.elements[i].symbol); printf(""); if (env->table.elements[i].object.type == TYPE_STRING) { printf("\""); @@ -254,6 +250,9 @@ void printEnv(struct Environment* env, int printPointers) } free(s); } + if (printPointers) { + printf(" @ %p", env->table.elements[i].symbol); + } printf("\n"); } } diff --git a/src/hash.c b/src/hash.c index 3212f43..d7564bf 100644 --- a/src/hash.c +++ b/src/hash.c @@ -1,7 +1,6 @@ #include "hash.h" #include "env.h" -#include #include static unsigned long hash(const char *str)