Skip to content

Commit

Permalink
CHANGE: Disable support for Rebol values in struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jul 28, 2021
1 parent 4763277 commit 2cc8c73
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/core/m-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ static void Mark_Value(REBVAL *val, REBCNT depth);
Mark_Struct_Field(stu, (struct Struct_Field *)SERIES_SKIP(series, len), depth + 1);
}
}
#ifdef unused
else if (field->type == STRUCT_TYPE_REBVAL) {
REBCNT i;
ASSERT2(field->size == sizeof(REBVAL), RP_BAD_SIZE);
Expand All @@ -178,7 +179,7 @@ static void Mark_Value(REBVAL *val, REBCNT depth);
}
}
}

#endif
/* ignore primitive datatypes */
}

Expand Down
12 changes: 11 additions & 1 deletion src/core/t-struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ static get_scalar(REBSTU *stu,
VAL_STRUCT_LEN(val) = field->size;
}
break;
#ifdef unused
case STRUCT_TYPE_REBVAL:
memcpy(val, data, sizeof(REBVAL));
break;
#endif
default:
/* should never be here */
return FALSE;
Expand Down Expand Up @@ -437,6 +439,7 @@ static void parse_attr (REBVAL *blk, REBINT *raw_size, REBUPT *raw_addr)
}
break;
case SYM_EXTERN:
#ifdef unused
++ attr;

if (*raw_addr != 0) /* raw-memory is exclusive with extern */
Expand Down Expand Up @@ -466,6 +469,9 @@ static void parse_attr (REBVAL *blk, REBINT *raw_size, REBUPT *raw_addr)

*raw_addr = (REBUPT)addr;
}
#else
Trap0(RE_FEATURE_NA);
#endif
break;
/*
case SYM_ALIGNMENT:
Expand Down Expand Up @@ -848,7 +854,11 @@ static REBOOL parse_field_type(struct Struct_Field *field, REBVAL *spec, REBVAL
return PE_BAD_SELECT;
}

REBINT Cmp_Struct(REBVAL *s, REBVAL *t)
/***********************************************************************
**
*/ REBINT Cmp_Struct(REBVAL *s, REBVAL *t)
/*
***********************************************************************/
{
REBINT n = VAL_STRUCT_FIELDS(s) - VAL_STRUCT_FIELDS(t);
if (n != 0) {
Expand Down

0 comments on commit 2cc8c73

Please sign in to comment.