Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return RFCTYPE_NUM as string to be consistent with other RFC interfac… #11

Merged
merged 1 commit into from
Sep 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/RSAP.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ void get_field_value(DATA_CONTAINER_HANDLE hcont, RFC_FIELD_DESC fieldDesc, SEXP
// set the column type
switch (fieldDesc.type) {
case RFCTYPE_FLOAT:
case RFCTYPE_NUM:
case RFCTYPE_BCD:
SET_VECTOR_ELT(value, fld, allocVector(REALSXP, 1));
break;
Expand All @@ -616,6 +615,7 @@ void get_field_value(DATA_CONTAINER_HANDLE hcont, RFC_FIELD_DESC fieldDesc, SEXP
case RFCTYPE_STRING:
case RFCTYPE_XSTRING:
case RFCTYPE_CHAR:
case RFCTYPE_NUM:
default:
SET_VECTOR_ELT(value, fld, allocVector(STRSXP, 1));
break;
Expand All @@ -626,9 +626,6 @@ void get_field_value(DATA_CONTAINER_HANDLE hcont, RFC_FIELD_DESC fieldDesc, SEXP
case RFCTYPE_FLOAT:
REAL(VECTOR_ELT(value, fld))[0] = REAL(get_float_value(hcont, fieldDesc.name))[0];
break;
case RFCTYPE_NUM:
REAL(VECTOR_ELT(value, fld))[0] = REAL(get_num_value(hcont, fieldDesc.name, fieldDesc.nucLength))[0];
break;
case RFCTYPE_BCD:
REAL(VECTOR_ELT(value, fld))[0] = REAL(get_bcd_value(hcont, fieldDesc.name))[0];
break;
Expand Down Expand Up @@ -671,6 +668,7 @@ void get_field_value(DATA_CONTAINER_HANDLE hcont, RFC_FIELD_DESC fieldDesc, SEXP
SET_STRING_ELT(VECTOR_ELT(value, fld), 0, get_xstring_value(hcont, fieldDesc.name));
break;
case RFCTYPE_CHAR:
case RFCTYPE_NUM:
default:
SET_STRING_ELT(VECTOR_ELT(value, fld), 0, get_char_value(hcont, fieldDesc.name, fieldDesc.nucLength));
break;
Expand Down Expand Up @@ -736,7 +734,6 @@ SEXP get_table_value(RFC_TABLE_HANDLE tableHandle){
// set the column type
switch (fieldDesc.type) {
case RFCTYPE_FLOAT:
case RFCTYPE_NUM:
case RFCTYPE_BCD:
SET_VECTOR_ELT(value, fld, allocVector(REALSXP, tabLen));
break;
Expand All @@ -759,6 +756,7 @@ SEXP get_table_value(RFC_TABLE_HANDLE tableHandle){
case RFCTYPE_STRING:
case RFCTYPE_XSTRING:
case RFCTYPE_CHAR:
case RFCTYPE_NUM:
default:
SET_VECTOR_ELT(value, fld, allocVector(STRSXP, tabLen));
break;
Expand Down Expand Up @@ -787,9 +785,6 @@ SEXP get_table_value(RFC_TABLE_HANDLE tableHandle){
case RFCTYPE_FLOAT:
REAL(VECTOR_ELT(value, fld))[r] = REAL(get_float_value(tableHandle, fieldDesc.name))[0];
break;
case RFCTYPE_NUM:
REAL(VECTOR_ELT(value, fld))[r] = REAL(get_num_value(tableHandle, fieldDesc.name, fieldDesc.nucLength))[0];
break;
case RFCTYPE_BCD:
REAL(VECTOR_ELT(value, fld))[r] = REAL(get_bcd_value(tableHandle, fieldDesc.name))[0];
break;
Expand Down Expand Up @@ -832,6 +827,7 @@ SEXP get_table_value(RFC_TABLE_HANDLE tableHandle){
SET_STRING_ELT(VECTOR_ELT(value, fld), r, get_xstring_value(tableHandle, fieldDesc.name));
break;
case RFCTYPE_CHAR:
case RFCTYPE_NUM:
default:
SET_STRING_ELT(VECTOR_ELT(value, fld), r, get_char_value(tableHandle, fieldDesc.name, fieldDesc.nucLength));
break;
Expand Down