Merge branch 'bw/trace-no-inline-getnanotime'
authorJunio C Hamano <gitster@pobox.com>
Thu, 16 Oct 2014 21:16:45 +0000 (14:16 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Oct 2014 21:16:45 +0000 (14:16 -0700)
No file-scope static variables in an inlined function, please.

* bw/trace-no-inline-getnanotime:
trace.c: do not mark getnanotime() as "inline"

1  2 
trace.c
diff --combined trace.c
index b6f25a23fdf8b6eec64181b5d6b56909bbe4ae7b,03990df747ebf3be4c082c38f2a8bb03d31b945a..477860894196e32d7db990459cef47175277c441
+++ b/trace.c
@@@ -216,7 -216,7 +216,7 @@@ void trace_argv_printf(const char **arg
        va_end(ap);
  }
  
 -void trace_strbuf(const char *key, const struct strbuf *data)
 +void trace_strbuf(struct trace_key *key, const struct strbuf *data)
  {
        trace_strbuf_fl(NULL, 0, key, data);
  }
@@@ -298,12 -298,13 +298,12 @@@ void trace_repo_setup(const char *prefi
  {
        static struct trace_key key = TRACE_KEY_INIT(SETUP);
        const char *git_work_tree;
 -      char cwd[PATH_MAX];
 +      char *cwd;
  
        if (!trace_want(&key))
                return;
  
 -      if (!getcwd(cwd, PATH_MAX))
 -              die("Unable to get current working directory");
 +      cwd = xgetcwd();
  
        if (!(git_work_tree = get_git_work_tree()))
                git_work_tree = "(null)";
        trace_printf_key(&key, "setup: worktree: %s\n", quote_crnl(git_work_tree));
        trace_printf_key(&key, "setup: cwd: %s\n", quote_crnl(cwd));
        trace_printf_key(&key, "setup: prefix: %s\n", quote_crnl(prefix));
 +
 +      free(cwd);
  }
  
  int trace_want(struct trace_key *key)
@@@ -385,7 -384,7 +385,7 @@@ static inline uint64_t gettimeofday_nan
   * Returns nanoseconds since the epoch (01/01/1970), for performance tracing
   * (i.e. favoring high precision over wall clock time accuracy).
   */
inline uint64_t getnanotime(void)
+ uint64_t getnanotime(void)
  {
        static uint64_t offset;
        if (offset > 1) {