From 1487eebe7953eae9788ea0735da94b2af6a95f12 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Fri, 22 Jan 2021 08:49:18 +0100 Subject: [PATCH] Remove time counter Nobody uses that, and it requires running extra code for each line --- include/asm/asm.h | 1 - src/asm/main.c | 22 ---------------------- src/asm/parser.y | 4 +--- 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/include/asm/asm.h b/include/asm/asm.h index 8a563a18..66cf60a0 100644 --- a/include/asm/asm.h +++ b/include/asm/asm.h @@ -24,7 +24,6 @@ #define MAXMACROARGS 99999 #define MAXINCPATHS 128 -extern uint32_t nTotalLines; extern struct Section *pCurrentSection; #endif /* RGBDS_ASM_ASM_H */ diff --git a/src/asm/main.c b/src/asm/main.c index 530f293b..0cff8c3d 100644 --- a/src/asm/main.c +++ b/src/asm/main.c @@ -45,9 +45,6 @@ size_t cldefines_bufsize; const size_t cldefine_entrysize = 2 * sizeof(void *); char **cldefines; -clock_t nStartClock, nEndClock; -uint32_t nTotalLines; - #if defined(YYDEBUG) && YYDEBUG extern int yydebug; #endif @@ -485,9 +482,6 @@ int main(int argc, char *argv[]) lexer_Init(); fstk_Init(tzMainfile, maxRecursionDepth); - nStartClock = clock(); - - nTotalLines = 0; sym_Init(now); sym_SetExportAll(exportall); @@ -503,22 +497,6 @@ int main(int argc, char *argv[]) sect_CheckUnionClosed(); - double timespent; - - nEndClock = clock(); - timespent = ((double)(nEndClock - nStartClock)) - / (double)CLOCKS_PER_SEC; - if (verbose) { - printf("Success! %" PRIu32 " lines in %d.%02d seconds ", - nTotalLines, (int)timespent, - ((int)(timespent * 100.0)) % 100); - if (timespent < FLT_MIN_EXP) - printf("(INFINITY lines/minute)\n"); - else - printf("(%d lines/minute)\n", - (int)(60 / timespent * nTotalLines)); - } - if (oFailedOnMissingInclude) return 0; diff --git a/src/asm/parser.y b/src/asm/parser.y index ccbd9661..09a3af13 100644 --- a/src/asm/parser.y +++ b/src/asm/parser.y @@ -565,9 +565,7 @@ lines : /* empty */ | lines { nListCountEmpty = 0; nPCOffset = 0; - } line { - nTotalLines++; - } + } line ; line : label T_NEWLINE