summaryrefslogtreecommitdiffstats
path: root/bench/libdimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-05-05 20:09:38 -0600
committerTavian Barnes <tavianator@gmail.com>2010-05-05 22:47:44 -0600
commit6c2943e735c99579b5b861f67f2d98e5ddd6306f (patch)
treee882a1dda2726dd9dfca3fe2dd44750b17b1edda /bench/libdimension
parentb14506e501770aeaf54d1160c0073398cc29a038 (diff)
downloaddimension-6c2943e735c99579b5b861f67f2d98e5ddd6306f.tar.xz
Use C99 for loop initializers.
Diffstat (limited to 'bench/libdimension')
-rw-r--r--bench/libdimension/array.c9
-rw-r--r--bench/libdimension/prtree.c7
2 files changed, 7 insertions, 9 deletions
diff --git a/bench/libdimension/array.c b/bench/libdimension/array.c
index dae7c98..f9ac22d 100644
--- a/bench/libdimension/array.c
+++ b/bench/libdimension/array.c
@@ -29,7 +29,6 @@ main()
uint32_t object = 1;
void *ptr;
size_t size;
- unsigned int i;
const unsigned int count = 32;
sandglass_t sandglass;
@@ -53,7 +52,7 @@ main()
printf("dmnsn_array_push():");
- for (i = 0; i < count; ++i) {
+ for (unsigned int i = 0; i < count; ++i) {
sandglass_bench_noprecache(&sandglass, dmnsn_array_push(array, &object));
printf(" %ld", sandglass.grains);
}
@@ -87,7 +86,7 @@ main()
printf("dmnsn_array_insert():");
- for (i = 0; i < count; ++i) {
+ for (size_t i = 0; i < count; ++i) {
sandglass_bench_noprecache(&sandglass,
dmnsn_array_insert(array, count/2, &object));
printf(" %ld", sandglass.grains);
@@ -98,7 +97,7 @@ main()
printf("dmnsn_array_remove():");
- for (i = 0; i < count; ++i) {
+ for (size_t i = 0; i < count; ++i) {
sandglass_bench_noprecache(&sandglass,
dmnsn_array_remove(array, count/2));
printf(" %ld", sandglass.grains);
@@ -109,7 +108,7 @@ main()
printf("dmnsn_array_pop():");
- for (i = 0; i < count; ++i) {
+ for (size_t i = 0; i < count; ++i) {
sandglass_bench_noprecache(&sandglass, dmnsn_array_pop(array, &object));
printf(" %ld", sandglass.grains);
}
diff --git a/bench/libdimension/prtree.c b/bench/libdimension/prtree.c
index b3bee13..d4b3ed7 100644
--- a/bench/libdimension/prtree.c
+++ b/bench/libdimension/prtree.c
@@ -52,9 +52,8 @@ main()
dmnsn_prtree *tree;
dmnsn_intersection intersection;
dmnsn_line ray;
- const unsigned int nobjects = 128;
+ const size_t nobjects = 128;
dmnsn_array *objects;
- unsigned int i;
sandglass_t sandglass;
if (sandglass_init_monotonic(&sandglass, SANDGLASS_CPUTIME) != 0) {
@@ -63,7 +62,7 @@ main()
}
objects = dmnsn_new_array(sizeof(dmnsn_object *));
- for (i = 0; i < nobjects; ++i) {
+ for (size_t i = 0; i < nobjects; ++i) {
dmnsn_object *object = dmnsn_new_object();
/* Generate a bounding box in (-1, -1, -1), (1, 1, 1) */
dmnsn_randomize_bounding_box(object);
@@ -87,7 +86,7 @@ main()
/* Cleanup */
dmnsn_delete_prtree(tree);
- for (i = 0; i < nobjects; ++i) {
+ for (size_t i = 0; i < nobjects; ++i) {
dmnsn_object *object;
dmnsn_array_get(objects, i, &object);
dmnsn_delete_object(object);