Skip to content

Commit 2ada844

Browse files
committed
Changed int to enum type for error code
1 parent 09553f1 commit 2ada844

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

ext/symengine/ruby_basic.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ VALUE cbasic_binary_op(VALUE self, VALUE operand2,
3333

3434
cresult = basic_new_heap();
3535

36-
int error_code = cwfunc_ptr(cresult, this, cbasic_operand2);
36+
symengine_exceptions_t error_code
37+
= cwfunc_ptr(cresult, this, cbasic_operand2);
3738
if (error_code == 0) {
3839
result = Data_Wrap_Struct(Klass_of_Basic(cresult), NULL,
3940
cbasic_free_heap, cresult);
@@ -55,7 +56,7 @@ VALUE cbasic_unary_op(VALUE self,
5556

5657
cresult = basic_new_heap();
5758

58-
int error_code = cwfunc_ptr(cresult, this);
59+
symengine_exceptions_t error_code = cwfunc_ptr(cresult, this);
5960
if (error_code == 0) {
6061
result = Data_Wrap_Struct(Klass_of_Basic(cresult), NULL,
6162
cbasic_free_heap, cresult);

ext/symengine/symengine_utils.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ VALUE function_onearg(CWRAPPER_OUTPUT_TYPE (*cwfunc_ptr)(basic_struct *,
211211
sympify(operand1, cbasic_operand1);
212212

213213
cresult = basic_new_heap();
214-
int error_code = cwfunc_ptr(cresult, cbasic_operand1);
214+
symengine_exceptions_t error_code = cwfunc_ptr(cresult, cbasic_operand1);
215215
if (error_code == 0) {
216216
result = Data_Wrap_Struct(Klass_of_Basic(cresult), NULL,
217217
cbasic_free_heap, cresult);
@@ -240,7 +240,8 @@ VALUE function_twoarg(CWRAPPER_OUTPUT_TYPE (*cwfunc_ptr)(basic_struct *,
240240
sympify(operand2, cbasic_operand2);
241241

242242
cresult = basic_new_heap();
243-
int error_code = cwfunc_ptr(cresult, cbasic_operand1, cbasic_operand2);
243+
symengine_exceptions_t error_code
244+
= cwfunc_ptr(cresult, cbasic_operand1, cbasic_operand2);
244245

245246
if (error_code == 0) {
246247
result = Data_Wrap_Struct(Klass_of_Basic(cresult), NULL,

0 commit comments

Comments
 (0)