summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-07-31 21:26:29 -0600
committerTavian Barnes <tavianator@gmail.com>2010-07-31 21:26:29 -0600
commitfb9dcc629630fe77840574088412eeb12b8d7ddb (patch)
treebb6735fa053ee26b43c09455eccd20a19fb8b1b6
parentdb019a2c4aa8a7bbfad0dd380717a1d6567d2e82 (diff)
downloaddimension-fb9dcc629630fe77840574088412eeb12b8d7ddb.tar.xz
Fix some -W{strict,missing}-prototypes warnings.
-rw-r--r--bench/libdimension/array.c2
-rw-r--r--bench/libdimension/geometry.c2
-rw-r--r--bench/libdimension/list.c4
-rw-r--r--bench/libdimension/prtree.c10
-rw-r--r--dimension/parse.c14
-rw-r--r--dimension/parse.h4
-rw-r--r--libdimension/dimension/camera.h2
-rw-r--r--libdimension/dimension/cameras.h2
-rw-r--r--libdimension/dimension/error.h6
-rw-r--r--libdimension/dimension/geometry.h6
-rw-r--r--libdimension/dimension/interior.h2
-rw-r--r--libdimension/dimension/light.h2
-rw-r--r--libdimension/dimension/object.h2
-rw-r--r--libdimension/dimension/objects.h4
-rw-r--r--libdimension/dimension/progress.h2
-rw-r--r--libdimension/dimension/scene.h2
-rw-r--r--libdimension/dimension/texture.h6
-rw-r--r--libdimension/error.c2
-rw-r--r--libdimension/platform.h6
-rw-r--r--libdimension/prtree.c2
-rw-r--r--tests/libdimension/error.c2
-rw-r--r--tests/libdimension/gl.c2
-rw-r--r--tests/libdimension/png.c2
-rw-r--r--tests/libdimension/prtree.c6
-rw-r--r--tests/libdimension/render.c6
-rw-r--r--tests/libdimension/warning.c2
26 files changed, 51 insertions, 51 deletions
diff --git a/bench/libdimension/array.c b/bench/libdimension/array.c
index 30c87e8..2011268 100644
--- a/bench/libdimension/array.c
+++ b/bench/libdimension/array.c
@@ -23,7 +23,7 @@
#include <stdint.h>
int
-main()
+main(void)
{
const unsigned int count = 32;
uint32_t object = 1;
diff --git a/bench/libdimension/geometry.c b/bench/libdimension/geometry.c
index b844efe..7e34d6d 100644
--- a/bench/libdimension/geometry.c
+++ b/bench/libdimension/geometry.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
int
-main()
+main(void)
{
dmnsn_vector vector, vector2;
dmnsn_matrix matrix, matrix2;
diff --git a/bench/libdimension/list.c b/bench/libdimension/list.c
index 16eb501..56a2181 100644
--- a/bench/libdimension/list.c
+++ b/bench/libdimension/list.c
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <stdint.h>
-bool
+static bool
dmnsn_comparator(dmnsn_list_iterator *i, dmnsn_list_iterator *j)
{
uint32_t a, b;
@@ -33,7 +33,7 @@ dmnsn_comparator(dmnsn_list_iterator *i, dmnsn_list_iterator *j)
}
int
-main()
+main(void)
{
const size_t count = 32;
uint32_t object = 1;
diff --git a/bench/libdimension/prtree.c b/bench/libdimension/prtree.c
index 749d524..0df0509 100644
--- a/bench/libdimension/prtree.c
+++ b/bench/libdimension/prtree.c
@@ -21,7 +21,7 @@
#include <sandglass.h>
#include <stdlib.h>
-bool
+static bool
dmnsn_fake_intersection_fn(const dmnsn_object *object, dmnsn_line line,
dmnsn_intersection *intersection)
{
@@ -29,13 +29,13 @@ dmnsn_fake_intersection_fn(const dmnsn_object *object, dmnsn_line line,
return true;
}
-bool
+static bool
dmnsn_fake_inside_fn(const dmnsn_object *object, dmnsn_vector point)
{
return true;
}
-void
+static void
dmnsn_randomize_bounding_box(dmnsn_object *object)
{
dmnsn_vector a, b;
@@ -53,7 +53,7 @@ dmnsn_randomize_bounding_box(dmnsn_object *object)
}
static dmnsn_object *
-dmnsn_new_fake_object()
+dmnsn_new_fake_object(void)
{
dmnsn_object *object = dmnsn_new_object();
/* Generate a bounding box in (-1, -1, -1), (1, 1, 1) */
@@ -64,7 +64,7 @@ dmnsn_new_fake_object()
}
int
-main()
+main(void)
{
const size_t nobjects = 128;
diff --git a/dimension/parse.c b/dimension/parse.c
index 7b33b1d..93edb84 100644
--- a/dimension/parse.c
+++ b/dimension/parse.c
@@ -35,7 +35,7 @@ typedef struct dmnsn_patricia_trie {
dmnsn_astnode value;
} dmnsn_patricia_trie;
-void
+static void
dmnsn_delete_patricia_trie(dmnsn_patricia_trie *trie)
{
if (trie) {
@@ -55,8 +55,8 @@ dmnsn_delete_patricia_trie(dmnsn_patricia_trie *trie)
}
}
-dmnsn_patricia_trie *
-dmnsn_new_patricia_trie()
+static dmnsn_patricia_trie *
+dmnsn_new_patricia_trie(void)
{
dmnsn_patricia_trie *trie = dmnsn_malloc(sizeof(dmnsn_patricia_trie));
trie->prefix = dmnsn_strdup("");
@@ -65,7 +65,7 @@ dmnsn_new_patricia_trie()
return trie;
}
-void
+static void
dmnsn_patricia_insert(dmnsn_patricia_trie *trie,
const char *id, dmnsn_astnode value)
{
@@ -147,7 +147,7 @@ dmnsn_patricia_insert(dmnsn_patricia_trie *trie,
}
}
-bool
+static bool
dmnsn_patricia_remove(dmnsn_patricia_trie *trie, const char *id)
{
/*
@@ -190,7 +190,7 @@ dmnsn_patricia_remove(dmnsn_patricia_trie *trie, const char *id)
return false;
}
-dmnsn_astnode *
+static dmnsn_astnode *
dmnsn_patricia_find(dmnsn_patricia_trie *trie, const char *id)
{
/*
@@ -969,7 +969,7 @@ dmnsn_eval_binary(dmnsn_astnode astnode, dmnsn_symbol_table *symtable)
dmnsn_delete_astnode(lhs);
dmnsn_delete_astnode(rhs);
return ret;
- }
+ }
switch (astnode.type) {
case DMNSN_AST_EQUAL:
diff --git a/dimension/parse.h b/dimension/parse.h
index c47363f..e81f76e 100644
--- a/dimension/parse.h
+++ b/dimension/parse.h
@@ -199,7 +199,7 @@ struct dmnsn_astnode {
typedef dmnsn_array dmnsn_astree;
-dmnsn_astnode dmnsn_new_ast_array();
+dmnsn_astnode dmnsn_new_ast_array(void);
dmnsn_astnode dmnsn_new_ast_integer(long value);
dmnsn_astnode dmnsn_new_ast_float(double value);
dmnsn_astnode dmnsn_new_ast_ivector(long x, long y, long z, long f, long t);
@@ -222,7 +222,7 @@ const char *dmnsn_astnode_string(dmnsn_astnode_type astnode_type);
typedef dmnsn_array dmnsn_symbol_table;
-dmnsn_symbol_table *dmnsn_new_symbol_table();
+dmnsn_symbol_table *dmnsn_new_symbol_table(void);
void dmnsn_delete_symbol_table(dmnsn_symbol_table *symtable);
diff --git a/libdimension/dimension/camera.h b/libdimension/dimension/camera.h
index 1bc3e1f..e95ad18 100644
--- a/libdimension/dimension/camera.h
+++ b/libdimension/dimension/camera.h
@@ -41,7 +41,7 @@ struct dmnsn_camera {
void *ptr;
};
-dmnsn_camera *dmnsn_new_camera();
+dmnsn_camera *dmnsn_new_camera(void);
void dmnsn_delete_camera(dmnsn_camera *camera);
#endif /* DIMENSION_CAMERA_H */
diff --git a/libdimension/dimension/cameras.h b/libdimension/dimension/cameras.h
index 7c588bf..7f4d549 100644
--- a/libdimension/dimension/cameras.h
+++ b/libdimension/dimension/cameras.h
@@ -28,7 +28,7 @@
/* A perspective camera, at the origin, looking at (0, 0, 1). The feild of view
is the section of the plane z = 1 from (-0.5, -0.5) to (0.5, 0.5). Rays are
transformed by the camera's transformation matrix. */
-dmnsn_camera *dmnsn_new_perspective_camera();
+dmnsn_camera *dmnsn_new_perspective_camera(void);
/* Get or set the transformation matrix */
dmnsn_matrix dmnsn_get_perspective_camera_trans(const dmnsn_camera *camera);
diff --git a/libdimension/dimension/error.h b/libdimension/dimension/error.h
index 6eecbfb..a0b3857 100644
--- a/libdimension/dimension/error.h
+++ b/libdimension/dimension/error.h
@@ -66,15 +66,15 @@ void dmnsn_report_error(dmnsn_severity severity,
const char *str);
/* Get and set the library resilience, thread-safely */
-dmnsn_severity dmnsn_get_resilience();
+dmnsn_severity dmnsn_get_resilience(void);
void dmnsn_set_resilience(dmnsn_severity resilience);
/* Fatal error callback type */
-typedef void dmnsn_fatal_error_fn();
+typedef void dmnsn_fatal_error_fn(void);
/* Get and set libdimension fatal error handling strategy - the default is
exit(EXIT_FAILURE) */
-dmnsn_fatal_error_fn *dmnsn_get_fatal_error_fn();
+dmnsn_fatal_error_fn *dmnsn_get_fatal_error_fn(void);
void dmnsn_set_fatal_error_fn(dmnsn_fatal_error_fn *fatal);
#endif /* DIMENSION_ERROR_H */
diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h
index 5efba3a..42a9985 100644
--- a/libdimension/dimension/geometry.h
+++ b/libdimension/dimension/geometry.h
@@ -118,7 +118,7 @@ dmnsn_new_matrix(double a0, double a1, double a2, double a3,
return m;
}
-dmnsn_matrix dmnsn_identity_matrix();
+dmnsn_matrix dmnsn_identity_matrix(void);
dmnsn_matrix dmnsn_scale_matrix(dmnsn_vector s);
dmnsn_matrix dmnsn_translation_matrix(dmnsn_vector d);
/* Left-handed rotation; theta/|theta| = axis, |theta| = angle */
@@ -132,7 +132,7 @@ dmnsn_new_line(dmnsn_vector x0, dmnsn_vector n)
}
DMNSN_INLINE dmnsn_bounding_box
-dmnsn_zero_bounding_box()
+dmnsn_zero_bounding_box(void)
{
dmnsn_bounding_box box = {
{ INFINITY, INFINITY, INFINITY },
@@ -142,7 +142,7 @@ dmnsn_zero_bounding_box()
}
DMNSN_INLINE dmnsn_bounding_box
-dmnsn_infinite_bounding_box()
+dmnsn_infinite_bounding_box(void)
{
dmnsn_bounding_box box = {
{ -INFINITY, -INFINITY, -INFINITY },
diff --git a/libdimension/dimension/interior.h b/libdimension/dimension/interior.h
index 69a0fcb..96168cf 100644
--- a/libdimension/dimension/interior.h
+++ b/libdimension/dimension/interior.h
@@ -39,7 +39,7 @@ typedef struct dmnsn_interior {
unsigned int *refcount;
} dmnsn_interior;
-dmnsn_interior *dmnsn_new_interior();
+dmnsn_interior *dmnsn_new_interior(void);
void dmnsn_delete_interior(dmnsn_interior *interior);
#endif /* DIMENSION_INTERIOR_H */
diff --git a/libdimension/dimension/light.h b/libdimension/dimension/light.h
index 3c861fd..69ed9e7 100644
--- a/libdimension/dimension/light.h
+++ b/libdimension/dimension/light.h
@@ -41,7 +41,7 @@ struct dmnsn_light {
void *ptr;
};
-dmnsn_light *dmnsn_new_light();
+dmnsn_light *dmnsn_new_light(void);
void dmnsn_delete_light(dmnsn_light *light);
#endif /* DIMENSION_LIGHT_H */
diff --git a/libdimension/dimension/object.h b/libdimension/dimension/object.h
index 5cc62a1..f633a2d 100644
--- a/libdimension/dimension/object.h
+++ b/libdimension/dimension/object.h
@@ -83,7 +83,7 @@ struct dmnsn_object {
};
/* Allocate a dummy object */
-dmnsn_object *dmnsn_new_object();
+dmnsn_object *dmnsn_new_object(void);
/* Free an object */
void dmnsn_delete_object(dmnsn_object *object);
diff --git a/libdimension/dimension/objects.h b/libdimension/dimension/objects.h
index a12fee9..9986717 100644
--- a/libdimension/dimension/objects.h
+++ b/libdimension/dimension/objects.h
@@ -29,9 +29,9 @@
dmnsn_object *dmnsn_new_plane(dmnsn_vector normal);
/* A sphere object, of radius 1, centered at the origin. */
-dmnsn_object *dmnsn_new_sphere();
+dmnsn_object *dmnsn_new_sphere(void);
/* A cube, axis-aligned, from (-1, -1, -1) to (1, 1, 1) */
-dmnsn_object *dmnsn_new_cube();
+dmnsn_object *dmnsn_new_cube(void);
#endif /* DIMENSION_OBJECTS_H */
diff --git a/libdimension/dimension/progress.h b/libdimension/dimension/progress.h
index 0a7dce2..53dfc37 100644
--- a/libdimension/dimension/progress.h
+++ b/libdimension/dimension/progress.h
@@ -31,7 +31,7 @@
typedef struct dmnsn_progress dmnsn_progress;
/* Allocate a new progress object */
-dmnsn_progress *dmnsn_new_progress();
+dmnsn_progress *dmnsn_new_progress(void);
/* For failed returns from *_async() functions */
void dmnsn_delete_progress(dmnsn_progress *progress);
diff --git a/libdimension/dimension/scene.h b/libdimension/dimension/scene.h
index 6831048..7c53991 100644
--- a/libdimension/dimension/scene.h
+++ b/libdimension/dimension/scene.h
@@ -67,7 +67,7 @@ typedef struct {
} dmnsn_scene;
/* Create a scene */
-dmnsn_scene *dmnsn_new_scene();
+dmnsn_scene *dmnsn_new_scene(void);
void dmnsn_delete_scene(dmnsn_scene *scene);
#endif /* DIMENSION_SCENE_H */
diff --git a/libdimension/dimension/texture.h b/libdimension/dimension/texture.h
index b2eef05..3d37aa1 100644
--- a/libdimension/dimension/texture.h
+++ b/libdimension/dimension/texture.h
@@ -49,7 +49,7 @@ struct dmnsn_pigment {
void *ptr;
};
-dmnsn_pigment *dmnsn_new_pigment();
+dmnsn_pigment *dmnsn_new_pigment(void);
void dmnsn_delete_pigment(dmnsn_pigment *pigment);
void dmnsn_pigment_init(dmnsn_pigment *pigment);
@@ -88,7 +88,7 @@ struct dmnsn_finish {
void *ptr;
};
-dmnsn_finish *dmnsn_new_finish();
+dmnsn_finish *dmnsn_new_finish(void);
void dmnsn_delete_finish(dmnsn_finish *finish);
/*
@@ -107,7 +107,7 @@ typedef struct {
unsigned int *refcount;
} dmnsn_texture;
-dmnsn_texture *dmnsn_new_texture();
+dmnsn_texture *dmnsn_new_texture(void);
void dmnsn_delete_texture(dmnsn_texture *texture);
void dmnsn_texture_init(dmnsn_texture *texture);
diff --git a/libdimension/error.c b/libdimension/error.c
index 5785356..c8e10e9 100644
--- a/libdimension/error.c
+++ b/libdimension/error.c
@@ -24,7 +24,7 @@
#include <stdio.h> /* For fprintf() */
#include <stdlib.h> /* For exit() */
-static void dmnsn_default_fatal_error_fn();
+static void dmnsn_default_fatal_error_fn(void);
static dmnsn_fatal_error_fn *dmnsn_fatal = &dmnsn_default_fatal_error_fn;
static dmnsn_severity dmnsn_resilience = DMNSN_SEVERITY_MEDIUM;
diff --git a/libdimension/platform.h b/libdimension/platform.h
index a2bcd39..a5d4dc6 100644
--- a/libdimension/platform.h
+++ b/libdimension/platform.h
@@ -29,12 +29,12 @@
void dmnsn_backtrace(FILE *file);
/* Return whether this is the main execution thread, if we can tell */
-bool dmnsn_is_main_thread();
+bool dmnsn_is_main_thread(void);
/* Return true if we are little-endian */
-bool dmnsn_is_little_endian();
+bool dmnsn_is_little_endian(void);
/* Return the number of CPUs available to dimension */
-size_t dmnsn_ncpus();
+size_t dmnsn_ncpus(void);
#endif /* DIMENSION_IMPL_UTILITIES_H */
diff --git a/libdimension/prtree.c b/libdimension/prtree.c
index 6980337..69a70a4 100644
--- a/libdimension/prtree.c
+++ b/libdimension/prtree.c
@@ -518,7 +518,7 @@ dmnsn_new_prtree(const dmnsn_array *objects)
}
/* Free a PR-tree node */
-void
+static void
dmnsn_delete_prtree_node(dmnsn_prtree_node *node)
{
if (node) {
diff --git a/tests/libdimension/error.c b/tests/libdimension/error.c
index e5b7b2a..e8100f0 100644
--- a/tests/libdimension/error.c
+++ b/tests/libdimension/error.c
@@ -23,7 +23,7 @@
#include <stdlib.h>
int
-main()
+main(void)
{
dmnsn_set_resilience(DMNSN_SEVERITY_LOW);
dmnsn_error(DMNSN_SEVERITY_LOW, "This error is expected.");
diff --git a/tests/libdimension/gl.c b/tests/libdimension/gl.c
index 8177ff6..71ba64e 100644
--- a/tests/libdimension/gl.c
+++ b/tests/libdimension/gl.c
@@ -22,7 +22,7 @@
#include <unistd.h>
int
-main()
+main(void)
{
/* Set the resilience low for tests */
dmnsn_set_resilience(DMNSN_SEVERITY_LOW);
diff --git a/tests/libdimension/png.c b/tests/libdimension/png.c
index f28d50f..a3e4da8 100644
--- a/tests/libdimension/png.c
+++ b/tests/libdimension/png.c
@@ -22,7 +22,7 @@
#include <stdio.h>
int
-main()
+main(void)
{
/* Set the resilience low for tests */
dmnsn_set_resilience(DMNSN_SEVERITY_LOW);
diff --git a/tests/libdimension/prtree.c b/tests/libdimension/prtree.c
index 1c69fd4..2cf259f 100644
--- a/tests/libdimension/prtree.c
+++ b/tests/libdimension/prtree.c
@@ -28,7 +28,7 @@
unsigned int calls = 0;
-bool
+static bool
dmnsn_fake_intersection_fn(const dmnsn_object *object, dmnsn_line line,
dmnsn_intersection *intersection)
{
@@ -37,7 +37,7 @@ dmnsn_fake_intersection_fn(const dmnsn_object *object, dmnsn_line line,
return true;
}
-void
+static void
dmnsn_randomize_bounding_box(dmnsn_object *object)
{
dmnsn_vector a, b;
@@ -55,7 +55,7 @@ dmnsn_randomize_bounding_box(dmnsn_object *object)
}
int
-main()
+main(void)
{
const size_t nobjects = 128;
dmnsn_scene *scene = dmnsn_new_scene();
diff --git a/tests/libdimension/render.c b/tests/libdimension/render.c
index e227c7a..29e733e 100644
--- a/tests/libdimension/render.c
+++ b/tests/libdimension/render.c
@@ -25,8 +25,8 @@
/*
* Test scene -- code version of tests/dimension/demo.pov
*/
-dmnsn_scene *
-dmnsn_new_test_scene()
+static dmnsn_scene *
+dmnsn_new_test_scene(void)
{
/* Allocate a new scene */
dmnsn_scene *scene = dmnsn_new_scene();
@@ -110,7 +110,7 @@ dmnsn_new_test_scene()
}
int
-main()
+main(void)
{
bool have_png = true, have_gl = true;
diff --git a/tests/libdimension/warning.c b/tests/libdimension/warning.c
index 128f56f..d221076 100644
--- a/tests/libdimension/warning.c
+++ b/tests/libdimension/warning.c
@@ -23,7 +23,7 @@
#include <stdlib.h>
int
-main()
+main(void)
{
if (dmnsn_get_resilience() != DMNSN_SEVERITY_MEDIUM) {
return EXIT_FAILURE;