diff options
| author | Tyge Løvset <[email protected]> | 2020-09-14 11:43:15 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-09-14 11:43:15 +0200 |
| commit | ab21f83c4af4f2b628ce36ad03f5c78fbb11a06a (patch) | |
| tree | 900c1ba2db1f861ceca40a3e37a3e644aeaee954 /examples | |
| parent | 1dd8d2ef2b5fd86bd500ab01c52f7e4a3bd9df60 (diff) | |
| download | STC-modified-ab21f83c4af4f2b628ce36ad03f5c78fbb11a06a.tar.gz STC-modified-ab21f83c4af4f2b628ce36ad03f5c78fbb11a06a.zip | |
Removed warnings. clang, vs.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/complex.c | 2 | ||||
| -rw-r--r-- | examples/ex_gaussian.c | 2 | ||||
| -rw-r--r-- | examples/heap.c | 4 | ||||
| -rw-r--r-- | examples/queue.c | 3 |
4 files changed, 5 insertions, 6 deletions
diff --git a/examples/complex.c b/examples/complex.c index 25a59eff..151824e2 100644 --- a/examples/complex.c +++ b/examples/complex.c @@ -23,7 +23,7 @@ int main() { // Put in some data.
cmap_g listMap = cmap_ini;
- *carray2f_at(&table, y, x) = 3.1415927; // table[y][x]
+ *carray2f_at(&table, y, x) = 3.1415927f; // table[y][x]
clist_y_push_back(&tableList, table);
cmap_g_put(&listMap, tableKey, tableList);
cmap_s_put(&myMap, strKey, listMap);
diff --git a/examples/ex_gaussian.c b/examples/ex_gaussian.c index cd44e78a..8751ffa0 100644 --- a/examples/ex_gaussian.c +++ b/examples/ex_gaussian.c @@ -31,7 +31,7 @@ int main() // Create histogram map
cmap_i mhist = cmap_ini;
for (size_t i = 0; i < N; ++i) {
- int index = round( crand_normal_f64(&rng, &dist) );
+ int index = (int) round( crand_normal_f64(&rng, &dist) );
cmap_i_emplace(&mhist, index, 0).item->value += 1;
}
diff --git a/examples/heap.c b/examples/heap.c index 5917dd30..a281de01 100644 --- a/examples/heap.c +++ b/examples/heap.c @@ -18,7 +18,7 @@ int main() pcg = crand_rng32_init(seed);
clock_t start = clock();
for (int i=0; i<N; ++i)
- cvec_f_push_back(&pq, crand_i32(&pcg));
+ cvec_f_push_back(&pq, (float) crand_i32(&pcg));
cpqueue_f_build(&pq);
printf("Built priority queue: %f secs\n", (clock() - start) / (float) CLOCKS_PER_SEC);
@@ -34,7 +34,7 @@ int main() pcg = crand_rng32_init(seed);
start = clock();
for (int i=0; i<N; ++i)
- cpqueue_f_push(&pq, crand_i32(&pcg));
+ cpqueue_f_push(&pq, (float) crand_i32(&pcg));
printf("pushed PQ: %f secs\n", (clock() - start) / (float) CLOCKS_PER_SEC);
for (int i=0; i<M; ++i)
diff --git a/examples/queue.c b/examples/queue.c index 25aefd09..5bac7535 100644 --- a/examples/queue.c +++ b/examples/queue.c @@ -26,7 +26,6 @@ int main() { else
--n, cqueue_i_pop(&queue);
}
- printf("%d\n", n);
- printf("%zu\n", n, cqueue_i_size(queue));
+ printf("%d, %zu\n", n, cqueue_i_size(queue));
cqueue_i_destroy(&queue);
}
|
