--- CBOR-XS/XS.xs 2013/11/20 15:05:46 1.22 +++ CBOR-XS/XS.xs 2013/11/20 16:29:02 1.24 @@ -56,10 +56,10 @@ CBOR_TAG_MAGIC = 55799 // self-describe cbor }; -#define F_SHRINK 0x00000001UL -#define F_ALLOW_UNKNOWN 0x00000002UL -#define F_ALLOW_SHARING 0x00000004UL //TODO -#define F_DEDUP_STRINGS 0x00000008UL //TODO +#define F_SHRINK 0x00000001UL +#define F_ALLOW_UNKNOWN 0x00000002UL +#define F_ALLOW_SHARING 0x00000004UL //TODO +#define F_ALLOW_STRINGREF 0x00000008UL //TODO #define INIT_SIZE 32 // initial scalar size to be allocated @@ -225,7 +225,7 @@ static void encode_str (enc_t *enc, int utf8, char *str, STRLEN len) { - if (ecb_expect_false (enc->cbor.flags & F_DEDUP_STRINGS)) + if (ecb_expect_false (enc->cbor.flags & F_ALLOW_STRINGREF)) { SV **svp = hv_fetch (enc->stringref[!!utf8], str, len, 1); @@ -517,7 +517,7 @@ SvPOK_only (enc.sv); - if (cbor->flags & F_DEDUP_STRINGS) + if (cbor->flags & F_ALLOW_STRINGREF) { encode_tag (&enc, CBOR_TAG_STRINGREF_NAMESPACE); enc.stringref[0]= (HV *)sv_2mortal ((SV *)newHV ()); @@ -658,7 +658,7 @@ // for speed reasons, we specialcase single-string // byte or utf-8 strings as keys, but only when !stringref - if (expect_true (!dec->stringref)) + if (ecb_expect_true (!dec->stringref)) if (*dec->cur >= 0x40 && *dec->cur <= 0x40 + 27) { I32 len = decode_uint (dec); @@ -1106,7 +1106,7 @@ shrink = F_SHRINK allow_unknown = F_ALLOW_UNKNOWN allow_sharing = F_ALLOW_SHARING - dedup_strings = F_DEDUP_STRINGS + allow_stringref = F_ALLOW_STRINGREF PPCODE: { if (enable) @@ -1122,7 +1122,7 @@ get_shrink = F_SHRINK get_allow_unknown = F_ALLOW_UNKNOWN get_allow_sharing = F_ALLOW_SHARING - get_dedup_strings = F_DEDUP_STRINGS + get_allow_stringref = F_ALLOW_STRINGREF PPCODE: XPUSHs (boolSV (self->flags & ix));