berns 3.1.1 → 3.1.6

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: eceee553d37bba81c69041a8b4df52d8d108edfeb40d23005d2045c2d10af24a
4
- data.tar.gz: 176886a8d6d08a5c83624ca294ee3a62c30846dcbc359888f47f8e500fb539e5
3
+ metadata.gz: 35456041201304fa20aa55c6c0ee8b056fed532cca353b7a7c8229347e9e85e9
4
+ data.tar.gz: b8f585c668d24887a5f483654ad4a377a4e5b9274f790a1889b8f3afe0b827cb
5
5
  SHA512:
6
- metadata.gz: 433c793484d7508edd1c376aae80d881425dbf76c5713e0d6aefed09be9d0f60a40ae7aa6279259c15a56835b46c95ec095dfea91b869b137ad97069f8f99480
7
- data.tar.gz: e931debab26d70ec30977baf2abe7dd7ca43b3d4f32a2492120d409823936f93602efff0bedfb96f48688b33e11660bfd8c8ea49a071219f83ca5111458f151a
6
+ metadata.gz: 941492438079fc0fa16d906f5164eb1389fd79836dfff72ecae0fdff5983625980269312bf267128ef9118ee17cf53f5e3543b62498b471480f0d7cdb4d4810d
7
+ data.tar.gz: c9296d7ed90bb530ccc47c7b1f6dcee704e7212c4d824d7d536e87e941256bd413db77379a146c93afa3bcafab18965e327c3f1331c16d6a46374afc3e46a7b2
data/ext/berns/berns.c CHANGED
@@ -1,5 +1,4 @@
1
1
  #include "ruby.h"
2
- #include "extconf.h"
3
2
  #include "hescape.h"
4
3
 
5
4
  static const char *attr_close = "\"";
@@ -47,11 +46,12 @@ static const size_t sllen = 1;
47
46
  * Macro to define a "dynamic" function that generates a void element.
48
47
  */
49
48
  #define VOID_ELEMENT(element_name) \
50
- static VALUE external_##element_name##_element(int argc, VALUE* argv, RB_UNUSED_VAR(VALUE self)) { \
49
+ static VALUE external_##element_name##_element(int argc, VALUE *argv, RB_UNUSED_VAR(VALUE self)) { \
51
50
  rb_check_arity(argc, 0, 1); \
52
51
  \
53
- char *tag = #element_name; \
54
- char *string = void_element(tag, strlen(tag), &argv[0]); \
52
+ VALUE attrs = argv[0]; \
53
+ const char *tag = #element_name; \
54
+ char *string = void_element(tag, strlen(tag), attrs); \
55
55
  VALUE rstring = rb_utf8_str_new_cstr(string); \
56
56
  free(string); \
57
57
  \
@@ -62,12 +62,13 @@ static const size_t sllen = 1;
62
62
  * Macro to define a "dynamic" function that generates a standard element.
63
63
  */
64
64
  #define STANDARD_ELEMENT(element_name) \
65
- static VALUE external_##element_name##_element(int argc, VALUE* argv, RB_UNUSED_VAR(VALUE self)) { \
65
+ static VALUE external_##element_name##_element(int argc, VALUE *argv, RB_UNUSED_VAR(VALUE self)) { \
66
66
  rb_check_arity(argc, 0, 1); \
67
67
  \
68
68
  CONTENT_FROM_BLOCK; \
69
- char *tag = #element_name; \
70
- char *string = element(tag, strlen(tag), RSTRING_PTR(content), RSTRING_LEN(content), &argv[0]); \
69
+ VALUE attrs = argv[0]; \
70
+ const char *tag = #element_name; \
71
+ char *string = element(tag, strlen(tag), RSTRING_PTR(content), RSTRING_LEN(content), attrs); \
71
72
  VALUE rstring = rb_utf8_str_new_cstr(string); \
72
73
  free(string); \
73
74
  \
@@ -78,12 +79,16 @@ static const size_t sllen = 1;
78
79
  /*
79
80
  * "Safe strcpy" - https://twitter.com/hyc_symas/status/1102573036534972416?s=12
80
81
  */
81
- static char *stecpy(char *destination, const char *source, const char *end) {
82
+ static char * stecpy(char *destination, const char *source, const char *end) {
83
+ if (end) {
84
+ end--;
85
+ }
86
+
82
87
  while (*source && destination < end) {
83
88
  *destination++ = *source++;
84
89
  }
85
90
 
86
- if (destination < end) {
91
+ if (destination) {
87
92
  *destination = '\0';
88
93
  }
89
94
 
@@ -123,7 +128,6 @@ static VALUE external_escape_html(const VALUE self, VALUE string) {
123
128
  static char * empty_value_to_attribute(const char *attr, const size_t attrlen) {
124
129
  size_t total_size = attrlen + 1;
125
130
  char *dest = malloc(total_size);
126
- char *ptr = NULL;
127
131
  char *end = dest + total_size;
128
132
 
129
133
  stecpy(dest, attr, end);
@@ -140,7 +144,6 @@ static char * string_value_to_attribute(const char *attr, const size_t attrlen,
140
144
  if (vallen == 0) {
141
145
  size_t total_size = attrlen + 1;
142
146
  char *dest = malloc(total_size);
143
- char *ptr = NULL;
144
147
  char *end = dest + total_size;
145
148
 
146
149
  stecpy(dest, attr, end);
@@ -168,21 +171,21 @@ static char * string_value_to_attribute(const char *attr, const size_t attrlen,
168
171
  }
169
172
  }
170
173
 
171
- static char * hash_value_to_attribute(char *attr, const size_t attrlen, VALUE *value) {
172
- if (TYPE(*value) == T_IMEMO) {
173
- return calloc(0, 1);
174
+ static char * hash_value_to_attribute(const char *attr, const size_t attrlen, VALUE value) {
175
+ if (TYPE(value) == T_IMEMO) {
176
+ return strdup("");
174
177
  }
175
178
 
176
- Check_Type(*value, T_HASH);
179
+ Check_Type(value, T_HASH);
177
180
 
178
- if (rb_hash_size(*value) == 1 ) {
179
- return calloc(0, 1);
181
+ if (rb_hash_size(value) == 1) {
182
+ return strdup("");
180
183
  }
181
184
 
182
185
  VALUE subkey;
183
186
  VALUE subvalue;
184
187
 
185
- const VALUE keys = rb_funcall(*value, rb_intern("keys"), 0);
188
+ const VALUE keys = rb_funcall(value, rb_intern("keys"), 0);
186
189
  const VALUE length = RARRAY_LEN(keys);
187
190
 
188
191
  size_t allocated = 256;
@@ -194,7 +197,7 @@ static char * hash_value_to_attribute(char *attr, const size_t attrlen, VALUE *v
194
197
 
195
198
  for (unsigned int i = 0; i < length; i++) {
196
199
  subkey = rb_ary_entry(keys, i);
197
- subvalue = rb_hash_aref(*value, subkey);
200
+ subvalue = rb_hash_aref(value, subkey);
198
201
 
199
202
  switch(TYPE(subkey)) {
200
203
  case T_STRING:
@@ -211,7 +214,7 @@ static char * hash_value_to_attribute(char *attr, const size_t attrlen, VALUE *v
211
214
  break;
212
215
  }
213
216
 
214
- size_t subattr_len = attrlen + 1;
217
+ size_t subattr_len = attrlen;
215
218
  size_t subkey_len = RSTRING_LEN(subkey);
216
219
 
217
220
  if (attrlen > 0 && subkey_len > 0) {
@@ -222,29 +225,31 @@ static char * hash_value_to_attribute(char *attr, const size_t attrlen, VALUE *v
222
225
  subattr_len += subkey_len;
223
226
  }
224
227
 
225
- char subattr[subattr_len];
228
+ char subattr[subattr_len + 1];
226
229
  char *ptr = subattr;
227
- char *end = subattr + sizeof(subattr);
230
+ char *subend = subattr + subattr_len + 1;
228
231
 
229
232
  if (attrlen > 0) {
230
- ptr = stecpy(ptr, attr, end);
233
+ ptr = stecpy(ptr, attr, subend);
231
234
  }
232
235
 
233
236
  if (attrlen > 0 && subkey_len > 0) {
234
- ptr = stecpy(ptr, dash, end);
237
+ ptr = stecpy(ptr, dash, subend);
235
238
  }
236
239
 
237
- stecpy(ptr, RSTRING_PTR(subkey), end);
240
+ stecpy(ptr, RSTRING_PTR(subkey), subend);
238
241
 
239
242
  char *combined;
240
243
 
241
244
  switch(TYPE(subvalue)) {
242
245
  case T_FALSE:
243
- combined = calloc(0, 1);
246
+ combined = strdup("");
244
247
  break;
245
248
 
249
+ case T_NIL:
250
+ /* Fall through. */
246
251
  case T_TRUE:
247
- combined = string_value_to_attribute(subattr, subattr_len, "", 0);
252
+ combined = empty_value_to_attribute(subattr, subattr_len);
248
253
  break;
249
254
 
250
255
  case T_STRING:
@@ -256,13 +261,8 @@ static char * hash_value_to_attribute(char *attr, const size_t attrlen, VALUE *v
256
261
  combined = string_value_to_attribute(subattr, subattr_len, RSTRING_PTR(subvalue), RSTRING_LEN(subvalue));
257
262
  break;
258
263
 
259
- case T_NIL:
260
- subvalue = rb_utf8_str_new_cstr("");
261
- combined = string_value_to_attribute(subattr, subattr_len, RSTRING_PTR(subvalue), RSTRING_LEN(subvalue));
262
- break;
263
-
264
264
  case T_HASH:
265
- combined = hash_value_to_attribute(subattr, subattr_len, &subvalue);
265
+ combined = hash_value_to_attribute(subattr, subattr_len, subvalue);
266
266
  break;
267
267
 
268
268
  default:
@@ -272,7 +272,7 @@ static char * hash_value_to_attribute(char *attr, const size_t attrlen, VALUE *v
272
272
  }
273
273
 
274
274
  size_t combined_len = strlen(combined);
275
- size_t size_to_append = combined_len;
275
+ size_t size_to_append = combined_len + 1;
276
276
 
277
277
  if (i > 0) {
278
278
  size_to_append += splen;
@@ -313,7 +313,7 @@ static char * hash_value_to_attribute(char *attr, const size_t attrlen, VALUE *v
313
313
  /*
314
314
  * Convert an attribute name and value into a string.
315
315
  */
316
- static char * to_attribute(VALUE attr, VALUE *value) {
316
+ static char * to_attribute(VALUE attr, VALUE value) {
317
317
  switch(TYPE(attr)) {
318
318
  case T_SYMBOL:
319
319
  attr = rb_sym2str(attr);
@@ -327,26 +327,27 @@ static char * to_attribute(VALUE attr, VALUE *value) {
327
327
  char *val = NULL;
328
328
  VALUE str;
329
329
 
330
- switch(TYPE(*value)) {
330
+ switch(TYPE(value)) {
331
331
  case T_NIL:
332
+ /* Fall through. */
332
333
  case T_TRUE:
333
334
  val = empty_value_to_attribute(RSTRING_PTR(attr), RSTRING_LEN(attr));
334
335
  break;
335
336
  case T_FALSE:
336
- val = calloc(0, 1);
337
+ val = strdup("");
337
338
  break;
338
339
  case T_HASH:
339
340
  val = hash_value_to_attribute(RSTRING_PTR(attr), RSTRING_LEN(attr), value);
340
341
  break;
341
342
  case T_STRING:
342
- val = string_value_to_attribute(RSTRING_PTR(attr), RSTRING_LEN(attr), RSTRING_PTR(*value), RSTRING_LEN(*value));
343
+ val = string_value_to_attribute(RSTRING_PTR(attr), RSTRING_LEN(attr), RSTRING_PTR(value), RSTRING_LEN(value));
343
344
  break;
344
345
  case T_SYMBOL:
345
- str = rb_sym2str(*value);
346
+ str = rb_sym2str(value);
346
347
  val = string_value_to_attribute(RSTRING_PTR(attr), RSTRING_LEN(attr), RSTRING_PTR(str), RSTRING_LEN(str));
347
348
  break;
348
349
  default:
349
- str = rb_funcall(*value, rb_intern("to_s"), 0);
350
+ str = rb_funcall(value, rb_intern("to_s"), 0);
350
351
  val = string_value_to_attribute(RSTRING_PTR(attr), RSTRING_LEN(attr), RSTRING_PTR(str), RSTRING_LEN(str));
351
352
  break;
352
353
  }
@@ -372,7 +373,7 @@ static VALUE external_to_attribute(RB_UNUSED_VAR(VALUE self), VALUE attr, VALUE
372
373
 
373
374
  StringValue(attr);
374
375
 
375
- char *val = to_attribute(attr, &value);
376
+ char *val = to_attribute(attr, value);
376
377
  VALUE rstring = rb_utf8_str_new_cstr(val);
377
378
  free(val);
378
379
 
@@ -392,8 +393,8 @@ static VALUE external_to_attributes(RB_UNUSED_VAR(VALUE self), VALUE attributes)
392
393
  return rb_utf8_str_new_cstr("");
393
394
  }
394
395
 
395
- char *empty = "";
396
- char *attrs = hash_value_to_attribute(empty, 0, &attributes);
396
+ const char *empty = "";
397
+ char *attrs = hash_value_to_attribute(empty, 0, attributes);
397
398
 
398
399
  VALUE rstring = rb_utf8_str_new_cstr(attrs);
399
400
  free(attrs);
@@ -401,9 +402,9 @@ static VALUE external_to_attributes(RB_UNUSED_VAR(VALUE self), VALUE attributes)
401
402
  return rstring;
402
403
  }
403
404
 
404
- static char * void_element(char *tag, size_t tlen, VALUE *attributes) {
405
+ static char * void_element(const char *tag, size_t tlen, VALUE attributes) {
405
406
  /* T_IMEMO is what we get if an optional argument was not passed. */
406
- if (TYPE(*attributes) == T_IMEMO) {
407
+ if (TYPE(attributes) == T_IMEMO) {
407
408
  size_t total = tag_olen + tlen + tag_clen + 1;
408
409
  char *string = malloc(total);
409
410
  char *ptr;
@@ -415,7 +416,7 @@ static char * void_element(char *tag, size_t tlen, VALUE *attributes) {
415
416
 
416
417
  return string;
417
418
  } else {
418
- char *empty = "";
419
+ const char *empty = "";
419
420
  char *attrs = hash_value_to_attribute(empty, 0, attributes);
420
421
 
421
422
  size_t total = tag_olen + tlen + splen + strlen(attrs) + tag_clen + 1;
@@ -454,7 +455,7 @@ static VALUE external_void_element(int argc, VALUE *arguments, RB_UNUSED_VAR(VAL
454
455
 
455
456
  StringValue(tag);
456
457
 
457
- char *string = void_element(RSTRING_PTR(tag), RSTRING_LEN(tag), &attributes);
458
+ char *string = void_element(RSTRING_PTR(tag), RSTRING_LEN(tag), attributes);
458
459
  VALUE rstring = rb_utf8_str_new_cstr(string);
459
460
 
460
461
  free(string);
@@ -462,8 +463,8 @@ static VALUE external_void_element(int argc, VALUE *arguments, RB_UNUSED_VAR(VAL
462
463
  return rstring;
463
464
  }
464
465
 
465
- static char * element(char *tag, size_t tlen, char *content, size_t conlen, VALUE *attributes) {
466
- char *empty = "";
466
+ static char * element(const char *tag, size_t tlen, char *content, size_t conlen, VALUE attributes) {
467
+ const char *empty = "";
467
468
  char *attrs = hash_value_to_attribute(empty, 0, attributes);
468
469
  size_t alen = strlen(attrs);
469
470
 
@@ -529,123 +530,123 @@ static VALUE external_element(int argc, VALUE *arguments, RB_UNUSED_VAR(VALUE se
529
530
 
530
531
  CONTENT_FROM_BLOCK;
531
532
 
532
- char *string = element(RSTRING_PTR(tag), RSTRING_LEN(tag), RSTRING_PTR(content), RSTRING_LEN(content), &attributes);
533
+ char *string = element(RSTRING_PTR(tag), RSTRING_LEN(tag), RSTRING_PTR(content), RSTRING_LEN(content), attributes);
533
534
  VALUE rstring = rb_utf8_str_new_cstr(string);
534
535
  free(string);
535
536
 
536
537
  return rstring;
537
538
  }
538
539
 
539
- VOID_ELEMENT(area);
540
- VOID_ELEMENT(base);
541
- VOID_ELEMENT(br);
542
- VOID_ELEMENT(col);
543
- VOID_ELEMENT(embed);
544
- VOID_ELEMENT(hr);
545
- VOID_ELEMENT(img);
546
- VOID_ELEMENT(input);
547
- VOID_ELEMENT(link);
548
- VOID_ELEMENT(menuitem);
549
- VOID_ELEMENT(meta);
550
- VOID_ELEMENT(param);
551
- VOID_ELEMENT(source);
552
- VOID_ELEMENT(track);
553
- VOID_ELEMENT(wbr);
554
-
555
- STANDARD_ELEMENT(a);
556
- STANDARD_ELEMENT(abbr);
557
- STANDARD_ELEMENT(address);
558
- STANDARD_ELEMENT(article);
559
- STANDARD_ELEMENT(aside);
560
- STANDARD_ELEMENT(audio);
561
- STANDARD_ELEMENT(b);
562
- STANDARD_ELEMENT(bdi);
563
- STANDARD_ELEMENT(bdo);
564
- STANDARD_ELEMENT(blockquote);
565
- STANDARD_ELEMENT(body);
566
- STANDARD_ELEMENT(button);
567
- STANDARD_ELEMENT(canvas);
568
- STANDARD_ELEMENT(caption);
569
- STANDARD_ELEMENT(cite);
570
- STANDARD_ELEMENT(code);
571
- STANDARD_ELEMENT(colgroup);
572
- STANDARD_ELEMENT(datalist);
573
- STANDARD_ELEMENT(dd);
574
- STANDARD_ELEMENT(del);
575
- STANDARD_ELEMENT(details);
576
- STANDARD_ELEMENT(dfn);
577
- STANDARD_ELEMENT(dialog);
578
- STANDARD_ELEMENT(div);
579
- STANDARD_ELEMENT(dl);
580
- STANDARD_ELEMENT(dt);
581
- STANDARD_ELEMENT(em);
582
- STANDARD_ELEMENT(fieldset);
583
- STANDARD_ELEMENT(figcaption);
584
- STANDARD_ELEMENT(figure);
585
- STANDARD_ELEMENT(footer);
586
- STANDARD_ELEMENT(form);
587
- STANDARD_ELEMENT(h1);
588
- STANDARD_ELEMENT(h2);
589
- STANDARD_ELEMENT(h3);
590
- STANDARD_ELEMENT(h4);
591
- STANDARD_ELEMENT(h5);
592
- STANDARD_ELEMENT(h6);
593
- STANDARD_ELEMENT(head);
594
- STANDARD_ELEMENT(header);
595
- STANDARD_ELEMENT(html);
596
- STANDARD_ELEMENT(i);
597
- STANDARD_ELEMENT(iframe);
598
- STANDARD_ELEMENT(ins);
599
- STANDARD_ELEMENT(kbd);
600
- STANDARD_ELEMENT(label);
601
- STANDARD_ELEMENT(legend);
602
- STANDARD_ELEMENT(li);
603
- STANDARD_ELEMENT(main);
604
- STANDARD_ELEMENT(map);
605
- STANDARD_ELEMENT(mark);
606
- STANDARD_ELEMENT(menu);
607
- STANDARD_ELEMENT(meter);
608
- STANDARD_ELEMENT(nav);
609
- STANDARD_ELEMENT(noscript);
610
- STANDARD_ELEMENT(object);
611
- STANDARD_ELEMENT(ol);
612
- STANDARD_ELEMENT(optgroup);
613
- STANDARD_ELEMENT(option);
614
- STANDARD_ELEMENT(output);
615
- STANDARD_ELEMENT(p);
616
- STANDARD_ELEMENT(picture);
617
- STANDARD_ELEMENT(pre);
618
- STANDARD_ELEMENT(progress);
619
- STANDARD_ELEMENT(q);
620
- STANDARD_ELEMENT(rp);
621
- STANDARD_ELEMENT(rt);
622
- STANDARD_ELEMENT(ruby);
623
- STANDARD_ELEMENT(s);
624
- STANDARD_ELEMENT(samp);
625
- STANDARD_ELEMENT(script);
626
- STANDARD_ELEMENT(section);
627
- STANDARD_ELEMENT(select);
628
- STANDARD_ELEMENT(small);
629
- STANDARD_ELEMENT(span);
630
- STANDARD_ELEMENT(strong);
631
- STANDARD_ELEMENT(style);
632
- STANDARD_ELEMENT(sub);
633
- STANDARD_ELEMENT(summary);
634
- STANDARD_ELEMENT(table);
635
- STANDARD_ELEMENT(tbody);
636
- STANDARD_ELEMENT(td);
637
- STANDARD_ELEMENT(template);
638
- STANDARD_ELEMENT(textarea);
639
- STANDARD_ELEMENT(tfoot);
640
- STANDARD_ELEMENT(th);
641
- STANDARD_ELEMENT(thead);
642
- STANDARD_ELEMENT(time);
643
- STANDARD_ELEMENT(title);
644
- STANDARD_ELEMENT(tr);
645
- STANDARD_ELEMENT(u);
646
- STANDARD_ELEMENT(ul);
647
- STANDARD_ELEMENT(var);
648
- STANDARD_ELEMENT(video);
540
+ VOID_ELEMENT(area)
541
+ VOID_ELEMENT(base)
542
+ VOID_ELEMENT(br)
543
+ VOID_ELEMENT(col)
544
+ VOID_ELEMENT(embed)
545
+ VOID_ELEMENT(hr)
546
+ VOID_ELEMENT(img)
547
+ VOID_ELEMENT(input)
548
+ VOID_ELEMENT(link)
549
+ VOID_ELEMENT(menuitem)
550
+ VOID_ELEMENT(meta)
551
+ VOID_ELEMENT(param)
552
+ VOID_ELEMENT(source)
553
+ VOID_ELEMENT(track)
554
+ VOID_ELEMENT(wbr)
555
+
556
+ STANDARD_ELEMENT(a)
557
+ STANDARD_ELEMENT(abbr)
558
+ STANDARD_ELEMENT(address)
559
+ STANDARD_ELEMENT(article)
560
+ STANDARD_ELEMENT(aside)
561
+ STANDARD_ELEMENT(audio)
562
+ STANDARD_ELEMENT(b)
563
+ STANDARD_ELEMENT(bdi)
564
+ STANDARD_ELEMENT(bdo)
565
+ STANDARD_ELEMENT(blockquote)
566
+ STANDARD_ELEMENT(body)
567
+ STANDARD_ELEMENT(button)
568
+ STANDARD_ELEMENT(canvas)
569
+ STANDARD_ELEMENT(caption)
570
+ STANDARD_ELEMENT(cite)
571
+ STANDARD_ELEMENT(code)
572
+ STANDARD_ELEMENT(colgroup)
573
+ STANDARD_ELEMENT(datalist)
574
+ STANDARD_ELEMENT(dd)
575
+ STANDARD_ELEMENT(del)
576
+ STANDARD_ELEMENT(details)
577
+ STANDARD_ELEMENT(dfn)
578
+ STANDARD_ELEMENT(dialog)
579
+ STANDARD_ELEMENT(div)
580
+ STANDARD_ELEMENT(dl)
581
+ STANDARD_ELEMENT(dt)
582
+ STANDARD_ELEMENT(em)
583
+ STANDARD_ELEMENT(fieldset)
584
+ STANDARD_ELEMENT(figcaption)
585
+ STANDARD_ELEMENT(figure)
586
+ STANDARD_ELEMENT(footer)
587
+ STANDARD_ELEMENT(form)
588
+ STANDARD_ELEMENT(h1)
589
+ STANDARD_ELEMENT(h2)
590
+ STANDARD_ELEMENT(h3)
591
+ STANDARD_ELEMENT(h4)
592
+ STANDARD_ELEMENT(h5)
593
+ STANDARD_ELEMENT(h6)
594
+ STANDARD_ELEMENT(head)
595
+ STANDARD_ELEMENT(header)
596
+ STANDARD_ELEMENT(html)
597
+ STANDARD_ELEMENT(i)
598
+ STANDARD_ELEMENT(iframe)
599
+ STANDARD_ELEMENT(ins)
600
+ STANDARD_ELEMENT(kbd)
601
+ STANDARD_ELEMENT(label)
602
+ STANDARD_ELEMENT(legend)
603
+ STANDARD_ELEMENT(li)
604
+ STANDARD_ELEMENT(main)
605
+ STANDARD_ELEMENT(map)
606
+ STANDARD_ELEMENT(mark)
607
+ STANDARD_ELEMENT(menu)
608
+ STANDARD_ELEMENT(meter)
609
+ STANDARD_ELEMENT(nav)
610
+ STANDARD_ELEMENT(noscript)
611
+ STANDARD_ELEMENT(object)
612
+ STANDARD_ELEMENT(ol)
613
+ STANDARD_ELEMENT(optgroup)
614
+ STANDARD_ELEMENT(option)
615
+ STANDARD_ELEMENT(output)
616
+ STANDARD_ELEMENT(p)
617
+ STANDARD_ELEMENT(picture)
618
+ STANDARD_ELEMENT(pre)
619
+ STANDARD_ELEMENT(progress)
620
+ STANDARD_ELEMENT(q)
621
+ STANDARD_ELEMENT(rp)
622
+ STANDARD_ELEMENT(rt)
623
+ STANDARD_ELEMENT(ruby)
624
+ STANDARD_ELEMENT(s)
625
+ STANDARD_ELEMENT(samp)
626
+ STANDARD_ELEMENT(script)
627
+ STANDARD_ELEMENT(section)
628
+ STANDARD_ELEMENT(select)
629
+ STANDARD_ELEMENT(small)
630
+ STANDARD_ELEMENT(span)
631
+ STANDARD_ELEMENT(strong)
632
+ STANDARD_ELEMENT(style)
633
+ STANDARD_ELEMENT(sub)
634
+ STANDARD_ELEMENT(summary)
635
+ STANDARD_ELEMENT(table)
636
+ STANDARD_ELEMENT(tbody)
637
+ STANDARD_ELEMENT(td)
638
+ STANDARD_ELEMENT(template)
639
+ STANDARD_ELEMENT(textarea)
640
+ STANDARD_ELEMENT(tfoot)
641
+ STANDARD_ELEMENT(th)
642
+ STANDARD_ELEMENT(thead)
643
+ STANDARD_ELEMENT(time)
644
+ STANDARD_ELEMENT(title)
645
+ STANDARD_ELEMENT(tr)
646
+ STANDARD_ELEMENT(u)
647
+ STANDARD_ELEMENT(ul)
648
+ STANDARD_ELEMENT(var)
649
+ STANDARD_ELEMENT(video)
649
650
 
650
651
  void Init_berns() {
651
652
  VALUE Berns = rb_define_module("Berns");
data/ext/berns/extconf.rb CHANGED
@@ -1,8 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
  require 'mkmf'
3
3
 
4
- $CFLAGS = '-O3 -msse4' # rubocop:disable Style/GlobalVars
4
+ dir_config 'berns'
5
+
6
+ append_cflags '-O3'
7
+ append_cflags '-Wshadow'
8
+ append_cflags '-Wstrict-overflow'
9
+ append_cflags '-flto'
10
+ append_cflags '-fno-strict-aliasing'
11
+ append_cflags '-msse4'
12
+ append_cflags '-std=c99'
5
13
 
6
- dir_config('berns')
7
- create_header
8
14
  create_makefile 'berns/berns'
data/lib/berns/berns.so CHANGED
Binary file
data/lib/berns/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Berns
3
- VERSION = '3.1.1'
3
+ VERSION = '3.1.6'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berns
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Beck
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-05-10 00:00:00.000000000 Z
12
+ date: 2021-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: benchmark-ips