]> git.ipfire.org Git - thirdparty/git.git/blobdiff - trace.c
C99: remove hardcoded-out !HAVE_VARIADIC_MACROS code
[thirdparty/git.git] / trace.c
diff --git a/trace.c b/trace.c
index f726686fd92f0b9f388b7dddeca55edc2ea8d8a8..794a087c21e100e147665181a592bc811b3c1265 100644 (file)
--- a/trace.c
+++ b/trace.c
@@ -108,16 +108,11 @@ static int prepare_trace_line(const char *file, int line,
        gettimeofday(&tv, NULL);
        secs = tv.tv_sec;
        localtime_r(&secs, &tm);
-       strbuf_addf(buf, "%02d:%02d:%02d.%06ld ", tm.tm_hour, tm.tm_min,
-                   tm.tm_sec, (long) tv.tv_usec);
-
-#ifdef HAVE_VARIADIC_MACROS
-       /* print file:line */
-       strbuf_addf(buf, "%s:%d ", file, line);
+       strbuf_addf(buf, "%02d:%02d:%02d.%06ld %s:%d", tm.tm_hour, tm.tm_min,
+                   tm.tm_sec, (long) tv.tv_usec, file, line);
        /* align trace output (column 40 catches most files names in git) */
        while (buf->len < 40)
                strbuf_addch(buf, ' ');
-#endif
 
        return 1;
 }
@@ -229,74 +224,6 @@ static void trace_performance_vprintf_fl(const char *file, int line,
        strbuf_release(&buf);
 }
 
-#ifndef HAVE_VARIADIC_MACROS
-
-void trace_printf(const char *format, ...)
-{
-       va_list ap;
-       va_start(ap, format);
-       trace_vprintf_fl(NULL, 0, &trace_default_key, format, ap);
-       va_end(ap);
-}
-
-void trace_printf_key(struct trace_key *key, const char *format, ...)
-{
-       va_list ap;
-       va_start(ap, format);
-       trace_vprintf_fl(NULL, 0, key, format, ap);
-       va_end(ap);
-}
-
-void trace_argv_printf(const char **argv, const char *format, ...)
-{
-       va_list ap;
-       va_start(ap, format);
-       trace_argv_vprintf_fl(NULL, 0, argv, format, ap);
-       va_end(ap);
-}
-
-void trace_strbuf(struct trace_key *key, const struct strbuf *data)
-{
-       trace_strbuf_fl(NULL, 0, key, data);
-}
-
-void trace_performance(uint64_t nanos, const char *format, ...)
-{
-       va_list ap;
-       va_start(ap, format);
-       trace_performance_vprintf_fl(NULL, 0, nanos, format, ap);
-       va_end(ap);
-}
-
-void trace_performance_since(uint64_t start, const char *format, ...)
-{
-       va_list ap;
-       va_start(ap, format);
-       trace_performance_vprintf_fl(NULL, 0, getnanotime() - start,
-                                    format, ap);
-       va_end(ap);
-}
-
-void trace_performance_leave(const char *format, ...)
-{
-       va_list ap;
-       uint64_t since;
-
-       if (perf_indent)
-               perf_indent--;
-
-       if (!format) /* Allow callers to leave without tracing anything */
-               return;
-
-       since = perf_start_times[perf_indent];
-       va_start(ap, format);
-       trace_performance_vprintf_fl(NULL, 0, getnanotime() - since,
-                                    format, ap);
-       va_end(ap);
-}
-
-#else
-
 void trace_printf_key_fl(const char *file, int line, struct trace_key *key,
                         const char *format, ...)
 {
@@ -342,9 +269,6 @@ void trace_performance_leave_fl(const char *file, int line,
        va_end(ap);
 }
 
-#endif /* HAVE_VARIADIC_MACROS */
-
-
 static const char *quote_crnl(const char *path)
 {
        static struct strbuf new_path = STRBUF_INIT;