Skip to content

Commit

Permalink
Use the right member of union arguments so that everything typechecks
Browse files Browse the repository at this point in the history
  • Loading branch information
pdewacht committed Jan 23, 2016
1 parent 773dba6 commit b9748cb
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions builtInFunctions.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,9 +948,9 @@ symbolDefineBIF(parameterList, kindOfFixup)
return(makeFailureValue());
} else {
syntheticDefineStatement = buildDefineStatement(stringValue->
value, parameterList->theOperand);
value, parameterList->theOperand.expressionUnion);
}
assembleDefineStatement(syntheticDefineStatement->statementBody);
assembleDefineStatement(syntheticDefineStatement->statementBody.defineUnion);
freeStatement(syntheticDefineStatement);
return(makeBooleanValue(TRUE));
}
Expand Down
24 changes: 12 additions & 12 deletions debugPrintSD_6502.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ printOperand(operand)
switch (operand->kindOfOperand) {

case EXPRESSION_OPND:
printExpression(operand->theOperand);
printExpression(operand->theOperand.expressionUnion);
break;

case IMMEDIATE_OPND:
printExpression(operand->theOperand);
printExpression(operand->theOperand.immediateUnion);
break;

case INDIRECT_OPND:
printExpression(operand->theOperand);
printExpression(operand->theOperand.indirectUnion);
break;

case A_REGISTER_OPND:
Expand All @@ -225,39 +225,39 @@ printOperand(operand)
break;

case POST_INDEXED_Y_OPND:
printExpression(operand->theOperand);
printExpression(operand->theOperand.postIndexedYUnion);
break;

case PRE_INDEXED_X_OPND:
printExpression(operand->theOperand);
printExpression(operand->theOperand.preIndexedXUnion);
break;

case X_INDEXED_OPND:
printExpression(operand->theOperand);
printExpression(operand->theOperand.xIndexedUnion);
break;

case Y_INDEXED_OPND:
printExpression(operand->theOperand);
printExpression(operand->theOperand.yIndexedUnion);
break;

case X_SELECTED_OPND:
printIdentifierList(operand->theOperand);
printIdentifierList(operand->theOperand.xSelectedUnion);
break;

case Y_SELECTED_OPND:
printIdentifierList(operand->theOperand);
printIdentifierList(operand->theOperand.ySelectedUnion);
break;

case PRE_SELECTED_X_OPND:
printIdentifierList(operand->theOperand);
printIdentifierList(operand->theOperand.preSelectedUnion);
break;

case STRING_OPND:
tab(); printf("(string: \"%s\")\n", operand->theOperand);
tab(); printf("(string: \"%s\")\n", operand->theOperand.stringUnion);
break;

case BLOCK_OPND:
printBlock(operand->theOperand);
printBlock(operand->theOperand.blockUnion);
break;

default:
Expand Down
8 changes: 4 additions & 4 deletions encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ encodeOperand(operand)
case PRE_INDEXED_X_OPND:
case X_INDEXED_OPND:
case Y_INDEXED_OPND:
return(encodeExpression(operand->theOperand));
return(encodeExpression(operand->theOperand.expressionUnion));

case A_REGISTER_OPND:
case X_REGISTER_OPND:
Expand All @@ -294,7 +294,7 @@ encodeOperand(operand)
return(FALSE);

case STRING_OPND:
return(encodeString(operand->theOperand));
return(encodeString(operand->theOperand.stringUnion));

case BLOCK_OPND:
error(BLOCK_OPERAND_IN_OBJECT_EXPRESSION_ERROR);
Expand Down Expand Up @@ -534,7 +534,7 @@ encodeMifStatement(mifStatement)
encodeByte(MIF_TAG) &&
encodeExpression(mifStatement->mifCondition) &&
encodeBlock(mifStatement->mifConsequence) &&
encodeBlock(mifStatement->mifContinuation)
encodeBlock(mifStatement->mifContinuation.mifBlockUnion)
);
}

Expand Down Expand Up @@ -637,7 +637,7 @@ encodeStatement(statement)
return(encodeFreturnStatement(statement->statementBody.freturnUnion));

case GROUP_STATEMENT:
return(encodeBlock(statement->statementBody));
return(encodeBlock(statement->statementBody.groupUnion));

case MDEFINE_STATEMENT:
return(encodeMdefineStatement(statement->statementBody.defineUnion));
Expand Down
20 changes: 10 additions & 10 deletions operandStuffSD_6502.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ duplicateOperandForFixup(operand, isSpecialFunctionOperand)
case X_INDEXED_OPND:
case Y_INDEXED_OPND:
result->theOperand.expressionUnion =
duplicateExpressionForFixup(operand->theOperand,
duplicateExpressionForFixup(operand->theOperand.expressionUnion,
FALSE, isSpecialFunctionOperand);
break;
case X_SELECTED_OPND:
case Y_SELECTED_OPND:
case PRE_SELECTED_X_OPND:
result->theOperand.expressionUnion =
duplicateExpressionForFixup(operand->theOperand,
duplicateExpressionForFixup(operand->theOperand.xSelectedUnion,
FALSE, isSpecialFunctionOperand);
break;
case A_REGISTER_OPND:
Expand Down Expand Up @@ -195,7 +195,7 @@ freeOperand(operand)
case PRE_INDEXED_X_OPND:
case X_INDEXED_OPND:
case Y_INDEXED_OPND:
freeExpression(operand->theOperand);
freeExpression(operand->theOperand.expressionUnion);
break;

case A_REGISTER_OPND:
Expand All @@ -206,15 +206,15 @@ freeOperand(operand)
case X_SELECTED_OPND:
case Y_SELECTED_OPND:
case PRE_SELECTED_X_OPND:
freeSelectionList(operand->theOperand);
freeSelectionList(operand->theOperand.xSelectedUnion);
break;

case STRING_OPND:
freeString(operand->theOperand);
freeString(operand->theOperand.stringUnion);
break;

case BLOCK_OPND:
freeBlock(operand->theOperand);
freeBlock(operand->theOperand.blockUnion);
break;

default:
Expand Down Expand Up @@ -302,7 +302,7 @@ evaluateOperand(operand)
case PRE_INDEXED_X_OPND:
case X_INDEXED_OPND:
case Y_INDEXED_OPND:
result = evaluateExpression(operand->theOperand,
result = evaluateExpression(operand->theOperand.expressionUnion,
performingFixups ? NO_FIXUP : OPERAND_FIXUP);
if (operand->kindOfOperand != EXPRESSION_OPND) {
if (result->addressMode != EXPRESSION_OPND) {
Expand All @@ -324,7 +324,7 @@ evaluateOperand(operand)
case X_SELECTED_OPND:
case Y_SELECTED_OPND:
case PRE_SELECTED_X_OPND:
result = evaluateSelectionList(operand->theOperand);
result = evaluateSelectionList(operand->theOperand.xSelectedUnion);
if (result->addressMode != EXPRESSION_OPND) {
error(BAD_ADDRESS_MODE_ERROR);
result->kindOfValue = FAIL;
Expand All @@ -334,15 +334,15 @@ evaluateOperand(operand)
break;

case STRING_OPND:
result = newValue(STRING_VALUE, operand->theOperand,
result = newValue(STRING_VALUE, operand->theOperand.stringUnion,
STRING_OPND);
break;

case BLOCK_OPND:
if (standaloneExpansionFlag)
forceExpansion();
sideEffectFlag = TRUE;
assembleBlock(operand->theOperand);
assembleBlock(operand->theOperand.blockUnion);
expansionOn();
result = newValue(FAIL, 0, BLOCK_OPND);
break;
Expand Down

0 comments on commit b9748cb

Please sign in to comment.