Re: Fastcode Template B&V's
- From: "Anders Isaksson" <blockcad@xxxxxxxxxxxxxxx>
- Date: Thu, 6 Oct 2005 17:01:35 +0200
Dennis wrote:
>
> No protection against the problem with releasing to different
> functions with the same name.
How does 'the other system' protect against this?
> The library manager sees no reason to update the function in the
> library from Function1 to Function1, because functions with the
> same ID are the same ?
Release date of function1?
> In short: The rule of strong function ID is not enforced and this
> will lead to a reduction of quality.
I took a look into the B&V source, and it seems the following change may
help. It will show a message box about the problem, and not add the function
to the function list.
(FastcodeChallengeUnit.pas, line 117, 118)
uses
UtilsUnit, Windows, Dialogs;
(FastcodeChallengeUnit.pas, line 237-)
function TFastcodeChallenge.RegisterFunction(const FunctionData:
TFastcodeChallengeFunction): PFastcodeChallengeFunction;
var
i: Integer;
begin
// -- Added check for duplicates
for i := 0 to Pred(FFunctionList.Count) do
begin
if CompareText(PFastcodeChallengeFunction(FFunctionList[i]).Name,
FunctionData.Name) = 0 then
begin
ShowMessage('Duplicate function name: ' + FunctionData.Name +
#13#10 + 'Not added to function list!');
Exit;
end;
if (PFastcodeChallengeFunction(FFunctionList[i]).Addr =
FunctionData.Addr) then
begin
ShowMessage('The same function is used under different names: ' +
#13#10 +
FunctionData.Name + #13#10 +
PFastcodeChallengeFunction(FFunctionList[i]).Name +
#13#10 + 'Not added to function list!');
Exit;
end;
end;
// --- end of added code
New(Result);
try
Result^ := FunctionData;
FFunctionList.Add(Result);
except
Dispose(Result);
raise;
end;
end;
--
Anders Isaksson, Sweden
BlockCAD: http://web.telia.com/~u16122508/proglego.htm
Gallery: http://web.telia.com/~u16122508/gallery/index.htm
.
- Follow-Ups:
- Re: Fastcode Template B&V's
- From: Dennis
- Re: Fastcode Template B&V's
- References:
- Re: Fastcode Template B&V's
- From: Anders Isaksson
- Re: Fastcode Template B&V's
- From: Dennis
- Re: Fastcode Template B&V's
- Prev by Date: Re: FastcodeCompareStr B&V 2.1
- Next by Date: Re: Fastcode Template B&V's
- Previous by thread: Re: Fastcode Template B&V's
- Next by thread: Re: Fastcode Template B&V's
- Index(es):
Relevant Pages
|