mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
use plan9 malloc
This commit is contained in:
parent
e290cfc138
commit
d1b4cfde55
4 changed files with 8 additions and 12 deletions
|
@ -25,7 +25,9 @@
|
||||||
#define vlong _fmtvlong
|
#define vlong _fmtvlong
|
||||||
#define uvlong _fmtuvlong
|
#define uvlong _fmtuvlong
|
||||||
|
|
||||||
|
#ifndef USED
|
||||||
#define USED(x) if(x);else
|
#define USED(x) if(x);else
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef unsigned char uchar;
|
typedef unsigned char uchar;
|
||||||
typedef unsigned short ushort;
|
typedef unsigned short ushort;
|
||||||
|
@ -37,6 +39,7 @@ typedef unsigned long long uvlong;
|
||||||
typedef long long vlong;
|
typedef long long vlong;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#undef nil
|
||||||
#define nil 0 /* cannot be ((void*)0) because used for function pointers */
|
#define nil 0 /* cannot be ((void*)0) because used for function pointers */
|
||||||
|
|
||||||
typedef int (*Fmts)(Fmt*);
|
typedef int (*Fmts)(Fmt*);
|
||||||
|
|
|
@ -11,11 +11,8 @@
|
||||||
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
|
* 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 <stdlib.h>
|
|
||||||
#include "utf.h"
|
|
||||||
#include "fmt.h"
|
|
||||||
#include "fmtdef.h"
|
#include "fmtdef.h"
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -11,11 +11,8 @@
|
||||||
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
|
* 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 <stdlib.h>
|
|
||||||
#include "utf.h"
|
|
||||||
#include "fmt.h"
|
|
||||||
#include "fmtdef.h"
|
#include "fmtdef.h"
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -31,6 +31,5 @@ vsmprint(char *fmt, va_list args)
|
||||||
n = dofmt(&f, fmt);
|
n = dofmt(&f, fmt);
|
||||||
if(n < 0)
|
if(n < 0)
|
||||||
return nil;
|
return nil;
|
||||||
*(char*)f.to = '\0';
|
return fmtstrflush(&f);
|
||||||
return (char*)f.start;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue