mathematical 1.6.18 → 1.6.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 273ff66b5f3f1a80c7922a10a6c11797fbf187b589e477fb88ebbe91de66911a
4
- data.tar.gz: d8f27438acfc80ae8ece3b1dec8ddcb385b9f6e1f772eb7e7e9c39676c183b8d
3
+ metadata.gz: decc78795a11a4d3e06cd094da6683f36ee449a386573b15ea7b1872d2466576
4
+ data.tar.gz: 4219a816fd4c73da3c1404611c617e71b4016b05140fa5307365898d7a375933
5
5
  SHA512:
6
- metadata.gz: a7f0b9973cbeff8512f6fabb11388e7b76b872c1eeb8f951c2c23f4b2bccdd974b6ce92f5cc0b40fdfe372aa7a31ec9153c273df4bb19cfffe144b8cd996c6b6
7
- data.tar.gz: b545fb60e6fb60fc5a06210b69c48027bb36cfa149ad1647d1d8d2701a9e54caaf8979628ba41ffec6b27afc218dd9f68034933f437aa14fac3c492cc3b98347
6
+ metadata.gz: 0a5f188613d972e700f2525ec8dc1c6193f29d171b03ce010730fe80318e4b04de49ef0f60202b562eddb0900cbac1e2bd5c367c3407b26fc944276db4288b1d
7
+ data.tar.gz: d0fb800031dce4db133c138f2536af6dd6959f193223f2ad4d1aea963eb9162cd33b8aa5695908f61954c7ec3cca63b188b4d4070d205380187d6d307195b7ae
@@ -17,7 +17,7 @@ lsm_itex_free_mathml_buffer (char *mathml)
17
17
  }
18
18
 
19
19
  char *
20
- lsm_itex_to_mathml (const char *itex, gssize size) { }
20
+ lsm_itex_to_mathml (const char *itex, gssize size) { return NULL; }
21
21
 
22
22
 
23
23
  char *
@@ -27,7 +27,7 @@ lsm_mtex_to_mathml (const char *mtex, gssize size, int delimiter, int render_typ
27
27
  char *mathml;
28
28
  int status = 0;
29
29
 
30
- if (mtex == NULL) {
30
+ if (!mtex) {
31
31
  return NULL;
32
32
  }
33
33
 
@@ -42,7 +42,7 @@ lsm_mtex_to_mathml (const char *mtex, gssize size, int delimiter, int render_typ
42
42
 
43
43
  switch (render_type) {
44
44
  case PARSE:
45
- mathml = mtex2MML_parse(mtex, usize, delimiter);
45
+ mathml = mtex2MML_global_parse(mtex, usize, delimiter, 1);
46
46
  if (mathml == NULL) {
47
47
  status = 1;
48
48
  }
@@ -60,7 +60,7 @@ lsm_mtex_to_mathml (const char *mtex, gssize size, int delimiter, int render_typ
60
60
  mathml = mtex2MML_output();
61
61
  break;
62
62
  default:
63
- mathml = mtex2MML_parse(mtex, usize, delimiter);
63
+ mathml = mtex2MML_global_parse(mtex, usize, delimiter, 1);
64
64
  if (mathml == NULL) {
65
65
  status = 1;
66
66
  }
@@ -82,9 +82,5 @@ lsm_mtex_to_mathml (const char *mtex, gssize size, int delimiter, int render_typ
82
82
  void
83
83
  lsm_mtex_free_mathml_buffer (char *mathml)
84
84
  {
85
- if (mathml == NULL) {
86
- return;
87
- }
88
-
89
85
  mtex2MML_free_string (mathml);
90
86
  }
@@ -135,7 +135,7 @@ VALUE process(VALUE self, unsigned long maxsize, const char *latex_code, unsigne
135
135
  cairo_surface_t *surface;
136
136
 
137
137
  if (format == FORMAT_SVG) {
138
- surface = cairo_svg_surface_create_for_stream (cairoSvgSurfaceCallback, self, width_pt, height_pt);
138
+ surface = cairo_svg_surface_create_for_stream (cairoSvgSurfaceCallback, (void *)self, width_pt, height_pt);
139
139
  } else if (format == FORMAT_PNG) {
140
140
  surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
141
141
  }
@@ -145,14 +145,12 @@ VALUE process(VALUE self, unsigned long maxsize, const char *latex_code, unsigne
145
145
  lsm_dom_view_render (view, cairo, 0, 0);
146
146
 
147
147
  switch (format) {
148
- case FORMAT_PNG: {
149
- cairo_surface_write_to_png_stream (cairo_get_target (cairo), cairoPngSurfaceCallback, self);
148
+ case FORMAT_PNG:
149
+ cairo_surface_write_to_png_stream (cairo_get_target (cairo), cairoPngSurfaceCallback, (void *)self);
150
150
  break;
151
- }
152
- default: {
151
+ default:
153
152
  break;
154
153
  }
155
- }
156
154
 
157
155
  cairo_destroy (cairo);
158
156
  cairo_surface_destroy (surface);
@@ -231,7 +229,7 @@ static VALUE MATHEMATICAL_process(VALUE self, VALUE rb_Input, VALUE rb_ParseType
231
229
  args[4] = rb_iv_get(self, "@delimiter");
232
230
  args[5] = rb_ParseType;
233
231
 
234
- output = rb_rescue(process_helper, args, process_rescue, rb_Input);
232
+ output = rb_rescue(process_helper, (VALUE)&args[0], process_rescue, rb_Input);
235
233
  break;
236
234
  }
237
235
  case T_ARRAY: {
@@ -255,7 +253,7 @@ static VALUE MATHEMATICAL_process(VALUE self, VALUE rb_Input, VALUE rb_ParseType
255
253
  args[4] = rb_iv_get(self, "@delimiter");
256
254
  args[5] = rb_ParseType;
257
255
 
258
- hash = rb_rescue(process_helper, args, process_rescue, math);
256
+ hash = rb_rescue(process_helper, (VALUE)&args[0], process_rescue, math);
259
257
 
260
258
  rb_ary_store(output, i, hash);
261
259
  }
@@ -264,7 +262,7 @@ static VALUE MATHEMATICAL_process(VALUE self, VALUE rb_Input, VALUE rb_ParseType
264
262
  default: {
265
263
  /* should be impossible, Ruby code prevents this */
266
264
  print_and_raise(rb_eTypeError, "not valid value");
267
- output = NULL;
265
+ output = (VALUE)NULL;
268
266
  break;
269
267
  }
270
268
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Mathematical
4
- VERSION = "1.6.18"
4
+ VERSION = "1.6.20"
5
5
  end
data/mathematical.gemspec CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ["lib", "ext"]
22
22
  spec.extensions = ["ext/mathematical/extconf.rb"]
23
23
 
24
- spec.add_dependency("ruby-enum", "~> 0.4")
24
+ spec.add_dependency("ruby-enum", ">= 0.4", "< 2.0")
25
25
 
26
26
  spec.add_development_dependency("math-to-itex", "~> 0.3")
27
27
  spec.add_development_dependency("minitest", "~> 5.6")
metadata CHANGED
@@ -1,30 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mathematical
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.18
4
+ version: 1.6.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-30 00:00:00.000000000 Z
11
+ date: 2024-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-enum
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.4'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.4'
27
- force_ruby_platform: false
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
28
33
  - !ruby/object:Gem::Dependency
29
34
  name: math-to-itex
30
35
  requirement: !ruby/object:Gem::Requirement
@@ -1309,7 +1314,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1309
1314
  - !ruby/object:Gem::Version
1310
1315
  version: '0'
1311
1316
  requirements: []
1312
- rubygems_version: 3.4.22
1317
+ rubygems_version: 3.3.7
1313
1318
  signing_key:
1314
1319
  specification_version: 4
1315
1320
  summary: Quickly convert math equations into beautiful SVGs/PNGs/MathML.