Compute the ordinal base and limit in assign_ordinals instead of doing

it while parsing.
This commit is contained in:
Alexandre Julliard 2005-08-29 15:15:42 +00:00
parent bba5423d0f
commit d13b99d5f9
1 changed files with 10 additions and 2 deletions

View File

@ -609,6 +609,16 @@ static void assign_ordinals( DLLSPEC *spec )
int i, count, ordinal;
/* start assigning from base, or from 1 if no ordinal defined yet */
spec->base = MAX_ORDINALS;
spec->limit = 0;
for (i = 0; i < spec->nb_entry_points; i++)
{
ordinal = spec->entry_points[i].ordinal;
if (ordinal == -1) continue;
if (ordinal > spec->limit) spec->limit = ordinal;
if (ordinal < spec->base) spec->base = ordinal;
}
if (spec->base == MAX_ORDINALS) spec->base = 1;
if (spec->limit < spec->base) spec->limit = spec->base;
@ -826,8 +836,6 @@ static int parse_def_export( char *name, DLLSPEC *spec )
error( "Ordinal number %d too large\n", ordinal );
goto error;
}
if (ordinal > spec->limit) spec->limit = ordinal;
if (ordinal < spec->base) spec->base = ordinal;
odp->ordinal = ordinal;
token = GetToken(1);
}