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.27 by root, Mon Apr 9 05:09:57 2007 UTC vs.
Revision 1.28 by root, Wed Apr 11 12:23:02 2007 UTC

31#define F_DEFAULT (9UL << S_MAXDEPTH) 31#define F_DEFAULT (9UL << S_MAXDEPTH)
32 32
33#define INIT_SIZE 32 // initial scalar size to be allocated 33#define INIT_SIZE 32 // initial scalar size to be allocated
34#define INDENT_STEP 3 // spaces per indentation level 34#define INDENT_STEP 3 // spaces per indentation level
35 35
36#define UTF8_MAX_LEN 11 // for perls UTF-X: max. number of octets per character
37#define SHORT_STRING_LEN 512 // special-case strings of up to this size 36#define SHORT_STRING_LEN 512 // special-case strings of up to this size
38 37
39#define SB do { 38#define SB do {
40#define SE } while (0) 39#define SE } while (0)
41 40
216 } 215 }
217 while (--clen); 216 while (--clen);
218 } 217 }
219 else 218 else
220 { 219 {
221 need (enc, len += UTF8_MAX_LEN - 1); // never more than 11 bytes needed 220 need (enc, len += UTF8_MAXBYTES - 1); // never more than 11 bytes needed
222 enc->cur = uvuni_to_utf8_flags (enc->cur, uch, 0); 221 enc->cur = uvuni_to_utf8_flags (enc->cur, uch, 0);
223 ++str; 222 ++str;
224 } 223 }
225 } 224 }
226 } 225 }
601 SV *sv = 0; 600 SV *sv = 0;
602 int utf8 = 0; 601 int utf8 = 0;
603 602
604 do 603 do
605 { 604 {
606 char buf [SHORT_STRING_LEN + UTF8_MAX_LEN]; 605 char buf [SHORT_STRING_LEN + UTF8_MAXBYTES];
607 char *cur = buf; 606 char *cur = buf;
608 607
609 do 608 do
610 { 609 {
611 unsigned char ch = *(unsigned char *)dec->cur++; 610 unsigned char ch = *(unsigned char *)dec->cur++;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines