Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Fix compilation errors from implicit typecasts observed on Arm macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jwright6323 committed Mar 25, 2024
1 parent ec94ba8 commit c6299aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ doc/
ext/mathematical/lib
file.svg
Gemfile.lock
*.gem
InstalledFiles
lib/bundler/man
lib/mathematical.bundle
Expand Down
10 changes: 5 additions & 5 deletions ext/mathematical/mathematical.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ VALUE process(VALUE self, unsigned long maxsize, const char *latex_code, unsigne
cairo_surface_t *surface;

if (format == FORMAT_SVG) {
surface = cairo_svg_surface_create_for_stream (cairoSvgSurfaceCallback, self, width_pt, height_pt);
surface = cairo_svg_surface_create_for_stream (cairoSvgSurfaceCallback, (void *)self, width_pt, height_pt);
} else if (format == FORMAT_PNG) {
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
}
Expand All @@ -146,7 +146,7 @@ VALUE process(VALUE self, unsigned long maxsize, const char *latex_code, unsigne

switch (format) {
case FORMAT_PNG:
cairo_surface_write_to_png_stream (cairo_get_target (cairo), cairoPngSurfaceCallback, self);
cairo_surface_write_to_png_stream (cairo_get_target (cairo), cairoPngSurfaceCallback, (void *)self);
break;
default:
break;
Expand Down Expand Up @@ -229,7 +229,7 @@ static VALUE MATHEMATICAL_process(VALUE self, VALUE rb_Input, VALUE rb_ParseType
args[4] = rb_iv_get(self, "@delimiter");
args[5] = rb_ParseType;

output = rb_rescue(process_helper, args, process_rescue, rb_Input);
output = rb_rescue(process_helper, (VALUE)&args[0], process_rescue, rb_Input);
break;
}
case T_ARRAY: {
Expand All @@ -253,7 +253,7 @@ static VALUE MATHEMATICAL_process(VALUE self, VALUE rb_Input, VALUE rb_ParseType
args[4] = rb_iv_get(self, "@delimiter");
args[5] = rb_ParseType;

hash = rb_rescue(process_helper, args, process_rescue, math);
hash = rb_rescue(process_helper, (VALUE)&args[0], process_rescue, math);

rb_ary_store(output, i, hash);
}
Expand All @@ -262,7 +262,7 @@ static VALUE MATHEMATICAL_process(VALUE self, VALUE rb_Input, VALUE rb_ParseType
default: {
/* should be impossible, Ruby code prevents this */
print_and_raise(rb_eTypeError, "not valid value");
output = NULL;
output = (VALUE)NULL;
break;
}
}
Expand Down

0 comments on commit c6299aa

Please sign in to comment.