Commits

Barry Schwartz committed ce1d04b

Change caml_invalid_argument to caml_failwith in the stubs.

Comments (0)

Files changed (1)

caml2geom_stubs.c

     CAMLparam2(_p, _i);
     int i = Int_val(_i);
     if (i < 0 || 1 < i)
-        caml_invalid_argument("Point.coord index out of range");
+        caml_failwith("Point.coord index out of range");
     CAMLreturn(caml_copy_double((*OPAQUE_P(Geom::Point, _p))[i]));
 }
 
     CAMLparam3(_p, _i, _v);
     int i = Int_val(_i);
     if (i < 0 || 1 < i)
-        caml_invalid_argument("Point.coord index out of range");
+        caml_failwith("Point.coord index out of range");
     (*OPAQUE_P(Geom::Point, _p))[i] = Double_val(_v);
     CAMLreturn(Val_unit);
 }
         point = path->pointAt(time);
     }
     catch (Geom::RangeError&) {
-        caml_invalid_argument("Parameter t out of bounds");
+        caml_failwith("Parameter t out of bounds");
     }
     _point = OPAQUE_P_ALLOC(Geom::Point, point_ops);
     OPAQUE_P(Geom::Point, _point) = new Geom::Point(point);
         val = path->valueAt(time, dim2[Int_val(_dim2)]);
     }
     catch (Geom::RangeError&) {
-        caml_invalid_argument("Parameter t out of bounds");
+        caml_failwith("Parameter t out of bounds");
     }
     CAMLreturn(caml_copy_double(val));
 }
             path->append(*curve, stitching[Int_val(Field(_stitch, 0))]);
     }
     catch (Geom::ContinuityError&) {
-        caml_invalid_argument("Non-contiguous path");
+        caml_failwith("Non-contiguous path");
     }
     CAMLreturn(Val_unit);
 }
             path->append(*other, stitching[Int_val(Field(_stitch, 0))]);
     }
     catch (Geom::ContinuityError&) {
-        caml_invalid_argument("Non-contiguous path");
+        caml_failwith("Non-contiguous path");
     }
     CAMLreturn(Val_unit);
 }
         time = path->nearestPoint(*point, from_t, to_t, &distance_squared);
     }
     catch (Geom::RangeError&) {
-        caml_invalid_argument("[from,to] interval out of bounds");
+        caml_failwith("[from,to] interval out of bounds");
     }
     _result = caml_alloc(2, 0);
     Store_field(_result, 0, caml_copy_double(time));