You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice that it leads one to think that these are all the same format, aside from element size. That's not the case: XT_ARRAY_BOOL includes an extra size field that needs to be written. From qap_decode.c:
case XT_ARRAY_BOOL:
{
int vl = ptoi(*(b++));
char *cb = (char*) b;
val = allocVector(LGLSXP, vl);
i = 0;
while (i < vl) {
LOGICAL(val)[i] = (cb[i] == 1) ? TRUE : ((cb[i] == 0) ? FALSE : NA_LOGICAL);
i++;
}
while ((i & 3) != 0) i++;
b = (unsigned int*) (cb + i);
}
*buf = b;
break;
/*...*/
case XT_ARRAY_DOUBLE:
l = ln / 8;
val = allocVector(REALSXP, l);
#ifdef NATIVE_COPY
memcpy(REAL(val), b, sizeof(double) * l);
b += l * 2;
#else
i = 0;
while (i < l) {
fixdcpy(REAL(val) + i, b);
b += 2;
i++;
}
#endif
*buf = b;
break;
Note the extra undocumented int vl = ptoi(*(b++)); in XT_ARRAY_BOOL.
The text was updated successfully, but these errors were encountered:
Thanks. Historically there were two versions of XT_ARRAY_BOOL - one aligned (the one you see) and one unaligned (the one described). At some point the unaligned one was replaced with the aligned one - both are described in Rsrv.h - they have in fact distinct codes. I have updated the documentation to match the current status and also fixed the XT_LIST_TAG doc bug.
Quoting http://www.rforge.net/Rserve/dev.html:
Notice that it leads one to think that these are all the same format, aside from element size. That's not the case: XT_ARRAY_BOOL includes an extra size field that needs to be written. From
qap_decode.c
:Note the extra undocumented
int vl = ptoi(*(b++));
in XT_ARRAY_BOOL.The text was updated successfully, but these errors were encountered: