]> git.ipfire.org Git - thirdparty/git.git/commitdiff
quote.h: simplify the inclusion
authorJonathan Nieder <jrnieder@gmail.com>
Wed, 5 Jan 2011 00:36:34 +0000 (18:36 -0600)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Feb 2011 23:15:17 +0000 (15:15 -0800)
Attempting to include quote.h without first including strbuf.h results
in warnings:

 ./quote.h:33:33: warning: ‘struct strbuf’ declared inside parameter list
 ./quote.h:33:33: warning: its scope is only this definition or declaration, which is probably not what you want
 ./quote.h:34:34: warning: ‘struct strbuf’ declared inside parameter list
 ...

Add a toplevel declaration for struct strbuf to avoid this.

While at it, stop including system headers from quote.h.  git source
files already need to include git-compat-util.h sooner to ensure the
appropriate feature test macros are defined.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
quote.h

diff --git a/quote.h b/quote.h
index 38003bff5f97a11e051b106522a8548d43d24f6c..024e21d80ceaa37ec1f893acc907a62092560d21 100644 (file)
--- a/quote.h
+++ b/quote.h
@@ -1,8 +1,7 @@
 #ifndef QUOTE_H
 #define QUOTE_H
 
-#include <stddef.h>
-#include <stdio.h>
+struct strbuf;
 
 /* Help to copy the thing properly quoted for the shell safety.
  * any single quote is replaced with '\'', any exclamation point