better includes?

This commit is contained in:
Russ Cox 2006-01-17 13:22:03 +00:00
parent f18ed453eb
commit f60d3735c6
29 changed files with 56 additions and 137 deletions

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
/* /*

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
/* format the output into f->to and return the number of characters fmted */ /* format the output into f->to and return the number of characters fmted */

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
/* format the output into f->to and return the number of characters fmted */ /* format the output into f->to and return the number of characters fmted */

View File

@ -11,17 +11,10 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdio.h> #include <u.h>
#include <math.h> #include <libc.h>
#include <float.h> #include <float.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <stdarg.h>
#include <ctype.h> #include <ctype.h>
#include <fmt.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
enum enum
@ -55,6 +48,7 @@ static double pows10[] =
1e150, 1e151, 1e152, 1e153, 1e154, 1e155, 1e156, 1e157, 1e158, 1e159, 1e150, 1e151, 1e152, 1e153, 1e154, 1e155, 1e156, 1e157, 1e158, 1e159,
}; };
#undef pow10
#define pow10(x) fmtpow10(x) #define pow10(x) fmtpow10(x)
static double static double

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
enum enum

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
/* /*

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
/* /*

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
int int

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdlib.h> #include <u.h>
#include <stdarg.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
char* char*

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
/* /*

View File

@ -11,9 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include "plan9.h" #include <libc.h>
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
int int

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <stdlib.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
Rune* Rune*

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
Rune* Rune*

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
Rune* Rune*

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
int int

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
int int

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
Rune* Rune*

View File

@ -11,22 +11,9 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
/*
* Plan 9 port version must include libc.h in order to
* get Plan 9 debugging malloc, which sometimes returns
* different pointers than the standard malloc.
*/
#ifdef PLAN9PORT
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include "fmtdef.h" #include "fmtdef.h"
#else
#include <stdlib.h>
#include <string.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h"
#endif
static int static int
runeFmtStrFlush(Fmt *f) runeFmtStrFlush(Fmt *f)

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <string.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
int int

View File

@ -11,9 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include "plan9.h" #include <libc.h>
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
char* char*

View File

@ -11,9 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include "plan9.h" #include <libc.h>
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
char* char*

View File

@ -11,9 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include "plan9.h" #include <libc.h>
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
int int

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include <fmt.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
int int

View File

@ -11,14 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdlib.h> #include <u.h>
#include <math.h> #include <libc.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
static ulong static ulong

View File

@ -11,9 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include "plan9.h" #include <libc.h>
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
int int

View File

@ -11,9 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdarg.h> #include <u.h>
#include "plan9.h" #include <libc.h>
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
char* char*

View File

@ -11,22 +11,10 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
/*
* Plan 9 port version must include libc.h in order to
* get Plan 9 debugging malloc, which sometimes returns
* different pointers than the standard malloc.
*/
#ifdef PLAN9PORT
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include "fmtdef.h" #include "fmtdef.h"
#else
#include <stdlib.h>
#include <string.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h"
#endif
static int static int
fmtStrFlush(Fmt *f) fmtStrFlush(Fmt *f)

View File

@ -11,10 +11,8 @@
* ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/ */
#include <stdlib.h> #include <u.h>
#include <stdarg.h> #include <libc.h>
#include "plan9.h"
#include "fmt.h"
#include "fmtdef.h" #include "fmtdef.h"
int int