aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdlib')
-rw-r--r--src/stdlib/bigint.c4
-rw-r--r--src/stdlib/bigint.h24
-rw-r--r--src/stdlib/bools.h24
-rw-r--r--src/stdlib/bytes.c8
-rw-r--r--src/stdlib/bytes.h8
-rw-r--r--src/stdlib/intX.c.h8
-rw-r--r--src/stdlib/intX.h28
-rw-r--r--src/stdlib/lists.c12
-rw-r--r--src/stdlib/numX.c.h20
-rw-r--r--src/stdlib/numX.h24
-rw-r--r--src/stdlib/paths.c16
-rw-r--r--src/stdlib/tables.c29
-rw-r--r--src/stdlib/tables.h2
-rw-r--r--src/stdlib/text.c12
-rw-r--r--src/stdlib/text.h4
15 files changed, 165 insertions, 58 deletions
diff --git a/src/stdlib/bigint.c b/src/stdlib/bigint.c
index 4a5b2565..d47dfee8 100644
--- a/src/stdlib/bigint.c
+++ b/src/stdlib/bigint.c
@@ -431,7 +431,9 @@ PUREFUNC Closure_t Int$onward(Int_t first, Int_t step) {
}
public
-Int_t Int$from_str(const char *str) { return Int$parse(Text$from_str(str), NONE_INT, NULL); }
+Int_t Int$from_str(const char *str) {
+ return Int$parse(Text$from_str(str), NONE_INT, NULL);
+}
public
OptionalInt_t Int$parse(Text_t text, OptionalInt_t base, Text_t *remainder) {
diff --git a/src/stdlib/bigint.h b/src/stdlib/bigint.h
index d5bad85f..d7eae403 100644
--- a/src/stdlib/bigint.h
+++ b/src/stdlib/bigint.h
@@ -170,10 +170,22 @@ MACROLIKE PUREFUNC bool Int$is_negative(Int_t x) {
// Int constructors:
PUREFUNC Int_t Int$from_num64(double n, bool truncate);
-MACROLIKE PUREFUNC Int_t Int$from_num32(float n, bool truncate) { return Int$from_num64((double)n, truncate); }
+MACROLIKE PUREFUNC Int_t Int$from_num32(float n, bool truncate) {
+ return Int$from_num64((double)n, truncate);
+}
PUREFUNC Int_t Int$from_int64(int64_t i);
-MACROLIKE CONSTFUNC Int_t Int$from_int32(Int32_t i) { return Int$from_int64((Int32_t)i); }
-MACROLIKE CONSTFUNC Int_t Int$from_int16(Int16_t i) { return I_small(i); }
-MACROLIKE CONSTFUNC Int_t Int$from_int8(Int8_t i) { return I_small(i); }
-MACROLIKE CONSTFUNC Int_t Int$from_byte(Byte_t b) { return I_small(b); }
-MACROLIKE CONSTFUNC Int_t Int$from_bool(Bool_t b) { return I_small(b); }
+MACROLIKE CONSTFUNC Int_t Int$from_int32(Int32_t i) {
+ return Int$from_int64((Int32_t)i);
+}
+MACROLIKE CONSTFUNC Int_t Int$from_int16(Int16_t i) {
+ return I_small(i);
+}
+MACROLIKE CONSTFUNC Int_t Int$from_int8(Int8_t i) {
+ return I_small(i);
+}
+MACROLIKE CONSTFUNC Int_t Int$from_byte(Byte_t b) {
+ return I_small(b);
+}
+MACROLIKE CONSTFUNC Int_t Int$from_bool(Bool_t b) {
+ return I_small(b);
+}
diff --git a/src/stdlib/bools.h b/src/stdlib/bools.h
index 52bd45a8..17ff3681 100644
--- a/src/stdlib/bools.h
+++ b/src/stdlib/bools.h
@@ -13,11 +13,23 @@
PUREFUNC Text_t Bool$as_text(const void *b, bool colorize, const TypeInfo_t *type);
OptionalBool_t Bool$parse(Text_t text, Text_t *remainder);
-MACROLIKE Bool_t Bool$from_int(Int_t i) { return (i.small != 0); }
-MACROLIKE Bool_t Bool$from_int64(Int64_t i) { return (i != 0); }
-MACROLIKE Bool_t Bool$from_int32(Int32_t i) { return (i != 0); }
-MACROLIKE Bool_t Bool$from_int16(Int16_t i) { return (i != 0); }
-MACROLIKE Bool_t Bool$from_int8(Int8_t i) { return (i != 0); }
-MACROLIKE Bool_t Bool$from_byte(uint8_t b) { return (b != 0); }
+MACROLIKE Bool_t Bool$from_int(Int_t i) {
+ return (i.small != 0);
+}
+MACROLIKE Bool_t Bool$from_int64(Int64_t i) {
+ return (i != 0);
+}
+MACROLIKE Bool_t Bool$from_int32(Int32_t i) {
+ return (i != 0);
+}
+MACROLIKE Bool_t Bool$from_int16(Int16_t i) {
+ return (i != 0);
+}
+MACROLIKE Bool_t Bool$from_int8(Int8_t i) {
+ return (i != 0);
+}
+MACROLIKE Bool_t Bool$from_byte(uint8_t b) {
+ return (b != 0);
+}
extern const TypeInfo_t Bool$info;
diff --git a/src/stdlib/bytes.c b/src/stdlib/bytes.c
index 23a7ced8..2b2a6507 100644
--- a/src/stdlib/bytes.c
+++ b/src/stdlib/bytes.c
@@ -31,7 +31,9 @@ PUREFUNC public Text_t Byte$as_text(const void *b, bool colorize, const TypeInfo
}
public
-CONSTFUNC bool Byte$is_between(const Byte_t x, const Byte_t low, const Byte_t high) { return low <= x && x <= high; }
+CONSTFUNC bool Byte$is_between(const Byte_t x, const Byte_t low, const Byte_t high) {
+ return low <= x && x <= high;
+}
public
OptionalByte_t Byte$parse(Text_t text, OptionalInt_t base, Text_t *remainder) {
@@ -68,7 +70,9 @@ public
bool Byte$get_bit(Byte_t x, Int_t bit_index) {
if (Int$compare_value(bit_index, I(1)) < 0) fail("Invalid bit index (expected 1 or higher): ", bit_index);
if (Int$compare_value(bit_index, I(8)) > 0)
- fail("Bit index is too large! There are only 8 bits in a byte, but index is: ", bit_index);
+ fail("Bit index is too large! There are only 8 bits in a byte, but index "
+ "is: ",
+ bit_index);
return ((x & (Byte_t)(1L << (Int64$from_int(bit_index, true) - 1L))) != 0);
}
diff --git a/src/stdlib/bytes.h b/src/stdlib/bytes.h
index 6581f300..b0a1c213 100644
--- a/src/stdlib/bytes.h
+++ b/src/stdlib/bytes.h
@@ -21,8 +21,12 @@ Byte_t Byte$from_int16(int16_t i, bool truncate);
OptionalByte_t Byte$parse(Text_t text, OptionalInt_t base, Text_t *remainder);
Closure_t Byte$to(Byte_t first, Byte_t last, OptionalInt8_t step);
-MACROLIKE Byte_t Byte$from_int8(int8_t i) { return (Byte_t)i; }
-MACROLIKE Byte_t Byte$from_bool(bool b) { return (Byte_t)b; }
+MACROLIKE Byte_t Byte$from_int8(int8_t i) {
+ return (Byte_t)i;
+}
+MACROLIKE Byte_t Byte$from_bool(bool b) {
+ return (Byte_t)b;
+}
CONSTFUNC bool Byte$is_between(const Byte_t x, const Byte_t low, const Byte_t high);
extern const Byte_t Byte$min;
diff --git a/src/stdlib/intX.c.h b/src/stdlib/intX.c.h
index cba25bae..19f838d7 100644
--- a/src/stdlib/intX.c.h
+++ b/src/stdlib/intX.c.h
@@ -104,7 +104,9 @@ Text_t NAMESPACED(as_text)(const void *i, bool colorize, const TypeInfo_t *info)
return colorize ? Text$concat(Text("\033[35m"), text, Text("\033[m")) : text;
}
public
-Text_t NAMESPACED(value_as_text)(INT_T i) { return _int64_to_text((int64_t)i); }
+Text_t NAMESPACED(value_as_text)(INT_T i) {
+ return _int64_to_text((int64_t)i);
+}
public
PUREFUNC int32_t NAMESPACED(compare)(const void *x, const void *y, const TypeInfo_t *info) {
(void)info;
@@ -120,7 +122,9 @@ CONSTFUNC bool NAMESPACED(is_between)(const INT_T x, const INT_T low, const INT_
return low <= x && x <= high;
}
public
-CONSTFUNC INT_T NAMESPACED(clamped)(INT_T x, INT_T min, INT_T max) { return x < min ? min : (x > max ? max : x); }
+CONSTFUNC INT_T NAMESPACED(clamped)(INT_T x, INT_T min, INT_T max) {
+ return x < min ? min : (x > max ? max : x);
+}
public
Text_t NAMESPACED(hex)(INT_T i, Int_t digits_int, bool uppercase, bool prefix) {
Int_t as_int = Int$from_int64((int64_t)i);
diff --git a/src/stdlib/intX.h b/src/stdlib/intX.h
index e9ecbfa1..3b8a5679 100644
--- a/src/stdlib/intX.h
+++ b/src/stdlib/intX.h
@@ -49,8 +49,12 @@ Closure_t NAMESPACED(onward)(INTX_T first, INTX_T step);
PUREFUNC OPT_T NAMESPACED(parse)(Text_t text, OptionalInt_t base, Text_t *remainder);
CONSTFUNC bool NAMESPACED(is_between)(const INTX_T x, const INTX_T low, const INTX_T high);
CONSTFUNC INTX_T NAMESPACED(clamped)(INTX_T x, INTX_T min, INTX_T max);
-MACROLIKE CONSTFUNC INTX_T NAMESPACED(from_byte)(Byte_t b) { return (INTX_T)b; }
-MACROLIKE CONSTFUNC INTX_T NAMESPACED(from_bool)(Bool_t b) { return (INTX_T)b; }
+MACROLIKE CONSTFUNC INTX_T NAMESPACED(from_byte)(Byte_t b) {
+ return (INTX_T)b;
+}
+MACROLIKE CONSTFUNC INTX_T NAMESPACED(from_bool)(Bool_t b) {
+ return (INTX_T)b;
+}
CONSTFUNC INTX_T NAMESPACED(gcd)(INTX_T x, INTX_T y);
extern const INTX_T NAMESPACED(min), NAMESPACED(max);
extern const TypeInfo_t NAMESPACED(info);
@@ -75,15 +79,25 @@ MACROLIKE INTX_T NAMESPACED(modulo)(INTX_T D, INTX_T d) {
return r;
}
-MACROLIKE INTX_T NAMESPACED(modulo1)(INTX_T D, INTX_T d) { return NAMESPACED(modulo)(D - 1, d) + 1; }
+MACROLIKE INTX_T NAMESPACED(modulo1)(INTX_T D, INTX_T d) {
+ return NAMESPACED(modulo)(D - 1, d) + 1;
+}
-MACROLIKE PUREFUNC INTX_T NAMESPACED(wrapping_plus)(INTX_T x, INTX_T y) { return (INTX_T)((UINTX_T)x + (UINTX_T)y); }
+MACROLIKE PUREFUNC INTX_T NAMESPACED(wrapping_plus)(INTX_T x, INTX_T y) {
+ return (INTX_T)((UINTX_T)x + (UINTX_T)y);
+}
-MACROLIKE PUREFUNC INTX_T NAMESPACED(wrapping_minus)(INTX_T x, INTX_T y) { return (INTX_T)((UINTX_T)x + (UINTX_T)y); }
+MACROLIKE PUREFUNC INTX_T NAMESPACED(wrapping_minus)(INTX_T x, INTX_T y) {
+ return (INTX_T)((UINTX_T)x + (UINTX_T)y);
+}
-MACROLIKE PUREFUNC INTX_T NAMESPACED(unsigned_left_shifted)(INTX_T x, INTX_T y) { return (INTX_T)((UINTX_T)x << y); }
+MACROLIKE PUREFUNC INTX_T NAMESPACED(unsigned_left_shifted)(INTX_T x, INTX_T y) {
+ return (INTX_T)((UINTX_T)x << y);
+}
-MACROLIKE PUREFUNC INTX_T NAMESPACED(unsigned_right_shifted)(INTX_T x, INTX_T y) { return (INTX_T)((UINTX_T)x >> y); }
+MACROLIKE PUREFUNC INTX_T NAMESPACED(unsigned_right_shifted)(INTX_T x, INTX_T y) {
+ return (INTX_T)((UINTX_T)x >> y);
+}
void NAMESPACED(serialize)(const void *obj, FILE *out, Table_t *, const TypeInfo_t *);
void NAMESPACED(deserialize)(FILE *in, void *outval, List_t *, const TypeInfo_t *);
diff --git a/src/stdlib/lists.c b/src/stdlib/lists.c
index 3149cf82..3cc99b17 100644
--- a/src/stdlib/lists.c
+++ b/src/stdlib/lists.c
@@ -441,10 +441,14 @@ List_t List$sample(List_t list, Int_t int_n, List_t weights, OptionalClosure_t r
}
public
-List_t List$from(List_t list, Int_t first) { return List$slice(list, first, I_small(-1)); }
+List_t List$from(List_t list, Int_t first) {
+ return List$slice(list, first, I_small(-1));
+}
public
-List_t List$to(List_t list, Int_t last) { return List$slice(list, I_small(1), last); }
+List_t List$to(List_t list, Int_t last) {
+ return List$slice(list, I_small(1), last);
+}
public
List_t List$by(List_t list, Int_t int_stride, int64_t padded_item_size) {
@@ -555,7 +559,9 @@ bool List$has(List_t list, void *item, const TypeInfo_t *type) {
}
public
-void List$clear(List_t *list) { *list = list->atomic ? EMPTY_ATOMIC_LIST : EMPTY_LIST; }
+void List$clear(List_t *list) {
+ *list = list->atomic ? EMPTY_ATOMIC_LIST : EMPTY_LIST;
+}
public
int32_t List$compare(const void *vx, const void *vy, const TypeInfo_t *type) {
diff --git a/src/stdlib/numX.c.h b/src/stdlib/numX.c.h
index a8ab0de8..2d652ebe 100644
--- a/src/stdlib/numX.c.h
+++ b/src/stdlib/numX.c.h
@@ -68,7 +68,9 @@ PUREFUNC int32_t NAMESPACED(compare)(const void *x, const void *y, const TypeInf
}
#elif NUMX_C_H__BITS == 32
public
-PUREFUNC Text_t NAMESPACED(value_as_text)(NUM_T x) { return Num$value_as_text((double)x); }
+PUREFUNC Text_t NAMESPACED(value_as_text)(NUM_T x) {
+ return Num$value_as_text((double)x);
+}
public
PUREFUNC Text_t NAMESPACED(as_text)(const void *x, bool colorize, const TypeInfo_t *info) {
(void)info;
@@ -185,7 +187,9 @@ CONSTFUNC NUM_T NAMESPACED(mod1)(NUM_T num, NUM_T modulus) {
}
public
-CONSTFUNC NUM_T NAMESPACED(mix)(NUM_T amount, NUM_T x, NUM_T y) { return (SUFFIXED(1.0) - amount) * x + amount * y; }
+CONSTFUNC NUM_T NAMESPACED(mix)(NUM_T amount, NUM_T x, NUM_T y) {
+ return (SUFFIXED(1.0) - amount) * x + amount * y;
+}
public
CONSTFUNC bool NAMESPACED(is_between)(const NUM_T x, const NUM_T low, const NUM_T high) {
@@ -222,11 +226,17 @@ CONSTFUNC bool NAMESPACED(is_none)(const void *n, const TypeInfo_t *info) {
}
public
-CONSTFUNC bool NAMESPACED(isinf)(NUM_T n) { return (fpclassify(n) == FP_INFINITE); }
+CONSTFUNC bool NAMESPACED(isinf)(NUM_T n) {
+ return (fpclassify(n) == FP_INFINITE);
+}
public
-CONSTFUNC bool NAMESPACED(finite)(NUM_T n) { return (fpclassify(n) != FP_INFINITE); }
+CONSTFUNC bool NAMESPACED(finite)(NUM_T n) {
+ return (fpclassify(n) != FP_INFINITE);
+}
public
-CONSTFUNC bool NAMESPACED(isnan)(NUM_T n) { return (fpclassify(n) == FP_NAN); }
+CONSTFUNC bool NAMESPACED(isnan)(NUM_T n) {
+ return (fpclassify(n) == FP_NAN);
+}
public
const TypeInfo_t NAMESPACED(info) = {
diff --git a/src/stdlib/numX.h b/src/stdlib/numX.h
index 210c4cc7..2ff2cc36 100644
--- a/src/stdlib/numX.h
+++ b/src/stdlib/numX.h
@@ -52,17 +52,29 @@ CONSTFUNC bool NAMESPACED(is_between)(const NUM_T x, const NUM_T low, const NUM_
CONSTFUNC NUM_T NAMESPACED(clamped)(NUM_T x, NUM_T low, NUM_T high);
#if NUMX_H__BITS == 64
-MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_num32)(float n) { return (NUM_T)n; }
+MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_num32)(float n) {
+ return (NUM_T)n;
+}
#elif NUMX_H__BITS == 32
-MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_num64)(double n) { return (NUM_T)n; }
+MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_num64)(double n) {
+ return (NUM_T)n;
+}
#endif
CONSTFUNC NUM_T NAMESPACED(from_int)(Int_t i, bool truncate);
CONSTFUNC NUM_T NAMESPACED(from_int64)(Int64_t i, bool truncate);
-MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_int32)(Int32_t i) { return (NUM_T)i; }
-MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_int16)(Int16_t i) { return (NUM_T)i; }
-MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_int8)(Int8_t i) { return (NUM_T)i; }
-MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_byte)(Byte_t i) { return (NUM_T)i; }
+MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_int32)(Int32_t i) {
+ return (NUM_T)i;
+}
+MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_int16)(Int16_t i) {
+ return (NUM_T)i;
+}
+MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_int8)(Int8_t i) {
+ return (NUM_T)i;
+}
+MACROLIKE CONSTFUNC NUM_T NAMESPACED(from_byte)(Byte_t i) {
+ return (NUM_T)i;
+}
extern const TypeInfo_t NAMESPACED(info);
diff --git a/src/stdlib/paths.c b/src/stdlib/paths.c
index 678e143a..0e9a14b9 100644
--- a/src/stdlib/paths.c
+++ b/src/stdlib/paths.c
@@ -99,7 +99,9 @@ Path_t Path$from_str(const char *str) {
}
public
-Path_t Path$from_text(Text_t text) { return Path$from_str(Text$as_c_string(text)); }
+Path_t Path$from_text(Text_t text) {
+ return Path$from_str(Text$as_c_string(text));
+}
public
Path_t Path$expand_home(Path_t path) {
@@ -646,7 +648,9 @@ OptionalPath_t Path$write_unique_bytes(Path_t path, List_t bytes) {
}
public
-OptionalPath_t Path$write_unique(Path_t path, Text_t text) { return Path$write_unique_bytes(path, Text$utf8(text)); }
+OptionalPath_t Path$write_unique(Path_t path, Text_t text) {
+ return Path$write_unique_bytes(path, Text$utf8(text));
+}
public
OptionalPath_t Path$parent(Path_t path) {
@@ -710,7 +714,9 @@ Path_t Path$child(Path_t path, Text_t name) {
}
public
-Path_t Path$sibling(Path_t path, Text_t name) { return Path$child(Path$parent(path), name); }
+Path_t Path$sibling(Path_t path, Text_t name) {
+ return Path$child(Path$parent(path), name);
+}
public
OptionalPath_t Path$with_extension(Path_t path, Text_t extension, bool replace) {
@@ -866,7 +872,9 @@ int Path$print(FILE *f, Path_t path) {
}
public
-const char *Path$as_c_string(Path_t path) { return String(path); }
+const char *Path$as_c_string(Path_t path) {
+ return String(path);
+}
public
Text_t Path$as_text(const void *obj, bool color, const TypeInfo_t *type) {
diff --git a/src/stdlib/tables.c b/src/stdlib/tables.c
index 81cccceb..a89ae85f 100644
--- a/src/stdlib/tables.c
+++ b/src/stdlib/tables.c
@@ -138,7 +138,8 @@ static void Table$set_bucket(Table_t *t, const void *entry, int32_t index, const
bucket->occupied = 1;
bucket->index = index;
bucket->next_bucket = END_OF_CHAIN;
- } else { // Collided with the start of a chain, put the new entry in chain position #2
+ } else { // Collided with the start of a chain, put the new entry in chain
+ // position #2
buckets[t->bucket_info->last_free] =
(bucket_t){.occupied = 1, .index = index, .next_bucket = bucket->next_bucket};
bucket->next_bucket = t->bucket_info->last_free;
@@ -317,7 +318,9 @@ CONSTFUNC public void *Table$entry(Table_t t, int64_t n) {
}
public
-void Table$clear(Table_t *t) { *t = EMPTY_TABLE; }
+void Table$clear(Table_t *t) {
+ *t = EMPTY_TABLE;
+}
public
Table_t Table$sorted(Table_t t, const TypeInfo_t *type) {
@@ -536,7 +539,8 @@ Table_t Table$from_entries(List_t entries, const TypeInfo_t *type) {
// "set intersection" in formal terms
public
Table_t Table$intersection(Table_t a, Table_t b, const TypeInfo_t *type) {
- // Return a table such that t[k]==a[k] for all k such that a.has(k), b.has(k), and a[k]==b[k]
+ // Return a table such that t[k]==a[k] for all k such that a.has(k), b.has(k),
+ // and a[k]==b[k]
Table_t result = EMPTY_TABLE;
const size_t offset = value_offset(type);
for (Table_t *t = &a; t; t = t->fallback) {
@@ -554,8 +558,8 @@ Table_t Table$intersection(Table_t a, Table_t b, const TypeInfo_t *type) {
// "set union" in formal terms
public
Table_t Table$with(Table_t a, Table_t b, const TypeInfo_t *type) {
- // return a table such that t[k]==b[k] for all k such that b.has(k), and t[k]==a[k] for all k such that a.has(k) and
- // not b.has(k)
+ // return a table such that t[k]==b[k] for all k such that b.has(k), and
+ // t[k]==a[k] for all k such that a.has(k) and not b.has(k)
Table_t result = EMPTY_TABLE;
const size_t offset = value_offset(type);
for (Table_t *t = &a; t; t = t->fallback) {
@@ -597,7 +601,8 @@ Table_t Table$difference(Table_t a, Table_t b, const TypeInfo_t *type) {
// "without" is "set difference" in formal terms
public
Table_t Table$without(Table_t a, Table_t b, const TypeInfo_t *type) {
- // Return a table such that t[k]==a[k] for all k such that not b.has(k) or b[k] != a[k]
+ // Return a table such that t[k]==a[k] for all k such that not b.has(k) or
+ // b[k] != a[k]
Table_t result = EMPTY_TABLE;
const size_t offset = value_offset(type);
for (Table_t *t = &a; t; t = t->fallback) {
@@ -656,12 +661,18 @@ void *Table$str_reserve(Table_t *t, const char *key, const void *value) {
}
public
-void Table$str_set(Table_t *t, const char *key, const void *value) { Table$set(t, &key, &value, &CStrToVoidStarTable); }
+void Table$str_set(Table_t *t, const char *key, const void *value) {
+ Table$set(t, &key, &value, &CStrToVoidStarTable);
+}
public
-void Table$str_remove(Table_t *t, const char *key) { return Table$remove(t, &key, &CStrToVoidStarTable); }
+void Table$str_remove(Table_t *t, const char *key) {
+ return Table$remove(t, &key, &CStrToVoidStarTable);
+}
-CONSTFUNC public void *Table$str_entry(Table_t t, int64_t n) { return Table$entry(t, n); }
+CONSTFUNC public void *Table$str_entry(Table_t t, int64_t n) {
+ return Table$entry(t, n);
+}
PUREFUNC public bool Table$is_none(const void *obj, const TypeInfo_t *info) {
(void)info;
diff --git a/src/stdlib/tables.h b/src/stdlib/tables.h
index 93da465e..f3f9d2c7 100644
--- a/src/stdlib/tables.h
+++ b/src/stdlib/tables.h
@@ -4,7 +4,7 @@
#include <stdbool.h>
#include <stdint.h>
-#include <string.h>
+#include <string.h> // IWYU pragma: export
#include "datatypes.h"
#include "lists.h"
diff --git a/src/stdlib/text.c b/src/stdlib/text.c
index ce48091a..ccb2510f 100644
--- a/src/stdlib/text.c
+++ b/src/stdlib/text.c
@@ -670,10 +670,14 @@ Text_t Text$slice(Text_t text, Int_t first_int, Int_t last_int) {
}
public
-Text_t Text$from(Text_t text, Int_t first) { return Text$slice(text, first, I_small(-1)); }
+Text_t Text$from(Text_t text, Int_t first) {
+ return Text$slice(text, first, I_small(-1));
+}
public
-Text_t Text$to(Text_t text, Int_t last) { return Text$slice(text, I_small(1), last); }
+Text_t Text$to(Text_t text, Int_t last) {
+ return Text$slice(text, I_small(1), last);
+}
public
Text_t Text$reversed(Text_t text) {
@@ -815,7 +819,9 @@ OptionalText_t Text$from_strn(const char *str, size_t len) {
}
public
-OptionalText_t Text$from_str(const char *str) { return str ? Text$from_strn(str, strlen(str)) : Text(""); }
+OptionalText_t Text$from_str(const char *str) {
+ return str ? Text$from_strn(str, strlen(str)) : Text("");
+}
static void u8_buf_append(Text_t text, Byte_t **buf, int64_t *capacity, int64_t *i) {
switch (text.tag) {
diff --git a/src/stdlib/text.h b/src/stdlib/text.h
index 44b7d736..abf8bd3c 100644
--- a/src/stdlib/text.h
+++ b/src/stdlib/text.h
@@ -33,7 +33,9 @@ static inline Text_t Text_from_str_literal(const char *str) {
return (Text_t){.length = strlen(str), .tag = TEXT_ASCII, .ascii = str};
}
-static inline Text_t Text_from_text(Text_t t) { return t; }
+static inline Text_t Text_from_text(Text_t t) {
+ return t;
+}
#define convert_to_text(x) \
_Generic(x, \