[PATCH] Avoid using "common" macro names as goto labels

Mike Hommey mh+jemalloc at glandium.org
Tue Apr 10 06:11:52 PDT 2012


From: Mike Hommey <mh at glandium.org>

OUT and ERROR are defined under mingw.
---
 src/prof.c |   14 +++++++-------
 src/util.c |    4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/prof.c b/src/prof.c
index d2532ec..2807057 100644
--- a/src/prof.c
+++ b/src/prof.c
@@ -854,7 +854,7 @@ prof_dump(bool propagate_err, const char *filename, bool leakcheck)
 			if (opt_abort)
 				abort();
 		}
-		goto ERROR;
+		goto ERR;
 	}
 
 	/* Merge per thread profile stats, and sum them in cnt_all. */
@@ -870,7 +870,7 @@ prof_dump(bool propagate_err, const char *filename, bool leakcheck)
 		    " [%"PRIu64": %"PRIu64"] @ heapprofile\n",
 		    cnt_all.curobjs, cnt_all.curbytes,
 		    cnt_all.accumobjs, cnt_all.accumbytes))
-			goto ERROR;
+			goto ERR;
 	} else {
 		if (prof_printf(propagate_err,
 		    "heap profile: %"PRId64": %"PRId64
@@ -878,22 +878,22 @@ prof_dump(bool propagate_err, const char *filename, bool leakcheck)
 		    cnt_all.curobjs, cnt_all.curbytes,
 		    cnt_all.accumobjs, cnt_all.accumbytes,
 		    ((uint64_t)1U << opt_lg_prof_sample)))
-			goto ERROR;
+			goto ERR;
 	}
 
 	/* Dump  per ctx profile stats. */
 	for (tabind = 0; ckh_iter(&bt2ctx, &tabind, &bt.v, &ctx.v)
 	    == false;) {
 		if (prof_dump_ctx(propagate_err, ctx.p, bt.p))
-			goto ERROR;
+			goto ERR;
 	}
 
 	/* Dump /proc/<pid>/maps if possible. */
 	if (prof_dump_maps(propagate_err))
-		goto ERROR;
+		goto ERR;
 
 	if (prof_flush(propagate_err))
-		goto ERROR;
+		goto ERR;
 	close(prof_dump_fd);
 	prof_leave();
 
@@ -909,7 +909,7 @@ prof_dump(bool propagate_err, const char *filename, bool leakcheck)
 	}
 
 	return (false);
-ERROR:
+ERR:
 	prof_leave();
 	return (true);
 }
diff --git a/src/util.c b/src/util.c
index 107bdcf..8a62738 100644
--- a/src/util.c
+++ b/src/util.c
@@ -349,7 +349,7 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap)
 	f = format;
 	while (true) {
 		switch (*f) {
-		case '\0': goto OUT;
+		case '\0': goto END;
 		case '%': {
 			bool alt_form = false;
 			bool zero_pad = false;
@@ -542,7 +542,7 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap)
 			break;
 		}}
 	}
-	OUT:
+	END:
 	if (i < size)
 		str[i] = '\0';
 	else
-- 
1.7.9.5




More information about the jemalloc-discuss mailing list