From def76fe4d9bbc2c342594dc05861b24d7165d274 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Mon, 2 Mar 2020 22:35:22 +1100 Subject: all: Use MP_ERROR_TEXT for all error messages. --- examples/natmod/features1/features1.c | 2 +- examples/natmod/features2/main.c | 2 +- examples/natmod/ure/ure.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/natmod/features1/features1.c b/examples/natmod/features1/features1.c index 1bfbe50b9..f865f1887 100644 --- a/examples/natmod/features1/features1.c +++ b/examples/natmod/features1/features1.c @@ -45,7 +45,7 @@ STATIC mp_int_t fibonacci_helper(mp_int_t x) { STATIC mp_obj_t fibonacci(mp_obj_t x_in) { mp_int_t x = mp_obj_get_int(x_in); if (x < 0) { - mp_raise_ValueError("can't compute negative Fibonacci number"); + mp_raise_ValueError(MP_ERROR_TEXT("can't compute negative Fibonacci number")); } return mp_obj_new_int(fibonacci_helper(x)); } diff --git a/examples/natmod/features2/main.c b/examples/natmod/features2/main.c index de83bf2be..1a39700dc 100644 --- a/examples/natmod/features2/main.c +++ b/examples/natmod/features2/main.c @@ -52,7 +52,7 @@ STATIC mp_obj_t productf(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_o mp_buffer_info_t bufinfo; mp_get_buffer_raise(args[0], &bufinfo, MP_BUFFER_RW); if (bufinfo.typecode != 'f') { - mp_raise_ValueError("expecting float array"); + mp_raise_ValueError(MP_ERROR_TEXT("expecting float array")); } // Compute product, store result back in first element of array diff --git a/examples/natmod/ure/ure.c b/examples/natmod/ure/ure.c index ca1383583..00ca2e9eb 100644 --- a/examples/natmod/ure/ure.c +++ b/examples/natmod/ure/ure.c @@ -15,7 +15,7 @@ void mp_stack_check(void) { // Assumes descending stack on target volatile char dummy; if (stack_top - &dummy >= STACK_LIMIT) { - mp_raise_msg(&mp_type_RuntimeError, "maximum recursion depth exceeded"); + mp_raise_msg(&mp_type_RuntimeError, MP_ERROR_TEXT("maximum recursion depth exceeded")); } } -- cgit v1.2.3