commit 7baa0b0ab07f6c844f3c4344585efbc338171c9e parent a975df69032a548be3180b5604a8ace4121770d3 Author: Vincent Forest <vincent.forest@meso-star.com> Date: Tue, 22 Sep 2015 17:23:36 +0200 Add missing comments Diffstat:
| M | src/s3d_scene.c | | | 12 | ++++++++++-- |
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/s3d_scene.c b/src/s3d_scene.c @@ -396,7 +396,11 @@ error: static FINLINE bool operator < (const struct fltui& it, const float val) { - return it.flt <= val; /* TODO comment the <= */ + /* This operator is used by the std::lower_bound algorithm that returns an + * iterator to the first element that is not less than val while one expect + * an iterator on the first element that is not less *or equal* than val. + * That's why we use <= rather than < */ + return it.flt <= val; } static res_T @@ -460,7 +464,11 @@ error: static FINLINE bool operator < (const struct nprims_cdf& it, const size_t iprim) { - return it.nprims <= iprim; /* TODO comment the <= */ + /* This operator is used by the std::lower_bound algorithm that returns an + * iterator to the first element that is not less than iprim while one expect + * an iterator on the first element that is not less *or equal* than iprim. + * That's why we use <= rather than < */ + return it.nprims <= iprim; } static res_T