diff options
author | Vito Caputo <vcaputo@gnugeneration.com> | 2016-12-21 02:54:46 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@gnugeneration.com> | 2016-12-21 02:54:46 -0800 |
commit | 7ac8684cd7928fcc497ddcfce06cf3b04d2ed7e5 (patch) | |
tree | 0e718dc25ea7872e0a93b5e9ea4036bc384ca97c | |
parent | ecd2271d50b347900e9e15da5112ffcd1e6084d9 (diff) |
ray: eliminate benign compiler warnings
-rw-r--r-- | modules/ray/ray_object.c | 8 | ||||
-rw-r--r-- | modules/ray/ray_object_light.h | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/modules/ray/ray_object.c b/modules/ray/ray_object.c index 8b324e5..e309647 100644 --- a/modules/ray/ray_object.c +++ b/modules/ray/ray_object.c @@ -1,3 +1,5 @@ +#include <assert.h> + #include "ray_object.h" #include "ray_object_light.h" #include "ray_object_plane.h" @@ -25,6 +27,8 @@ int ray_object_intersects_ray(ray_object_t *object, ray_ray_t *ray, float *res_d case RAY_OBJECT_TYPE_LIGHT: return ray_object_light_intersects_ray(&object->light, ray, res_distance); + default: + assert(0); } } @@ -44,6 +48,8 @@ ray_3f_t ray_object_normal(ray_object_t *object, ray_3f_t *point) case RAY_OBJECT_TYPE_LIGHT: return ray_object_light_normal(&object->light, point); + default: + assert(0); } } @@ -63,5 +69,7 @@ ray_surface_t ray_object_surface(ray_object_t *object, ray_3f_t *point) case RAY_OBJECT_TYPE_LIGHT: return ray_object_light_surface(&object->light, point); + default: + assert(0); } } diff --git a/modules/ray/ray_object_light.h b/modules/ray/ray_object_light.h index 73cf917..940e7eb 100644 --- a/modules/ray/ray_object_light.h +++ b/modules/ray/ray_object_light.h @@ -1,6 +1,8 @@ #ifndef _RAY_OBJECT_LIGHT_H #define _RAY_OBJECT_LIGHT_H +#include <assert.h> + #include "ray_light_emitter.h" #include "ray_object_light.h" #include "ray_object_point.h" @@ -27,6 +29,8 @@ static inline int ray_object_light_intersects_ray(ray_object_light_t *light, ray case RAY_LIGHT_EMITTER_TYPE_SPHERE: return ray_object_sphere_intersects_ray(&light->emitter.sphere, ray, res_distance); + default: + assert(0); } } @@ -42,6 +46,8 @@ static inline ray_3f_t ray_object_light_normal(ray_object_light_t *light, ray_3f case RAY_LIGHT_EMITTER_TYPE_POINT: return normal; + default: + assert(0); } } @@ -54,6 +60,8 @@ static inline ray_surface_t ray_object_light_surface(ray_object_light_t *light, case RAY_LIGHT_EMITTER_TYPE_POINT: return ray_object_point_surface(&light->emitter.point, point); + default: + assert(0); } } |