From 9ede9b80e0787505e7f20aa08f88fb05c7eaa543 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 13 Jul 2021 14:44:08 +0200 Subject: [PATCH] Issue a warnong only when ngdebug is set. --- src/spicelib/devices/cpl/cplhash.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/spicelib/devices/cpl/cplhash.c b/src/spicelib/devices/cpl/cplhash.c index 9c90a4df6..e058cf13f 100644 --- a/src/spicelib/devices/cpl/cplhash.c +++ b/src/spicelib/devices/cpl/cplhash.c @@ -22,6 +22,7 @@ CPLunsetup() calls mem_delete(). */ #include "ngspice/ngspice.h" #include "ngspice/iferrmsg.h" #include "ngspice/hash.h" +#include "ngspice/fteext.h" // #define DB_FULL /* uncomment for debugging output, all addresses to files */ #ifdef DB_FULL @@ -73,7 +74,7 @@ int memsaved(void *ptr) { #endif #endif } else - fprintf(stderr, "Could not insert item into hashtable at 0x%p\n", ptr); + fprintf(stderr, "Warning: Could not insert item into hashtable at 0x%p\n", ptr); gc_is_on = 1; } return OK; @@ -90,8 +91,8 @@ void memdeleted(const void *ptr) { fprintf(freelog, "0x%p\n", ptr); #endif } - else - fprintf(stderr, "Could not delete item from hashtable at 0x%p\n", ptr); + else if (ft_ngdebug) + fprintf(stderr, "Warning: Could not delete item from hashtable at 0x%p\n", ptr); #else } #endif