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

Comparing CBOR-XS/XS.xs (file contents):
Revision 1.42 by root, Tue Dec 10 15:31:40 2013 UTC vs.
Revision 1.44 by root, Tue Feb 18 22:12:12 2014 UTC

7#include <stdlib.h> 7#include <stdlib.h>
8#include <stdio.h> 8#include <stdio.h>
9#include <limits.h> 9#include <limits.h>
10#include <float.h> 10#include <float.h>
11 11
12#define ECB_NO_THREADS 1
12#include "ecb.h" 13#include "ecb.h"
13 14
14// compatibility with perl <5.18 15// compatibility with perl <5.18
15#ifndef HvNAMELEN_get 16#ifndef HvNAMELEN_get
16# define HvNAMELEN_get(hv) strlen (HvNAME (hv)) 17# define HvNAMELEN_get(hv) strlen (HvNAME (hv))
736{ 737{
737 // for speed reasons, we specialcase single-string 738 // for speed reasons, we specialcase single-string
738 // byte or utf-8 strings as keys, but only when !stringref 739 // byte or utf-8 strings as keys, but only when !stringref
739 740
740 if (ecb_expect_true (!dec->stringref)) 741 if (ecb_expect_true (!dec->stringref))
741 if (ecb_expect_true ((*dec->cur - MAJOR_BYTES) <= LENGTH_EXT8)) 742 if (ecb_expect_true ((U8)(*dec->cur - MAJOR_BYTES) <= LENGTH_EXT8))
742 { 743 {
743 I32 len = decode_uint (dec); 744 I32 len = decode_uint (dec);
744 char *key = (char *)dec->cur; 745 char *key = (char *)dec->cur;
745 746
746 dec->cur += len; 747 dec->cur += len;
747 748
748 hv_store (hv, key, len, decode_sv (dec), 0); 749 hv_store (hv, key, len, decode_sv (dec), 0);
749 750
750 return; 751 return;
751 } 752 }
752 else if (ecb_expect_true ((*dec->cur - MAJOR_TEXT) <= LENGTH_EXT8)) 753 else if (ecb_expect_true ((U8)(*dec->cur - MAJOR_TEXT) <= LENGTH_EXT8))
753 { 754 {
754 I32 len = decode_uint (dec); 755 I32 len = decode_uint (dec);
755 char *key = (char *)dec->cur; 756 char *key = (char *)dec->cur;
756 757
757 dec->cur += len; 758 dec->cur += len;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines