diff --git a/Makefile b/Makefile index 4fcd5dc..d27ef2f 100644 --- a/Makefile +++ b/Makefile @@ -24,8 +24,9 @@ OBJS=\ # -fno-rtti: libf does not use runtime type information. # -nodefaultlibs: libf must not depend on the C++ stdlib. It does depend # on libc, so we use must use -lc linker option. -CXX = clang++-4.0 -std=c++1z -fno-exceptions -fno-rtti -nodefaultlibs -fPIC \ - -O2 +#CXX = clang++-7 -std=c++1z -fno-exceptions -fno-rtti -nodefaultlibs -fPIC \ + -O2 +CXX = g++ -std=c++2a -fno-exceptions -fno-rtti -nodefaultlibs -fPIC -O2 COPTS = -fPIC CLIBS = -lc -lgc CLIB = $(OBJS) diff --git a/examples/Makefile b/examples/Makefile index 745b28b..ae2f3d6 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,5 +1,5 @@ -CC = clang++-4.0 -std=c++1z -fno-exceptions -fno-rtti -nodefaultlibs +CC = g++ -std=c++2a -fno-exceptions -fno-rtti -nodefaultlibs COPTS = -fPIC -O2 CLIBS = -lc -lgc CLIB = $(OBJS) diff --git a/fseq.cpp b/fseq.cpp index 8136c59..8d13f7c 100644 --- a/fseq.cpp +++ b/fseq.cpp @@ -827,7 +827,7 @@ extern PURE Frag _seq_peek_front(Seq s) case SINGLE: { const Single &ss = s; - return ss.t[0]; + return static_cast(ss.t[0]); } case DEEP: { @@ -837,22 +837,22 @@ extern PURE Frag _seq_peek_front(Seq s) case DIG_1: { const Dig1 &r1 = sd.l; - return r1.t[0]; + return static_cast(r1.t[0]); } case DIG_2: { const Dig2 &r2 = sd.l; - return r2.t[0]; + return static_cast(r2.t[0]); } case DIG_3: { const Dig3 &r3 = sd.l; - return r3.t[0]; + return static_cast(r3.t[0]); } case DIG_4: { - const Dig4 r4 = sd.l; - return r4.t[0]; + const Dig4 &r4 = sd.l; + return static_cast(r4.t[0]); } default: error_bad_tree(); @@ -909,7 +909,7 @@ static Seq seq_push_back(Seq s, Tree t) const Dig4 &s4 = sd.r; if (index(sd.m) == NIL && index(sd.l) == DIG_1) { - Dig1 l1 = sd.l; + Dig1 l1(sd.l); return deep(dig3(l1.t[0], s4.t[0], s4.t[1]), empty(), dig3(s4.t[2], s4.t[3], t)); } @@ -1043,7 +1043,7 @@ extern PURE Frag _seq_peek_back(Seq s) case SINGLE: { const Single &ss = s; - return ss.t[0]; + return static_cast(ss.t[0]); } case DEEP: { @@ -1053,22 +1053,22 @@ extern PURE Frag _seq_peek_back(Seq s) case DIG_1: { const Dig1 &r1 = sd.r; - return r1.t[0]; + return static_cast(r1.t[0]); } case DIG_2: { const Dig2 &r2 = sd.r; - return r2.t[1]; + return static_cast(r2.t[1]); } case DIG_3: { const Dig3 &r3 = sd.r; - return r3.t[2]; + return static_cast(r3.t[2]); } case DIG_4: { const Dig4 &r4 = sd.r; - return r4.t[3]; + return static_cast(r4.t[3]); } default: error_bad_tree(); @@ -1112,14 +1112,14 @@ static Seq seq_append(Seq s, Tree *m, size_t m_len, Seq t) s = seq_push_back(s, m[i]); if (index(t) == SINGLE) { - Single ts = (t); + Single ts(t); s = seq_push_back(s, ts.t[0]); } return s; case DEEP: { const Deep &sd = s; - Deep td = (t); + Deep td(t); m_len = seq_append_middle(sd.r, m, m_len, td.l); Seq u = seq_append(sd.m, m, m_len, td.m); return deep(sd.l, u, td.r);