diff --git a/c3s/c3s.c b/c3s/c3s.c
index 5327c21..ff90bb2 100644
--- a/c3s/c3s.c
+++ b/c3s/c3s.c
@@ -43,7 +43,6 @@ sw buf_xfer_spaces (s_buf *out, s_buf *in)
assert(in);
assert(out);
while ((r = buf_peek_character_utf8(in, &c)) > 0 &&
- c >= 0 &&
c < UCD_MAX &&
g_ucd[c].flags & (UCD_OTHER_CONTROL | UCD_SEPARATOR_SPACE)) {
csize = r;
@@ -60,10 +59,10 @@ sw buf_xfer_spaces (s_buf *out, s_buf *in)
int main (int argc, char **argv)
{
- s8 i[BUF_SIZE];
+ char i[BUF_SIZE];
s_buf in;
s_tag input;
- s8 o[BUF_SIZE];
+ char o[BUF_SIZE];
s_buf out;
sw r;
s_tag result;
diff --git a/ic3/buf_linenoise.c b/ic3/buf_linenoise.c
index 4b6f968..9acc8cf 100644
--- a/ic3/buf_linenoise.c
+++ b/ic3/buf_linenoise.c
@@ -18,15 +18,15 @@
#include "../linenoise/linenoise.h"
typedef struct buf_linenoise {
- s_buf buf;
- bool eof;
- const s8 *prompt;
+ s_buf buf;
+ bool eof;
+ const char *prompt;
} s_buf_linenoise;
sw buf_linenoise_refill_fgets (s_buf *buf);
sw buf_linenoise_refill_linenoise (s_buf *buf);
-void buf_linenoise_close (s_buf *buf, const s8 *history_path)
+void buf_linenoise_close (s_buf *buf, const char *history_path)
{
assert(buf);
if (history_path)
@@ -38,8 +38,8 @@ void buf_linenoise_close (s_buf *buf, const s8 *history_path)
puts("");
}
-s_buf * buf_linenoise_open_r (s_buf *buf, const s8 *prompt,
- const s8 *history_path)
+s_buf * buf_linenoise_open_r (s_buf *buf, const char *prompt,
+ const char *history_path)
{
s_buf_linenoise *buf_linenoise;
assert(buf);
@@ -112,7 +112,7 @@ sw buf_linenoise_refill_linenoise (s_buf *buf)
}
linenoiseHistoryAdd(buf_linenoise->buf.ptr.p);
buf_linenoise_len = strlen(buf_linenoise->buf.ptr.p);
- buf_linenoise->buf.ptr.ps8[buf_linenoise_len++] = '\n';
+ buf_linenoise->buf.ptr.pchar[buf_linenoise_len++] = '\n';
buf_linenoise->buf.size = buf_linenoise->buf.wpos = buf_linenoise_len;
buf_linenoise->buf.rpos = 0;
}
diff --git a/ic3/buf_linenoise.h b/ic3/buf_linenoise.h
index 88f2ebd..dea3d29 100644
--- a/ic3/buf_linenoise.h
+++ b/ic3/buf_linenoise.h
@@ -17,8 +17,8 @@
#ifndef IC3_BUF_LINENOISE_H
#define IC3_BUF_LINENOISE_H
-void buf_linenoise_close (s_buf *buf, const s8 *history_path);
-s_buf * buf_linenoise_open_r (s_buf *buf, const s8 *prompt,
- const s8 *history_path);
+void buf_linenoise_close (s_buf *buf, const char *history_path);
+s_buf * buf_linenoise_open_r (s_buf *buf, const char *prompt,
+ const char *history_path);
#endif /* IC3_BUF_LINENOISE_H */
diff --git a/ic3/ic3.c b/ic3/ic3.c
index 68af6bc..20bed7b 100644
--- a/ic3/ic3.c
+++ b/ic3/ic3.c
@@ -49,7 +49,6 @@ sw ic3_buf_ignore_spaces (s_buf *out, s_buf *in)
assert(in);
assert(out);
while ((r = buf_peek_character_utf8(in, &c)) > 0 &&
- c >= 0 &&
c < UCD_MAX &&
g_ucd[c].flags & (UCD_OTHER_CONTROL | UCD_SEPARATOR_SPACE)) {
csize = r;
@@ -73,7 +72,6 @@ sw buf_xfer_spaces (s_buf *out, s_buf *in)
assert(in);
assert(out);
while ((r = buf_peek_character_utf8(in, &c)) > 0 &&
- c >= 0 &&
c < UCD_MAX &&
g_ucd[c].flags & (UCD_OTHER_CONTROL | UCD_SEPARATOR_SPACE)) {
csize = r;
@@ -90,10 +88,10 @@ sw buf_xfer_spaces (s_buf *out, s_buf *in)
int main (int argc, char **argv)
{
- s8 i[BUF_SIZE];
+ char i[BUF_SIZE];
s_buf in;
s_tag input;
- s8 o[BUF_SIZE];
+ char o[BUF_SIZE];
s_buf out;
sw r;
s_tag result;
diff --git a/libc3/array.c b/libc3/array.c
index 0a1a860..fe0df65 100644
--- a/libc3/array.c
+++ b/libc3/array.c
@@ -202,7 +202,7 @@ s_array * array_init (s_array *a, const s_sym *type, uw dimension,
return a;
}
-s_array * array_init_1 (s_array *array, s8 *p)
+s_array * array_init_1 (s_array *array, const char *p)
{
s_buf buf;
uw len;
@@ -211,7 +211,7 @@ s_array * array_init_1 (s_array *array, s8 *p)
assert(array);
assert(p);
len = strlen(p);
- buf_init(&buf, false, len, p);
+ buf_init(&buf, false, len, (char *) p);
buf.wpos = len;
r = buf_parse_array(&buf, &tmp);
if (r < 0 || (uw) r != len) {
diff --git a/libc3/array.h b/libc3/array.h
index d44900c..254f32e 100644
--- a/libc3/array.h
+++ b/libc3/array.h
@@ -19,7 +19,7 @@
void array_clean (s_array *a);
s_array * array_init (s_array *a, const s_sym *type,
uw dimension, const uw *dimensions);
-s_array * array_init_1 (s_array *a, s8 *p);
+s_array * array_init_1 (s_array *a, const char *p);
s_array * array_init_cast (s_array *a, const s_tag *tag);
s_array * array_init_copy (s_array *a, const s_array *src);
s_array * array_init_void (s_array *array);
diff --git a/libc3/buf.c b/libc3/buf.c
index e5a24ed..8adeaf3 100644
--- a/libc3/buf.c
+++ b/libc3/buf.c
@@ -179,7 +179,7 @@ sw buf_ignore_spaces_but_newline (s_buf *buf)
return result;
}
-s_buf * buf_init (s_buf *buf, bool p_free, uw size, s8 *p)
+s_buf * buf_init (s_buf *buf, bool p_free, uw size, char *p)
{
assert(buf);
assert(p);
@@ -187,7 +187,7 @@ s_buf * buf_init (s_buf *buf, bool p_free, uw size, s8 *p)
buf->flush = NULL;
buf->free = p_free;
buf->line = -1;
- buf->ptr.ps8 = p;
+ buf->ptr.pchar = p;
buf->refill = NULL;
buf->rpos = 0;
buf->save = NULL;
@@ -197,7 +197,7 @@ s_buf * buf_init (s_buf *buf, bool p_free, uw size, s8 *p)
return buf;
}
-s_buf * buf_init_1 (s_buf *buf, bool p_free, s8 *p)
+s_buf * buf_init_1 (s_buf *buf, bool p_free, char *p)
{
uw len;
assert(buf);
@@ -208,7 +208,7 @@ s_buf * buf_init_1 (s_buf *buf, bool p_free, s8 *p)
return buf;
}
-s_buf * buf_init_1_copy (s_buf *buf, const s8 *p)
+s_buf * buf_init_1_copy (s_buf *buf, const char *p)
{
uw size;
assert(buf);
@@ -223,7 +223,7 @@ s_buf * buf_init_1_copy (s_buf *buf, const s8 *p)
s_buf * buf_init_alloc (s_buf *buf, uw size)
{
- s8 *p;
+ char *p;
assert(buf);
if (! size)
return buf_init(buf, false, 0, NULL);
@@ -237,7 +237,7 @@ s_buf * buf_init_str (s_buf *buf, bool p_free, s_str *p)
{
assert(buf);
assert(p);
- buf_init(buf, p_free, p->size, (s8 *) p->ptr.ps8);
+ buf_init(buf, p_free, p->size, (char *) p->ptr.pchar);
buf->wpos = p->size;
return buf;
}
@@ -252,7 +252,7 @@ s_buf * buf_init_str_copy (s_buf *buf, const s_str *str)
return buf;
}
-s_buf * buf_new (bool p_free, uw size, s8 *p)
+s_buf * buf_new (bool p_free, uw size, char *p)
{
s_buf *buf;
buf = malloc(sizeof(s_buf));
@@ -272,7 +272,7 @@ s_buf * buf_new_alloc (uw size)
return buf;
}
-sw buf_peek_1 (s_buf *buf, const s8 *p)
+sw buf_peek_1 (s_buf *buf, const char *p)
{
s_str stra;
assert(buf);
@@ -488,13 +488,13 @@ sw buf_peek_str (s_buf *buf, const s_str *src)
}
size = buf->wpos - buf->rpos;
if ((uw) size < src->size) {
- if (memcmp(buf->ptr.ps8 + buf->rpos, src->ptr.p, size))
+ if (memcmp(buf->ptr.pchar + buf->rpos, src->ptr.p, size))
return 0;
}
if (buf->rpos + src->size > buf->wpos &&
buf_refill(buf, src->size) < (sw) src->size)
return 0;
- if (memcmp(buf->ptr.ps8 + buf->rpos, src->ptr.p, src->size))
+ if (memcmp(buf->ptr.pchar + buf->rpos, src->ptr.p, src->size))
return 0;
return src->size;
}
@@ -513,7 +513,7 @@ sw buf_peek_to_str (s_buf *buf, s_str *dest)
str_init_empty(dest);
return 0;
}
- str_init_alloc(dest, size, buf->ptr.ps8 + buf->rpos);
+ str_init_alloc(dest, size, buf->ptr.pchar + buf->rpos);
return size;
}
@@ -593,7 +593,7 @@ sw buf_peek_u64 (s_buf *buf, u64 *p)
return size;
}
-sw buf_read_1 (s_buf *buf, const s8 *p)
+sw buf_read_1 (s_buf *buf, const char *p)
{
s_str stra;
assert(buf);
@@ -708,7 +708,7 @@ sw buf_read_to_str (s_buf *buf, s_str *dest)
str_init_empty(dest);
return 0;
}
- str_init_alloc(dest, size, buf->ptr.ps8 + buf->rpos);
+ str_init_alloc(dest, size, buf->ptr.pchar + buf->rpos);
return buf_ignore(buf, size);
}
@@ -795,7 +795,7 @@ sw buf_refill_compact (s_buf *buf)
size = buf->wpos - min_rpos;
assert(size < buf->size);
memmove(buf->ptr.p,
- buf->ptr.ps8 + min_rpos,
+ buf->ptr.pchar + min_rpos,
size);
buf->rpos -= min_rpos;
save = buf->save;
@@ -887,7 +887,7 @@ sw buf_vf (s_buf *buf, const char *fmt, va_list ap)
return r;
}
-sw buf_write_1 (s_buf *buf, const s8 *p)
+sw buf_write_1 (s_buf *buf, const char *p)
{
s_str stra;
str_init_1(&stra, NULL, p);
@@ -907,7 +907,7 @@ sw buf_write_character_utf8 (s_buf *buf, character c)
assert(! "buffer overflow");
return -1;
}
- character_utf8(c, buf->ptr.ps8 + buf->wpos);
+ character_utf8(c, buf->ptr.pchar + buf->wpos);
buf->wpos += size;
return size;
}
diff --git a/libc3/buf.h b/libc3/buf.h
index f6ad5bd..71fb836 100644
--- a/libc3/buf.h
+++ b/libc3/buf.h
@@ -27,16 +27,16 @@
/* Stack-allocation compatible functions, call buf_clean after use. */
void buf_clean (s_buf *buf);
-s_buf * buf_init (s_buf *buf, bool p_free, uw size, s8 *p);
-s_buf * buf_init_1 (s_buf *buf, bool p_free, s8 *p);
+s_buf * buf_init (s_buf *buf, bool p_free, uw size, char *p);
+s_buf * buf_init_1 (s_buf *buf, bool p_free, char *p);
s_buf * buf_init_alloc (s_buf *buf, uw size);
s_buf * buf_init_str (s_buf *buf, bool free, s_str *p);
s_buf * buf_init_str_copy (s_buf *buf, const s_str *str);
/* Heap-allocation compatible functions, call buf_delete after use. */
void buf_delete (s_buf *buf);
-s_buf * buf_new (bool free, uw size, s8 *p);
-s_buf * buf_new_1 (bool free, uw size, s8 *p);
+s_buf * buf_new (bool free, uw size, char *p);
+s_buf * buf_new_1 (bool free, uw size, char *p);
s_buf * buf_new_alloc (uw bytes);
s_buf * buf_new_str (s_str *str);
@@ -48,7 +48,7 @@ sw buf_ignore_line (s_buf *buf);
sw buf_ignore_newline (s_buf *buf);
sw buf_ignore_spaces (s_buf *buf);
sw buf_ignore_spaces_but_newline (s_buf *buf);
-sw buf_peek_1 (s_buf *buf, const s8 *p);
+sw buf_peek_1 (s_buf *buf, const char *p);
sw buf_peek_character_utf8 (s_buf *buf, character *p);
sw buf_peek_f32 (s_buf *buf, f32 *p);
sw buf_peek_f64 (s_buf *buf, f64 *p);
@@ -65,7 +65,7 @@ sw buf_peek_u32 (s_buf *buf, u32 *p);
sw buf_peek_u64 (s_buf *buf, u64 *p);
sw buf_read_integer (s_buf *buf, s_integer *dst);
sw buf_read_character_utf8 (s_buf *buf, character *p);
-sw buf_read_1 (s_buf *buf, const s8 *p);
+sw buf_read_1 (s_buf *buf, const char *p);
sw buf_read_f32 (s_buf *buf, f32 *p);
sw buf_read_f64 (s_buf *buf, f64 *p);
sw buf_read_s8 (s_buf *buf, s8 *p);
@@ -88,7 +88,7 @@ sw buf_str_to_hex_size (const s_str *src);
sw buf_u8_to_hex (s_buf *buf, const u8 *x);
sw buf_u8_to_hex_size (const u8 *x);
sw buf_vf (s_buf *buf, const char *fmt, va_list ap);
-sw buf_write_1 (s_buf *buf, const s8 *p);
+sw buf_write_1 (s_buf *buf, const char *p);
sw buf_write_character_utf8 (s_buf *buf, character c);
sw buf_write_f32 (s_buf *buf, f32 x);
sw buf_write_f64 (s_buf *buf, f64 x);
diff --git a/libc3/buf_inspect.c b/libc3/buf_inspect.c
index cf8ac3c..4a5aef2 100644
--- a/libc3/buf_inspect.c
+++ b/libc3/buf_inspect.c
@@ -712,7 +712,7 @@ sw buf_inspect_f32 (s_buf *buf, const f32 *f)
sw buf_inspect_f32_size (const f32 *f)
{
- s8 b[32];
+ char b[32];
s_buf buf;
assert(f);
buf_init(&buf, false, sizeof(b), b);
@@ -787,7 +787,7 @@ sw buf_inspect_f64 (s_buf *buf, const f64 *f)
sw buf_inspect_f64_size (const f64 *f)
{
- s8 b[64];
+ char b[64];
s_buf buf;
assert(f);
buf_init(&buf, false, sizeof(b), b);
@@ -1419,7 +1419,7 @@ sw buf_inspect_map (s_buf *buf, const s_map *map)
return r;
}
else
- if ((r = buf_write_1(buf, k->data.sym->str.ptr.ps8)) < 0)
+ if ((r = buf_write_1(buf, k->data.sym->str.ptr.pchar)) < 0)
return r;
result += r;
if ((r = buf_write_1(buf, ": ")) < 0)
@@ -1631,7 +1631,7 @@ sw buf_inspect_str_byte_size (const u8 *byte)
sw buf_inspect_str_character (s_buf *buf, const character *c)
{
- s8 b[4];
+ char b[4];
s_buf char_buf;
int i;
int j;
@@ -1825,7 +1825,7 @@ sw buf_inspect_struct (s_buf *buf, const s_struct *s)
return r;
}
else
- if ((r = buf_write_1(buf, s->type->module->str.ptr.ps8)) < 0)
+ if ((r = buf_write_1(buf, s->type->module->str.ptr.pchar)) < 0)
return r;
result += r;
if ((r = buf_write_1(buf, "{")) < 0)
@@ -1847,7 +1847,7 @@ sw buf_inspect_struct (s_buf *buf, const s_struct *s)
return r;
}
else
- if ((r = buf_write_1(buf, k->data.sym->str.ptr.ps8)) < 0)
+ if ((r = buf_write_1(buf, k->data.sym->str.ptr.pchar)) < 0)
return r;
result += r;
if ((r = buf_write_1(buf, ": ")) < 0)
@@ -1856,7 +1856,7 @@ sw buf_inspect_struct (s_buf *buf, const s_struct *s)
if (s->data) {
if (! tag_type(s->type->map.value + i, &type))
return -1;
- if ((r = data_buf_inspect(type, buf, (s8 *) s->data +
+ if ((r = data_buf_inspect(type, buf, (char *) s->data +
s->type->offset[i])) < 0)
return r;
result += r;
@@ -2137,7 +2137,7 @@ sw buf_inspect_tag_size (const s_tag *tag)
sw buf_inspect_tag_type (s_buf *buf, e_tag_type type)
{
- const s8 *s;
+ const char *s;
assert(buf);
s = tag_type_to_string(type);
if (! s)
@@ -2147,7 +2147,7 @@ sw buf_inspect_tag_type (s_buf *buf, e_tag_type type)
sw buf_inspect_tag_type_size (e_tag_type type)
{
- const s8 *s;
+ const char *s;
s = tag_type_to_string(type);
if (! s)
return -1;
diff --git a/libc3/buf_parse.c b/libc3/buf_parse.c
index 17f5158..5eb0907 100644
--- a/libc3/buf_parse.c
+++ b/libc3/buf_parse.c
@@ -1537,7 +1537,7 @@ sw buf_parse_ident (s_buf *buf, s_ident *dest)
sw result = 0;
s_buf_save save;
s_str str;
- s8 t[IDENT_MAX];
+ char t[IDENT_MAX];
s_buf tmp;
assert(buf);
assert(dest);
@@ -2420,8 +2420,8 @@ sw buf_parse_str (s_buf *buf, s_str *dest)
{
u8 b;
character c;
- s8 *end = "\"";
- s8 *end1 = NULL;
+ char *end = "\"";
+ char *end1 = NULL;
sw r;
sw result = 0;
s_buf_save save;
@@ -2727,7 +2727,7 @@ sw buf_parse_sym (s_buf *buf, const s_sym **dest)
sw result = 0;
s_buf_save save;
s_str str;
- s8 t[SYM_MAX];
+ char t[SYM_MAX];
s_buf tmp;
assert(buf);
assert(dest);
@@ -2803,7 +2803,7 @@ sw buf_parse_sym_str (s_buf *buf, s_str *str)
sw r;
sw result = 0;
s_buf_save save;
- s8 t[SYM_MAX];
+ char t[SYM_MAX];
s_buf tmp;
buf_save_init(buf, &save);
buf_init(&tmp, false, sizeof(t), t);
diff --git a/libc3/c3.c b/libc3/c3.c
index 2f170dd..0c6ee99 100644
--- a/libc3/c3.c
+++ b/libc3/c3.c
@@ -53,7 +53,7 @@ uw * c3_facts_next_id (uw *dest)
return dest;
}
-s_env * c3_init (s_env *env, int argc, s8 **argv)
+s_env * c3_init (s_env *env, int argc, char **argv)
{
if (! env)
env = &g_c3_env;
diff --git a/libc3/c3_main.h b/libc3/c3_main.h
index 12d3ed7..a4f016c 100644
--- a/libc3/c3_main.h
+++ b/libc3/c3_main.h
@@ -22,11 +22,11 @@ extern const s_str g_c3_base_octal;
extern const s_str g_c3_base_decimal;
extern const s_str g_c3_base_hexadecimal;
extern const s_str g_c3_bases_hexadecimal[2];
-extern const s8 *g_c3_license;
+extern const char *g_c3_license;
extern sw g_c3_exit_code;
/* stack-allocation compatible functions */
-s_env * c3_init (s_env *env, int argc, s8 **argv);
+s_env * c3_init (s_env *env, int argc, char **argv);
void c3_clean (s_env *env);
/* debug */
diff --git a/libc3/call.c b/libc3/call.c
index 7ed5948..a8f9ee7 100644
--- a/libc3/call.c
+++ b/libc3/call.c
@@ -66,9 +66,9 @@ bool call_get (s_call *call, s_facts *facts)
! facts_find_fact_by_tags(facts, &tag_module_name,
&tag_operator, &tag_ident)) {
err_write_1("call_get: symbol ");
- err_write_1(call->ident.sym->str.ptr.ps8);
+ err_write_1(call->ident.sym->str.ptr.pchar);
err_write_1(" not found in module ");
- err_write_1(call->ident.module->str.ptr.ps8);
+ err_write_1(call->ident.module->str.ptr.pchar);
err_write_1("\n");
return false;
}
@@ -78,9 +78,9 @@ bool call_get (s_call *call, s_facts *facts)
call->fn = fn_new_copy(&tag_var.data.fn);
else {
err_write_1("call_get: ");
- err_write_1(call->ident.module->str.ptr.ps8);
+ err_write_1(call->ident.module->str.ptr.pchar);
err_write_1(".");
- err_write_1(call->ident.sym->str.ptr.ps8);
+ err_write_1(call->ident.sym->str.ptr.pchar);
err_puts(" is not a function");
return false;
}
@@ -92,9 +92,9 @@ bool call_get (s_call *call, s_facts *facts)
call->cfn = cfn_new_copy(&tag_var.data.cfn);
else {
err_write_1("call_get: ");
- err_write_1(call->ident.module->str.ptr.ps8);
+ err_write_1(call->ident.module->str.ptr.pchar);
err_write_1(".");
- err_write_1(call->ident.sym->str.ptr.ps8);
+ err_write_1(call->ident.sym->str.ptr.pchar);
err_puts(" is not a C function");
return false;
}
@@ -146,9 +146,9 @@ bool call_op_get (s_call *call, s_facts *facts)
NULL, NULL });
if (! facts_with_cursor_next(&cursor)) {
err_write_1("call_get: symbol ");
- err_write_1(call->ident.sym->str.ptr.ps8);
+ err_write_1(call->ident.sym->str.ptr.pchar);
err_write_1(" not found in module ");
- err_write_1(call->ident.module->str.ptr.ps8);
+ err_write_1(call->ident.module->str.ptr.pchar);
err_write_1("\n");
facts_with_cursor_clean(&cursor);
return false;
@@ -160,9 +160,9 @@ bool call_op_get (s_call *call, s_facts *facts)
if (facts_with_cursor_next(&cursor)) {
if (tag_var.type != TAG_FN) {
err_write_1("call_get: ");
- err_write_1(call->ident.module->str.ptr.ps8);
+ err_write_1(call->ident.module->str.ptr.pchar);
err_write_1(".");
- err_write_1(call->ident.sym->str.ptr.ps8);
+ err_write_1(call->ident.sym->str.ptr.pchar);
err_puts(" is not a function");
facts_with_cursor_clean(&cursor);
return false;
@@ -176,9 +176,9 @@ bool call_op_get (s_call *call, s_facts *facts)
if (facts_with_cursor_next(&cursor)) {
if (tag_var.type != TAG_CFN) {
err_write_1("call_get: ");
- err_write_1(call->ident.module->str.ptr.ps8);
+ err_write_1(call->ident.module->str.ptr.pchar);
err_write_1(".");
- err_write_1(call->ident.sym->str.ptr.ps8);
+ err_write_1(call->ident.sym->str.ptr.pchar);
err_puts(" is not a C function");
facts_with_cursor_clean(&cursor);
return false;
@@ -214,13 +214,13 @@ s_call * call_init (s_call *call)
return call;
}
-s_call * call_init_1 (s_call *call, const s8 *p)
+s_call * call_init_1 (s_call *call, const char *p)
{
s_buf buf;
uw len;
sw r;
len = strlen(p);
- buf_init(&buf, false, len, (s8 *) p);
+ buf_init(&buf, false, len, (char *) p);
buf.wpos = len;
r = buf_parse_call(&buf, call);
if (r < 0 || (uw) r != len) {
diff --git a/libc3/call.h b/libc3/call.h
index ddd91aa..b21ed9a 100644
--- a/libc3/call.h
+++ b/libc3/call.h
@@ -18,7 +18,7 @@
/* Stack-allocation compatible functions */
void call_clean (s_call *call);
s_call * call_init (s_call *call);
-s_call * call_init_1 (s_call *call, const s8 *p);
+s_call * call_init_1 (s_call *call, const char *p);
s_call * call_init_cast (s_call *call, const s_tag *tag);
s_call * call_init_copy (s_call *call, const s_call *src);
s_call * call_init_op (s_call *call);
diff --git a/libc3/cfn.c b/libc3/cfn.c
index 2c6d20b..75b4468 100644
--- a/libc3/cfn.c
+++ b/libc3/cfn.c
@@ -209,8 +209,8 @@ s_cfn * cfn_init_cast (s_cfn *cfn, const s_tag *tag)
s_cfn * cfn_link (s_cfn *cfn)
{
assert(cfn);
- if (! (cfn->ptr.p = dlsym(RTLD_DEFAULT, cfn->name->str.ptr.ps8))) {
- warnx("cfn_link: %s: %s", cfn->name->str.ptr.ps8, dlerror());
+ if (! (cfn->ptr.p = dlsym(RTLD_DEFAULT, cfn->name->str.ptr.pchar))) {
+ warnx("cfn_link: %s: %s", cfn->name->str.ptr.pchar, dlerror());
assert(! "cfn_link: dlsym failed");
return NULL;
}
@@ -290,7 +290,7 @@ s_tag * cfn_tag_init (s_tag *tag, const s_sym *type)
assert(type);
if (! sym_to_tag_type(type, &tmp.type)) {
err_write_1("cfn_tag_init: invalid type: ");
- err_puts(type->str.ptr.ps8);
+ err_puts(type->str.ptr.pchar);
assert(! "cfn_tag_init: invalid type");
return NULL;
}
diff --git a/libc3/character.c b/libc3/character.c
index 0290562..d70286b 100644
--- a/libc3/character.c
+++ b/libc3/character.c
@@ -17,7 +17,7 @@
#include "tag_type.h"
#include "ucd.h"
-character character_1 (const s8 *p)
+character character_1 (const char *p)
{
character c;
s_str stra;
@@ -71,8 +71,7 @@ bool character_is_digit (character c)
bool character_is_lowercase (character c)
{
- return (c >= 0 &&
- c < UCD_MAX &&
+ return (c < UCD_MAX &&
g_ucd[c].flags & UCD_LETTER_LOWERCASE);
}
@@ -80,30 +79,26 @@ bool character_is_printable (character c)
{
const u64 ucd_printable = UCD_LETTER | UCD_MARK | UCD_NUMBER |
UCD_PUNCTUATION | UCD_SYMBOL | UCD_SEPARATOR_SPACE;
- return (c >= 0 &&
- c < UCD_MAX &&
+ return (c < UCD_MAX &&
g_ucd[c].flags & ucd_printable);
}
bool character_is_space (character c)
{
- return (c >= 0 &&
- c < UCD_MAX &&
+ return (c < UCD_MAX &&
g_ucd[c].flags & (UCD_OTHER_CONTROL | UCD_SEPARATOR_SPACE));
}
bool character_is_uppercase (character c)
{
- return (c >= 0 &&
- c < UCD_MAX &&
+ return (c < UCD_MAX &&
g_ucd[c].flags & UCD_LETTER_UPPERCASE);
}
character character_switch_case (character c)
{
character s;
- if (c >= 0 &&
- c < UCD_MAX &&
+ if (c < UCD_MAX &&
(s = g_ucd[c].to_lower | g_ucd[c].to_upper))
return s;
return c;
@@ -111,8 +106,7 @@ character character_switch_case (character c)
character character_to_lower (character c)
{
- if (c >= 0 &&
- c < UCD_MAX &&
+ if (c < UCD_MAX &&
g_ucd[c].to_lower)
return g_ucd[c].to_lower;
return c;
@@ -120,14 +114,13 @@ character character_to_lower (character c)
character character_to_upper (character c)
{
- if (c >= 0 &&
- c < UCD_MAX &&
+ if (c < UCD_MAX &&
g_ucd[c].to_upper)
return g_ucd[c].to_upper;
return c;
}
-sw character_utf8 (character c, s8 *dest)
+sw character_utf8 (character c, char *dest)
{
const u8 _00000111 = 0x07;
const u8 _00001111 = 0x0F;
@@ -137,24 +130,22 @@ sw character_utf8 (character c, s8 *dest)
const u8 _11000000 = 0xC0;
const u8 _11100000 = 0xE0;
const u8 _11110000 = 0xF0;
- if (c == -1)
- return -1;
- if (((u64) c) < 0x80) {
+ if (c < 0x80) {
dest[0] = (s8) c;
return 1;
}
- if (((u64) c) < 0x800) {
+ if (c < 0x800) {
dest[0] = _11000000 | ((c >> 6) & _00011111);
dest[1] = _10000000 | ( c & _00111111);
return 2;
}
- if (((u64) c) < 0x10000) {
+ if (c < 0x10000) {
dest[0] = _11100000 | ((c >> 12) & _00001111);
dest[1] = _10000000 | ((c >> 6) & _00111111);
dest[2] = _10000000 | ( c & _00111111);
return 3;
}
- if (((u64) c) < 0x110000) {
+ if (c < 0x110000) {
dest[0] = _11110000 | ((c >> 18) & _00000111);
dest[1] = _10000000 | ((c >> 12) & _00111111);
dest[2] = _10000000 | ((c >> 6) & _00111111);
@@ -166,15 +157,13 @@ sw character_utf8 (character c, s8 *dest)
sw character_utf8_size (character c)
{
- if (c == -1)
- return -1;
- if (((u64) c) < 0x80)
+ if (c < 0x80)
return 1;
- if (((u64) c) < 0x800)
+ if (c < 0x800)
return 2;
- if (((u64) c) < 0x10000)
+ if (c < 0x10000)
return 3;
- if (((u64) c) < 0x110000)
+ if (c < 0x110000)
return 4;
return -1;
}
diff --git a/libc3/character.h b/libc3/character.h
index c52abdd..b8b01ed 100644
--- a/libc3/character.h
+++ b/libc3/character.h
@@ -16,7 +16,7 @@
#include "hash.h"
#include "types.h"
-character character_1 (const s8 *p);
+character character_1 (const char *p);
void character_hash_update (character c, t_hash *hash);
character * character_init_cast (character *c, const s_tag *tag);
character * character_init_copy (character *c, const character *src);
@@ -30,7 +30,7 @@ character character_switch_case (character c);
character character_to_lower (character c);
character character_to_upper (character c);
sw character_write (s_buf *buf, character c);
-sw character_utf8 (character c, s8 *dest);
+sw character_utf8 (character c, char *dest);
sw character_utf8_size (character c);
#endif /* LIBC3_CHARACTER_H */
diff --git a/libc3/env.c b/libc3/env.c
index 9befcef..e00d950 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -51,7 +51,7 @@
s_env g_c3_env;
-static s_env * env_init_args (s_env *env, int argc, s8 **argv);
+static s_env * env_init_args (s_env *env, int argc, char **argv);
void env_clean (s_env *env)
{
@@ -180,8 +180,8 @@ bool env_eval_call (s_env *env, const s_call *call, s_tag *dest)
result = env_eval_call_fn(env, &c, dest);
else {
warnx("env_eval_call: could not resolve call %s.%s.",
- c.ident.module->str.ptr.ps8,
- c.ident.sym->str.ptr.ps8);
+ c.ident.module->str.ptr.pchar,
+ c.ident.sym->str.ptr.pchar);
result = false;
}
call_clean(&c);
@@ -375,8 +375,8 @@ bool env_eval_equal_tag (s_env *env, const s_tag *a, const s_tag *b,
is_unbound_b = b->type == TAG_IDENT;
if (is_unbound_a && is_unbound_b) {
warnx("unbound equal on both sides: %s = %s",
- a->data.ident.sym->str.ptr.ps8,
- b->data.ident.sym->str.ptr.ps8);
+ a->data.ident.sym->str.ptr.pchar,
+ b->data.ident.sym->str.ptr.pchar);
return false;
}
if (is_unbound_a) {
@@ -578,8 +578,8 @@ bool env_eval_ident (s_env *env, const s_ident *ident, s_tag *dest)
if (! ((tag = frame_get(env->frame, tmp_ident.sym)) ||
(tag = ident_get(&tmp_ident, &env->facts, &tmp)))) {
warnx("unbound ident: %s.%s",
- tmp_ident.module->str.ptr.ps8,
- tmp_ident.sym->str.ptr.ps8);
+ tmp_ident.module->str.ptr.pchar,
+ tmp_ident.sym->str.ptr.pchar);
return false;
}
tag_init_copy(dest, tag);
@@ -699,7 +699,7 @@ bool env_eval_struct (s_env *env, const s_struct *s, s_tag *dest)
warnx("env_eval_struct:"
" invalid type %s for key %s, expected %s.",
tag_type_to_string(tag.type),
- t->type->map.key[i].data.sym->str.ptr.ps8,
+ t->type->map.key[i].data.sym->str.ptr.pchar,
tag_type_to_string(t->type->map.value[i].type));
goto ko_tag;
}
@@ -841,7 +841,7 @@ s_list ** env_get_struct_type_spec (s_env *env,
! list_is_plist(tmp.data.list)) {
warnx("env_get_struct_type_spec: module %s"
" has a defstruct that is not a property list",
- module->str.ptr.ps8);
+ module->str.ptr.pchar);
tag_clean(&tmp);
return NULL;
}
@@ -849,7 +849,7 @@ s_list ** env_get_struct_type_spec (s_env *env,
return dest;
}
-s_env * env_init (s_env *env, int argc, s8 **argv)
+s_env * env_init (s_env *env, int argc, char **argv)
{
s_str path;
assert(env);
@@ -887,9 +887,9 @@ s_env * env_init (s_env *env, int argc, s8 **argv)
return env;
}
-s_env * env_init_args (s_env *env, int argc, s8 **argv)
+s_env * env_init_args (s_env *env, int argc, char **argv)
{
- s8 a[PATH_MAX];
+ char a[PATH_MAX];
s_str argv0;
s_buf buf;
s_str dir;
@@ -946,13 +946,13 @@ bool env_module_load (s_env *env, const s_sym *module, s_facts *facts)
assert(facts);
if (! module_path(module, &env->module_path, &path)) {
warnx("env_module_load: %s: module_path",
- module->str.ptr.ps8);
+ module->str.ptr.pchar);
return false;
}
tag_init_time(&tag_time);
if (facts_load_file(facts, &path) < 0) {
warnx("env_module_load: %s: facts_load_file",
- path.ptr.ps8);
+ path.ptr.pchar);
str_clean(&path);
return false;
}
@@ -1017,8 +1017,8 @@ s8 env_operator_arity (s_env *env, const s_ident *op)
else
warnx("env_operator_arity: "
"arity for operator %s not found in module %s",
- op->sym->str.ptr.ps8,
- op->module->str.ptr.ps8);
+ op->sym->str.ptr.pchar,
+ op->module->str.ptr.pchar);
facts_cursor_clean(&cursor);
return r;
}
@@ -1086,8 +1086,8 @@ s8 env_operator_precedence (s_env *env, const s_ident *op)
else
warnx("env_operator_precedence: "
"precedence for operator %s not found in module %s",
- op->sym->str.ptr.ps8,
- op->module->str.ptr.ps8);
+ op->sym->str.ptr.pchar,
+ op->module->str.ptr.pchar);
facts_cursor_clean(&cursor);
return r;
}
@@ -1132,9 +1132,9 @@ s_ident * env_operator_resolve (s_env *env, const s_ident *op,
}
if (false)
warnx("env_operator_resolve: operator %s/%d not found in module %s",
- tmp.sym->str.ptr.ps8,
+ tmp.sym->str.ptr.pchar,
arity,
- tmp.module->str.ptr.ps8);
+ tmp.module->str.ptr.pchar);
facts_with_cursor_clean(&cursor);
return NULL;
}
@@ -1159,8 +1159,8 @@ const s_sym * env_operator_symbol (s_env *env, const s_ident *op)
else
warnx("env_operator_symbol: "
"symbol for operator %s not found in module %s",
- op->sym->str.ptr.ps8,
- op->module->str.ptr.ps8);
+ op->sym->str.ptr.pchar,
+ op->module->str.ptr.pchar);
facts_cursor_clean(&cursor);
return r;
}
diff --git a/libc3/env.h b/libc3/env.h
index 627a8d9..377daa0 100644
--- a/libc3/env.h
+++ b/libc3/env.h
@@ -19,7 +19,7 @@ extern s_env g_c3_env;
/* Stack allocation compatible functions, call env_clean after use. */
void env_clean (s_env *env);
-s_env * env_init (s_env *env, int argc, s8 **argv);
+s_env * env_init (s_env *env, int argc, char **argv);
/* Operators. */
bool env_eval_array (s_env *env, const s_array *array,
diff --git a/libc3/facts.c b/libc3/facts.c
index ac20b22..9cc3304 100644
--- a/libc3/facts.c
+++ b/libc3/facts.c
@@ -165,9 +165,9 @@ sw facts_dump (s_facts *facts, s_buf *buf)
return r;
}
-sw facts_dump_file (s_facts *facts, const s8 *path)
+sw facts_dump_file (s_facts *facts, const char *path)
{
- s8 b[BUF_SIZE];
+ char b[BUF_SIZE];
s_buf buf;
FILE *fp;
sw r;
@@ -293,12 +293,12 @@ sw facts_load (s_facts *facts, s_buf *buf, const s_str *path)
return result;
ko_header:
warnx("facts_load: %s: invalid or missing header",
- path->ptr.ps8);
+ path->ptr.pchar);
return -1;
ko_fact:
facts_lock_unlock_w(facts);
warnx("facts_load: %s: %s fact line %lu",
- path->ptr.ps8,
+ path->ptr.pchar,
r ? "invalid" : "missing",
(unsigned long) line);
return -1;
@@ -306,15 +306,15 @@ sw facts_load (s_facts *facts, s_buf *buf, const s_str *path)
sw facts_load_file (s_facts *facts, const s_str *path)
{
- s8 b[BUF_SIZE];
+ char b[BUF_SIZE];
s_buf buf;
FILE *fp;
sw result;
assert(facts);
assert(path);
buf_init(&buf, false, sizeof(b), b);
- if (! (fp = fopen(path->ptr.ps8, "rb"))) {
- warn("facts_load_file: %s", path->ptr.ps8);
+ if (! (fp = fopen(path->ptr.pchar, "rb"))) {
+ warn("facts_load_file: %s", path->ptr.pchar);
return -1;
}
buf_file_open_r(&buf, fp);
@@ -445,12 +445,12 @@ sw facts_open_buf (s_facts *facts, s_buf *buf, const s_str *path)
sw facts_open_file (s_facts *facts, const s_str *path)
{
FILE *fp;
- s8 i[BUF_SIZE];
+ char i[BUF_SIZE];
s_buf in;
sw r;
sw result = 0;
buf_init(&in, false, sizeof(i), i);
- if (! (fp = fopen(path->ptr.ps8, "rb"))) {
+ if (! (fp = fopen(path->ptr.pchar, "rb"))) {
if (errno == ENOENT)
return facts_open_file_create(facts, path);
return -1;
@@ -460,8 +460,8 @@ sw facts_open_file (s_facts *facts, const s_str *path)
return r;
result += r;
buf_file_close(&in);
- if (! (fp = fopen(path->ptr.ps8, "ab"))) {
- warn("facts_open_file: fopen: %s", path->ptr.ps8);
+ if (! (fp = fopen(path->ptr.pchar, "ab"))) {
+ warn("facts_open_file: fopen: %s", path->ptr.pchar);
return -1;
}
if (! (facts->log = log_new()))
@@ -476,8 +476,8 @@ sw facts_open_file_create (s_facts *facts, const s_str *path)
s_buf *out;
sw r;
sw result = 0;
- if (! (fp = fopen(path->ptr.ps8, "wb"))) {
- warn("facts_open_file_create: fopen: %s", path->ptr.ps8);
+ if (! (fp = fopen(path->ptr.pchar, "wb"))) {
+ warn("facts_open_file_create: fopen: %s", path->ptr.pchar);
return -1;
}
if (facts_count(facts)) {
@@ -647,9 +647,9 @@ s_fact * facts_replace_tags (s_facts *facts, const s_tag *subject,
return f;
}
-sw facts_save_file (s_facts *facts, const s8 *path)
+sw facts_save_file (s_facts *facts, const char *path)
{
- s8 b[BUF_SIZE];
+ char b[BUF_SIZE];
s_buf buf;
FILE *fp;
sw r;
diff --git a/libc3/facts.h b/libc3/facts.h
index bf36889..e76695e 100644
--- a/libc3/facts.h
+++ b/libc3/facts.h
@@ -51,12 +51,12 @@ s_fact * facts_replace_fact (s_facts *facts, const s_fact *fact);
s_fact * facts_replace_tags (s_facts *facts, const s_tag *subject,
const s_tag *predicate,
const s_tag *object);
-sw facts_save_file (s_facts *facts, const s8 *path);
+sw facts_save_file (s_facts *facts, const char *path);
bool facts_unref_tag (s_facts *facts, const s_tag *tag);
/* Observers */
sw facts_dump (s_facts *facts, s_buf *buf);
-sw facts_dump_file (s_facts *facts, const s8 *path);
+sw facts_dump_file (s_facts *facts, const char *path);
s_fact * facts_find_fact (s_facts *facts, const s_fact *fact);
s_fact * facts_find_fact_by_tags (s_facts *facts, const s_tag *subject,
const s_tag *predicate,
diff --git a/libc3/file.c b/libc3/file.c
index bb64ea2..4d37d85 100644
--- a/libc3/file.c
+++ b/libc3/file.c
@@ -51,16 +51,16 @@ bool * file_access (const s_str *path, const s_sym *mode,
m = X_OK;
else
m = F_OK;
- *dest = access(path->ptr.ps8, m) ? false : true;
+ *dest = access(path->ptr.pchar, m) ? false : true;
return dest;
}
sw file_copy_1 (const char *from, const char *to)
{
- s8 buf[4096];
+ char buf[4096];
sw fd_from = -1;
sw fd_to = -1;
- s8 *out;
+ char *out;
sw r;
sw saved_errno;
sw w;
@@ -117,8 +117,8 @@ s_tag * file_mtime (const s_str *path, s_tag *dest)
struct stat sb;
assert(path);
assert(dest);
- if (stat(path->ptr.ps8, &sb)) {
- warn("file_mtime: %s", path->ptr.ps8);
+ if (stat(path->ptr.pchar, &sb)) {
+ warn("file_mtime: %s", path->ptr.pchar);
return NULL;
}
#if HAVE_STAT_MTIM
@@ -135,7 +135,7 @@ s_str * file_search (const s_str *suffix, const s_sym *mode,
s_str *dest)
{
bool access;
- s8 buf_s[PATH_MAX];
+ char buf_s[PATH_MAX];
s_buf buf;
const s_list *path;
sw r;
@@ -153,7 +153,7 @@ s_str * file_search (const s_str *suffix, const s_sym *mode,
buf_save_restore_wpos(&buf, &save);
str = &path->tag.data.str;
if ((r = buf_write_str(&buf, str)) < 0 ||
- (str->ptr.ps8[str->size - 1] != '/' &&
+ (str->ptr.pchar[str->size - 1] != '/' &&
(r = buf_write_1(&buf, "/")) < 0) ||
(r = buf_write_str(&buf, suffix)) < 0)
return NULL;
diff --git a/libc3/fn.c b/libc3/fn.c
index 26d7040..56eb224 100644
--- a/libc3/fn.c
+++ b/libc3/fn.c
@@ -43,7 +43,7 @@ s_fn * fn_init (s_fn *fn)
return fn;
}
-s_fn * fn_init_1 (s_fn *fn, s8 *p)
+s_fn * fn_init_1 (s_fn *fn, char *p)
{
s_buf buf;
uw len;
@@ -51,7 +51,7 @@ s_fn * fn_init_1 (s_fn *fn, s8 *p)
assert(fn);
assert(p);
len = strlen(p);
- buf_init(&buf, false, len, (s8 *) p);
+ buf_init(&buf, false, len, (char *) p);
buf.wpos = len;
r = buf_parse_fn(&buf, fn);
if (r < 0 || (uw) r != len)
diff --git a/libc3/fn.h b/libc3/fn.h
index fe4328e..4ee482c 100644
--- a/libc3/fn.h
+++ b/libc3/fn.h
@@ -24,7 +24,7 @@
/* Stack-allocation compatible functions, call fn_clean after use. */
void fn_clean (s_fn *fn);
s_fn * fn_init (s_fn *fn);
-s_fn * fn_init_1 (s_fn *fn, s8 *p);
+s_fn * fn_init_1 (s_fn *fn, char *p);
s_fn * fn_init_cast (s_fn *fn, const s_tag *tag);
s_fn * fn_init_copy (s_fn *fn, const s_fn *src);
diff --git a/libc3/hash.c b/libc3/hash.c
index a7ea0cb..2db14ba 100644
--- a/libc3/hash.c
+++ b/libc3/hash.c
@@ -24,7 +24,7 @@
#define HASH_UPDATE_DEF(type) \
bool hash_update_##type (t_hash *hash, const type *x) \
{ \
- const s8 t[] = #type; \
+ const char t[] = #type; \
assert(hash); \
assert(x); \
return hash_update(hash, t, sizeof(t)) && \
@@ -64,10 +64,10 @@ bool hash_update (t_hash *hash, const void *data, uw size)
return true;
}
-bool hash_update_1 (t_hash *hash, const s8 *p)
+bool hash_update_1 (t_hash *hash, const char *p)
{
uw len;
- const s8 type[] = "s8*";
+ const char type[] = "s8*";
assert(hash);
assert(p);
len = strlen(p);
@@ -79,7 +79,7 @@ bool hash_update_1 (t_hash *hash, const s8 *p)
bool hash_update_array (t_hash *hash, const s_array *a)
{
uw i = 0;
- const s8 type[] = "array";
+ const char type[] = "array";
assert(hash);
assert(a);
if (! hash_update(hash, type, sizeof(type)) ||
@@ -110,7 +110,7 @@ bool hash_update_array (t_hash *hash, const s_array *a)
bool hash_update_bool (t_hash *hash, const bool *x)
{
bool b;
- const s8 type[] = "bool";
+ const char type[] = "bool";
assert(hash);
assert(x);
b = x ? 1 : 0;
@@ -120,7 +120,7 @@ bool hash_update_bool (t_hash *hash, const bool *x)
bool hash_update_call (t_hash *hash, const s_call *call)
{
- const s8 type[] = "call";
+ const char type[] = "call";
assert(hash);
assert(call);
return hash_update(hash, type, sizeof(type)) &&
@@ -130,7 +130,7 @@ bool hash_update_call (t_hash *hash, const s_call *call)
bool hash_update_cfn (t_hash *hash, const s_cfn *cfn)
{
- const s8 type[] = "cfn";
+ const char type[] = "cfn";
assert(hash);
assert(cfn);
return hash_update(hash, type, sizeof(type)) &&
@@ -138,15 +138,14 @@ bool hash_update_cfn (t_hash *hash, const s_cfn *cfn)
hash_update_list(hash, (const s_list * const *) &cfn->arg_types);
}
+HASH_UPDATE_DEF(char)
HASH_UPDATE_DEF(character)
-
HASH_UPDATE_DEF(f32)
-
HASH_UPDATE_DEF(f64)
bool hash_update_fact (t_hash *hash, const s_fact *fact)
{
- const s8 type[] = "fact";
+ const char type[] = "fact";
assert(hash);
assert(fact);
assert(fact->subject);
@@ -160,7 +159,7 @@ bool hash_update_fact (t_hash *hash, const s_fact *fact)
bool hash_update_fn (t_hash *hash, const s_fn *fn)
{
- const s8 type[] = "fn";
+ const char type[] = "fn";
assert(hash);
assert(fn);
return hash_update(hash, type, sizeof(type)) &&
@@ -173,7 +172,7 @@ bool hash_update_fn_clauses (t_hash *hash, const s_fn_clause *clauses)
{
uw count = 0;
const s_fn_clause *f;
- const s8 type[] = "fn_clauses";
+ const char type[] = "fn_clauses";
assert(hash);
assert(clauses);
if (! hash_update(hash, type, sizeof(type)))
@@ -199,14 +198,14 @@ bool hash_update_fn_clauses (t_hash *hash, const s_fn_clause *clauses)
bool hash_update_ident (t_hash *hash, const s_ident *ident)
{
- const s8 type[] = "ident";
+ const char type[] = "ident";
assert(hash);
assert(ident);
if (! hash_update(hash, type, sizeof(type)))
return false;
if (ident->module) {
if (! hash_update_sym(hash, &ident->module) ||
- ! hash_update_s8(hash, "."))
+ ! hash_update_char(hash, "."))
return false;
}
return hash_update_sym(hash, &ident->sym);
@@ -216,7 +215,7 @@ bool hash_update_integer (t_hash *hash, const s_integer *i)
{
int j = 0;
mp_digit *digit;
- const s8 type[] = "integer";
+ const char type[] = "integer";
assert(hash);
assert(i);
digit = i->mp_int.dp;
@@ -238,7 +237,7 @@ bool hash_update_list (t_hash *hash, const s_list * const *list)
uw count;
const s_list *l;
const s_list *last;
- const s8 type[] = "list";
+ const char type[] = "list";
assert(hash);
assert(list);
l = *list;
@@ -262,7 +261,7 @@ bool hash_update_list (t_hash *hash, const s_list * const *list)
bool hash_update_map (t_hash *hash, const s_map *map)
{
uw i = 0;
- const s8 type[] = "map";
+ const char type[] = "map";
assert(hash);
assert(map);
if (! hash_update(hash, type, strlen(type)) ||
@@ -279,7 +278,7 @@ bool hash_update_map (t_hash *hash, const s_map *map)
bool hash_update_ptag (t_hash *hash, const p_tag *ptag)
{
- const s8 type[] = "ptag";
+ const char type[] = "ptag";
assert(hash);
assert(ptag);
if (! hash_update(hash, type, sizeof(type)))
@@ -289,7 +288,7 @@ bool hash_update_ptag (t_hash *hash, const p_tag *ptag)
bool hash_update_ptr (t_hash *hash, const u_ptr_w *ptr)
{
- const s8 type[] = "ptr";
+ const char type[] = "ptr";
if (! hash_update(hash, type, strlen(type)))
return false;
return hash_update(hash, &ptr->p, sizeof(void *));
@@ -297,7 +296,7 @@ bool hash_update_ptr (t_hash *hash, const u_ptr_w *ptr)
bool hash_update_ptr_free (t_hash *hash, const u_ptr_w *ptr_free)
{
- const s8 type[] = "ptr_free";
+ const char type[] = "ptr_free";
if (! hash_update(hash, type, strlen(type)))
return false;
return hash_update(hash, &ptr_free->p, sizeof(void *));
@@ -305,25 +304,21 @@ bool hash_update_ptr_free (t_hash *hash, const u_ptr_w *ptr_free)
bool hash_update_quote (t_hash *hash, const s_quote *x)
{
- const s8 type[] = "quote";
+ const char type[] = "quote";
if (! hash_update(hash, type, strlen(type)))
return false;
return hash_update_tag(hash, x->tag);
}
HASH_UPDATE_DEF(s8)
-
HASH_UPDATE_DEF(s16)
-
HASH_UPDATE_DEF(s32)
-
HASH_UPDATE_DEF(s64)
-
HASH_UPDATE_DEF(sw)
bool hash_update_str (t_hash *hash, const s_str *str)
{
- s8 type[] = "str";
+ char type[] = "str";
assert(hash);
assert(str);
return hash_update(hash, type, strlen(type)) &&
@@ -336,7 +331,7 @@ bool hash_update_struct (t_hash *hash, const s_struct *s)
const void *data;
uw i = 0;
const s_sym *sym;
- s8 type[] = "struct";
+ char type[] = "struct";
assert(hash);
assert(s);
if (! hash_update(hash, type, sizeof(type)) ||
@@ -371,7 +366,7 @@ bool hash_update_struct (t_hash *hash, const s_struct *s)
bool hash_update_struct_type (t_hash *hash, const s_struct_type *st)
{
uw i;
- s8 type[] = "struct_type";
+ char type[] = "struct_type";
assert(hash);
assert(st);
if (! hash_update(hash, type, strlen(type)) ||
@@ -389,7 +384,7 @@ bool hash_update_struct_type (t_hash *hash, const s_struct_type *st)
bool hash_update_sym (t_hash *hash, const s_sym * const *sym)
{
- s8 type[] = "sym";
+ char type[] = "sym";
assert(hash);
assert(sym);
return hash_update(hash, type, sizeof(type)) &&
@@ -399,7 +394,7 @@ bool hash_update_sym (t_hash *hash, const s_sym * const *sym)
bool hash_update_tag (t_hash *hash, const s_tag *tag)
{
u8 tag_type;
- s8 type[] = "tag";
+ char type[] = "tag";
assert(hash);
assert(tag);
if (! hash_update(hash, type, strlen(type)))
@@ -477,7 +472,7 @@ HASH_UPDATE_DEF(uw)
bool hash_update_var (t_hash *hash, const void *x)
{
- s8 type[] = "var";
+ char type[] = "var";
(void) x;
assert(hash);
return hash_update(hash, type, strlen(type));
@@ -485,7 +480,7 @@ bool hash_update_var (t_hash *hash, const void *x)
bool hash_update_void (t_hash *hash, const void *x)
{
- s8 type[] = "void";
+ char type[] = "void";
(void) x;
assert(hash);
return hash_update(hash, type, strlen(type));
diff --git a/libc3/hash.h b/libc3/hash.h
index 5b03a3e..eb25614 100644
--- a/libc3/hash.h
+++ b/libc3/hash.h
@@ -23,11 +23,12 @@ void hash_init (t_hash *hash);
uw hash_to_uw (t_hash *hash);
u64 hash_to_u64 (t_hash *hash);
bool hash_update (t_hash *hash, const void *data, uw size);
-bool hash_update_1 (t_hash *hash, const s8 *p);
+bool hash_update_1 (t_hash *hash, const char *p);
bool hash_update_array (t_hash *hash, const s_array *a);
bool hash_update_bool (t_hash *hash, const bool *b);
bool hash_update_call (t_hash *hash, const s_call *call);
bool hash_update_cfn (t_hash *hash, const s_cfn *cfn);
+HASH_UPDATE_PROTOTYPE(char);
HASH_UPDATE_PROTOTYPE(character);
HASH_UPDATE_PROTOTYPE(f32);
HASH_UPDATE_PROTOTYPE(f64);
diff --git a/libc3/ident.c b/libc3/ident.c
index 1e043ce..a17ef21 100644
--- a/libc3/ident.c
+++ b/libc3/ident.c
@@ -97,9 +97,9 @@ s_tag * ident_get (const s_ident *ident, s_facts *facts, s_tag *dest)
if (facts_with_cursor_next(&cursor)) {
if (tag_var.type != TAG_CFN) {
err_write_1("call_get: ");
- err_write_1(module->str.ptr.ps8);
+ err_write_1(module->str.ptr.pchar);
err_write_1(".");
- err_write_1(ident->sym->str.ptr.ps8);
+ err_write_1(ident->sym->str.ptr.pchar);
err_puts(" is not a C function");
facts_with_cursor_clean(&cursor);
return NULL;
@@ -113,9 +113,9 @@ s_tag * ident_get (const s_ident *ident, s_facts *facts, s_tag *dest)
if (facts_with_cursor_next(&cursor)) {
if (tag_var.type != TAG_FN) {
err_write_1("call_get: ");
- err_write_1(module->str.ptr.ps8);
+ err_write_1(module->str.ptr.pchar);
err_write_1(".");
- err_write_1(ident->sym->str.ptr.ps8);
+ err_write_1(ident->sym->str.ptr.pchar);
err_puts(" is not a function");
facts_with_cursor_clean(&cursor);
return NULL;
@@ -180,7 +180,7 @@ s_ident * ident_init (s_ident *ident, const s_sym *module,
return ident;
}
-s_ident * ident_init_1 (s_ident *ident, const s8 *p)
+s_ident * ident_init_1 (s_ident *ident, const char *p)
{
s_str tmp;
str_init_1(&tmp, NULL, p);
diff --git a/libc3/ident.h b/libc3/ident.h
index 0617721..7620e6d 100644
--- a/libc3/ident.h
+++ b/libc3/ident.h
@@ -22,7 +22,7 @@
/* Stack-allocation compatible functions */
s_ident * ident_init (s_ident *ident, const s_sym *module,
const s_sym *sym);
-s_ident * ident_init_1 (s_ident *ident, const s8 *p);
+s_ident * ident_init_1 (s_ident *ident, const char *p);
s_ident * ident_init_cast (s_ident *ident, const s_tag *tag);
s_ident * ident_init_copy (s_ident *ident, const s_ident *src);
diff --git a/libc3/integer.c b/libc3/integer.c
index 74da7f4..a47fd1c 100644
--- a/libc3/integer.c
+++ b/libc3/integer.c
@@ -195,12 +195,12 @@ s_integer * integer_init (s_integer *dest)
return dest;
}
-s_integer * integer_init_1 (s_integer *i, const s8 *p)
+s_integer * integer_init_1 (s_integer *i, const char *p)
{
s_buf buf;
assert(i);
assert(p);
- buf_init_1(&buf, false, (s8 *) p);
+ buf_init_1(&buf, false, (char *) p);
buf_parse_integer(&buf, i);
return i;
}
diff --git a/libc3/integer.h b/libc3/integer.h
index 4f82744..bd57266 100644
--- a/libc3/integer.h
+++ b/libc3/integer.h
@@ -27,7 +27,7 @@
/* Stack allocation compatible functions */
s_integer * integer_init (s_integer *i);
-s_integer * integer_init_1 (s_integer *i, const s8 *p);
+s_integer * integer_init_1 (s_integer *i, const char *p);
s_integer * integer_init_cast (s_integer *a, const s_tag *tag);
s_integer * integer_init_copy (s_integer *a, const s_integer *src);
s_integer * integer_init_f32 (s_integer *a, f32 x);
diff --git a/libc3/io.c b/libc3/io.c
index 059ce3e..615fc7f 100644
--- a/libc3/io.c
+++ b/libc3/io.c
@@ -46,7 +46,7 @@ sw err_inspect (const s_tag *x)
return err_inspect_tag(x);
}
-sw err_puts (const s8 *x)
+sw err_puts (const char *x)
{
sw r;
sw result = 0;
@@ -60,7 +60,7 @@ sw err_puts (const s8 *x)
return result;
}
-sw err_write_1 (const s8 *x)
+sw err_write_1 (const char *x)
{
sw r;
if ((r = buf_write_1(&g_c3_env.err, x)) > 0)
@@ -82,7 +82,7 @@ sw io_inspect (const s_tag *x)
return result;
}
-sw io_puts (const s8 *x)
+sw io_puts (const char *x)
{
sw r;
sw result = 0;
@@ -96,7 +96,7 @@ sw io_puts (const s8 *x)
return result;
}
-sw io_write_1 (const s8 *x)
+sw io_write_1 (const char *x)
{
sw r;
if ((r = buf_write_1(&g_c3_env.out, x)) > 0)
diff --git a/libc3/io.h b/libc3/io.h
index 71675b8..41b0da7 100644
--- a/libc3/io.h
+++ b/libc3/io.h
@@ -27,13 +27,13 @@
/* error output */
sw err_inspect (const s_tag *x);
-sw err_puts (const s8 *x);
-sw err_write_1 (const s8 *x);
+sw err_puts (const char *x);
+sw err_write_1 (const char *x);
/* standard output */
sw io_inspect (const s_tag *x);
-sw io_puts (const s8 *x);
-sw io_write_1 (const s8 *x);
+sw io_puts (const char *x);
+sw io_write_1 (const char *x);
PROTOTYPES_ERR_IO_INSPECT(array, const s_array *);
PROTOTYPES_ERR_IO_INSPECT(bool, const bool *);
diff --git a/libc3/license.c b/libc3/license.c
index 4a58d71..88c2daa 100644
--- a/libc3/license.c
+++ b/libc3/license.c
@@ -12,7 +12,7 @@
*/
#include "c3_main.h"
-const s8 * g_c3_license = "c3\n"
+const char *g_c3_license = "c3\n"
"Copyright 2022,2023 kmx.io <contact@kmx.io>\n"
"\n"
"Permission is hereby granted to use this software granted the above\n"
diff --git a/libc3/list.c b/libc3/list.c
index b7cc567..bac4a82 100644
--- a/libc3/list.c
+++ b/libc3/list.c
@@ -65,7 +65,7 @@ s_list * list_init (s_list *list, s_list *next)
return list;
}
-s_list * list_init_1 (s_list *list, const s8 *p, s_list *next)
+s_list * list_init_1 (s_list *list, const char *p, s_list *next)
{
assert(list);
tag_init_1(&list->tag, p);
@@ -195,11 +195,11 @@ s_list * list_new (s_list *next)
return list_init(dest, next);
}
-s_list * list_new_1 (const s8 *p)
+s_list * list_new_1 (const char *p)
{
s_buf buf;
s_list *list;
- buf_init_1(&buf, false, (s8 *) p);
+ buf_init_1(&buf, false, (char *) p);
if (buf_parse_list(&buf, &list) != (sw) strlen(p)) {
assert(! "invalid list");
return NULL;
diff --git a/libc3/list.h b/libc3/list.h
index 1c6cb5f..27561d1 100644
--- a/libc3/list.h
+++ b/libc3/list.h
@@ -27,24 +27,24 @@
/* Stack-allocation functions, call list_clean after use. */
void list_clean (s_list *list);
s_list * list_init (s_list *list, s_list *next);
-s_list * list_init_1 (s_list *list, const s8 *p, s_list *next);
+s_list * list_init_1 (s_list *list, const char *p, s_list *next);
s_list ** list_init_cast (s_list **list, const s_tag *tag);
s_list ** list_init_copy (s_list **list, const s_list * const *src);
s_list * list_init_copy_tag (s_list *list, const s_tag *tag,
s_list *next);
-s_list * list_init_eval (s_list *list, const s8 *p);
+s_list * list_init_eval (s_list *list, const char *p);
/* Heap-allocation functions, call list_delete after use */
s_list * list_delete (s_list *list);
void list_delete_all (s_list *list);
void list_f_clean (s_list **list);
s_list * list_new (s_list *next);
-s_list * list_new_1 (const s8 *p);
+s_list * list_new_1 (const char *p);
s_list * list_new_f64 (f64 x, s_list *next);
s_list * list_new_copy (const s_tag *tag, s_list *next);
s_list * list_new_list (s_list *list, s_list *next);
s_list * list_new_map (uw count, s_list *next);
-s_list * list_new_str_1 (s8 *free, const s8 *p, s_list *next);
+s_list * list_new_str_1 (char *free, const char *p, s_list *next);
/* Observers */
s_list ** list_cast (const s_tag *tag, s_list **list);
diff --git a/libc3/list_init.c b/libc3/list_init.c
index aef37cf..9e407fd 100644
--- a/libc3/list_init.c
+++ b/libc3/list_init.c
@@ -118,7 +118,7 @@ s_list * list_init_ident (s_list *list, const s_ident *ident,
return list;
}
-s_list * list_init_ident_1 (s_list *list, const s8 *p, s_list *next)
+s_list * list_init_ident_1 (s_list *list, const char *p, s_list *next)
{
s_list tmp;
assert(list);
@@ -129,7 +129,7 @@ s_list * list_init_ident_1 (s_list *list, const s8 *p, s_list *next)
return list;
}
-s_list * list_init_integer_1 (s_list *list, const s8 *p, s_list *next)
+s_list * list_init_integer_1 (s_list *list, const char *p, s_list *next)
{
s_list tmp;
assert(list);
@@ -174,7 +174,7 @@ s_list * list_init_map (s_list *list, uw count, s_list *next)
return list;
}
-s_list * list_init_map_1 (s_list *list, const s8 *p, s_list *next)
+s_list * list_init_map_1 (s_list *list, const char *p, s_list *next)
{
s_list tmp;
assert(list);
@@ -251,8 +251,8 @@ s_list * list_init_s64 (s_list *list, s64 i, s_list *next)
return list;
}
-s_list * list_init_str (s_list *list, s8 *p_free, uw size, const s8 *p,
- s_list *next)
+s_list * list_init_str (s_list *list, char *p_free, uw size,
+ const char *p, s_list *next)
{
s_list tmp;
assert(list);
@@ -263,7 +263,7 @@ s_list * list_init_str (s_list *list, s8 *p_free, uw size, const s8 *p,
return list;
}
-s_list * list_init_str_1 (s_list *list, s8 *p_free, const s8 *p,
+s_list * list_init_str_1 (s_list *list, char *p_free, const char *p,
s_list *next)
{
s_list tmp;
@@ -322,7 +322,7 @@ s_list * list_init_sym (s_list *list, const s_sym *sym, s_list *next)
return list;
}
-s_list * list_init_sym_1 (s_list *list, const s8 *p, s_list *next)
+s_list * list_init_sym_1 (s_list *list, const char *p, s_list *next)
{
s_list tmp;
assert(list);
@@ -525,7 +525,7 @@ s_list * list_new_ident (const s_ident *ident, s_list *next)
return list;
}
-s_list * list_new_ident_1 (const s8 *p, s_list *next)
+s_list * list_new_ident_1 (const char *p, s_list *next)
{
s_list *list;
list = list_new(next);
@@ -538,7 +538,7 @@ s_list * list_new_ident_1 (const s8 *p, s_list *next)
return list;
}
-s_list * list_new_integer_1 (const s8 *p, s_list *next)
+s_list * list_new_integer_1 (const char *p, s_list *next)
{
s_list *list;
list = list_new(next);
@@ -590,7 +590,7 @@ s_list * list_new_map (uw count, s_list *next)
return list;
}
-s_list * list_new_map_1 (const s8 *p, s_list *next)
+s_list * list_new_map_1 (const char *p, s_list *next)
{
s_list *list;
list = list_new(next);
@@ -681,7 +681,8 @@ s_list * list_new_s64 (s64 i, s_list *next)
return list;
}
-s_list * list_new_str (s8 *p_free, uw size, const s8 *p, s_list *next)
+s_list * list_new_str (char *p_free, uw size, const char *p,
+ s_list *next)
{
s_list *list;
list = list_new(next);
@@ -694,7 +695,7 @@ s_list * list_new_str (s8 *p_free, uw size, const s8 *p, s_list *next)
return list;
}
-s_list * list_new_str_1 (s8 *p_free, const s8 *p, s_list *next)
+s_list * list_new_str_1 (char *p_free, const char *p, s_list *next)
{
s_list *list;
list = list_new(next);
@@ -762,7 +763,7 @@ s_list * list_new_sym (const s_sym *sym, s_list *next)
return list;
}
-s_list * list_new_sym_1 (const s8 *p, s_list *next)
+s_list * list_new_sym_1 (const char *p, s_list *next)
{
s_list *list;
list = list_new(next);
diff --git a/libc3/list_init.h b/libc3/list_init.h
index dc3aa1b..e47ece0 100644
--- a/libc3/list_init.h
+++ b/libc3/list_init.h
@@ -27,23 +27,24 @@ s_list * list_init_f32 (s_list *list, f32 f, s_list *next);
s_list * list_init_f64 (s_list *list, f64 f, s_list *next);
s_list * list_init_ident (s_list *list, const s_ident *ident,
s_list *next);
-s_list * list_init_ident_1 (s_list *list, const s8 *p, s_list *next);
-s_list * list_init_integer_1 (s_list *list, const s8 *p, s_list *next);
+s_list * list_init_ident_1 (s_list *list, const char *p, s_list *next);
+s_list * list_init_integer_1 (s_list *list, const char *p,
+ s_list *next);
s_list * list_init_integer_copy (s_list *list, const s_integer *i,
s_list *next);
s_list * list_init_integer_zero (s_list *list, s_list *next);
s_list * list_init_map (s_list *list, uw count, s_list *next);
-s_list * list_init_map_1 (s_list *list, const s8 *p, s_list *next);
+s_list * list_init_map_1 (s_list *list, const char *p, s_list *next);
s_list * list_init_ptr (s_list *list, void *p, s_list *next);
s_list * list_init_ptr_free (s_list *list, void *p, s_list *next);
s_list * list_init_s8 (s_list *list, s8 i, s_list *next);
s_list * list_init_s16 (s_list *list, s16 i, s_list *next);
s_list * list_init_s32 (s_list *list, s32 i, s_list *next);
s_list * list_init_s64 (s_list *list, s64 i, s_list *next);
-s_list * list_init_str (s_list *list, s8 *p_free, uw size, const s8 *p,
- s_list *next);
-s_list * list_init_str_1 (s_list *list, s8 *p_free, const s8 *p,
+s_list * list_init_str (s_list *list, char *p_free, uw size,
+ const char *p, s_list *next);
+s_list * list_init_str_1 (s_list *list, char *p_free, const char *p,
s_list *next);
s_list * list_init_struct (s_list *list, const s_sym *module,
s_list *next);
@@ -52,7 +53,7 @@ s_list * list_init_struct_with_data (s_list *list, const s_sym *module,
s_list *next);
s_list * list_init_sw (s_list *list, sw i, s_list *next);
s_list * list_init_sym (s_list *list, const s_sym *sym, s_list *next);
-s_list * list_init_sym_1 (s_list *list, const s8 *p, s_list *next);
+s_list * list_init_sym_1 (s_list *list, const char *p, s_list *next);
s_list * list_init_tuple (s_list *list, uw count, s_list *next);
s_list * list_init_tuple_2 (s_list *list, const s_tag *a,
const s_tag *b, s_list *next);
@@ -75,28 +76,29 @@ s_list * list_new_character (character c, s_list *next);
s_list * list_new_f32 (f32 f, s_list *next);
s_list * list_new_f64 (f64 f, s_list *next);
s_list * list_new_ident (const s_ident *ident, s_list *next);
-s_list * list_new_ident_1 (const s8 *p, s_list *next);
-s_list * list_new_integer_1 (const s8 *p, s_list *next);
+s_list * list_new_ident_1 (const char *p, s_list *next);
+s_list * list_new_integer_1 (const char *p, s_list *next);
s_list * list_new_integer_copy (const s_integer *i, s_list *next);
s_list * list_new_integer_zero (s_list *next);
s_list * list_new_map (uw count, s_list *next);
-s_list * list_new_map_1 (const s8 *p, s_list *next);
+s_list * list_new_map_1 (const char *p, s_list *next);
s_list * list_new_ptr (void *p, s_list *next);
s_list * list_new_ptr_free (void *p, s_list *next);
s_list * list_new_s8 (s8 i, s_list *next);
s_list * list_new_s16 (s16 i, s_list *next);
s_list * list_new_s32 (s32 i, s_list *next);
s_list * list_new_s64 (s64 i, s_list *next);
-s_list * list_new_str (s8 *p_free, uw size, const s8 *p, s_list *next);
-s_list * list_new_str_1 (s8 *p_free, const s8 *p, s_list *next);
+s_list * list_new_str (char *p_free, uw size, const char *p,
+ s_list *next);
+s_list * list_new_str_1 (char *p_free, const char *p, s_list *next);
s_list * list_new_struct (const s_sym *module, s_list *next);
s_list * list_new_struct_with_data (const s_sym *module,
bool free_data, void *data,
s_list *next);
s_list * list_new_sw (sw i, s_list *next);
s_list * list_new_sym (const s_sym *sym, s_list *next);
-s_list * list_new_sym_1 (const s8 *p, s_list *next);
+s_list * list_new_sym_1 (const char *p, s_list *next);
s_list * list_new_tuple (uw count, s_list *next);
s_list * list_new_tuple_2 (const s_tag *a, const s_tag *b,
s_list *next);
@@ -119,27 +121,27 @@ s_list * list_character (s_list *list, character c);
s_list * list_f32 (s_list *list, f32 f);
s_list * list_f64 (s_list *list, f64 f);
s_list * list_ident (s_list *list, const s_ident *ident);
-s_list * list_ident_1 (s_list *list, const s8 *p);
-s_list * list_integer_1 (s_list *list, const s8 *p);
+s_list * list_ident_1 (s_list *list, const char *p);
+s_list * list_integer_1 (s_list *list, const char *p);
s_list * list_integer_copy (s_list *list, const s_integer *i);
s_list * list_integer_zero (s_list *list);
s_list * list_map (s_list *list, uw count);
-s_list * list_map_1 (s_list *list, const s8 *p);
+s_list * list_map_1 (s_list *list, const char *p);
s_list * list_ptr (s_list *list, void *p);
s_list * list_ptr_free (s_list *list, void *p);
s_list * list_s8 (s_list *list, s8 i);
s_list * list_s16 (s_list *list, s16 i);
s_list * list_s32 (s_list *list, s32 i);
s_list * list_s64 (s_list *list, s64 i);
-s_list * list_str (s_list *list, s8 *p_free, uw size, const s8 *p);
-s_list * list_str_1 (s_list *list, s8 *p_free, const s8 *p);
+s_list * list_str (s_list *list, char *p_free, uw size, const char *p);
+s_list * list_str_1 (s_list *list, char *p_free, const char *p);
s_list * list_struct (s_list *list, const s_sym *module);
s_list * list_struct_with_data (s_list *list, const s_sym *module,
bool free_data, void *data);
s_list * list_sw (s_list *list, sw i);
s_list * list_sym (s_list *list, const s_sym *sym);
-s_list * list_sym_1 (s_list *list, const s8 *p);
+s_list * list_sym_1 (s_list *list, const char *p);
s_list * list_tuple (s_list *list, uw count);
s_list * list_tuple_2 (s_list *list, const s_tag *a, const s_tag *b);
s_list * list_time (s_list *list);
diff --git a/libc3/map.c b/libc3/map.c
index b8fda6d..a82b673 100644
--- a/libc3/map.c
+++ b/libc3/map.c
@@ -84,13 +84,13 @@ s_map * map_init (s_map *map, uw count)
return map;
}
-s_map * map_init_1 (s_map *map, const s8 *p)
+s_map * map_init_1 (s_map *map, const char *p)
{
s_buf buf;
sw r;
assert(map);
assert(p);
- buf_init_1(&buf, false, (s8 *) p);
+ buf_init_1(&buf, false, (char *) p);
if ((r = buf_parse_map(&buf, map)) != (sw) strlen(p)) {
assert(! "invalid map");
warnx("invalid map: \"%s\" (%ld)", p, r);
@@ -182,7 +182,7 @@ s_map * map_new (uw count)
return map_init(map, count);
}
-s_map * map_new_1 (const s8 *p)
+s_map * map_new_1 (const char *p)
{
s_map *map;
if (! (map = malloc(sizeof(s_map)))) {
diff --git a/libc3/map.h b/libc3/map.h
index 2e54be5..125751c 100644
--- a/libc3/map.h
+++ b/libc3/map.h
@@ -18,7 +18,7 @@
/* Stack allocation compatible functions, call map_clean after use. */
void map_clean (s_map *map);
s_map * map_init (s_map *map, uw size);
-s_map * map_init_1 (s_map *map, const s8 *p);
+s_map * map_init_1 (s_map *map, const char *p);
s_map * map_init_cast (s_map *map, const s_tag *tag);
s_map * map_init_copy (s_map *map, const s_map *src);
s_map * map_init_from_lists (s_map *map, const s_list *keys,
@@ -27,7 +27,7 @@ s_map * map_init_from_lists (s_map *map, const s_list *keys,
/* Heap allocation functions, call map_delete after use. */
void map_delete (s_map *map);
s_map * map_new (uw size);
-s_map * map_new_1 (const s8 *p);
+s_map * map_new_1 (const char *p);
s_map * map_new_from_lists (const s_list *keys, const s_list *values);
/* Modifiers */
diff --git a/libc3/sequence.c b/libc3/sequence.c
index a50ea21..cb24e27 100644
--- a/libc3/sequence.c
+++ b/libc3/sequence.c
@@ -20,7 +20,7 @@ void sequence_clean (s_sequence *seq)
}
s_sequence * sequence_init (s_sequence *seq, f64 duration,
- const s8 *title, f_sequence load,
+ const char *title, f_sequence load,
f_sequence render, f_sequence unload,
void *window)
{
diff --git a/libc3/sequence.h b/libc3/sequence.h
index a869db2..2065e13 100644
--- a/libc3/sequence.h
+++ b/libc3/sequence.h
@@ -19,7 +19,7 @@
after use. */
void sequence_clean (s_sequence *seq);
s_sequence * sequence_init (s_sequence *sequence, f64 duration,
- const s8 *title, f_sequence load,
+ const char *title, f_sequence load,
f_sequence render, f_sequence unload,
void *window);
diff --git a/libc3/str.c b/libc3/str.c
index 6dffba0..185129c 100644
--- a/libc3/str.c
+++ b/libc3/str.c
@@ -95,7 +95,7 @@ bool str_has_reserved_characters (const s_str *src)
return false;
}
-s_str * str_init (s_str *str, s8 *free, uw size, const s8 *p)
+s_str * str_init (s_str *str, char *free, uw size, const char *p)
{
assert(str);
str->free.p = free;
@@ -104,7 +104,7 @@ s_str * str_init (s_str *str, s8 *free, uw size, const s8 *p)
return str;
}
-s_str * str_init_1 (s_str *str, s8 *free, const s8 *p)
+s_str * str_init_1 (s_str *str, char *free, const char *p)
{
assert(str);
str->free.p = free;
@@ -113,7 +113,7 @@ s_str * str_init_1 (s_str *str, s8 *free, const s8 *p)
return str;
}
-s_str * str_init_alloc (s_str *str, uw size, const s8 *p)
+s_str * str_init_alloc (s_str *str, uw size, const char *p)
{
assert(str);
str->free.p = calloc(size + 1, 1);
@@ -155,7 +155,7 @@ s_str * str_init_copy (s_str *str, const s_str *src)
return str;
}
-s_str * str_init_copy_1 (s_str *str, const s8 *src)
+s_str * str_init_copy_1 (s_str *str, const char *src)
{
uw len;
assert(str);
@@ -191,7 +191,7 @@ s_str * str_init_slice (s_str *str, const s_str *src, sw start, sw end)
s_buf buf;
assert(str);
assert(src);
- buf_init(&buf, false, src->size, (s8 *) src->ptr.ps8);
+ buf_init(&buf, false, src->size, (char *) src->ptr.pchar);
if (! str_sw_pos_to_uw(start, src->size, &buf.rpos) ||
! str_sw_pos_to_uw(end, src->size, &buf.wpos))
return NULL;
@@ -234,7 +234,7 @@ uw * str_sw_pos_to_uw (sw pos, uw max_pos, uw *dest)
s_str * str_init_vf (s_str *str, const char *fmt, va_list ap)
{
int len;
- s8 *s;
+ char *s;
len = vasprintf(&s, fmt, ap);
if (len < 0)
err(1, "vasprintf");
@@ -268,7 +268,7 @@ sw str_length_utf8 (const s_str *str)
return result;
}
-s_str * str_new (s8 *free, uw size, const s8 *p)
+s_str * str_new (char *free, uw size, const char *p)
{
s_str *str;
str = malloc(sizeof(s_str));
@@ -278,16 +278,16 @@ s_str * str_new (s8 *free, uw size, const s8 *p)
return str;
}
-s_str * str_new_1 (s8 *free, const s8 *s)
+s_str * str_new_1 (char *free, const char *s)
{
size_t len = strlen(s);
s_str *str = str_new(free, len, s);
return str;
}
-s_str * str_new_cpy (const s8 *p, uw size)
+s_str * str_new_cpy (const char *p, uw size)
{
- s8 *a;
+ char *a;
s_str *str;
if (! (a = malloc(size))) {
warn("str_new_cpy");
@@ -300,7 +300,7 @@ s_str * str_new_cpy (const s8 *p, uw size)
s_str * str_new_copy (const s_str *src)
{
- s8 *a;
+ char *a;
s_str *dest;
assert(src);
if (! (a = malloc(src->size))) {
@@ -424,7 +424,7 @@ sw str_read_character_utf8 (s_str *str, character *c)
if (size < 0)
return size;
str->size -= size;
- str->ptr.p = str->ptr.ps8 + size;
+ str->ptr.p = str->ptr.pchar + size;
return size;
}
diff --git a/libc3/str.h b/libc3/str.h
index e9b6cc2..f44f532 100644
--- a/libc3/str.h
+++ b/libc3/str.h
@@ -28,12 +28,12 @@
/* Stack allocation compatible functions */
void str_clean (s_str *str);
-s_str * str_init (s_str *str, s8 *free, uw size, const s8 *p);
-s_str * str_init_1 (s_str *str, s8 *free, const s8 *p);
-s_str * str_init_alloc (s_str *str, uw size, const s8 *p);
+s_str * str_init (s_str *str, char *free, uw size, const char *p);
+s_str * str_init_1 (s_str *str, char *free, const char *p);
+s_str * str_init_alloc (s_str *str, uw size, const char *p);
s_str * str_init_cast (s_str *str, const s_tag *tag);
s_str * str_init_copy (s_str *str, const s_str *src);
-s_str * str_init_copy_1 (s_str *str, const s8 *p);
+s_str * str_init_copy_1 (s_str *str, const char *p);
s_str * str_init_empty (s_str *str);
s_str * str_init_f (s_str *str, const char *fmt, ...);
s_str * str_init_slice (s_str *str, const s_str *src, sw start, sw end);
@@ -42,9 +42,9 @@ s_str * str_init_slice_utf8 (s_str *str, const s_str *src, sw start,
s_str * str_init_vf (s_str *str, const char *fmt, va_list ap);
/* Constructors, call str_delete after use */
-s_str * str_new (s8 *free, uw size, const s8 *p);
-s_str * str_new_1 (s8 *free, const s8 *p);
-s_str * str_new_cpy (const s8 *p, uw size);
+s_str * str_new (char *free, uw size, const char *p);
+s_str * str_new_1 (char *free, const char *p);
+s_str * str_new_cpy (const char *p, uw size);
s_str * str_new_copy (const s_str *src);
s_str * str_new_empty (void);
s_str * str_new_f (const char *fmt, ...);
diff --git a/libc3/sym.c b/libc3/sym.c
index fae25ea..29e8d59 100644
--- a/libc3/sym.c
+++ b/libc3/sym.c
@@ -21,7 +21,7 @@ s_sym_list * sym_list_new (s_sym *sym, s_sym_list *next);
static s_sym_list * g_sym_list = NULL;
-const s_sym * sym_1 (const s8 *p)
+const s_sym * sym_1 (const char *p)
{
s_str stra;
str_init_1(&stra, NULL, p);
@@ -100,7 +100,7 @@ bool sym_has_reserved_characters (const s_sym *sym)
return false;
}
-const s_sym ** sym_init_1 (const s_sym **sym, const s8 *p)
+const s_sym ** sym_init_1 (const s_sym **sym, const char *p)
{
assert(sym);
assert(p);
@@ -345,7 +345,7 @@ bool sym_to_buf_inspect (const s_sym *type, f_buf_inspect *dest)
return true;
}
err_write_1("sym_to_buf_inspect: unknown type: ");
- err_write_1(type->str.ptr.ps8);
+ err_write_1(type->str.ptr.pchar);
err_write_1("\n");
assert(! "sym_to_buf_inspect: unknown type");
return false;
diff --git a/libc3/sym.h b/libc3/sym.h
index 289e4ca..83d1929 100644
--- a/libc3/sym.h
+++ b/libc3/sym.h
@@ -26,8 +26,8 @@
#define SYM_MAX 1024
-const s_sym * sym_1 (const s8 *p);
-const s_sym ** sym_init_1 (const s_sym **sym, const s8 *p);
+const s_sym * sym_1 (const char *p);
+const s_sym ** sym_init_1 (const s_sym **sym, const char *p);
const s_sym ** sym_init_cast (const s_sym **sym, const s_tag *tag);
const s_sym ** sym_init_copy (const s_sym **sym,
const s_sym * const *src);
diff --git a/libc3/tag.c b/libc3/tag.c
index 792ac9f..6c4c9d1 100644
--- a/libc3/tag.c
+++ b/libc3/tag.c
@@ -45,7 +45,7 @@
s_tag g_tag_first;
s_tag g_tag_last;
-s_tag * tag_1 (s_tag *tag, const s8 *p)
+s_tag * tag_1 (s_tag *tag, const char *p)
{
tag_clean(tag);
return tag_init_1(tag, p);
@@ -377,7 +377,7 @@ s_tag * tag_init (s_tag *tag)
return tag;
}
-s_tag * tag_init_1 (s_tag *tag, const s8 *p)
+s_tag * tag_init_1 (s_tag *tag, const char *p)
{
s_buf buf;
uw len;
@@ -386,7 +386,7 @@ s_tag * tag_init_1 (s_tag *tag, const s8 *p)
tag_init_void(tag);
if (! p)
return tag;
- buf_init_1(&buf, false, (s8 *) p);
+ buf_init_1(&buf, false, (char *) p);
len = strlen(p);
r = buf_parse_tag(&buf, tag);
if (r < 0 || (uw) r != len) {
@@ -488,7 +488,7 @@ bool tag_is_unbound_var (const s_tag *tag)
return (tag && tag->type == TAG_VAR);
}
-s_tag * tag_list_1 (s_tag *tag, const s8 *p)
+s_tag * tag_list_1 (s_tag *tag, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -585,7 +585,7 @@ s_tag * tag_new (void)
return tag;
}
-s_tag * tag_new_1 (const s8 *p)
+s_tag * tag_new_1 (const char *p)
{
s_tag *tag;
tag = calloc(1, sizeof(s_tag));
@@ -658,7 +658,7 @@ bool tag_to_const_pointer (const s_tag *tag, const s_sym *type,
if (tag->type != tag_type) {
warnx("tag_to_const_pointer: cannot cast %s to %s",
tag_type_to_string(tag->type),
- type->str.ptr.ps8);
+ type->str.ptr.pchar);
assert(! "tag_to_const_pointer: cannot cast");
return false;
}
@@ -886,7 +886,7 @@ bool tag_to_ffi_pointer (s_tag *tag, const s_sym *type, void **dest)
return true;
}
if (type == sym_1("Char*")) {
- *dest = (void *) tag->data.str.ptr.ps8;
+ *dest = (void *) tag->data.str.ptr.pchar;
return true;
}
goto invalid_cast;
@@ -916,7 +916,7 @@ bool tag_to_ffi_pointer (s_tag *tag, const s_sym *type, void **dest)
return true;
}
if (type == sym_1("Char*")) {
- *dest = (void *) tag->data.sym->str.ptr.ps8;
+ *dest = (void *) tag->data.sym->str.ptr.pchar;
return true;
}
goto invalid_cast;
diff --git a/libc3/tag.h b/libc3/tag.h
index 33304d3..a6cf8f3 100644
--- a/libc3/tag.h
+++ b/libc3/tag.h
@@ -32,12 +32,12 @@ extern s_tag g_tag_last;
/* Stack-allocation compatible functions, call tag_clean after use. */
void tag_clean (s_tag *tag);
s_tag * tag_init (s_tag *tag);
-s_tag * tag_init_1 (s_tag *tag, const s8 *p);
+s_tag * tag_init_1 (s_tag *tag, const char *p);
/* Heap-allocation functions, call tag_delete after use. */
void tag_delete (s_tag *tag);
s_tag * tag_new (void);
-s_tag * tag_new_1 (const s8 *p);
+s_tag * tag_new_1 (const char *p);
/* Observers */
u64 tag_hash_u64 (const s_tag *tag);
@@ -53,7 +53,7 @@ ffi_type tag_to_ffi_type(const s_tag *tag);
const s_sym ** tag_type (const s_tag *tag, const s_sym **type);
/* Operators. */
-s_tag * tag_1 (s_tag *tag, const s8 *p);
+s_tag * tag_1 (s_tag *tag, const char *p);
s_tag * tag_integer_cast_to_s16 (const s_tag *tag, s_tag *dest);
s_tag * tag_integer_cast_to_s32 (const s_tag *tag, s_tag *dest);
s_tag * tag_integer_cast_to_s64 (const s_tag *tag, s_tag *dest);
@@ -63,7 +63,7 @@ s_tag * tag_integer_cast_to_u32 (const s_tag *tag, s_tag *dest);
s_tag * tag_integer_cast_to_u64 (const s_tag *tag, s_tag *dest);
s_tag * tag_integer_cast_to_u8 (const s_tag *tag, s_tag *dest);
s_tag * tag_integer_reduce (s_tag *tag);
-s_tag * tag_list_1 (s_tag *tag, const s8 *p);
+s_tag * tag_list_1 (s_tag *tag, const char *p);
bool tag_to_const_pointer (const s_tag *tag, const s_sym *type,
const void **dest);
bool tag_to_ffi_pointer (s_tag *tag, const s_sym *type, void **dest);
diff --git a/libc3/tag_init.c b/libc3/tag_init.c
index 49ecc2c..6e6082b 100644
--- a/libc3/tag_init.c
+++ b/libc3/tag_init.c
@@ -111,7 +111,7 @@ s_tag * tag_init_ident (s_tag *tag, const s_ident *ident)
return tag;
}
-s_tag * tag_init_ident_1 (s_tag *tag, const s8 *p)
+s_tag * tag_init_ident_1 (s_tag *tag, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -122,7 +122,7 @@ s_tag * tag_init_ident_1 (s_tag *tag, const s8 *p)
return tag;
}
-s_tag * tag_init_integer_1 (s_tag *tag, const s8 *p)
+s_tag * tag_init_integer_1 (s_tag *tag, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -176,7 +176,7 @@ s_tag * tag_init_map (s_tag *tag, uw count)
return tag;
}
-s_tag * tag_init_map_1 (s_tag *tag, const s8 *p)
+s_tag * tag_init_map_1 (s_tag *tag, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -249,7 +249,7 @@ s_tag * tag_init_s64 (s_tag *tag, s64 i)
return tag;
}
-s_tag * tag_init_str (s_tag *tag, s8 *p_free, uw size, const s8 *p)
+s_tag * tag_init_str (s_tag *tag, char *p_free, uw size, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -260,7 +260,7 @@ s_tag * tag_init_str (s_tag *tag, s8 *p_free, uw size, const s8 *p)
return tag;
}
-s_tag * tag_init_str_1 (s_tag *tag, s8 *p_free, const s8 *p)
+s_tag * tag_init_str_1 (s_tag *tag, char *p_free, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -315,7 +315,7 @@ s_tag * tag_init_sym (s_tag *tag, const s_sym *sym)
return tag;
}
-s_tag * tag_init_sym_1 (s_tag *tag, const s8 *p)
+s_tag * tag_init_sym_1 (s_tag *tag, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -507,7 +507,7 @@ s_tag * tag_new_ident (const s_ident *ident)
return tag;
}
-s_tag * tag_new_ident_1 (const s8 *p)
+s_tag * tag_new_ident_1 (const char *p)
{
s_tag *tag;
if (! (tag = calloc(1, sizeof(s_tag)))) {
@@ -522,7 +522,7 @@ s_tag * tag_new_ident_1 (const s8 *p)
return tag;
}
-s_tag * tag_new_integer_1 (const s8 *p)
+s_tag * tag_new_integer_1 (const char *p)
{
s_tag *tag;
if (! (tag = calloc(1, sizeof(s_tag)))) {
@@ -594,7 +594,7 @@ s_tag * tag_new_map (uw count)
return tag;
}
-s_tag * tag_new_map_1 (const s8 *p)
+s_tag * tag_new_map_1 (const char *p)
{
s_tag *tag;
if (! (tag = calloc(1, sizeof(s_tag)))) {
@@ -687,7 +687,7 @@ s_tag * tag_new_s64 (s64 i)
return tag;
}
-s_tag * tag_new_str (s8 *p_free, uw size, const s8 *p)
+s_tag * tag_new_str (char *p_free, uw size, const char *p)
{
s_tag *tag;
if (! (tag = calloc(1, sizeof(s_tag)))) {
@@ -702,7 +702,7 @@ s_tag * tag_new_str (s8 *p_free, uw size, const s8 *p)
return tag;
}
-s_tag * tag_new_str_1 (s8 *p_free, const s8 *p)
+s_tag * tag_new_str_1 (char *p_free, const char *p)
{
s_tag *tag;
if (! (tag = calloc(1, sizeof(s_tag)))) {
@@ -773,7 +773,7 @@ s_tag * tag_new_sym (const s_sym *sym)
return tag;
}
-s_tag * tag_new_sym_1 (const s8 *p)
+s_tag * tag_new_sym_1 (const char *p)
{
s_tag *tag;
if (! (tag = calloc(1, sizeof(s_tag)))) {
@@ -980,7 +980,7 @@ s_tag * tag_ident (s_tag *tag, const s_ident *ident)
return tag;
}
-s_tag * tag_ident_1 (s_tag *tag, const s8 *p)
+s_tag * tag_ident_1 (s_tag *tag, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -992,7 +992,7 @@ s_tag * tag_ident_1 (s_tag *tag, const s8 *p)
return tag;
}
-s_tag * tag_integer_1 (s_tag *tag, const s8 *p)
+s_tag * tag_integer_1 (s_tag *tag, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -1051,7 +1051,7 @@ s_tag * tag_map (s_tag *tag, uw count)
return tag;
}
-s_tag * tag_map_1 (s_tag *tag, const s8 *p)
+s_tag * tag_map_1 (s_tag *tag, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -1131,7 +1131,7 @@ s_tag * tag_s64 (s_tag *tag, s64 i)
return tag;
}
-s_tag * tag_str (s_tag *tag, s8 *p_free, uw size, const s8 *p)
+s_tag * tag_str (s_tag *tag, char *p_free, uw size, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -1143,7 +1143,7 @@ s_tag * tag_str (s_tag *tag, s8 *p_free, uw size, const s8 *p)
return tag;
}
-s_tag * tag_str_1 (s_tag *tag, s8 *p_free, const s8 *p)
+s_tag * tag_str_1 (s_tag *tag, char *p_free, const char *p)
{
s_tag tmp = {0};
assert(tag);
@@ -1203,7 +1203,7 @@ s_tag * tag_sym (s_tag *tag, const s_sym *sym)
return tag;
}
-s_tag * tag_sym_1 (s_tag *tag, const s8 *p)
+s_tag * tag_sym_1 (s_tag *tag, const char *p)
{
s_tag tmp = {0};
assert(tag);
diff --git a/libc3/tag_init.h b/libc3/tag_init.h
index fc1110e..7947320 100644
--- a/libc3/tag_init.h
+++ b/libc3/tag_init.h
@@ -25,27 +25,27 @@ s_tag * tag_init_copy (s_tag *tag, const s_tag *src);
s_tag * tag_init_f32 (s_tag *tag, f32 f);
s_tag * tag_init_f64 (s_tag *tag, f64 f);
s_tag * tag_init_ident (s_tag *tag, const s_ident *ident);
-s_tag * tag_init_ident_1 (s_tag *tag, const s8 *p);
-s_tag * tag_init_integer_1 (s_tag *tag, const s8 *p);
+s_tag * tag_init_ident_1 (s_tag *tag, const char *p);
+s_tag * tag_init_integer_1 (s_tag *tag, const char *p);
s_tag * tag_init_integer_copy (s_tag *tag, const s_integer *i);
s_tag * tag_init_integer_zero (s_tag *tag);
s_tag * tag_init_list (s_tag *tag, s_list *list);
s_tag * tag_init_map (s_tag *tag, uw count);
-s_tag * tag_init_map_1 (s_tag *tag, const s8 *p);
+s_tag * tag_init_map_1 (s_tag *tag, const char *p);
s_tag * tag_init_ptr (s_tag *tag, void *p);
s_tag * tag_init_ptr_free (s_tag *tag, void *p);
s_tag * tag_init_s8 (s_tag *tag, s8 i);
s_tag * tag_init_s16 (s_tag *tag, s16 i);
s_tag * tag_init_s32 (s_tag *tag, s32 i);
s_tag * tag_init_s64 (s_tag *tag, s64 i);
-s_tag * tag_init_str (s_tag *tag, s8 *p_free, uw size, const s8 *p);
-s_tag * tag_init_str_1 (s_tag *tag, s8 *p_free, const s8 *p);
+s_tag * tag_init_str (s_tag *tag, char *p_free, uw size, const char *p);
+s_tag * tag_init_str_1 (s_tag *tag, char *p_free, const char *p);
s_tag * tag_init_struct (s_tag *tag, const s_sym *module);
s_tag * tag_init_struct_with_data (s_tag *tag, const s_sym *module,
bool free_data, void *data);
s_tag * tag_init_sw (s_tag *tag, sw i);
s_tag * tag_init_sym (s_tag *tag, const s_sym *sym);
-s_tag * tag_init_sym_1 (s_tag *tag, const s8 *p);
+s_tag * tag_init_sym_1 (s_tag *tag, const char *p);
s_tag * tag_init_tuple (s_tag *tag, uw count);
s_tag * tag_init_tuple_2 (s_tag *tag, const s_tag *a, const s_tag *b);
s_tag * tag_init_time (s_tag *tag);
@@ -67,27 +67,27 @@ s_tag * tag_new_copy (const s_tag *src);
s_tag * tag_new_f32 (f32 f);
s_tag * tag_new_f64 (f64 f);
s_tag * tag_new_ident (const s_ident *ident);
-s_tag * tag_new_ident_1 (const s8 *p);
-s_tag * tag_new_integer_1 (const s8 *p);
+s_tag * tag_new_ident_1 (const char *p);
+s_tag * tag_new_integer_1 (const char *p);
s_tag * tag_new_integer_copy (const s_integer *i);
s_tag * tag_new_integer_zero (void);
s_tag * tag_new_list (s_list *list);
s_tag * tag_new_map (uw count);
-s_tag * tag_new_map_1 (const s8 *p);
+s_tag * tag_new_map_1 (const char *p);
s_tag * tag_new_ptr (void *p);
s_tag * tag_new_ptr_free (void *p);
s_tag * tag_new_s8 (s8 i);
s_tag * tag_new_s16 (s16 i);
s_tag * tag_new_s32 (s32 i);
s_tag * tag_new_s64 (s64 i);
-s_tag * tag_new_str (s8 *p_free, uw size, const s8 *p);
-s_tag * tag_new_str_1 (s8 *p_free, const s8 *p);
+s_tag * tag_new_str (char *p_free, uw size, const char *p);
+s_tag * tag_new_str_1 (char *p_free, const char *p);
s_tag * tag_new_struct (const s_sym *module);
s_tag * tag_new_struct_with_data (const s_sym *module, bool free_data,
void *data);
s_tag * tag_new_sw (sw i);
s_tag * tag_new_sym (const s_sym *sym);
-s_tag * tag_new_sym_1 (const s8 *p);
+s_tag * tag_new_sym_1 (const char *p);
s_tag * tag_new_tuple (uw count);
s_tag * tag_new_tuple_2 (const s_tag *a, const s_tag *b);
s_tag * tag_new_time (void);
@@ -109,27 +109,27 @@ s_tag * tag_copy (s_tag *tag, const s_tag *src);
s_tag * tag_f32 (s_tag *tag, f32 f);
s_tag * tag_f64 (s_tag *tag, f64 f);
s_tag * tag_ident (s_tag *tag, const s_ident *ident);
-s_tag * tag_ident_1 (s_tag *tag, const s8 *p);
-s_tag * tag_integer_1 (s_tag *tag, const s8 *p);
+s_tag * tag_ident_1 (s_tag *tag, const char *p);
+s_tag * tag_integer_1 (s_tag *tag, const char *p);
s_tag * tag_integer_copy (s_tag *tag, const s_integer *i);
s_tag * tag_integer_zero (s_tag *tag);
s_tag * tag_list (s_tag *tag, s_list *list);
s_tag * tag_map (s_tag *tag, uw count);
-s_tag * tag_map_1 (s_tag *tag, const s8 *p);
+s_tag * tag_map_1 (s_tag *tag, const char *p);
s_tag * tag_ptr (s_tag *tag, void *p);
s_tag * tag_ptr_free (s_tag *tag, void *p);
s_tag * tag_s8 (s_tag *tag, s8 i);
s_tag * tag_s16 (s_tag *tag, s16 i);
s_tag * tag_s32 (s_tag *tag, s32 i);
s_tag * tag_s64 (s_tag *tag, s64 i);
-s_tag * tag_str (s_tag *tag, s8 *p_free, uw size, const s8 *p);
-s_tag * tag_str_1 (s_tag *tag, s8 *p_free, const s8 *p);
+s_tag * tag_str (s_tag *tag, char *p_free, uw size, const char *p);
+s_tag * tag_str_1 (s_tag *tag, char *p_free, const char *p);
s_tag * tag_struct (s_tag *tag, const s_sym *module);
s_tag * tag_struct_with_data (s_tag *tag, const s_sym *module,
bool free_data, void *data);
s_tag * tag_sw (s_tag *tag, sw i);
s_tag * tag_sym (s_tag *tag, const s_sym *sym);
-s_tag * tag_sym_1 (s_tag *tag, const s8 *p);
+s_tag * tag_sym_1 (s_tag *tag, const char *p);
s_tag * tag_tuple (s_tag *tag, uw count);
s_tag * tag_tuple_2 (s_tag *tag, const s_tag *a, const s_tag *b);
s_tag * tag_time (s_tag *tag);
diff --git a/libc3/tag_init.rb b/libc3/tag_init.rb
index 5d23dc1..066580e 100644
--- a/libc3/tag_init.rb
+++ b/libc3/tag_init.rb
@@ -271,7 +271,7 @@ end
class TagInit1 < TagInit
def initialize(name, suffix, tag_type, init_mode = :init_mode_init,
- args_list = [Arg.new("const s8 *", "p")])
+ args_list = [Arg.new("const char *", "p")])
super(name, suffix, tag_type, init_mode, args_list)
end
end
@@ -327,7 +327,7 @@ class TagInitList
TagInit.new("list", "TAG_LIST", :init_mode_direct,
[Arg.new("s_list *", "list")]),
# TagInit1.new("list", "1", "TAG_LIST", :init_mode_init,
-# [Arg.new("const s8 *", "p"),
+# [Arg.new("const char *", "p"),
# Arg.new("s_list *", "next")]),
TagInit.new("map", "TAG_MAP", :init_mode_init,
[Arg.new("uw", "count")]),
@@ -345,12 +345,12 @@ class TagInitList
TagInit.new("s64", "TAG_S64", :init_mode_direct,
[Arg.new("s64", "i")]),
TagInit.new("str", "TAG_STR", :init_mode_init,
- [Arg.new("s8 *", "p_free"),
+ [Arg.new("char *", "p_free"),
Arg.new("uw", "size"),
- Arg.new("const s8 *", "p")]),
+ Arg.new("const char *", "p")]),
TagInit.new("str", "1", "TAG_STR", :init_mode_init,
- [Arg.new("s8 *", "p_free"),
- Arg.new("const s8 *", "p")]),
+ [Arg.new("char *", "p_free"),
+ Arg.new("const char *", "p")]),
TagInit.new("struct", "TAG_STRUCT", :init_mode_init,
[Arg.new("const s_sym *", "module")]),
TagInit.new("struct", "with_data", "TAG_STRUCT", :init_mode_init,
diff --git a/libc3/tag_type.c b/libc3/tag_type.c
index 9d58c77..2dad942 100644
--- a/libc3/tag_type.c
+++ b/libc3/tag_type.c
@@ -99,7 +99,7 @@ bool tag_type_to_ffi_type (e_tag_type type, ffi_type **dest)
return false;
}
-const s8 * tag_type_to_string (e_tag_type tag_type)
+const char * tag_type_to_string (e_tag_type tag_type)
{
switch (tag_type) {
case TAG_VOID: return "Void";
diff --git a/libc3/tag_type.h b/libc3/tag_type.h
index dd5e0f2..016ed10 100644
--- a/libc3/tag_type.h
+++ b/libc3/tag_type.h
@@ -21,6 +21,6 @@
#include "types.h"
-const s8 * tag_type_to_string (e_tag_type type);
+const char * tag_type_to_string (e_tag_type type);
#endif /* LIBC3_TAG_TYPE */
diff --git a/libc3/tuple.c b/libc3/tuple.c
index 9e53ed8..e18d611 100644
--- a/libc3/tuple.c
+++ b/libc3/tuple.c
@@ -56,7 +56,7 @@ s_tuple * tuple_init (s_tuple *tuple, uw count)
return tuple;
}
-s_tuple * tuple_init_1 (s_tuple *tuple, const s8 *p)
+s_tuple * tuple_init_1 (s_tuple *tuple, const char *p)
{
s_buf buf;
uw len;
@@ -64,7 +64,7 @@ s_tuple * tuple_init_1 (s_tuple *tuple, const s8 *p)
assert(tuple);
assert(p);
len = strlen(p);
- buf_init(&buf, false, len, (s8 *) p);
+ buf_init(&buf, false, len, (char *) p);
buf.wpos = len;
r = buf_parse_tuple(&buf, tuple);
if (r < 0 || (uw) r != len) {
@@ -151,7 +151,7 @@ s_tuple * tuple_new (uw count)
return tuple;
}
-s_tuple * tuple_new_1 (const s8 *p)
+s_tuple * tuple_new_1 (const char *p)
{
s_tuple *tuple;
tuple = malloc(sizeof(s_tuple));
diff --git a/libc3/tuple.h b/libc3/tuple.h
index e359608..1415ae8 100644
--- a/libc3/tuple.h
+++ b/libc3/tuple.h
@@ -24,7 +24,7 @@
/* Stack allocation compatible functions */
s_tuple * tuple_init (s_tuple *tuple, uw count);
-s_tuple * tuple_init_1 (s_tuple *tuple, const s8 *p);
+s_tuple * tuple_init_1 (s_tuple *tuple, const char *p);
s_tuple * tuple_init_2 (s_tuple *tuple, const s_tag *a, const s_tag *b);
s_tuple * tuple_init_cast (s_tuple *tuple, const s_tag *tag);
s_tuple * tuple_init_copy (s_tuple *tuple, const s_tuple *src);
@@ -32,13 +32,13 @@ void tuple_clean (s_tuple *tuple);
/* Constructors, call tuple_delete after use */
s_tuple * tuple_new (uw count);
-s_tuple * tuple_new_1 (const s8 *p);
+s_tuple * tuple_new_1 (const char *p);
/* Destructor */
void tuple_delete (s_tuple *tuple);
/* Modifiers */
-s_tuple * tuple_1 (s_tuple *tuple, const s8 *p);
+s_tuple * tuple_1 (s_tuple *tuple, const char *p);
/* Observers */
s_list * tuple_to_list (const s_tuple *tuple, s_list **list);
diff --git a/libc3/type.c b/libc3/type.c
index cc2388e..4508566 100644
--- a/libc3/type.c
+++ b/libc3/type.c
@@ -20,14 +20,14 @@
const s_sym * type_pointer (const s_sym *type)
{
uw len;
- s8 *mem;
+ char *mem;
s_str str;
const s_sym *tmp;
assert(type);
len = type->str.size + 2;
if (! (mem = malloc(len)))
errx(1, "type_pointer: out of memory");
- memcpy(mem, type->str.ptr.ps8, type->str.size);
+ memcpy(mem, type->str.ptr.pchar, type->str.size);
memcpy(mem + type->str.size, "*", 2);
str_init(&str, mem, len, mem);
tmp = str_to_sym(&str);
diff --git a/libc3/types.h b/libc3/types.h
index 2d7372b..a632cea 100644
--- a/libc3/types.h
+++ b/libc3/types.h
@@ -39,16 +39,16 @@
#endif
/* Basic integer types. */
-typedef char s8;
+typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
-typedef long sw;
typedef int64_t s64;
+typedef long sw;
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
-typedef unsigned long uw;
typedef uint64_t u64;
+typedef unsigned long uw;
#ifdef SW_MAX
#undef SW_MAX
@@ -173,7 +173,7 @@ typedef union tag_data u_tag_data;
typedef union tag_type u_tag_type;
/* typedefs */
-typedef s32 character;
+typedef u32 character;
typedef s_tag **p_facts_spec;
typedef s_tag *t_facts_spec[];
typedef SHA1_CTX t_hash;
@@ -237,14 +237,16 @@ struct map {
union ptr_ {
const void *p;
- const s8 *ps8;
- const u8 *pu8;
+ const char *pchar;
+ const s8 *ps8;
+ const u8 *pu8;
};
union ptr_w {
void *p;
- s8 *ps8;
- u8 *pu8;
+ char *pchar;
+ s8 *ps8;
+ u8 *pu8;
};
struct quote {
@@ -466,7 +468,7 @@ struct sequence {
u64 frame;
f64 t;
s_time t0;
- const s8 *title;
+ const char *title;
void *window;
f_sequence load;
f_sequence render;
@@ -555,7 +557,7 @@ struct facts_cursor {
/* 9 */
struct env {
sw argc;
- s8 **argv;
+ char **argv;
s_str argv0_dir;
s_list *backtrace;
const s_sym *current_module;
diff --git a/libc3/window/cairo/cairo_font.c b/libc3/window/cairo/cairo_font.c
index 4eca894..c10a76e 100644
--- a/libc3/window/cairo/cairo_font.c
+++ b/libc3/window/cairo/cairo_font.c
@@ -52,7 +52,7 @@ static FT_Library * cairo_font_ft (void)
return g_cairo_font_ft;
}
-s_cairo_font * cairo_font_init (s_cairo_font *font, const s8 *path)
+s_cairo_font * cairo_font_init (s_cairo_font *font, const char *path)
{
FT_Library *ft;
assert(font);
@@ -66,9 +66,9 @@ s_cairo_font * cairo_font_init (s_cairo_font *font, const s8 *path)
str_clean(&font->path);
return NULL;
}
- if (FT_New_Face(*ft, font->real_path.ptr.ps8, 0, &font->ft_face)) {
+ if (FT_New_Face(*ft, font->real_path.ptr.pchar, 0, &font->ft_face)) {
err_write_1("cairo_font_init: error loading font: ");
- err_puts(font->real_path.ptr.ps8);
+ err_puts(font->real_path.ptr.pchar);
str_clean(&font->path);
str_clean(&font->real_path);
return NULL;
diff --git a/libc3/window/cairo/cairo_font.h b/libc3/window/cairo/cairo_font.h
index 5d55775..fff82a4 100644
--- a/libc3/window/cairo/cairo_font.h
+++ b/libc3/window/cairo/cairo_font.h
@@ -17,10 +17,10 @@
#include <err.h>
#include "types.h"
-/* Stack-allocation compatible functions, call cairo_font_clean after
- use. */
+/* Stack-allocation compatible functions, call cairo_font_clean
+ after use. */
void cairo_font_clean (s_cairo_font *font);
-s_cairo_font * cairo_font_init (s_cairo_font *font, const s8 *path);
+s_cairo_font * cairo_font_init (s_cairo_font *font, const char *path);
/* Observers */
void cairo_set_font (cairo_t *cr, const s_cairo_font *font);
diff --git a/libc3/window/cairo/cairo_sprite.c b/libc3/window/cairo/cairo_sprite.c
index 581bb7f..7033a0d 100644
--- a/libc3/window/cairo/cairo_sprite.c
+++ b/libc3/window/cairo/cairo_sprite.c
@@ -41,7 +41,7 @@ void cairo_sprite_clean (s_cairo_sprite *sprite)
}
s_cairo_sprite * cairo_sprite_init (s_cairo_sprite *sprite,
- const s8 *path,
+ const char *path,
uw dim_x, uw dim_y,
uw frame_count)
{
@@ -69,10 +69,11 @@ s_cairo_sprite * cairo_sprite_init (s_cairo_sprite *sprite,
str_clean(&sprite->path);
return NULL;
}
- src = cairo_image_surface_create_from_png(sprite->real_path.ptr.ps8);
+ src =
+ cairo_image_surface_create_from_png(sprite->real_path.ptr.pchar);
if (! src) {
err_write_1("cairo_sprite_init: error loading image: ");
- err_puts(sprite->real_path.ptr.ps8);
+ err_puts(sprite->real_path.ptr.pchar);
str_clean(&sprite->path);
str_clean(&sprite->real_path);
return NULL;
diff --git a/libc3/window/cairo/cairo_sprite.h b/libc3/window/cairo/cairo_sprite.h
index 53822f7..02312cb 100644
--- a/libc3/window/cairo/cairo_sprite.h
+++ b/libc3/window/cairo/cairo_sprite.h
@@ -19,7 +19,7 @@
/* stack allocation compatible functions */
void cairo_sprite_clean (s_cairo_sprite *sprite);
s_cairo_sprite * cairo_sprite_init (s_cairo_sprite *sprite,
- const s8 *path,
+ const char *path,
uw dim_x, uw dim_y,
uw frame_count);
diff --git a/libc3/window/cairo/demo/flies.c b/libc3/window/cairo/demo/flies.c
index c9a74c7..247327f 100644
--- a/libc3/window/cairo/demo/flies.c
+++ b/libc3/window/cairo/demo/flies.c
@@ -128,7 +128,7 @@ bool flies_load (s_sequence *seq)
bool flies_render (s_sequence *seq)
{
- s8 a[BOARD_SIZE];
+ char a[BOARD_SIZE];
uw address[2];
s_array *board;
f64 board_w;
@@ -192,18 +192,18 @@ bool flies_render (s_sequence *seq)
buf_write_1(&buf, "In ");
buf_inspect_uw(&buf, fly_in);
buf_write_u8(&buf, 0);
- cairo_text_extents(cr, buf.ptr.ps8, &te);
+ cairo_text_extents(cr, buf.ptr.pchar, &te);
y = board_h + board_item_h + te.height + te.y_bearing;
x = board_x;
cairo_move_to(cr, x, y);
- cairo_show_text(cr, buf.ptr.ps8);
+ cairo_show_text(cr, buf.ptr.pchar);
buf_init(&buf, false, sizeof(a), a);
buf_write_1(&buf, "Out ");
buf_inspect_uw(&buf, fly_out);
buf_write_u8(&buf, 0);
x = board_x + board_item_w * (BOARD_SIZE / 2 + 1);
cairo_move_to(cr, x, y);
- cairo_show_text(cr, buf.ptr.ps8);
+ cairo_show_text(cr, buf.ptr.pchar);
address[1] = 0;
while (address[1] < BOARD_SIZE) {
y = board_item_h * address[1];
diff --git a/libc3/window/cairo/demo/window_cairo_demo.c b/libc3/window/cairo/demo/window_cairo_demo.c
index 6c85ac0..8611cbe 100644
--- a/libc3/window/cairo/demo/window_cairo_demo.c
+++ b/libc3/window/cairo/demo/window_cairo_demo.c
@@ -115,7 +115,7 @@ bool window_cairo_demo_load (s_window_cairo *window)
}
static void render_text (cairo_t *cr, double x, double y,
- const s8 *p)
+ const char *p)
{
cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
cairo_move_to(cr, x - 1.0, y - 1.0);
@@ -171,7 +171,7 @@ bool window_cairo_demo_render (s_window_cairo *window)
2);
cairo_fill(cr);
/* fps */
- s8 fps[32];
+ char fps[32];
snprintf(fps, sizeof(fps), "%f", (f64) seq->frame / seq->t);
cairo_text_extents(cr, fps, &te);
render_text(cr, 20.0, 20.0 + te.height, fps);
diff --git a/libc3/window/cairo/types.h b/libc3/window/cairo/types.h
index 7893512..e419fbe 100644
--- a/libc3/window/cairo/types.h
+++ b/libc3/window/cairo/types.h
@@ -108,7 +108,7 @@ struct window_cairo {
uw sequence_count;
uw sequence_pos;
s_tag tag; // TODO: move sequence to tag
- const s8 *title;
+ const char *title;
f_window_cairo_unload unload;
};
diff --git a/libc3/window/cairo/window_cairo.c b/libc3/window/cairo/window_cairo.c
index da4abbd..05c9fd9 100644
--- a/libc3/window/cairo/window_cairo.c
+++ b/libc3/window/cairo/window_cairo.c
@@ -32,7 +32,7 @@ void window_cairo_clean (s_window_cairo *window)
s_window_cairo * window_cairo_init (s_window_cairo *window,
sw x, sw y, uw w, uw h,
- const s8 *title,
+ const char *title,
uw sequence_count)
{
s_window_cairo tmp = {0};
diff --git a/libc3/window/cairo/window_cairo.h b/libc3/window/cairo/window_cairo.h
index 678b198..ddc79d2 100644
--- a/libc3/window/cairo/window_cairo.h
+++ b/libc3/window/cairo/window_cairo.h
@@ -25,7 +25,7 @@ void c3_window_cairo_init (void);
void window_cairo_clean (s_window_cairo *window);
s_window_cairo * window_cairo_init (s_window_cairo *window,
sw x, sw y, uw w, uw h,
- const s8 *title,
+ const char *title,
uw sequence_count);
bool window_cairo_run (s_window_cairo *window);
diff --git a/libc3/window/sdl2/demo/flies.c b/libc3/window/sdl2/demo/flies.c
index 9151dcd..74dfcda 100644
--- a/libc3/window/sdl2/demo/flies.c
+++ b/libc3/window/sdl2/demo/flies.c
@@ -135,7 +135,7 @@ bool flies_load (s_sequence *seq)
bool flies_render (s_sequence *seq)
{
- s8 a[BOARD_SIZE];
+ char a[BOARD_SIZE];
uw address[2];
s_array *board;
f64 board_w;
diff --git a/libc3/window/sdl2/demo/window_sdl2_demo.c b/libc3/window/sdl2/demo/window_sdl2_demo.c
index 65cd7d8..388086f 100644
--- a/libc3/window/sdl2/demo/window_sdl2_demo.c
+++ b/libc3/window/sdl2/demo/window_sdl2_demo.c
@@ -310,7 +310,7 @@ bool window_sdl2_demo_render (s_window_sdl2 *window)
12 + 2);
*/
/* fps */
- s8 fps[32];
+ char fps[32];
snprintf(fps, sizeof(fps), "%.1f", (f64) seq->frame / seq->t);
gl_text_update_1(&g_text_fps, fps);
glEnable(GL_BLEND);
diff --git a/libc3/window/sdl2/gl_camera.c b/libc3/window/sdl2/gl_camera.c
index 9b1cb27..0ba3aaa 100644
--- a/libc3/window/sdl2/gl_camera.c
+++ b/libc3/window/sdl2/gl_camera.c
@@ -15,7 +15,7 @@
#include "gl_camera.h"
#include "gl_matrix_4f.h"
-static const s8 * g_gl_camera_vertex_shader_src = "#version 330 core\n"
+static const char * g_gl_camera_vertex_shader_src = "#version 330 core\n"
"layout (location = 0) in vec3 aPos;\n"
"uniform mat4 matrix;\n"
"\n"
@@ -56,7 +56,7 @@ s_gl_camera * gl_camera_init (s_gl_camera *camera, uw w, uw h)
glCompileShader(vertex_shader);
glGetShaderiv(vertex_shader, GL_COMPILE_STATUS, &success);
if (! success) {
- s8 info_log[512];
+ char info_log[512];
glGetShaderInfoLog(vertex_shader, sizeof(info_log), NULL, info_log);
err_write_1("gl_camera_init: shader compilation failed: ");
err_puts(info_log);
diff --git a/libc3/window/sdl2/gl_deprecated.c b/libc3/window/sdl2/gl_deprecated.c
index dd77e39..e62df28 100644
--- a/libc3/window/sdl2/gl_deprecated.c
+++ b/libc3/window/sdl2/gl_deprecated.c
@@ -13,7 +13,7 @@
#define GL_SILENCE_DEPRECATION 1
#include "gl_deprecated.h"
-const s8 * gl_error_string (GLenum error)
+const char * gl_error_string (GLenum error)
{
- return (const s8 *) gluErrorString(error);
+ return (const char *) gluErrorString(error);
}
diff --git a/libc3/window/sdl2/gl_deprecated.h b/libc3/window/sdl2/gl_deprecated.h
index 0699465..a0ab259 100644
--- a/libc3/window/sdl2/gl_deprecated.h
+++ b/libc3/window/sdl2/gl_deprecated.h
@@ -15,6 +15,6 @@
#include "types.h"
-const s8 * gl_error_string (GLenum error);
+const char * gl_error_string (GLenum error);
#endif /* GL_DEPRECATED_H */
diff --git a/libc3/window/sdl2/gl_font.c b/libc3/window/sdl2/gl_font.c
index 1a1f9b9..41ac14d 100644
--- a/libc3/window/sdl2/gl_font.c
+++ b/libc3/window/sdl2/gl_font.c
@@ -23,7 +23,7 @@ void gl_font_clean (s_gl_font *font)
str_clean(&font->real_path);
}
-s_gl_font * gl_font_init (s_gl_font *font, const s8 *path)
+s_gl_font * gl_font_init (s_gl_font *font, const char *path)
{
assert(font);
assert(path);
@@ -35,9 +35,9 @@ s_gl_font * gl_font_init (s_gl_font *font, const s8 *path)
return NULL;
}
assert(glGetError() == GL_NO_ERROR);
- if (FT_New_Face(g_ft, font->real_path.ptr.ps8, 0, &font->ft_face)) {
+ if (FT_New_Face(g_ft, font->real_path.ptr.pchar, 0, &font->ft_face)) {
err_write_1("gl_font_init: error loading font: ");
- err_puts(font->real_path.ptr.ps8);
+ err_puts(font->real_path.ptr.pchar);
str_clean(&font->path);
str_clean(&font->real_path);
return NULL;
diff --git a/libc3/window/sdl2/gl_font.h b/libc3/window/sdl2/gl_font.h
index 1ab8a96..6841544 100644
--- a/libc3/window/sdl2/gl_font.h
+++ b/libc3/window/sdl2/gl_font.h
@@ -20,7 +20,7 @@ extern FT_Library g_ft;
/* Stack-allocation compatible functions, call gl_font_clean
after use. */
void gl_font_clean (s_gl_font *font);
-s_gl_font * gl_font_init (s_gl_font *font, const s8 *path);
+s_gl_font * gl_font_init (s_gl_font *font, const char *path);
/* Operators. */
void gl_font_set_size (s_gl_font *font, f64 size, f64 pixels_per_point);
diff --git a/libc3/window/sdl2/gl_ortho.c b/libc3/window/sdl2/gl_ortho.c
index 0b5fe38..1b943ca 100644
--- a/libc3/window/sdl2/gl_ortho.c
+++ b/libc3/window/sdl2/gl_ortho.c
@@ -15,7 +15,7 @@
#include "gl_ortho.h"
#include "gl_matrix_4f.h"
-static const s8 * g_gl_ortho_vertex_shader_src = "#version 330 core\n"
+static const char * g_gl_ortho_vertex_shader_src = "#version 330 core\n"
"layout (location = 0) in vec3 aPos;\n"
"layout (location = 1) in vec3 aNorm;\n"
"layout (location = 2) in vec2 aTexCoord;\n"
@@ -69,7 +69,7 @@ s_gl_ortho * gl_ortho_init (s_gl_ortho *ortho)
glCompileShader(vertex_shader);
glGetShaderiv(vertex_shader, GL_COMPILE_STATUS, &success);
if (! success) {
- s8 info_log[512];
+ char info_log[512];
glGetShaderInfoLog(vertex_shader, sizeof(info_log), NULL, info_log);
err_write_1("gl_ortho_init: shader compilation failed: ");
err_puts(info_log);
@@ -120,7 +120,7 @@ void gl_ortho_render (s_gl_ortho *ortho)
&ortho->projection_matrix.xx);
if ((error = glGetError()) != GL_NO_ERROR) {
err_write_1("gl_ortho_render: glUniformMatrix4fv: ");
- err_puts((const s8 *) glewGetErrorString(error));
+ err_puts((const char *) glewGetErrorString(error));
assert(! "gl_ortho_render: glUniformMatrix4fv");
}
assert(glGetError() == GL_NO_ERROR);
diff --git a/libc3/window/sdl2/gl_sprite.c b/libc3/window/sdl2/gl_sprite.c
index ad1d46e..2b68e92 100644
--- a/libc3/window/sdl2/gl_sprite.c
+++ b/libc3/window/sdl2/gl_sprite.c
@@ -96,7 +96,7 @@ static bool png_info_to_gl_info (s32 png_color_type,
return true;
}
-s_gl_sprite * gl_sprite_init (s_gl_sprite *sprite, const s8 *path,
+s_gl_sprite * gl_sprite_init (s_gl_sprite *sprite, const char *path,
uw dim_x, uw dim_y, uw frame_count)
{
u8 *data;
@@ -139,10 +139,10 @@ s_gl_sprite * gl_sprite_init (s_gl_sprite *sprite, const s8 *path,
str_clean(&tmp.path);
return NULL;
}
- fp = fopen(tmp.real_path.ptr.ps8, "rb");
+ fp = fopen(tmp.real_path.ptr.pchar, "rb");
if (! fp) {
err_write_1("sdl2_sprite_init: fopen: ");
- err_puts(tmp.real_path.ptr.ps8);
+ err_puts(tmp.real_path.ptr.pchar);
str_clean(&tmp.path);
str_clean(&tmp.real_path);
return NULL;
@@ -150,7 +150,7 @@ s_gl_sprite * gl_sprite_init (s_gl_sprite *sprite, const s8 *path,
if (fread(png_header, 1, sizeof(png_header), fp) !=
sizeof(png_header)) {
err_write_1("sdl2_sprite_init: fread: ");
- err_puts(tmp.real_path.ptr.ps8);
+ err_puts(tmp.real_path.ptr.pchar);
fclose(fp);
str_clean(&tmp.path);
str_clean(&tmp.real_path);
@@ -158,7 +158,7 @@ s_gl_sprite * gl_sprite_init (s_gl_sprite *sprite, const s8 *path,
}
if (png_sig_cmp(png_header, 0, sizeof(png_header))) {
err_write_1("sdl2_sprite_init: not a png: ");
- err_puts(tmp.real_path.ptr.ps8);
+ err_puts(tmp.real_path.ptr.pchar);
fclose(fp);
str_clean(&tmp.path);
str_clean(&tmp.real_path);
@@ -168,7 +168,7 @@ s_gl_sprite * gl_sprite_init (s_gl_sprite *sprite, const s8 *path,
NULL);
if (! png_read) {
err_write_1("sdl2_sprite_init: png_create_read_struct: ");
- err_puts(tmp.real_path.ptr.ps8);
+ err_puts(tmp.real_path.ptr.pchar);
fclose(fp);
str_clean(&tmp.path);
str_clean(&tmp.real_path);
@@ -177,7 +177,7 @@ s_gl_sprite * gl_sprite_init (s_gl_sprite *sprite, const s8 *path,
png_info = png_create_info_struct(png_read);
if (! png_info) {
err_write_1("sdl2_sprite_init: png_create_info_struct: ");
- err_puts(tmp.real_path.ptr.ps8);
+ err_puts(tmp.real_path.ptr.pchar);
png_destroy_read_struct(&png_read, NULL, NULL);
fclose(fp);
str_clean(&tmp.path);
@@ -210,15 +210,15 @@ s_gl_sprite * gl_sprite_init (s_gl_sprite *sprite, const s8 *path,
err_write_1("sdl2_sprite_init: unknown PNG color type ");
err_inspect_s32(&png_color_type);
err_write_1(": ");
- err_puts(tmp.real_path.ptr.ps8);
+ err_puts(tmp.real_path.ptr.pchar);
}
if (! gl_internal_format) {
err_write_1("sdl2_sprite_init: unknown OpenGL internal format: ");
- err_puts(tmp.real_path.ptr.ps8);
+ err_puts(tmp.real_path.ptr.pchar);
}
if (! gl_type) {
err_write_1("sdl2_sprite_init: unknown OpenGL type: ");
- err_puts(tmp.real_path.ptr.ps8);
+ err_puts(tmp.real_path.ptr.pchar);
}
png_destroy_read_struct(&png_read, &png_info, NULL);
fclose(fp);
@@ -273,7 +273,7 @@ s_gl_sprite * gl_sprite_init (s_gl_sprite *sprite, const s8 *path,
data = malloc(tmp.h * sprite_stride);
if (! data) {
err_write_1("sdl2_sprite_init: failed to allocate memory: ");
- err_puts(tmp.real_path.ptr.ps8);
+ err_puts(tmp.real_path.ptr.pchar);
free(tmp.texture);
str_clean(&tmp.path);
str_clean(&tmp.real_path);
diff --git a/libc3/window/sdl2/gl_sprite.h b/libc3/window/sdl2/gl_sprite.h
index 22d7283..07ff58e 100644
--- a/libc3/window/sdl2/gl_sprite.h
+++ b/libc3/window/sdl2/gl_sprite.h
@@ -18,7 +18,7 @@
/* Stack-allocation compatible functions, call gl_sprite_clean
after use. */
void gl_sprite_clean (s_gl_sprite *sprite);
-s_gl_sprite * gl_sprite_init (s_gl_sprite *sprite, const s8 *path,
+s_gl_sprite * gl_sprite_init (s_gl_sprite *sprite, const char *path,
uw dim_x, uw dim_y, uw frame_count);
/* Observers. */
diff --git a/libc3/window/sdl2/gl_text.c b/libc3/window/sdl2/gl_text.c
index af261d9..c0e0820 100644
--- a/libc3/window/sdl2/gl_text.c
+++ b/libc3/window/sdl2/gl_text.c
@@ -46,7 +46,7 @@ s_gl_text * gl_text_init (s_gl_text *text, const s_gl_font *font)
}
s_gl_text * gl_text_init_1 (s_gl_text *text, const s_gl_font *font,
- const s8 *p)
+ const char *p)
{
s_str str;
str_init_1(&str, NULL, p);
@@ -194,7 +194,7 @@ bool gl_text_set_text (s_gl_text *text, const s_str *str)
return false;
}
-bool gl_text_set_text_1 (s_gl_text *text, const s8 *p)
+bool gl_text_set_text_1 (s_gl_text *text, const char *p)
{
s_str str;
assert(text);
@@ -241,7 +241,7 @@ bool gl_text_update (s_gl_text *text)
return true;
}
-bool gl_text_update_1 (s_gl_text *text, const s8 *p)
+bool gl_text_update_1 (s_gl_text *text, const char *p)
{
if (gl_text_set_text_1(text, p)) {
gl_text_update(text);
diff --git a/libc3/window/sdl2/gl_text.h b/libc3/window/sdl2/gl_text.h
index 835bfcd..af0f262 100644
--- a/libc3/window/sdl2/gl_text.h
+++ b/libc3/window/sdl2/gl_text.h
@@ -20,7 +20,7 @@
void gl_text_clean (s_gl_text *text);
s_gl_text * gl_text_init (s_gl_text *text, const s_gl_font *font);
s_gl_text * gl_text_init_1 (s_gl_text *text, const s_gl_font *font,
- const s8 *p);
+ const char *p);
s_gl_text * gl_text_init_str (s_gl_text *text, const s_gl_font *font,
const s_str *str);
@@ -28,10 +28,10 @@ s_gl_text * gl_text_init_str (s_gl_text *text, const s_gl_font *font,
bool gl_text_render_to_texture (s_gl_text *text);
bool gl_text_set_font (s_gl_text *text, const s_gl_font *font);
bool gl_text_set_text (s_gl_text *text, const s_str *str);
-bool gl_text_set_text_1 (s_gl_text *text, const s8 *p);
+bool gl_text_set_text_1 (s_gl_text *text, const char *p);
bool gl_text_set_text_buf (s_gl_text *text, s_buf *buf);
bool gl_text_update (s_gl_text *text);
-bool gl_text_update_1 (s_gl_text *text, const s8 *p);
+bool gl_text_update_1 (s_gl_text *text, const char *p);
bool gl_text_update_buf (s_gl_text *text, s_buf *buf);
/* Observers. */
diff --git a/libc3/window/sdl2/types.h b/libc3/window/sdl2/types.h
index ec3d2f1..2b10053 100644
--- a/libc3/window/sdl2/types.h
+++ b/libc3/window/sdl2/types.h
@@ -237,7 +237,7 @@ struct window_sdl2 {
uw sequence_count;
uw sequence_pos;
s_tag tag; // TODO: move sequence to tag
- const s8 *title;
+ const char *title;
f_window_sdl2_unload unload;
uw gl_w;
uw gl_h;
diff --git a/libc3/window/sdl2/window_sdl2.c b/libc3/window/sdl2/window_sdl2.c
index c46bc66..11eb091 100644
--- a/libc3/window/sdl2/window_sdl2.c
+++ b/libc3/window/sdl2/window_sdl2.c
@@ -110,7 +110,7 @@ void window_sdl2_default_unload_cb (s_window_sdl2 *window)
s_window_sdl2 * window_sdl2_init (s_window_sdl2 *window,
sw x, sw y, uw w, uw h,
- const s8 *title,
+ const char *title,
uw sequence_count)
{
s_window_sdl2 tmp = {0};
@@ -189,7 +189,7 @@ bool window_sdl2_run (s_window_sdl2 *window)
warnx("window_sdl2_run: failed to initialize GLEW");
goto ko;
}
- const s8 * version = (const s8 *) glGetString(GL_VERSION);
+ const char * version = (const char *) glGetString(GL_VERSION);
if (version) {
err_write_1("window_sdl2_run: OpenGL Version: ");
err_puts(version);
diff --git a/libc3/window/sdl2/window_sdl2.h b/libc3/window/sdl2/window_sdl2.h
index e1041f3..444292b 100644
--- a/libc3/window/sdl2/window_sdl2.h
+++ b/libc3/window/sdl2/window_sdl2.h
@@ -20,7 +20,7 @@
void window_sdl2_clean (s_window_sdl2 *window);
s_window_sdl2 * window_sdl2_init (s_window_sdl2 *window,
sw x, sw y, uw w, uw h,
- const s8 *title,
+ const char *title,
uw sequence_count);
/* Operators. */
diff --git a/libc3/window/types.h b/libc3/window/types.h
index 91c4ab3..0faaac7 100644
--- a/libc3/window/types.h
+++ b/libc3/window/types.h
@@ -65,7 +65,7 @@ struct window {
uw sequence_count;
uw sequence_pos;
s_tag tag; // TODO: move sequence to tag
- const s8 *title;
+ const char *title;
f_window_unload unload;
};
diff --git a/libc3/window/window.c b/libc3/window/window.c
index 95b41cc..fc8f23d 100644
--- a/libc3/window/window.c
+++ b/libc3/window/window.c
@@ -58,7 +58,7 @@ void window_clean (s_window *window)
s_window * window_init (s_window *window,
sw x, sw y, uw w, uw h,
- const s8 *title,
+ const char *title,
uw sequence_count)
{
s_window tmp = {0};
diff --git a/libc3/window/window.h b/libc3/window/window.h
index cdfeef8..e7d72af 100644
--- a/libc3/window/window.h
+++ b/libc3/window/window.h
@@ -21,7 +21,7 @@
void window_clean (s_window *window);
s_window * window_init (s_window *window,
sw x, sw y, uw w, uw h,
- const s8 *title,
+ const char *title,
uw sequence_count);
/* Operators. */
diff --git a/libffi b/libffi
index cb01c20..7822a32 160000
--- a/libffi
+++ b/libffi
@@ -1 +1 @@
-Subproject commit cb01c2084a514e10a6fd5fa5e1d79bb4aa7d71dd
+Subproject commit 7822a324dc2f437fe0efab615e96c40cc4624bd9
diff --git a/linenoise b/linenoise
index a7327ba..c5b9dac 160000
--- a/linenoise
+++ b/linenoise
@@ -1 +1 @@
-Subproject commit a7327ba54af89b97ce7e5585b3bdbe39a31bbc48
+Subproject commit c5b9daca881649610c2b0dff5f355ec5539b5300
diff --git a/test/bool_test.c b/test/bool_test.c
index a08343b..2cea0aa 100644
--- a/test/bool_test.c
+++ b/test/bool_test.c
@@ -25,6 +25,7 @@
TEST_EQ(str.size, strlen(expected)); \
TEST_STRNCMP(str.ptr.p, (expected), str.size); \
str_clean(&str); \
+ test_context(NULL); \
} while (0)
void bool_test (void);
diff --git a/test/buf_file_test.c b/test/buf_file_test.c
index 8d31f65..e3c708a 100644
--- a/test/buf_file_test.c
+++ b/test/buf_file_test.c
@@ -30,7 +30,7 @@ void buf_file_test (void)
TEST_CASE(buf_file_open_r_close)
{
- s8 b[16];
+ char b[16];
s_buf buf;
FILE *fp;
fp = fopen("/dev/null", "r");
@@ -46,7 +46,7 @@ TEST_CASE_END(buf_file_open_r_close)
TEST_CASE(buf_file_open_r_refill)
{
u8 b = 0x80;
- s8 bu[16];
+ char bu[16];
s_buf buf;
FILE *fp;
sw i = 64;
diff --git a/test/buf_inspect_test.c b/test/buf_inspect_test.c
index 6ef97db..3b33f8c 100644
--- a/test/buf_inspect_test.c
+++ b/test/buf_inspect_test.c
@@ -17,7 +17,7 @@
#define BUF_INSPECT_TEST_ARRAY(test, expected) \
do { \
- s8 b[1024]; \
+ char b[1024]; \
s_buf buf_result; \
s_array tmp; \
test_context("buf_inspect_array(" # test ") -> " # expected); \
@@ -26,14 +26,14 @@
TEST_EQ(buf_inspect_array_size(&tmp), strlen(expected)); \
TEST_EQ(buf_inspect_array(&buf_result, &tmp), strlen(expected)); \
TEST_EQ(buf_result.wpos, strlen(expected)); \
- TEST_STRNCMP(buf_result.ptr.ps8, (expected), buf_result.wpos); \
+ TEST_STRNCMP(buf_result.ptr.pchar, (expected), buf_result.wpos); \
array_clean(&tmp); \
buf_clean(&buf_result); \
} while (0)
#define BUF_INSPECT_TEST_BOOL(test, expected) \
do { \
- s8 b[16]; \
+ char b[16]; \
s_buf buf; \
bool tmp; \
test_context("buf_inspect_bool(" # test ") -> " # expected); \
@@ -47,7 +47,7 @@
#define BUF_INSPECT_TEST_CHARACTER(test, expected) \
do { \
- s8 b[32]; \
+ char b[32]; \
s_buf buf; \
character tmp; \
test_context("buf_inspect_character(" # test ") -> " # expected); \
@@ -56,20 +56,20 @@
TEST_EQ(buf_inspect_character_size(&tmp), strlen(expected)); \
TEST_EQ(buf_inspect_character(&buf, &tmp), strlen(expected)); \
TEST_EQ(buf.wpos, strlen(expected)); \
- TEST_STRNCMP(buf.ptr.ps8, (expected), buf.wpos); \
+ TEST_STRNCMP(buf.ptr.pchar, (expected), buf.wpos); \
test_context(NULL); \
} while (0)
#define BUF_INSPECT_TEST_F32(test, expected) \
do { \
- s8 b[32]; \
+ char b[32]; \
s_buf buf; \
f32 tmp; \
test_context("buf_inspect_f32(" # test ") -> " # expected); \
tmp = (test); \
buf_init(&buf, false, sizeof(b), b); \
buf_inspect_f32(&buf, &tmp); \
- TEST_STRNCMP(buf.ptr.ps8, (expected), buf.wpos); \
+ TEST_STRNCMP(buf.ptr.pchar, (expected), buf.wpos); \
TEST_EQ(buf.wpos, strlen(expected)); \
TEST_EQ(buf_inspect_f32_size(&tmp), strlen(expected)); \
buf_init(&buf, false, sizeof(b), b); \
@@ -79,25 +79,25 @@
#define BUF_INSPECT_TEST_F64(test, expected) \
do { \
- s8 b[64]; \
+ char b[64]; \
s_buf buf; \
f64 tmp; \
test_context("buf_inspect_f64(" # test ") -> " # expected); \
tmp = (test); \
buf_init(&buf, false, sizeof(b), b); \
buf_inspect_f64(&buf, &tmp); \
- TEST_STRNCMP(buf.ptr.ps8, (expected), buf.wpos); \
+ TEST_STRNCMP(buf.ptr.pchar, (expected), buf.wpos); \
TEST_EQ(buf.wpos, strlen(expected)); \
TEST_EQ(buf_inspect_f64_size(&tmp), strlen(expected)); \
buf_init(&buf, false, sizeof(b), b); \
TEST_EQ(buf_inspect_f64(&buf, &tmp), strlen(expected)); \
- TEST_STRNCMP(buf.ptr.ps8, (expected), buf.wpos); \
+ TEST_STRNCMP(buf.ptr.pchar, (expected), buf.wpos); \
test_context(NULL); \
} while (0)
#define BUF_INSPECT_TEST_INTEGER(test, expected) \
do { \
- s8 b[1024]; \
+ char b[1024]; \
s_buf buf_result; \
s_integer i; \
test_context("buf_inspect_integer(" # test ") -> " # expected); \
@@ -107,7 +107,7 @@
TEST_EQ(buf_inspect_integer(&buf_result, &i), strlen(test)); \
integer_clean(&i); \
TEST_EQ(buf_result.wpos, strlen(test)); \
- TEST_STRNCMP(buf_result.ptr.ps8, (expected), buf_result.wpos); \
+ TEST_STRNCMP(buf_result.ptr.pchar, (expected), buf_result.wpos); \
buf_clean(&buf_result); \
} while (0)
@@ -131,7 +131,7 @@
#define BUF_INSPECT_TEST_STR(test, expected) \
do { \
- s8 b[1024]; \
+ char b[1024]; \
s_buf buf; \
s_str str; \
test_context("buf_inspect_str(" # test ") -> " # expected); \
@@ -145,7 +145,7 @@
#define BUF_INSPECT_TEST_STR_CHARACTER(test, expected) \
do { \
- s8 b[32]; \
+ char b[32]; \
s_buf buf; \
character tmp; \
test_context("buf_inspect_str_character(" # test ") -> " \
@@ -154,7 +154,7 @@
tmp = (test); \
TEST_EQ(buf_inspect_str_character_size(&tmp), strlen(expected)); \
TEST_EQ(buf_inspect_str_character(&buf, &tmp), strlen(expected)); \
- TEST_STRNCMP(buf.ptr.ps8, (expected), buf.wpos); \
+ TEST_STRNCMP(buf.ptr.pchar, (expected), buf.wpos); \
test_context(NULL); \
} while (0)
@@ -169,7 +169,7 @@
TEST_EQ(buf_inspect_tag(&buf, test_tag), strlen(expected)); \
TEST_EQ(buf.wpos, strlen(expected)); \
if (g_test_last_ok) \
- TEST_STRNCMP(buf.ptr.ps8, (expected), buf.wpos); \
+ TEST_STRNCMP(buf.ptr.pchar, (expected), buf.wpos); \
buf_clean(&buf); \
} while (0)
@@ -256,12 +256,12 @@ TEST_CASE(buf_inspect_f64)
{
BUF_INSPECT_TEST_F64(0.0, "0.0");
BUF_INSPECT_TEST_F64(0.1, "1.0e-1");
- BUF_INSPECT_TEST_F64(0.123456789, "1.234567889999999e-1");
- BUF_INSPECT_TEST_F64(1.23456789, "1.234567889999999");
+ BUF_INSPECT_TEST_F64(0.123456789, "1.23456788999999e-1");
+ BUF_INSPECT_TEST_F64(1.23456789, "1.23456788999999");
BUF_INSPECT_TEST_F64(123456789.0, "1.23456789e+8");
BUF_INSPECT_TEST_F64(-0.1, "-1.0e-1");
- BUF_INSPECT_TEST_F64(-0.123456789, "-1.234567889999999e-1");
- BUF_INSPECT_TEST_F64(-1.23456789, "-1.234567889999999");
+ BUF_INSPECT_TEST_F64(-0.123456789, "-1.23456788999999e-1");
+ BUF_INSPECT_TEST_F64(-1.23456789, "-1.23456788999999");
BUF_INSPECT_TEST_F64(-123456789.0, "-1.23456789e+8");
}
TEST_CASE_END(buf_inspect_f64)
@@ -304,7 +304,7 @@ TEST_CASE(buf_inspect_str)
BUF_INSPECT_TEST_STR("\v", "\"\\v\"");
BUF_INSPECT_TEST_STR("\"", "\"\\\"\"");
{
- s8 b[1024];
+ char b[1024];
s_buf buf;
s_str str;
test_context("buf_inspect_str(\"\\0\") -> \"\\0\"");
diff --git a/test/buf_parse_test.c b/test/buf_parse_test.c
index 6441896..9546e10 100644
--- a/test/buf_parse_test.c
+++ b/test/buf_parse_test.c
@@ -77,7 +77,7 @@
#define BUF_PARSE_TEST_CHARACTER(test, expected) \
do { \
s_buf buf; \
- character dest = -1; \
+ character dest = 0; \
test_context("buf_parse_character(" # test ") -> " # expected); \
buf_init_1(&buf, false, (test)); \
TEST_EQ(buf_parse_character(&buf, &dest), strlen(test)); \
@@ -89,12 +89,12 @@
#define BUF_PARSE_TEST_CHARACTER_EOF(test) \
do { \
s_buf buf; \
- character dest = -1; \
+ character dest = 0; \
test_context("buf_parse_character(" # test ") -> -1"); \
buf_init_1(&buf, false, (test)); \
TEST_EQ(buf_parse_character(&buf, &dest), -1); \
TEST_EQ(buf.rpos, 0); \
- TEST_EQ(dest, -1); \
+ TEST_EQ(dest, 0); \
test_context(NULL); \
} while (0)
@@ -302,12 +302,12 @@
#define BUF_PARSE_TEST_NOT_CHARACTER(test) \
do { \
s_buf buf; \
- character dest = -1; \
+ character dest = 0; \
test_context("buf_parse_character(" # test ") -> 0"); \
buf_init_1(&buf, false, (test)); \
TEST_EQ(buf_parse_character(&buf, &dest), 0); \
TEST_EQ(buf.rpos, 0); \
- TEST_EQ(dest, -1); \
+ TEST_EQ(dest, 0); \
test_context(NULL); \
} while (0)
diff --git a/test/buf_test.c b/test/buf_test.c
index 954e8d7..b4a480b 100644
--- a/test/buf_test.c
+++ b/test/buf_test.c
@@ -36,7 +36,7 @@
test_context(# test " -> " # expected); \
TEST_EQ(test, len); \
TEST_EQ(buf.wpos, pos + len); \
- TEST_STRNCMP(buf.ptr.ps8 + pos, expected, len); \
+ TEST_STRNCMP(buf.ptr.pchar + pos, expected, len); \
} while (0)
#define BUF_TEST_IGNORE(test, count, expected) \
@@ -206,7 +206,7 @@ void buf_test (void)
TEST_CASE(buf_f)
{
- s8 b[32];
+ char b[32];
s_buf buf;
buf_init(&buf, false, sizeof(b), b); \
BUF_TEST_F(buf_f(&buf, "09AZaz"), "09AZaz");
@@ -360,7 +360,7 @@ TEST_CASE_END(buf_peek_s8)
TEST_CASE(buf_peek_s16)
{
- s8 b[8];
+ char b[8];
s_buf buf;
s16 val;
buf_init(&buf, false, sizeof(b), b);
@@ -437,7 +437,7 @@ TEST_CASE_END(buf_read_character_utf8)
TEST_CASE(buf_read_f32)
{
- s8 b[16];
+ char b[16];
s_buf buf;
f32 f;
buf_init(&buf, false, sizeof(b), b);
@@ -467,7 +467,7 @@ TEST_CASE_END(buf_read_character_utf8)
TEST_CASE(buf_read_f64)
{
- s8 b[32];
+ char b[32];
s_buf buf;
f64 f;
buf_init(&buf, false, sizeof(b), b);
@@ -540,7 +540,7 @@ TEST_CASE_END(buf_read_s8)
TEST_CASE(buf_read_s16)
{
- s8 b[8];
+ char b[8];
s_buf buf;
s16 val;
buf_init(&buf, false, sizeof(b), b);
@@ -565,7 +565,7 @@ TEST_CASE_END(buf_read_s16)
TEST_CASE(buf_read_s32)
{
- s8 b[16];
+ char b[16];
s_buf buf;
s32 val;
buf_init(&buf, false, sizeof(b), b);
@@ -595,7 +595,7 @@ TEST_CASE_END(buf_read_s16)
TEST_CASE(buf_read_s64)
{
- s8 b[32];
+ char b[32];
s_buf buf;
s64 val;
buf_init(&buf, false, sizeof(b), b);
@@ -668,7 +668,7 @@ TEST_CASE_END(buf_read_u8)
TEST_CASE(buf_read_u16)
{
- s8 b[8];
+ char b[8];
s_buf buf;
u16 val;
buf_init(&buf, false, sizeof(b), b);
@@ -698,7 +698,7 @@ TEST_CASE_END(buf_read_u8)
TEST_CASE(buf_read_u32)
{
- s8 b[16];
+ char b[16];
s_buf buf;
u32 val;
buf_init(&buf, false, sizeof(b), b);
@@ -728,7 +728,7 @@ TEST_CASE_END(buf_read_u8)
TEST_CASE(buf_read_u64)
{
- s8 b[32];
+ char b[32];
s_buf buf;
u64 val;
buf_init(&buf, false, sizeof(b), b);
@@ -758,7 +758,7 @@ TEST_CASE_END(buf_read_u8)
TEST_CASE(buf_write_s8)
{
- s8 b[4];
+ char b[4];
s_buf buf;
buf_init(&buf, false, sizeof(b), b);
TEST_EQ(buf_write_s8(&buf, 0x00), 1);
@@ -782,7 +782,7 @@ TEST_CASE_END(buf_write_s8)
TEST_CASE(buf_write_s16)
{
- s8 b[8];
+ char b[8];
s_buf buf;
buf_init(&buf, false, sizeof(b), b);
TEST_EQ(buf_write_s16(&buf, 0x0000), 2);
@@ -806,7 +806,7 @@ TEST_CASE_END(buf_write_s16)
TEST_CASE(buf_write_s32)
{
- s8 b[16];
+ char b[16];
s_buf buf;
buf_init(&buf, false, sizeof(b), b);
TEST_EQ(buf_write_s32(&buf, 0x00000000), 4);
@@ -830,7 +830,7 @@ TEST_CASE_END(buf_write_s32)
TEST_CASE(buf_write_s64)
{
- s8 b[32];
+ char b[32];
s_buf buf;
buf_init(&buf, false, sizeof(b), b);
TEST_EQ(buf_write_s64(&buf, 0x0000000000000000), 8);
@@ -854,7 +854,7 @@ TEST_CASE_END(buf_write_s64)
TEST_CASE(buf_write_u8)
{
- s8 b[4];
+ char b[4];
s_buf buf;
buf_init(&buf, false, sizeof(b), b);
TEST_EQ(buf_write_u8(&buf, 0x00), 1);
@@ -878,7 +878,7 @@ TEST_CASE_END(buf_write_u8)
TEST_CASE(buf_write_u16)
{
- s8 b[8];
+ char b[8];
s_buf buf;
buf_init(&buf, false, sizeof(b), b);
TEST_EQ(buf_write_u16(&buf, 0x0000), 2);
@@ -902,7 +902,7 @@ TEST_CASE_END(buf_write_u16)
TEST_CASE(buf_write_u32)
{
- s8 b[16];
+ char b[16];
s_buf buf;
buf_init(&buf, false, sizeof(b), b);
TEST_EQ(buf_write_u32(&buf, 0x00000000), 4);
@@ -926,7 +926,7 @@ TEST_CASE_END(buf_write_u32)
TEST_CASE(buf_write_u64)
{
- s8 b[32];
+ char b[32];
s_buf buf;
buf_init(&buf, false, sizeof(b), b);
TEST_EQ(buf_write_u64(&buf, 0x0000000000000000), 8);
@@ -955,9 +955,9 @@ TEST_CASE_END(buf_write_str)
TEST_CASE(buf_xfer)
{
- s8 d[16];
+ char d[16];
s_buf dest;
- s8 s[16] = "0123456789ABCDEF";
+ char s[16] = "0123456789ABCDEF";
s_buf src;
buf_init(&src, false, sizeof(s), s);
src.wpos = 16;
diff --git a/test/character_test.c b/test/character_test.c
index 987d39b..55f6025 100644
--- a/test/character_test.c
+++ b/test/character_test.c
@@ -240,9 +240,8 @@ TEST_CASE_END(character_utf8)
TEST_CASE(character_utf8_size)
{
- character c;
- for (c = -10; c < 0; c++)
- TEST_EQ(character_utf8_size(c), -1);
+ TEST_EQ(character_utf8_size((character) -1), -1);
+ TEST_EQ(character_utf8_size(0), 1);
TEST_EQ(character_utf8_size('_'), 1);
TEST_EQ(character_utf8_size('0'), 1);
TEST_EQ(character_utf8_size('1'), 1);
diff --git a/test/fact_test.c b/test/fact_test.c
index a45b3ba..e93d524 100644
--- a/test/fact_test.c
+++ b/test/fact_test.c
@@ -50,15 +50,15 @@ void fact_test_clean_3 (s_fact *fact)
tag_delete((s_tag *) fact->object);
}
-s_fact * fact_test_init_1 (s_fact *fact, const s8 *tag)
+s_fact * fact_test_init_1 (s_fact *fact, const char *tag)
{
assert(fact);
fact->subject = fact->predicate = fact->object = tag_new_1(tag);
return fact;
}
-s_fact * fact_test_init_3 (s_fact *fact, const s8 *subject,
- const s8 *predicate, const s8 *object)
+s_fact * fact_test_init_3 (s_fact *fact, const char *subject,
+ const char *predicate, const char *object)
{
assert(fact);
fact->subject = tag_new_1(subject);
diff --git a/test/fact_test.h b/test/fact_test.h
index 1001316..7281a1a 100644
--- a/test/fact_test.h
+++ b/test/fact_test.h
@@ -35,8 +35,8 @@
"Expected %s got %s.%s\n", \
TEST_COLOR_KO, \
__FILE__, __LINE__, __func__, \
- str_test.ptr.ps8, str_expected.ptr.ps8, \
- str_expected.ptr.ps8, str_test.ptr.ps8, \
+ str_test.ptr.pchar, str_expected.ptr.pchar, \
+ str_expected.ptr.pchar, str_test.ptr.pchar, \
TEST_COLOR_RESET); \
str_clean(&str_expected); \
str_clean(&str_test); \
@@ -46,8 +46,8 @@
void fact_test_clean_1 (s_fact *fact);
void fact_test_clean_3 (s_fact *fact);
-s_fact * fact_test_init_1 (s_fact *fact, const s8 *tag);
-s_fact * fact_test_init_3 (s_fact *fact, const s8 *subject,
- const s8 *predicate, const s8 *object);
+s_fact * fact_test_init_1 (s_fact *fact, const char *tag);
+s_fact * fact_test_init_3 (s_fact *fact, const char *subject,
+ const char *predicate, const char *object);
#endif /* FACT_TEST_H */
diff --git a/test/facts_cursor_test.c b/test/facts_cursor_test.c
index 5c6c12f..29e82b4 100644
--- a/test/facts_cursor_test.c
+++ b/test/facts_cursor_test.c
@@ -30,7 +30,7 @@ TEST_CASE(facts_cursor_init)
{
s_facts_cursor cursor;
uw i = 0;
- s8 *p[24] = {
+ char *p[24] = {
"0",
"1",
"10",
@@ -113,7 +113,7 @@ TEST_CASE(facts_cursor_next)
{
s_facts_cursor cursor;
uw i = 0;
- s8 *p[24] = {
+ char *p[24] = {
"-0x10000000000000000",
"-0x100000000",
"-0x10000",
diff --git a/test/facts_test.c b/test/facts_test.c
index 2feb119..de7c8cc 100644
--- a/test/facts_test.c
+++ b/test/facts_test.c
@@ -51,7 +51,7 @@ void facts_test (void)
TEST_CASE(facts_add)
{
uw i = 0;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -105,7 +105,7 @@ TEST_CASE_END(facts_add)
TEST_CASE(facts_dump_file)
{
uw i = 0;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -156,7 +156,7 @@ TEST_CASE_END(facts_dump_file)
TEST_CASE(facts_find)
{
uw i = 0;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -226,7 +226,7 @@ TEST_CASE_END(facts_init_clean)
TEST_CASE(facts_load)
{
uw i = 0;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -272,7 +272,7 @@ TEST_CASE_END(facts_load)
TEST_CASE(facts_log_add)
{
uw i = 0;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -323,7 +323,7 @@ TEST_CASE_END(facts_log_add)
TEST_CASE(facts_log_remove)
{
uw i = 0;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -392,7 +392,7 @@ TEST_CASE_END(facts_new_delete)
TEST_CASE(facts_open_file)
{
uw i = 0;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -418,7 +418,7 @@ TEST_CASE(facts_open_file)
"-0x10000000000000000",
NULL
};
- s8 *q[24] = {
+ char *q[24] = {
"\"b\"",
":b",
"B",
@@ -547,7 +547,7 @@ TEST_CASE_END(facts_open_file)
TEST_CASE(facts_remove)
{
uw i = 0;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -597,7 +597,7 @@ TEST_CASE_END(facts_remove)
TEST_CASE(facts_save)
{
uw i = 0;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
diff --git a/test/facts_with_test.c b/test/facts_with_test.c
index 978b4e7..d85cae7 100644
--- a/test/facts_with_test.c
+++ b/test/facts_with_test.c
@@ -35,7 +35,7 @@ TEST_CASE(facts_with_)
s_facts facts;
sw i = 0;
s_tag object;
- const s8 *p[9] = { "A", "B", "C", "D", "E", "F", "G", "H", NULL };
+ const char *p[9] = { "A", "B", "C", "D", "E", "F", "G", "H", NULL };
s_tag predicate;
s_tag subject;
s_tag tag[8];
@@ -186,7 +186,7 @@ TEST_CASE(facts_with_tags)
s_facts facts;
sw i = 0;
s_tag object;
- const s8 *p[9] = { "A", "B", "C", "D", "E", "F", "G", "H", NULL };
+ const char *p[9] = { "A", "B", "C", "D", "E", "F", "G", "H", NULL };
s_tag predicate;
s_tag subject;
s_tag tag[8];
diff --git a/test/set__fact_test.c b/test/set__fact_test.c
index 813746f..c75d396 100644
--- a/test/set__fact_test.c
+++ b/test/set__fact_test.c
@@ -92,7 +92,7 @@ TEST_CASE(set__fact_add)
{
s_fact fact[24];
sw i;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -140,7 +140,7 @@ TEST_CASE_END(set__fact_add)
TEST_CASE(set__fact_cursor)
{
sw i;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -225,7 +225,7 @@ TEST_CASE_END(set__fact_init_clean)
TEST_CASE(set__fact_remove)
{
sw i;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -272,7 +272,7 @@ TEST_CASE_END(set__fact_remove)
TEST_CASE(set__fact_resize)
{
sw i;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
diff --git a/test/set__tag_test.c b/test/set__tag_test.c
index 2619411..7d4463c 100644
--- a/test/set__tag_test.c
+++ b/test/set__tag_test.c
@@ -113,7 +113,7 @@ void set__tag_test (void)
TEST_CASE(set__tag_add)
{
uw i = 0;
- const s8 *p[] = {
+ const char *p[] = {
"false",
"true",
"'a'",
diff --git a/test/skiplist__fact_test.c b/test/skiplist__fact_test.c
index ba5cb9a..7b2c420 100644
--- a/test/skiplist__fact_test.c
+++ b/test/skiplist__fact_test.c
@@ -68,7 +68,7 @@ TEST_CASE(skiplist__fact_find)
const u8 *h;
const u8 height[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 0};
sw i;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -126,7 +126,7 @@ TEST_CASE(skiplist__fact_insert)
const u8 height[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 0};
const double *s;
const double spacing[] = {2.0, 2.4, 3.0, 0.0};
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
@@ -198,7 +198,7 @@ TEST_CASE(skiplist__fact_remove)
const u8 *h;
const u8 height[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 0};
sw i;
- s8 *p[24] = {
+ char *p[24] = {
"\"a\"",
":a",
"A",
diff --git a/test/str_test.c b/test/str_test.c
index a8e7f04..f114bdd 100644
--- a/test/str_test.c
+++ b/test/str_test.c
@@ -209,7 +209,7 @@ TEST_CASE_END(str_init_copy_1)
TEST_CASE(str_inspect)
{
s_str str;
- s8 zero[16] = {0};
+ char zero[16] = {0};
STR_TEST_INSPECT_1("", "\"\"");
STR_TEST_INSPECT_1(" ", "\" \"");
STR_TEST_INSPECT_1("\n", "\"\\n\"");
@@ -351,7 +351,7 @@ TEST_CASE_END(str_new_f)
TEST_CASE(str_to_hex)
{
- s8 zero[32] = {0};
+ char zero[32] = {0};
STR_TEST_TO_HEX(str_new_1(NULL, ""), "");
STR_TEST_TO_HEX(str_new(NULL, 1, zero), "00");
STR_TEST_TO_HEX(str_new(NULL, 2, zero), "0000");