mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 09:29:26 +02:00
* Raise range error exception directly to prevent note "Local variable "rcheck" is assigned but never used".
git-svn-id: trunk@9555 -
This commit is contained in:
parent
cd03a2893b
commit
93e62a3c0d
@ -823,7 +823,7 @@ INTERFACE
|
|||||||
IMPLEMENTATION
|
IMPLEMENTATION
|
||||||
|
|
||||||
USES
|
USES
|
||||||
classes;
|
classes {$ifopt r+}, sysconst {$endif};
|
||||||
|
|
||||||
type
|
type
|
||||||
TFMTBcdFactory = CLASS(TPublishableVarianttype)
|
TFMTBcdFactory = CLASS(TPublishableVarianttype)
|
||||||
@ -866,9 +866,10 @@ IMPLEMENTATION
|
|||||||
range_fracdigits = 0..pred ( MaxFmtBCDFractionSize );
|
range_fracdigits = 0..pred ( MaxFmtBCDFractionSize );
|
||||||
|
|
||||||
{$ifopt r+}
|
{$ifopt r+}
|
||||||
var
|
procedure RangeError;
|
||||||
rcheck : 0..0;
|
begin
|
||||||
rbad : Byte = 1;
|
raise ERangeError.Create(SRangeError);
|
||||||
|
end;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
{$ifndef debug_version}
|
{$ifndef debug_version}
|
||||||
@ -1986,8 +1987,8 @@ IMPLEMENTATION
|
|||||||
begin
|
begin
|
||||||
NormalizeBCD := True;
|
NormalizeBCD := True;
|
||||||
{$ifopt r+}
|
{$ifopt r+}
|
||||||
if ( Prec < 0 ) OR ( Prec > MaxFmtBCDFractionSize ) then rcheck := rbad;
|
if ( Prec < 0 ) OR ( Prec > MaxFmtBCDFractionSize ) then RangeError;
|
||||||
if ( Scale < 0 ) OR ( Prec >= MaxFmtBCDFractionSize ) then rcheck := rbad;
|
if ( Scale < 0 ) OR ( Prec >= MaxFmtBCDFractionSize ) then RangeError;
|
||||||
{$endif}
|
{$endif}
|
||||||
if BCDScale ( InBCD ) > Scale
|
if BCDScale ( InBCD ) > Scale
|
||||||
then begin
|
then begin
|
||||||
|
Loading…
Reference in New Issue
Block a user