From c444cae5ac1f65949c305f97cc6dd9f93b9e6a26 Mon Sep 17 00:00:00 2001 From: ketmar Date: Fri, 15 Jun 2012 15:32:17 +0300 Subject: [PATCH] some cosmetix for NEATCC (neatcc is not able to build k8jam yet) --- src/hash.c | 12 ++++++++++++ src/make.c | 6 +++--- src/make1.c | 8 ++++---- src/progress.c | 2 ++ src/progress.h | 2 ++ 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/hash.c b/src/hash.c index 3a785bb..3c1e1ee 100644 --- a/src/hash.c +++ b/src/hash.c @@ -88,6 +88,17 @@ static void hashstat (struct hash *hp) { if (here && !run) ++sets; run = here; } +#ifdef __NEATCC__ + printf("%s table: %d+%d+%d (%dK+%dK) items+table+hash, density: count=%d; sets=%d\n", + hp->name, + count, + hp->items.nel, + hp->tab.nel, + hp->items.nel*hp->items.size/1024, + (int)(hp->tab.nel*sizeof(ITEM **)/1024), + count, sets + ); +#else printf("%s table: %d+%d+%d (%dK+%dK) items+table+hash, %f density\n", hp->name, count, @@ -97,6 +108,7 @@ static void hashstat (struct hash *hp) { (int)(hp->tab.nel*sizeof(ITEM **)/1024), (float)count/(float)sets ); +#endif } diff --git a/src/make.c b/src/make.c index 00ad6fe..c68d2e8 100644 --- a/src/make.c +++ b/src/make.c @@ -141,10 +141,10 @@ int make (int n_targets, const char **targets, int anyhow) { //#ifdef OPT_HEADER_CACHE_EXT hcache_done(); //#endif -//#ifdef OPT_IMPROVED_PROGRESS_EXT - globs.updating = counts->updating; + globs.updating = counts->updating; //k8 +#ifndef __NEATCC__ globs.progress = progress_start(counts->updating); -//#endif +#endif status = counts->cantfind || counts->cantmake; for (i = 0; i < n_targets; ++i) status |= make1(bindtarget(targets[i])); return status; diff --git a/src/make1.c b/src/make1.c index 39feab7..6431b1a 100644 --- a/src/make1.c +++ b/src/make1.c @@ -193,9 +193,9 @@ static void make1b (TARGET *t) { /* set "progress" so that make1c() counts this target among the successes/failures. */ if (t->actions) { ++counts->total; -//#ifndef OPT_IMPROVED_PROGRESS_EXT - //if (DEBUG_MAKE && !(counts->total % 100)) printf("...on %dth target...\n", counts->total); -//#else +#ifdef __NEATCC__ + if (DEBUG_MAKE && !(counts->total % 100)) printf("...on %dth target...\n", counts->total); +#else { double est_remaining = progress_update(globs.progress, counts->total); if (est_remaining > 0.0) { @@ -209,7 +209,7 @@ static void make1b (TARGET *t) { } } } -//#endif +#endif pushsettings(t->settings); t->cmds = (char *)make1cmds(t->actions); popsettings(t->settings); diff --git a/src/progress.c b/src/progress.c index e7b4d3c..68e47c4 100644 --- a/src/progress.c +++ b/src/progress.c @@ -1,3 +1,4 @@ +#ifndef __NEATCC__ #include #include #include @@ -96,3 +97,4 @@ double progress_update (PROGRESS *progress, int completed) { LAST_STAMP(progress).when = now; return progress_estimate(progress); } +#endif diff --git a/src/progress.h b/src/progress.h index 1552b2b..32bd996 100644 --- a/src/progress.h +++ b/src/progress.h @@ -2,12 +2,14 @@ #define JAMH_PROGRESS_H +#ifndef __NEATCC__ struct _PROGRESS; typedef struct _PROGRESS PROGRESS; extern PROGRESS *progress_start (int total); extern double progress_update (PROGRESS *progress, int completed); +#endif #endif -- 2.11.4.GIT