Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
This commit is contained in:
@@ -107,8 +107,8 @@ int ED_IsConst (const ExprDesc* D)
|
||||
|
||||
static int ED_IsValid (const ExprDesc* D)
|
||||
/* Return true if the expression is valid, that is, neither the ERROR nor the
|
||||
* TOO_COMPLEX flags are set.
|
||||
*/
|
||||
** TOO_COMPLEX flags are set.
|
||||
*/
|
||||
{
|
||||
return ((D->Flags & (ED_ERROR | ED_TOO_COMPLEX)) == 0);
|
||||
}
|
||||
@@ -164,22 +164,22 @@ static void ED_MergeAddrSize (ExprDesc* ED, const ExprDesc* Right)
|
||||
{
|
||||
if (ED->AddrSize == ADDR_SIZE_DEFAULT) {
|
||||
/* If ED is valid, ADDR_SIZE_DEFAULT gets always overridden, otherwise
|
||||
* it takes precedence over anything else.
|
||||
*/
|
||||
** it takes precedence over anything else.
|
||||
*/
|
||||
if (ED_IsValid (ED)) {
|
||||
ED->AddrSize = Right->AddrSize;
|
||||
}
|
||||
} else if (Right->AddrSize == ADDR_SIZE_DEFAULT) {
|
||||
/* If Right is valid, ADDR_SIZE_DEFAULT gets always overridden,
|
||||
* otherwise it takes precedence over anything else.
|
||||
*/
|
||||
** otherwise it takes precedence over anything else.
|
||||
*/
|
||||
if (!ED_IsValid (Right)) {
|
||||
ED->AddrSize = Right->AddrSize;
|
||||
}
|
||||
} else {
|
||||
/* Neither ED nor Right has a default address size, use the larger of
|
||||
* the two.
|
||||
*/
|
||||
** the two.
|
||||
*/
|
||||
if (Right->AddrSize > ED->AddrSize) {
|
||||
ED->AddrSize = Right->AddrSize;
|
||||
}
|
||||
@@ -190,8 +190,8 @@ static void ED_MergeAddrSize (ExprDesc* ED, const ExprDesc* Right)
|
||||
|
||||
static ED_SymRef* ED_FindSymRef (ExprDesc* ED, SymEntry* Sym)
|
||||
/* Find a symbol reference and return it. Return NULL if the reference does
|
||||
* not exist.
|
||||
*/
|
||||
** not exist.
|
||||
*/
|
||||
{
|
||||
unsigned I;
|
||||
ED_SymRef* SymRef;
|
||||
@@ -207,8 +207,8 @@ static ED_SymRef* ED_FindSymRef (ExprDesc* ED, SymEntry* Sym)
|
||||
|
||||
static ED_SecRef* ED_FindSecRef (ExprDesc* ED, unsigned Sec)
|
||||
/* Find a section reference and return it. Return NULL if the reference does
|
||||
* not exist.
|
||||
*/
|
||||
** not exist.
|
||||
*/
|
||||
{
|
||||
unsigned I;
|
||||
ED_SecRef* SecRef;
|
||||
@@ -224,8 +224,8 @@ static ED_SecRef* ED_FindSecRef (ExprDesc* ED, unsigned Sec)
|
||||
|
||||
static ED_SymRef* ED_AllocSymRef (ExprDesc* ED, SymEntry* Sym)
|
||||
/* Allocate a new symbol reference and return it. The count of the new
|
||||
* reference will be set to zero, and the reference itself to Sym.
|
||||
*/
|
||||
** reference will be set to zero, and the reference itself to Sym.
|
||||
*/
|
||||
{
|
||||
ED_SymRef* SymRef;
|
||||
|
||||
@@ -251,8 +251,8 @@ static ED_SymRef* ED_AllocSymRef (ExprDesc* ED, SymEntry* Sym)
|
||||
|
||||
static ED_SecRef* ED_AllocSecRef (ExprDesc* ED, unsigned Sec)
|
||||
/* Allocate a new section reference and return it. The count of the new
|
||||
* reference will be set to zero, and the reference itself to Sec.
|
||||
*/
|
||||
** reference will be set to zero, and the reference itself to Sec.
|
||||
*/
|
||||
{
|
||||
ED_SecRef* SecRef;
|
||||
|
||||
@@ -278,8 +278,8 @@ static ED_SecRef* ED_AllocSecRef (ExprDesc* ED, unsigned Sec)
|
||||
|
||||
static ED_SymRef* ED_GetSymRef (ExprDesc* ED, SymEntry* Sym)
|
||||
/* Get a symbol reference and return it. If the symbol reference does not
|
||||
* exist, a new one is created and returned.
|
||||
*/
|
||||
** exist, a new one is created and returned.
|
||||
*/
|
||||
{
|
||||
ED_SymRef* SymRef = ED_FindSymRef (ED, Sym);
|
||||
if (SymRef == 0) {
|
||||
@@ -292,8 +292,8 @@ static ED_SymRef* ED_GetSymRef (ExprDesc* ED, SymEntry* Sym)
|
||||
|
||||
static ED_SecRef* ED_GetSecRef (ExprDesc* ED, unsigned Sec)
|
||||
/* Get a section reference and return it. If the section reference does not
|
||||
* exist, a new one is created and returned.
|
||||
*/
|
||||
** exist, a new one is created and returned.
|
||||
*/
|
||||
{
|
||||
ED_SecRef* SecRef = ED_FindSecRef (ED, Sec);
|
||||
if (SecRef == 0) {
|
||||
@@ -416,8 +416,8 @@ static void ED_Neg (ExprDesc* D)
|
||||
|
||||
static void ED_Move (ExprDesc* From, ExprDesc* To)
|
||||
/* Move the data from one ExprDesc to another. Old data is freed, and From
|
||||
* is prepared to that ED_Done may be called safely.
|
||||
*/
|
||||
** is prepared to that ED_Done may be called safely.
|
||||
*/
|
||||
{
|
||||
/* Delete old data */
|
||||
ED_Done (To);
|
||||
@@ -460,12 +460,12 @@ static unsigned char GetConstAddrSize (long Val)
|
||||
|
||||
static void StudyBinaryExpr (ExprNode* Expr, ExprDesc* D)
|
||||
/* Study a binary expression subtree. This is a helper function for StudyExpr
|
||||
* used for operations that succeed when both operands are known and constant.
|
||||
* It evaluates the two subtrees and checks if they are constant. If they
|
||||
* aren't constant, it will set the TOO_COMPLEX flag, and merge references.
|
||||
* Otherwise the first value is returned in D->Val, the second one in D->Right,
|
||||
* so the actual operation can be done by the caller.
|
||||
*/
|
||||
** used for operations that succeed when both operands are known and constant.
|
||||
** It evaluates the two subtrees and checks if they are constant. If they
|
||||
** aren't constant, it will set the TOO_COMPLEX flag, and merge references.
|
||||
** Otherwise the first value is returned in D->Val, the second one in D->Right,
|
||||
** so the actual operation can be done by the caller.
|
||||
*/
|
||||
{
|
||||
ExprDesc Right;
|
||||
|
||||
@@ -516,10 +516,10 @@ static void StudySymbol (ExprNode* Expr, ExprDesc* D)
|
||||
SymEntry* Sym = Expr->V.Sym;
|
||||
|
||||
/* If the symbol is defined somewhere, it has an expression associated.
|
||||
* In this case, just study the expression associated with the symbol,
|
||||
* but mark the symbol so if we encounter it twice, we know that we have
|
||||
* a circular reference.
|
||||
*/
|
||||
** In this case, just study the expression associated with the symbol,
|
||||
** but mark the symbol so if we encounter it twice, we know that we have
|
||||
** a circular reference.
|
||||
*/
|
||||
if (SymHasExpr (Sym)) {
|
||||
|
||||
if (SymHasUserMark (Sym)) {
|
||||
@@ -542,9 +542,9 @@ static void StudySymbol (ExprNode* Expr, ExprDesc* D)
|
||||
}
|
||||
|
||||
/* If the symbol has an explicit address size, use it. This may
|
||||
* lead to range errors later (maybe even in the linker stage), if
|
||||
* the user lied about the address size, but for now we trust him.
|
||||
*/
|
||||
** lead to range errors later (maybe even in the linker stage), if
|
||||
** the user lied about the address size, but for now we trust him.
|
||||
*/
|
||||
AddrSize = GetSymAddrSize (Sym);
|
||||
if (AddrSize != ADDR_SIZE_DEFAULT) {
|
||||
D->AddrSize = AddrSize;
|
||||
@@ -554,8 +554,8 @@ static void StudySymbol (ExprNode* Expr, ExprDesc* D)
|
||||
} else if (SymIsImport (Sym)) {
|
||||
|
||||
/* The symbol is an import. Track the symbols used and update the
|
||||
* address size.
|
||||
*/
|
||||
** address size.
|
||||
*/
|
||||
ED_SymRef* SymRef = ED_GetSymRef (D, Sym);
|
||||
++SymRef->Count;
|
||||
ED_UpdateAddrSize (D, GetSymAddrSize (Sym));
|
||||
@@ -566,17 +566,17 @@ static void StudySymbol (ExprNode* Expr, ExprDesc* D)
|
||||
SymTable* Parent;
|
||||
|
||||
/* The symbol is undefined. Track symbol usage but set the "too
|
||||
* complex" flag, since we cannot evaluate the final result.
|
||||
*/
|
||||
** complex" flag, since we cannot evaluate the final result.
|
||||
*/
|
||||
ED_SymRef* SymRef = ED_GetSymRef (D, Sym);
|
||||
++SymRef->Count;
|
||||
ED_Invalidate (D);
|
||||
|
||||
/* Since the symbol may be a forward, and we may need a statement
|
||||
* about the address size, check higher lexical levels for a symbol
|
||||
* with the same name and use its address size if we find such a
|
||||
* symbol which is defined.
|
||||
*/
|
||||
** about the address size, check higher lexical levels for a symbol
|
||||
** with the same name and use its address size if we find such a
|
||||
** symbol which is defined.
|
||||
*/
|
||||
AddrSize = GetSymAddrSize (Sym);
|
||||
Parent = GetSymParentScope (Sym);
|
||||
if (AddrSize == ADDR_SIZE_DEFAULT && Parent != 0) {
|
||||
@@ -612,8 +612,8 @@ static void StudyULabel (ExprNode* Expr, ExprDesc* D)
|
||||
/* Study an unnamed label expression node */
|
||||
{
|
||||
/* If we can resolve the label, study the expression associated with it,
|
||||
* otherwise mark the expression as too complex to evaluate.
|
||||
*/
|
||||
** otherwise mark the expression as too complex to evaluate.
|
||||
*/
|
||||
if (ULabCanResolve ()) {
|
||||
/* We can resolve the label */
|
||||
StudyExprInternal (ULabResolve (Expr->V.IVal), D);
|
||||
@@ -707,8 +707,8 @@ static void StudyMul (ExprNode* Expr, ExprDesc* D)
|
||||
StudyExprInternal (Expr->Right, &Right);
|
||||
|
||||
/* We can handle the operation if at least one of both operands is const
|
||||
* and the other one is valid.
|
||||
*/
|
||||
** and the other one is valid.
|
||||
*/
|
||||
if (ED_IsConst (D) && ED_IsValid (&Right)) {
|
||||
|
||||
/* Multiplicate both, result goes into Right */
|
||||
@@ -1480,24 +1480,24 @@ void StudyExpr (ExprNode* Expr, ExprDesc* D)
|
||||
}
|
||||
|
||||
/* If we don't have an address size, assign one if the expression is a
|
||||
* constant.
|
||||
*/
|
||||
** constant.
|
||||
*/
|
||||
if (D->AddrSize == ADDR_SIZE_DEFAULT && ED_IsConst (D)) {
|
||||
D->AddrSize = GetConstAddrSize (D->Val);
|
||||
}
|
||||
|
||||
/* If the expression is valid, throw away the address size and recalculate
|
||||
* it using the data we have. This is more exact than the on-the-fly
|
||||
* calculation done when evaluating the tree, because symbols may have
|
||||
* been removed from the expression, and the final numeric value is now
|
||||
* known.
|
||||
*/
|
||||
** it using the data we have. This is more exact than the on-the-fly
|
||||
** calculation done when evaluating the tree, because symbols may have
|
||||
** been removed from the expression, and the final numeric value is now
|
||||
** known.
|
||||
*/
|
||||
if (ED_IsValid (D)) {
|
||||
unsigned char AddrSize;
|
||||
|
||||
/* If there are symbols or sections, use the largest one. If the
|
||||
* expression resolves to a const, use the address size of the value.
|
||||
*/
|
||||
** expression resolves to a const, use the address size of the value.
|
||||
*/
|
||||
if (D->SymCount > 0 || D->SecCount > 0) {
|
||||
|
||||
D->AddrSize = ADDR_SIZE_DEFAULT;
|
||||
|
||||
Reference in New Issue
Block a user