remove CAPN_COMPOSITE_LIST and add capn_len

This commit is contained in:
James McKaskill 2013-09-16 16:53:33 -04:00
parent 59f827e93d
commit ff44e4df26
6 changed files with 165 additions and 180 deletions

View file

@ -14,7 +14,6 @@ UINT_T CAT(capn_get,SZ) (LIST_T l, int off) {
switch (p.type) {
case CAPN_LIST:
case CAPN_COMPOSITE_LIST:
if (p.datasz < SZ/8)
return 0;
d = p.data + off * (p.datasz + 8*p.ptrs);
@ -42,7 +41,6 @@ int CAT(capn_getv,SZ) (LIST_T l, int off, UINT_T *to, int sz) {
switch (p.type) {
case CAPN_LIST:
case CAPN_COMPOSITE_LIST:
if (p.datasz == SZ/8 && !p.ptrs && (SZ == 8 || CAPN_LITTLE)) {
memcpy(to, p.data + off, sz * (SZ/8));
return sz;
@ -81,7 +79,6 @@ int CAT(capn_set,SZ) (LIST_T l, int off, UINT_T v) {
switch (p.type) {
case CAPN_LIST:
case CAPN_COMPOSITE_LIST:
if (p.datasz < SZ/8)
return -1;
d = p.data + off * (p.datasz + 8*p.ptrs);
@ -110,7 +107,6 @@ int CAT(capn_setv,SZ) (LIST_T l, int off, const UINT_T *from, int sz) {
switch (p.type) {
case CAPN_LIST:
case CAPN_COMPOSITE_LIST:
if (p.datasz == SZ/8 && !p.ptrs && (SZ == 8 || CAPN_LITTLE)) {
memcpy(p.data + off, from, sz * (SZ/8));
return sz;