ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/XS.xs
(Generate patch)

Comparing JSON-XS/XS.xs (file contents):
Revision 1.7 by root, Fri Mar 23 15:57:18 2007 UTC vs.
Revision 1.8 by root, Fri Mar 23 16:13:59 2007 UTC

317 317
318 if (fast) 318 if (fast)
319 qsort (hes, count, sizeof (HE *), he_cmp_fast); 319 qsort (hes, count, sizeof (HE *), he_cmp_fast);
320 else 320 else
321 { 321 {
322 // hack to disable "use bytes" 322 // hack to forcefully disable "use bytes"
323 COP *oldcop = PL_curcop, cop; 323 COP cop = *PL_curcop;
324 cop.op_private = 0; 324 cop.op_private = 0;
325
326 ENTER;
327 SAVETMPS;
328
329 SAVEVPTR (PL_curcop);
325 PL_curcop = &cop; 330 PL_curcop = &cop;
326 331
327 SAVETMPS;
328 qsort (hes, count, sizeof (HE *), he_cmp_slow); 332 qsort (hes, count, sizeof (HE *), he_cmp_slow);
333
329 FREETMPS; 334 FREETMPS;
330 335 LEAVE;
331 PL_curcop = oldcop;
332 } 336 }
333 337
334 for (i = 0; i < count; ++i) 338 for (i = 0; i < count; ++i)
335 { 339 {
336 INDENT; 340 INDENT;
878 { 882 {
879 IV offset = dec.flags & F_UTF8 883 IV offset = dec.flags & F_UTF8
880 ? dec.cur - SvPVX (string) 884 ? dec.cur - SvPVX (string)
881 : utf8_distance (dec.cur, SvPVX (string)); 885 : utf8_distance (dec.cur, SvPVX (string));
882 SV *uni = sv_newmortal (); 886 SV *uni = sv_newmortal ();
887
883 // horrible hack to silence warning inside pv_uni_display 888 // horrible hack to silence warning inside pv_uni_display
884 COP cop; 889 COP cop = *PL_curcop;
885 memset (&cop, 0, sizeof (cop));
886 cop.cop_warnings = pWARN_NONE; 890 cop.cop_warnings = pWARN_NONE;
891 ENTER;
887 SAVEVPTR (PL_curcop); 892 SAVEVPTR (PL_curcop);
888 PL_curcop = &cop; 893 PL_curcop = &cop;
889
890 pv_uni_display (uni, dec.cur, dec.end - dec.cur, 20, UNI_DISPLAY_QQ); 894 pv_uni_display (uni, dec.cur, dec.end - dec.cur, 20, UNI_DISPLAY_QQ);
895 LEAVE;
896
891 croak ("%s, at character offset %d (%s)", 897 croak ("%s, at character offset %d (%s)",
892 dec.err, 898 dec.err,
893 (int)offset, 899 (int)offset,
894 dec.cur != dec.end ? SvPV_nolen (uni) : "(end of string)"); 900 dec.cur != dec.end ? SvPV_nolen (uni) : "(end of string)");
895 } 901 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines