From f0f6dc437ff16f0c3dc1ca005b32038d0b5aed8c Mon Sep 17 00:00:00 2001 From: q66 Date: Mon, 17 Apr 2017 17:13:14 +0200 Subject: [PATCH] fix build --- Makefile | 2 +- include/cubescript/cubescript.hh | 2 +- src/cs_gen.cc | 4 ++-- src/cs_vm.cc | 12 ++++++------ src/cubescript.cc | 12 ++++++------ src/lib_list.cc | 2 +- src/lib_str.cc | 10 +++++----- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index cb1446e8..2f395c5f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -OSTD_PATH = ../octastd +OSTD_PATH = ../libostd LIBCS_CXXFLAGS = \ -std=c++1z -Wall -Wextra -Wshadow -Wold-style-cast -Iinclude -Isrc -g \ diff --git a/include/cubescript/cubescript.hh b/include/cubescript/cubescript.hh index 8e796273..2c5a21a8 100644 --- a/include/cubescript/cubescript.hh +++ b/include/cubescript/cubescript.hh @@ -535,7 +535,7 @@ struct cs_error { try { char fbuf[512]; auto ret = ostd::format( - ostd::range_counter(ostd::char_range(fbuf, fbuf + sizeof(fbuf))), + ostd::counting_sink(ostd::char_range(fbuf, fbuf + sizeof(fbuf))), msg, std::forward(args)... ).get_written(); p_errmsg = save_msg(cs, ostd::char_range(fbuf, fbuf + ret)); diff --git a/src/cs_gen.cc b/src/cs_gen.cc index de9d8b90..743ad900 100644 --- a/src/cs_gen.cc +++ b/src/cs_gen.cc @@ -19,7 +19,7 @@ ostd::string_range cs_gen_state::get_str() { cs_string cs_gen_state::get_str_dup(bool unescape) { auto str = get_str(); - auto app = ostd::appender_range{}; + auto app = ostd::appender(); if (unescape) { util::unescape_string(app, str); } else { @@ -208,7 +208,7 @@ static inline void compileunescapestr(cs_gen_state &gs, bool macro = false) { size_t bufs = (gs.code.capacity() - gs.code.size()) * sizeof(uint32_t); char *buf = new char[bufs + 1]; auto writer = ostd::char_range(buf, buf + bufs); - size_t len = util::unescape_string(ostd::range_counter(writer), str).get_written(); + size_t len = util::unescape_string(ostd::counting_sink(writer), str).get_written(); memset(&buf[len], 0, sizeof(uint32_t) - len % sizeof(uint32_t)); gs.code.back() |= len << 8; uint32_t *ubuf = reinterpret_cast(buf); diff --git a/src/cs_vm.cc b/src/cs_vm.cc index b323e571..b0fa5d60 100644 --- a/src/cs_vm.cc +++ b/src/cs_vm.cc @@ -120,12 +120,12 @@ ostd::string_range cs_error::save_msg( ostd::char_range r(cs.p_errbuf, cs.p_errbuf + sizeof(cs.p_errbuf)); if (!gs->src_name.empty()) { sz = ostd::format( - ostd::range_counter(r), "%s:%d: %s", gs->src_name, + ostd::counting_sink(r), "%s:%d: %s", gs->src_name, gs->current_line, msg ).get_written(); } else { sz = ostd::format( - ostd::range_counter(r), "%d: %s", gs->current_line, msg + ostd::counting_sink(r), "%d: %s", gs->current_line, msg ).get_written(); } } catch (...) { @@ -435,7 +435,7 @@ static inline void callcommand( break; case 'C': { i = std::max(i + 1, numargs); - auto buf = ostd::appender_range{}; + auto buf = ostd::appender(); cscript::util::tvals_concat(buf, ostd::iter(args, args + i), " "); cs_value tv; tv.set_str(std::move(buf.get())); @@ -1383,7 +1383,7 @@ static uint32_t *runcode(cs_state &cs, uint32_t *code, cs_value &result) { int callargs = (op >> 8) & 0x1F, offset = numargs - callargs; result.force_null(); { - auto buf = ostd::appender_range{}; + auto buf = ostd::appender(); cscript::util::tvals_concat(buf, ostd::iter( &args[offset], &args[offset + callargs] ), " "); @@ -1405,7 +1405,7 @@ static uint32_t *runcode(cs_state &cs, uint32_t *code, cs_value &result) { case CsCodeConcW | CsRetFloat: case CsCodeConcW | CsRetInt: { int numconc = op >> 8; - auto buf = ostd::appender_range{}; + auto buf = ostd::appender(); cscript::util::tvals_concat( buf, ostd::iter(&args[numargs - numconc], &args[numargs]), ((op & CsCodeOpMask) == CsCodeConc) ? " " : "" @@ -1422,7 +1422,7 @@ static uint32_t *runcode(cs_state &cs, uint32_t *code, cs_value &result) { case CsCodeConcM | CsRetFloat: case CsCodeConcM | CsRetInt: { int numconc = op >> 8; - auto buf = ostd::appender_range{}; + auto buf = ostd::appender(); cscript::util::tvals_concat( buf, ostd::iter(&args[numargs - numconc], &args[numargs]) ); diff --git a/src/cubescript.cc b/src/cubescript.cc index 9373c6ee..1bd33450 100644 --- a/src/cubescript.cc +++ b/src/cubescript.cc @@ -4,13 +4,13 @@ namespace cscript { cs_string intstr(cs_int v) { - auto app = ostd::appender_range{}; + auto app = ostd::appender(); cscript::util::format_int(app, v); return std::move(app.get()); } cs_string floatstr(cs_float v) { - auto app = ostd::appender_range{}; + auto app = ostd::appender(); cscript::util::format_float(app, v); return std::move(app.get()); } @@ -223,7 +223,7 @@ void cs_ivar::set_value(cs_int val) { cs_string cs_ivar::to_printable() const { cs_int i = p_storage; - auto app = ostd::appender_range{}; + auto app = ostd::appender(); try { if (!(get_flags() & CS_IDF_HEX) || (i < 0)) { format(app, IvarFormat, get_name(), i); @@ -257,7 +257,7 @@ void cs_fvar::set_value(cs_float val) { cs_string cs_fvar::to_printable() const { cs_float f = p_storage; - auto app = ostd::appender_range{}; + auto app = ostd::appender(); try { format( app, (f == cs_int(f)) ? FvarRoundFormat : FvarFormat, get_name(), f @@ -277,7 +277,7 @@ void cs_svar::set_value(cs_string val) { cs_string cs_svar::to_printable() const { ostd::string_range s = p_storage; - auto app = ostd::appender_range{}; + auto app = ostd::appender(); try { if (ostd::find(s, '"').empty()) { format(app, SvarFormat, get_name(), s); @@ -1074,7 +1074,7 @@ void cs_init_lib_base(cs_state &gcs) { } catch (cs_error const &e) { result.set_str(cs_string{e.what()}); if (e.get_stack().get()) { - auto app = ostd::appender_range{}; + auto app = ostd::appender(); cscript::util::print_stack(app, e.get_stack()); tback.set_str(std::move(app.get())); } diff --git a/src/lib_list.cc b/src/lib_list.cc index 090ecc24..dd421b0d 100644 --- a/src/lib_list.cc +++ b/src/lib_list.cc @@ -421,7 +421,7 @@ end: }); gcs.new_command("prettylist", "ss", [](auto &cs, auto args, auto &res) { - auto buf = ostd::appender_range{}; + auto buf = ostd::appender(); ostd::string_range s = args[0].get_strr(); ostd::string_range conj = args[1].get_strr(); size_t len = util::ListParser(cs, s).count(); diff --git a/src/lib_str.cc b/src/lib_str.cc index 8e7cd225..382028e7 100644 --- a/src/lib_str.cc +++ b/src/lib_str.cc @@ -70,25 +70,25 @@ void cs_init_lib_string(cs_state &cs) { }); cs.new_command("escape", "s", [](auto &, auto args, auto &res) { - auto s = ostd::appender_range{}; + auto s = ostd::appender(); util::escape_string(s, args[0].get_strr()); res.set_str(std::move(s.get())); }); cs.new_command("unescape", "s", [](auto &, auto args, auto &res) { - auto s = ostd::appender_range{}; + auto s = ostd::appender(); util::unescape_string(s, args[0].get_strr()); res.set_str(std::move(s.get())); }); cs.new_command("concat", "V", [](auto &, auto args, auto &res) { - auto s = ostd::appender_range{}; + auto s = ostd::appender(); cscript::util::tvals_concat(s, args, " "); res.set_str(std::move(s.get())); }); cs.new_command("concatword", "V", [](auto &, auto args, auto &res) { - auto s = ostd::appender_range{}; + auto s = ostd::appender(); cscript::util::tvals_concat(s, args); res.set_str(std::move(s.get())); }); @@ -122,7 +122,7 @@ void cs_init_lib_string(cs_state &cs) { }); cs.new_command("tohex", "ii", [](auto &, auto args, auto &res) { - auto r = ostd::appender_range{}; + auto r = ostd::appender(); try { ostd::format( r, "0x%.*X", std::max(args[1].get_int(), cs_int(1)),