summaryrefslogtreecommitdiffhomepage
path: root/misc/examples/prime.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-12-29 00:28:50 +0100
committerTyge Løvset <[email protected]>2022-12-29 00:28:50 +0100
commit0761c13f316cc98ae7756f3527931aa86bed5016 (patch)
treee90777558956fcf91d6b1c958e0c3a6fb0ab007f /misc/examples/prime.c
parentd623c6c85071b9af5d607bb5d9aceceaea05220a (diff)
downloadSTC-modified-0761c13f316cc98ae7756f3527931aa86bed5016.tar.gz
STC-modified-0761c13f316cc98ae7756f3527931aa86bed5016.zip
Restructuring of some headers into include/algo folder. Some API changes *_replace*() functions have been renamed, and a few minor API changes.
Diffstat (limited to 'misc/examples/prime.c')
-rw-r--r--misc/examples/prime.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/misc/examples/prime.c b/misc/examples/prime.c
index 41d637b8..f6e89e09 100644
--- a/misc/examples/prime.c
+++ b/misc/examples/prime.c
@@ -2,7 +2,9 @@
#include <math.h>
#include <time.h>
#include <stc/cbits.h>
-#include <stc/views.h>
+#include <stc/algo/filter.h>
+#include <stc/algo/crange.h>
+
cbits sieveOfEratosthenes(size_t n)
{
@@ -41,7 +43,7 @@ int main(void)
puts("");
puts("Show the last 50 primes using a temporary crange generator:");
- c_FORFILTER (i, crange, crange_literal(n - 1, 0, -2)
+ c_FORFILTER (i, crange, crange_LITERAL(n - 1, 0, -2)
, cbits_test(&primes, *i.ref>>1)
, c_FLT_TAKE(i, 50)) {
printf("%lld ", *i.ref);