From 3297ca7f3a3313e80e49547c857e1593286316b8 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Sun, 31 May 2020 14:53:10 -0700 Subject: minor changes --- include/libn.h | 8 +++++--- include/u.h | 10 ++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/libn.h b/include/libn.h index 721defd..a4b9bf5 100644 --- a/include/libn.h +++ b/include/libn.h @@ -155,8 +155,8 @@ typedef uint32 rune; int utf8·fullrune(byte *s, int n); byte *utf8·findrune(byte *s, long i); byte *utf8·findrrune(byte* s, long c); -int utf8·chartorune(rune *r, byte *s); -int utf8·runetochar(byte *s, rune *r); +int utf8·bytetorune(rune *r, byte *s); +int utf8·runetobyte(byte *s, rune *r); int utf8·len(byte *s); int utf8·runelen(rune r); int utf8·isletter(rune r); @@ -377,6 +377,8 @@ uint64 rng·randi(int max); /* from plan9 libc */ +#define ERRMAX 128 /* max length of error string */ + #define SET(x) ((x)=0) #define USED(x) if(x){}else{} #ifdef __GNUC__ @@ -397,7 +399,7 @@ extern char *argv0; argc--; argv++; break;\ }\ _argc = 0;\ - while(*_args && (_args += utf8·chartorune(&_argc, _args)))\ + while(*_args && (_args += utf8·bytetorune(&_argc, _args)))\ switch(_argc) #define ARGEND SET(_argt);USED(_argt);USED(_argc);USED(_args);}USED(argv);USED(argc); #define ARGF() (_argt=_args, _args="",\ diff --git a/include/u.h b/include/u.h index 8044fe0..d6d6f16 100644 --- a/include/u.h +++ b/include/u.h @@ -17,8 +17,12 @@ typedef char byte; typedef unsigned char ubyte; typedef signed char sbyte; +typedef unsigned long ulong; +typedef signed long slong; + typedef long long vlong; typedef unsigned long long uvlong; +typedef signed long long svlong; typedef unsigned int uint; typedef uint8_t uint8; @@ -44,12 +48,6 @@ typedef int error; // ------------------------------------------------------------------ // Global macros -#ifdef RELEASE -#define Assert(x) -#else -#define Assert(x) assert(x) -#endif - #define arrlen(Array) (sizeof(Array) / sizeof((Array)[0])) #define arrend(Array) ((Array) + arrlen(Array)) -- cgit v1.2.1