summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/carc_api.md2
-rw-r--r--docs/cbox_api.md2
-rw-r--r--docs/ccommon_api.md10
-rw-r--r--docs/cdeq_api.md2
-rw-r--r--docs/clist_api.md6
-rw-r--r--docs/cmap_api.md12
-rw-r--r--docs/cpque_api.md2
-rw-r--r--docs/cqueue_api.md2
-rw-r--r--docs/crandom_api.md2
-rw-r--r--docs/cregex_api.md2
-rw-r--r--docs/cset_api.md2
-rw-r--r--docs/csmap_api.md8
-rw-r--r--docs/cspan_api.md6
-rw-r--r--docs/csset_api.md2
-rw-r--r--docs/cstack_api.md2
-rw-r--r--docs/cstr_api.md2
-rw-r--r--docs/csview_api.md6
-rw-r--r--docs/cvec_api.md4
18 files changed, 37 insertions, 37 deletions
diff --git a/docs/carc_api.md b/docs/carc_api.md
index 254f868a..8b7b67a1 100644
--- a/docs/carc_api.md
+++ b/docs/carc_api.md
@@ -97,7 +97,7 @@ bool carc_X_value_eq(const i_key* x, const i_key* y);
#define i_keyboxed Arc // Note: use i_keyboxed for carc or cbox value types
#include <stc/cstack.h>
-int main()
+int main(void)
{
Stack s1 = {0}, s2 = {0};
Map *map;
diff --git a/docs/cbox_api.md b/docs/cbox_api.md
index 83d59521..b6c76d2f 100644
--- a/docs/cbox_api.md
+++ b/docs/cbox_api.md
@@ -90,7 +90,7 @@ void int_drop(int* x) {
#define i_keyboxed IBox // NB: use i_keyboxed instead of i_key
#include <stc/cvec.h> // IVec : std::vector<std::unique_ptr<int>>
-int main()
+int main(void)
{
IVec vec = c_init(Vec, {2021, 2012, 2022, 2015});
ISet set = {0};
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md
index 6bce56af..e053f743 100644
--- a/docs/ccommon_api.md
+++ b/docs/ccommon_api.md
@@ -137,7 +137,7 @@ bool isPrime(long long i) {
return true;
}
-int main() {
+int main(void) {
// Get 10 prime numbers starting from 1000. Skip the first 15 primes,
// then select every 25th prime (including the initial).
crange R = crange_make(1001, INT64_MAX, 2); // 1001, 1003, ...
@@ -214,7 +214,7 @@ There is a [benchmark/test file here](../misc/benchmarks/various/csort_bench.c).
#include <stc/algo/sort.h>
#include <stdio.h>
-int main() {
+int main(void) {
int nums[] = {5, 3, 5, 9, 7, 4, 7, 2, 4, 9, 3, 1, 2, 6, 4};
intarray_sort_n(nums, c_arraylen(nums));
c_forrange (i, c_arraylen(arr)) printf(" %d", arr[i]);
@@ -230,7 +230,7 @@ possible and very fast. Note that `i_more` must be defined to retain specified t
#include <stc/algo/sort.h>
#include <stdio.h>
-int main() {
+int main(void) {
MyDeq deq = c_init(MyDeq, {5, 3, 5, 9, 7, 4, 7, 2, 4, 9, 3, 1, 2, 6, 4});
MyDeq_sort_n(&deq, MyDeq_size(&deq));
c_foreach (i, MyDeq, deq) printf(" %d", *i.ref);
@@ -348,7 +348,7 @@ int gcd(int a, int b) { // greatest common denominator
return a;
}
-int main()
+int main(void)
{
struct triples t = {.n=INT32_MAX};
int n = 0;
@@ -500,7 +500,7 @@ cvec_str readFile(const char* name)
return vec;
}
-int main()
+int main(void)
{
c_with (cvec_str vec = readFile(__FILE__), cvec_str_drop(&vec))
c_foreach (i, cvec_str, vec)
diff --git a/docs/cdeq_api.md b/docs/cdeq_api.md
index 292b0933..c6de6cd6 100644
--- a/docs/cdeq_api.md
+++ b/docs/cdeq_api.md
@@ -101,7 +101,7 @@ void cdeq_X_value_drop(cdeq_X_value* pval);
#include <stdio.h>
-int main() {
+int main(void) {
cdeq_i q = cdeq_i_init();
cdeq_i_push_front(&q, 10);
c_foreach (i, cdeq_i, q)
diff --git a/docs/clist_api.md b/docs/clist_api.md
index 023cca41..3d785789 100644
--- a/docs/clist_api.md
+++ b/docs/clist_api.md
@@ -122,7 +122,7 @@ Interleave *push_front()* / *push_back()* then *sort()*:
#include <stdio.h>
-int main() {
+int main(void) {
DList list = c_init(DList, {10., 20., 30., 40., 50., 60., 70., 80., 90.});
c_forrange (i, 1, 10) {
@@ -159,7 +159,7 @@ Use of *erase_at()* and *erase_range()*:
#include <stdio.h>
-int main ()
+int main(void)
{
clist_i L = c_init(clist_i, {10, 20, 30, 40, 50});
// 10 20 30 40 50
@@ -194,7 +194,7 @@ Splice `[30, 40]` from *L2* into *L1* before `3`:
#include <stdio.h>
-int main() {
+int main(void) {
clist_i L1 = c_init(clist_i, {1, 2, 3, 4, 5});
clist_i L2 = c_init(clist_i, {10, 20, 30, 40, 50});
diff --git a/docs/cmap_api.md b/docs/cmap_api.md
index 8ef322e6..eca350b4 100644
--- a/docs/cmap_api.md
+++ b/docs/cmap_api.md
@@ -121,7 +121,7 @@ bool c_memcmp_eq(const i_keyraw* a, const i_keyraw* b); // !
#define i_val_str
#include <stc/cmap.h>
-int main()
+int main(void)
{
// Create an unordered_map of three strings (that map to strings)
cmap_str umap = c_init(cmap_str, {
@@ -165,7 +165,7 @@ This example uses a cmap with cstr as mapped value.
#define i_val_str
#include <stc/cmap.h>
-int main()
+int main(void)
{
uint32_t col = 0xcc7744ff;
@@ -208,7 +208,7 @@ typedef struct { int x, y, z; } Vec3i;
#define i_tag vi
#include <stc/cmap.h>
-int main()
+int main(void)
{
// Define map with defered destruct
cmap_vi vecs = {0};
@@ -243,7 +243,7 @@ typedef struct { int x, y, z; } Vec3i;
#define i_tag iv
#include <stc/cmap.h>
-int main()
+int main(void)
{
cmap_iv vecs = {0}
@@ -304,7 +304,7 @@ static inline void Viking_drop(Viking* vk) {
#define i_val int
#include <stc/cmap.h>
-int main()
+int main(void)
{
// Use a HashMap to store the vikings' health points.
Vikings vikings = {0};
@@ -380,7 +380,7 @@ static inline RViking Viking_toraw(const Viking* vp) {
#define i_val int
#include <stc/cmap.h>
-int main()
+int main(void)
{
Vikings vikings = {0};
diff --git a/docs/cpque_api.md b/docs/cpque_api.md
index ca94e367..5b63dfd1 100644
--- a/docs/cpque_api.md
+++ b/docs/cpque_api.md
@@ -68,7 +68,7 @@ i_key cpque_X_value_clone(i_key value);
#define i_tag i
#include <stc/cpque.h>
-int main()
+int main(void)
{
intptr_t N = 10000000;
crand_t rng = crand_init(1234);
diff --git a/docs/cqueue_api.md b/docs/cqueue_api.md
index bce62833..b324e5fc 100644
--- a/docs/cqueue_api.md
+++ b/docs/cqueue_api.md
@@ -74,7 +74,7 @@ void cqueue_X_value_drop(cqueue_X_value* pval);
#include <stdio.h>
-int main() {
+int main(void) {
cqueue_i Q = cqueue_i_init();
// push() and pop() a few.
diff --git a/docs/crandom_api.md b/docs/crandom_api.md
index 74e23a6a..22a4f4dd 100644
--- a/docs/crandom_api.md
+++ b/docs/crandom_api.md
@@ -76,7 +76,7 @@ double crand_norm(crand_t* rng, crand_norm_t* dist);
#define i_tag i
#include <stc/csmap.h>
-int main()
+int main(void)
{
enum {N = 10000000};
const double Mean = -12.0, StdDev = 6.0, Scale = 74;
diff --git a/docs/cregex_api.md b/docs/cregex_api.md
index f87240f8..52476e09 100644
--- a/docs/cregex_api.md
+++ b/docs/cregex_api.md
@@ -102,7 +102,7 @@ If an error occurs ```cregex_compile``` returns a negative error code stored in
#define i_import // include dependent cstr, utf8 and cregex function definitions.
#include <stc/cregex.h>
-int main() {
+int main(void) {
const char* input = "start date is 2023-03-01, end date 2025-12-31.";
const char* pattern = "\\b(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)\\b";
diff --git a/docs/cset_api.md b/docs/cset_api.md
index 7bce3136..e894ad4f 100644
--- a/docs/cset_api.md
+++ b/docs/cset_api.md
@@ -83,7 +83,7 @@ cset_X_value cset_X_value_clone(cset_X_value val);
#define i_key_str
#include <stc/cset.h>
-int main ()
+int main(void)
{
Strset first, second={0}, third={0}, fourth={0}, fifth;
diff --git a/docs/csmap_api.md b/docs/csmap_api.md
index 2fd9f6a5..099d7dfc 100644
--- a/docs/csmap_api.md
+++ b/docs/csmap_api.md
@@ -108,7 +108,7 @@ void csmap_X_value_drop(csmap_X_value* pval);
#define i_val_str // ditto
#include <stc/csmap.h>
-int main()
+int main(void)
{
// Create a sorted map of three strings (maps to string)
csmap_str colors = c_init(csmap_str, {
@@ -166,7 +166,7 @@ static void print_result(strmap_result result) {
print_node(result.ref);
}
-int main()
+int main(void)
{
strmap m = {0};
@@ -191,7 +191,7 @@ This example uses a csmap with cstr as mapped value.
#define i_val_str
#include <stc/csmap.h>
-int main()
+int main(void)
{
uint32_t col = 0xcc7744ff;
IDSMap idnames = c_init(IDSMap, { {100, "Red"}, {110, "Blue"} });
@@ -237,7 +237,7 @@ static int Vec3i_cmp(const Vec3i* a, const Vec3i* b) {
#include <stc/csmap.h>
#include <stdio.h>
-int main()
+int main(void)
{
csmap_vi vmap = {0};
diff --git a/docs/cspan_api.md b/docs/cspan_api.md
index 1089e48d..09821450 100644
--- a/docs/cspan_api.md
+++ b/docs/cspan_api.md
@@ -101,7 +101,7 @@ if __name__ == '__main__':
#include <stc/cspan.h>
using_cspan3(myspan, int); // define myspan, myspan2, myspan3.
-int main() {
+int main(void) {
int arr[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24};
myspan3 ms3 = cspan_md(arr, 2, 3, 4); // C-order, i.e. row-major.
@@ -123,7 +123,7 @@ int main() {
#include <mdspan>
#include <tuple>
-int main() {
+int main(void) {
int arr[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24};
std::mdspan ms3(arr, 2, 3, 4);
@@ -147,7 +147,7 @@ Slicing cspan without and with reducing the rank:
using_cspan3(Span, int); // Shorthand to define Span, Span2, and Span3
-int main()
+int main(void)
{
// c_init() can create any STC container/span from an initializer list:
Span span = c_init(Span, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
diff --git a/docs/csset_api.md b/docs/csset_api.md
index d086b660..aef3af3c 100644
--- a/docs/csset_api.md
+++ b/docs/csset_api.md
@@ -83,7 +83,7 @@ csset_X_value csset_X_value_clone(csset_X_value val);
#define i_key_str
#include <stc/csset.h>
-int main ()
+int main(void)
{
SSet second={0}, third={0}, fourth={0}, fifth={0};
diff --git a/docs/cstack_api.md b/docs/cstack_api.md
index 51889d7f..e799b152 100644
--- a/docs/cstack_api.md
+++ b/docs/cstack_api.md
@@ -77,7 +77,7 @@ void cstack_X_value_drop(cvec_X_value* pval);
#include <stdio.h>
-int main() {
+int main(void) {
IStack stk = IStack_init();
for (int i=0; i < 100; ++i)
diff --git a/docs/cstr_api.md b/docs/cstr_api.md
index c7d19e0c..dae5669f 100644
--- a/docs/cstr_api.md
+++ b/docs/cstr_api.md
@@ -160,7 +160,7 @@ char* cstrnstrn(const char* str, const char* search, intptr_t slen, intpt
#define i_implement
#include <stc/cstr.h>
-int main() {
+int main(void) {
cstr s0, s1, full_path;
c_defer(
cstr_drop(&s0),
diff --git a/docs/csview_api.md b/docs/csview_api.md
index 33df6a64..79a5c07b 100644
--- a/docs/csview_api.md
+++ b/docs/csview_api.md
@@ -121,7 +121,7 @@ uint64_t csview_hash(const csview* x);
#include <stc/cstr.h>
#include <stc/csview.h>
-int main ()
+int main(void)
{
cstr str1 = cstr_lit("We think in generalities, but we live in details.");
// (quoting Alfred N. Whitehead)
@@ -151,7 +151,7 @@ red Apples
#define i_import // include dependent cstr, utf8 and cregex function definitions.
#include <stc/cstr.h>
-int main()
+int main(void)
{
cstr s1 = cstr_lit("hell😀 w😀rld");
@@ -198,7 +198,7 @@ cstack_str string_split(csview input, const char* sep)
return out;
}
-int main()
+int main(void)
{
print_split(c_sv("//This is a//double-slash//separated//string"), "//");
print_split(c_sv("This has no matching separator"), "xx");
diff --git a/docs/cvec_api.md b/docs/cvec_api.md
index ce85e446..d38ef23f 100644
--- a/docs/cvec_api.md
+++ b/docs/cvec_api.md
@@ -112,7 +112,7 @@ cvec_X_raw cvec_X_value_drop(cvec_X_value* pval);
#include <stdio.h>
-int main()
+int main(void)
{
// Create a vector containing integers
cvec_int vec = {0};
@@ -153,7 +153,7 @@ sorted: 5 7 8 13 16 25
#define i_key_str
#include <stc/cvec.h>
-int main() {
+int main(void) {
cvec_str names = cvec_str_init();
cvec_str_emplace(&names, "Mary");