From 28f2adb77ce853d675b964f427b16358343444d1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 1 Oct 2011 22:33:10 -0700 Subject: Maintaining C++ compiling (except for two issues that will need another commit). * filter.c: Include "gc.h" for prototype of protect. (struct filter_pair): Use const wchar_t *, so we can assign literals. (html_hex_continue): Ditto. * lib.c (and): Function renamed to andf, since and is a C++ operator. * lib.h (and): Declaration renamed. * match.c (match_files): Use of and updated to andf. --- ChangeLog | 17 +++++++++++++++++ filter.c | 5 +++-- lib.c | 2 +- lib.h | 2 +- match.c | 24 ++++++++++++------------ 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index d93cf59f..1aab5011 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2011-10-01 Kaz Kylheku + + Maintaining C++ compiling (except for two issues that will + need another commit). + + * filter.c: Include "gc.h" for prototype of protect. + (struct filter_pair): Use const wchar_t *, so we can assign + literals. + (html_hex_continue): Ditto. + + * lib.c (and): Function renamed to andf, since and is a C++ + operator. + + * lib.h (and): Declaration renamed. + + * match.c (match_files): Use of and updated to andf. + 2011-10-01 Kaz Kylheku HACKING: Clarified that --vg-debug is also needed to turn on on diff --git a/filter.c b/filter.c index bf20cffb..9b190ac9 100644 --- a/filter.c +++ b/filter.c @@ -33,6 +33,7 @@ #include "hash.h" #include "unwind.h" #include "filter.h" +#include "gc.h" static val make_trie(void) { @@ -127,7 +128,7 @@ val get_filter_trie(val sym) } struct filter_pair { - wchar_t *key, *value; + const wchar_t *key, *value; }; static val build_filter(struct filter_pair *pair, val compress_p) @@ -483,7 +484,7 @@ static struct filter_pair from_html_table[] = { static val html_hex_continue(val hexlist, val ch) { - static wchar_t *hexdigs = L"0123456789ABCDEF"; + static const wchar_t *hexdigs = L"0123456789ABCDEF"; if (iswxdigit(c_chr(ch))) { return func_f1(cons(ch, hexlist), html_hex_continue); diff --git a/lib.c b/lib.c index d4918993..932fecde 100644 --- a/lib.c +++ b/lib.c @@ -1515,7 +1515,7 @@ static val do_and(val fun1_list, val arg) return t; } -val and(val first_fun, ...) +val andf(val first_fun, ...) { va_list vl; list_collect_decl (out, iter); diff --git a/lib.h b/lib.h index 1ffbc2e9..329504a5 100644 --- a/lib.h +++ b/lib.h @@ -356,7 +356,7 @@ val reduce_left(val fun, val list, val init, val key); val bind2(val fun2, val arg); val bind2other(val fun2, val arg2); val chain(val first_fun, ...); -val and(val first_fun, ...); +val andf(val first_fun, ...); val vector(val alloc); val vec_get_fill(val vec); val vec_set_fill(val vec, val fill); diff --git a/match.c b/match.c index 977f8cee..af259cf2 100644 --- a/match.c +++ b/match.c @@ -1942,18 +1942,18 @@ repeat_spec_same_data: sem_error(spec_linenum, lit("deffilter: ~a is not a symbol"), first(first_spec), nao); - if (!all_satisfy(table, and(func_n1(listp), - chain(func_n1(length), - bind2(func_n2(eq), two), - nao), - chain(func_n1(first), - func_n1(stringp), - nao), - chain(func_n1(second), - func_n1(stringp), - nao), - nao), - nil)) + if (!all_satisfy(table, andf(func_n1(listp), + chain(func_n1(length), + bind2(func_n2(eq), two), + nao), + chain(func_n1(first), + func_n1(stringp), + nao), + chain(func_n1(second), + func_n1(stringp), + nao), + nao), + nil)) sem_error(spec_linenum, lit("deffilter arguments must be string pairs"), nao); -- cgit v1.2.3