mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-23 18:51:35 +02:00
* removed some warnings
This commit is contained in:
parent
dc329ecee3
commit
b136b62127
@ -98,7 +98,9 @@ UNIT Objects;
|
|||||||
{$E+} { Emulation is on }
|
{$E+} { Emulation is on }
|
||||||
{$X+} { Extended syntax is ok }
|
{$X+} { Extended syntax is ok }
|
||||||
{$R-} { Disable range checking }
|
{$R-} { Disable range checking }
|
||||||
{$S-} { Disable Stack Checking }
|
{$ifndef Linux}
|
||||||
|
{$S-} { Disable Stack Checking }
|
||||||
|
{$endif}
|
||||||
{$I-} { Disable IO Checking }
|
{$I-} { Disable IO Checking }
|
||||||
{$Q-} { Disable Overflow Checking }
|
{$Q-} { Disable Overflow Checking }
|
||||||
{$V-} { Turn off strict VAR strings }
|
{$V-} { Turn off strict VAR strings }
|
||||||
@ -2732,7 +2734,10 @@ END;
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.7 1998-07-15 12:08:33 carl
|
Revision 1.8 1998-09-09 15:29:02 peter
|
||||||
|
* removed some warnings
|
||||||
|
|
||||||
|
Revision 1.7 1998/07/15 12:08:33 carl
|
||||||
+ Atari TOS support
|
+ Atari TOS support
|
||||||
|
|
||||||
Revision 1.6 1998/07/08 12:00:25 carl
|
Revision 1.6 1998/07/08 12:00:25 carl
|
||||||
|
@ -32,44 +32,45 @@ function DoEncodeDate(Year, Month, Day: Word):longint;
|
|||||||
var
|
var
|
||||||
I: Longint;
|
I: Longint;
|
||||||
begin
|
begin
|
||||||
DoEncodeDate := 0;
|
DoEncodeDate := 0;
|
||||||
if (Year >= 1) and (Year <= 9999) and (Month >= 1) and (Month <= 12) and
|
if (Year >= 1) and (Year <= 9999) and (Month >= 1) and (Month <= 12) and
|
||||||
(Day >= 1) and (Day <= 31) then begin
|
(Day >= 1) and (Day <= 31) then
|
||||||
|
begin
|
||||||
Day := Day + DayTable[IsLeapYear(Year), Month] - 1;
|
Day := Day + DayTable[IsLeapYear(Year), Month] - 1;
|
||||||
I := Year - 1;
|
I := Year - 1;
|
||||||
DoEncodeDate := I * 365 + I div 4 - I div 100 + I div 400 + Day;
|
DoEncodeDate := I * 365 + I div 4 - I div 100 + I div 400 + Day;
|
||||||
end ;
|
end;
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
function doEncodeTime(Hour,Minute,Second,MilliSecond:word):longint;
|
function doEncodeTime(Hour,Minute,Second,MilliSecond:word):longint;
|
||||||
begin
|
begin
|
||||||
doEncodeTime := (Hour * 3600000 + Minute * 60000 + Second * 1000 + MilliSecond) { div MSecsPerDay} ;
|
doEncodeTime := (Hour * 3600000 + Minute * 60000 + Second * 1000 + MilliSecond) { div MSecsPerDay} ;
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
function DateToStr(Date:TDateTime):string;
|
function DateToStr(Date:TDateTime):string;
|
||||||
begin
|
begin
|
||||||
DateToStr := FormatDateTime('c', Date);
|
DateToStr := FormatDateTime('c', Date);
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
function TimeToStr(Time:TDateTime):string;
|
function TimeToStr(Time:TDateTime):string;
|
||||||
begin
|
begin
|
||||||
TimeToStr := FormatDateTime('t', Time);
|
TimeToStr := FormatDateTime('t', Time);
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
function DateTimeToStr(DateTime:TDateTime):string;
|
function DateTimeToStr(DateTime:TDateTime):string;
|
||||||
begin
|
begin
|
||||||
DateTimeToStr := FormatDateTime('c t', DateTime);
|
DateTimeToStr := FormatDateTime('c t', DateTime);
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
function EncodeDate(Year, Month, Day :word):TDateTime;
|
function EncodeDate(Year, Month, Day :word):TDateTime;
|
||||||
begin
|
begin
|
||||||
EncodeDate := DoEncodeDate(Year, Month, Day);
|
EncodeDate := DoEncodeDate(Year, Month, Day);
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
function EncodeTime(Hour, Minute, Second, MilliSecond:word):TDateTime;
|
function EncodeTime(Hour, Minute, Second, MilliSecond:word):TDateTime;
|
||||||
begin
|
begin
|
||||||
EncodeTime := doEncodeTime(hour, minute, second, millisecond) / MSecsPerDay;
|
EncodeTime := doEncodeTime(hour, minute, second, millisecond) / double(MSecsPerDay);
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
procedure DecodeDate(Date:TDateTime;var Year:word;var Month:word;var Day:word);
|
procedure DecodeDate(Date:TDateTime;var Year:word;var Month:word;var Day:word);
|
||||||
const
|
const
|
||||||
@ -78,7 +79,6 @@ const
|
|||||||
D100 = D4 * 25 - 1; { number of days in 100 years }
|
D100 = D4 * 25 - 1; { number of days in 100 years }
|
||||||
D400 = D100 * 4 + 1; { number of days in 400 years }
|
D400 = D100 * 4 + 1; { number of days in 400 years }
|
||||||
var
|
var
|
||||||
i:Longint;
|
|
||||||
l:longint;
|
l:longint;
|
||||||
ly:boolean;
|
ly:boolean;
|
||||||
begin
|
begin
|
||||||
@ -92,7 +92,7 @@ ly := IsLeapYear(Year);
|
|||||||
while (month < 12) and (l > DayTable[ly, month + 1]) do
|
while (month < 12) and (l > DayTable[ly, month + 1]) do
|
||||||
inc(month);
|
inc(month);
|
||||||
day := l - DayTable[ly, month];
|
day := l - DayTable[ly, month];
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
procedure DecodeTime(Time:TDateTime;var Hour:word;var Minute:word;var Second:word;var MilliSecond:word);
|
procedure DecodeTime(Time:TDateTime;var Hour:word;var Minute:word;var Second:word;var MilliSecond:word);
|
||||||
var l:longint;
|
var l:longint;
|
||||||
@ -102,7 +102,7 @@ Hour := l div 3600000;l := l mod 3600000;
|
|||||||
Minute := l div 60000;l := l mod 60000;
|
Minute := l div 60000;l := l mod 60000;
|
||||||
Second := l div 1000;l := l mod 1000;
|
Second := l div 1000;l := l mod 1000;
|
||||||
MilliSecond := l;
|
MilliSecond := l;
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
function FormatDateTime(formatstr:string;DateTime:TDateTime):string;
|
function FormatDateTime(formatstr:string;DateTime:TDateTime):string;
|
||||||
var i:longint;result:string;current:string;e:longint;
|
var i:longint;result:string;current:string;e:longint;
|
||||||
@ -121,19 +121,19 @@ while not(i > length(formatstr)) do begin
|
|||||||
while not(formatstr[i] in [' ','"','/',':','''']) and not(i > length(formatstr)) do begin
|
while not(formatstr[i] in [' ','"','/',':','''']) and not(i > length(formatstr)) do begin
|
||||||
current := current + formatstr[i];
|
current := current + formatstr[i];
|
||||||
inc(i);
|
inc(i);
|
||||||
end ;
|
end;
|
||||||
if ((current = 'a') or (current = 'am')) and (formatstr[i] = '/') then begin
|
if ((current = 'a') or (current = 'am')) and (formatstr[i] = '/') then begin
|
||||||
inc(i);current := current + '/';
|
inc(i);current := current + '/';
|
||||||
while not(formatstr[i] in [' ','"','/',':','''']) and not(i > length(formatstr)) do begin
|
while not(formatstr[i] in [' ','"','/',':','''']) and not(i > length(formatstr)) do begin
|
||||||
current := current + formatstr[i];
|
current := current + formatstr[i];
|
||||||
inc(i);
|
inc(i);
|
||||||
end ;
|
end;
|
||||||
end ;
|
end;
|
||||||
if not(current = '') then begin
|
if not(current = '') then begin
|
||||||
if (current = 'c') then begin
|
if (current = 'c') then begin
|
||||||
i := 1; result := ''; current := '';
|
i := 1; result := ''; current := '';
|
||||||
formatstr := ' ' + shortdateformat + '" "' + shorttimeformat;
|
formatstr := ' ' + shortdateformat + '" "' + shorttimeformat;
|
||||||
end ;
|
end;
|
||||||
if not(mTime = 0) then begin
|
if not(mTime = 0) then begin
|
||||||
if (current = 't') then begin
|
if (current = 't') then begin
|
||||||
formatstr := ' ' + shorttimeformat + copy(formatstr, i, length(formatstr));
|
formatstr := ' ' + shorttimeformat + copy(formatstr, i, length(formatstr));
|
||||||
@ -160,8 +160,8 @@ while not(i > length(formatstr)) do begin
|
|||||||
else if (current = 'ampm') then begin
|
else if (current = 'ampm') then begin
|
||||||
if h < 13 then strCat(result, TimeAMString)
|
if h < 13 then strCat(result, TimeAMString)
|
||||||
else strCat(result, TimePMString);
|
else strCat(result, TimePMString);
|
||||||
end ;
|
end;
|
||||||
end ;
|
end;
|
||||||
if not(mDate = 0) then begin
|
if not(mDate = 0) then begin
|
||||||
if (current = 'd') then result := result + inttostr(d)
|
if (current = 'd') then result := result + inttostr(d)
|
||||||
else if (current = 'dd') then result := result + right('0' + inttostr(d), 2)
|
else if (current = 'dd') then result := result + right('0' + inttostr(d), 2)
|
||||||
@ -174,9 +174,9 @@ while not(i > length(formatstr)) do begin
|
|||||||
else if (current = 'y') then result := result + inttostr(y)
|
else if (current = 'y') then result := result + inttostr(y)
|
||||||
else if (current = 'yy') then result := result + right(inttostr(y), 2)
|
else if (current = 'yy') then result := result + right(inttostr(y), 2)
|
||||||
else if (current = 'yyyy') or (current = 'yyy') then result := result + inttostr(y);
|
else if (current = 'yyyy') or (current = 'yyy') then result := result + inttostr(y);
|
||||||
end ;
|
end;
|
||||||
current := '';
|
current := '';
|
||||||
end ;
|
end;
|
||||||
if (formatstr[i] = '/') and not(mDate = 0) then result := result + dateseparator
|
if (formatstr[i] = '/') and not(mDate = 0) then result := result + dateseparator
|
||||||
else if (formatstr[i] = ':') and not(mTime = 0) then result := result + timeseparator
|
else if (formatstr[i] = ':') and not(mTime = 0) then result := result + timeseparator
|
||||||
else if (formatstr[i] in ['"','''']) then begin
|
else if (formatstr[i] in ['"','''']) then begin
|
||||||
@ -184,12 +184,12 @@ while not(i > length(formatstr)) do begin
|
|||||||
while not(formatstr[i] in ['"','''']) and not(i > length(formatstr)) do begin
|
while not(formatstr[i] in ['"','''']) and not(i > length(formatstr)) do begin
|
||||||
result := result + formatstr[i];
|
result := result + formatstr[i];
|
||||||
inc(i);
|
inc(i);
|
||||||
end ;
|
end;
|
||||||
end ;
|
end;
|
||||||
inc(i);
|
inc(i);
|
||||||
end ;
|
end;
|
||||||
FormatDateTime := Result;
|
FormatDateTime := Result;
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
function StrToDate(const s:string):TDateTime;
|
function StrToDate(const s:string):TDateTime;
|
||||||
var
|
var
|
||||||
@ -210,8 +210,8 @@ for i := 1 to length(s) do begin
|
|||||||
val(s1, values[n], c);
|
val(s1, values[n], c);
|
||||||
s1 := '';
|
s1 := '';
|
||||||
inc(n);
|
inc(n);
|
||||||
end ;
|
end;
|
||||||
end ;
|
end;
|
||||||
if (df = 'D/M/Y') then begin
|
if (df = 'D/M/Y') then begin
|
||||||
d := values[0];
|
d := values[0];
|
||||||
m := values[1];
|
m := values[1];
|
||||||
@ -238,71 +238,78 @@ else if (df = 'Y/M/D') then begin
|
|||||||
end
|
end
|
||||||
else if (n = 1) then
|
else if (n = 1) then
|
||||||
d := values[0];
|
d := values[0];
|
||||||
end ;
|
end;
|
||||||
if (n < 3) then begin
|
if (n < 3) then begin
|
||||||
getLocalTime(LocalTime);
|
getLocalTime(LocalTime);
|
||||||
y := LocalTime.wYear;
|
y := LocalTime.wYear;
|
||||||
if (n < 2) then
|
if (n < 2) then
|
||||||
m := LocalTime.wMonth;
|
m := LocalTime.wMonth;
|
||||||
end ;
|
end;
|
||||||
if (y >= 0) and (y < 100) then y := 1900 + y;
|
if (y >= 0) and (y < 100) then y := 1900 + y;
|
||||||
StrToDate := DoEncodeDate(y, m, d);
|
StrToDate := DoEncodeDate(y, m, d);
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function StrToTime(const s:string):TDateTime;
|
function StrToTime(const s:string):TDateTime;
|
||||||
begin
|
begin
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function StrToDateTime(const s:string):TDateTime;
|
function StrToDateTime(const s:string):TDateTime;
|
||||||
begin
|
begin
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function DayOfWeek(DateTime:TDateTime):longint;
|
function DayOfWeek(DateTime:TDateTime):longint;
|
||||||
begin
|
begin
|
||||||
DayOfWeek := (1 + Trunc(DateTime)) mod 7;
|
DayOfWeek := (1 + Trunc(DateTime)) mod 7;
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
procedure getlocaltime(var systemtime:tsystemtime);
|
procedure getlocaltime(var systemtime:tsystemtime);
|
||||||
var wDayOfWeek:word;
|
var
|
||||||
|
wDayOfWeek:word;
|
||||||
begin
|
begin
|
||||||
getdate(systemtime.wYear,
|
getdate(systemtime.wYear,systemtime.wMonth,systemtime.wDay,wDayOfWeek);
|
||||||
systemtime.wMonth,
|
gettime(systemtime.whour,systemtime.wminute,systemtime.wsecond,systemtime.wmillisecond);
|
||||||
systemtime.wDay,
|
systemtime.wmillisecond := systemtime.wmillisecond * 10;
|
||||||
wDayOfWeek);
|
end;
|
||||||
gettime(systemtime.whour,
|
|
||||||
systemtime.wminute,
|
|
||||||
systemtime.wsecond,
|
|
||||||
systemtime.wmillisecond);
|
|
||||||
systemtime.wmillisecond := systemtime.wmillisecond * 10;
|
|
||||||
end ;
|
|
||||||
|
|
||||||
function Date:TDateTime;
|
function Date:TDateTime;
|
||||||
var systemtime:tsystemtime;
|
var
|
||||||
|
systemtime:tsystemtime;
|
||||||
begin
|
begin
|
||||||
getlocaltime(systemtime);
|
getlocaltime(systemtime);
|
||||||
date := doEncodeDate(systemtime.wYear,systemtime.wMonth,systemtime.wDay);
|
date := doEncodeDate(systemtime.wYear,systemtime.wMonth,systemtime.wDay);
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function Time:TDateTime;
|
function Time:TDateTime;
|
||||||
var systemtime:tsystemtime;
|
var
|
||||||
|
systemtime:tsystemtime;
|
||||||
begin
|
begin
|
||||||
getlocaltime(systemtime);
|
getlocaltime(systemtime);
|
||||||
time := doEncodeTime(systemtime.wHour,systemtime.wMinute,
|
time := doEncodeTime(systemtime.wHour,systemtime.wMinute,
|
||||||
systemtime.wSecond,systemtime.wMillisecond) / MSecsPerDay;
|
systemtime.wSecond,systemtime.wMillisecond) / double(MSecsPerDay);
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function Now:TDateTime;
|
function Now:TDateTime;
|
||||||
var systemtime:tsystemtime;
|
var
|
||||||
|
systemtime:tsystemtime;
|
||||||
begin
|
begin
|
||||||
getlocaltime(systemtime);
|
getlocaltime(systemtime);
|
||||||
now := doEncodeDate(systemtime.wYear,systemtime.wMonth,systemtime.wDay) +
|
now := doEncodeDate(systemtime.wYear,systemtime.wMonth,systemtime.wDay) +
|
||||||
doEncodeTime(systemtime.wHour,systemtime.wMinute,
|
doEncodeTime(systemtime.wHour,systemtime.wMinute,
|
||||||
systemtime.wSecond,systemtime.wMillisecond) / MSecsPerDay;
|
systemtime.wSecond,systemtime.wMillisecond) / double(MSecsPerDay);
|
||||||
end ;
|
end;
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 1998-04-10 15:17:46 michael
|
Revision 1.2 1998-09-09 15:29:04 peter
|
||||||
|
* removed some warnings
|
||||||
|
|
||||||
|
Revision 1.1 1998/04/10 15:17:46 michael
|
||||||
+ Initial implementation; Donated by Gertjan Schouten
|
+ Initial implementation; Donated by Gertjan Schouten
|
||||||
His file was split into several files, to keep it a little bit structured.
|
His file was split into several files, to keep it a little bit structured.
|
||||||
|
|
||||||
|
@ -355,9 +355,6 @@ function arsinh(x : float) : float;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function artanh(x : float) : float;
|
function artanh(x : float) : float;
|
||||||
|
|
||||||
var temp : Float;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
If abs(x)>1 then InvalidArgument;
|
If abs(x)>1 then InvalidArgument;
|
||||||
artanh:=(Ln((1+x)/(1-x)))*0.5;
|
artanh:=(Ln((1+x)/(1-x)))*0.5;
|
||||||
@ -580,7 +577,7 @@ procedure momentskewkurtosis(const data : array of float;
|
|||||||
I : Longint;
|
I : Longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
invN:=1/(High(Data)-Low(Data)+1);
|
invN:=1.0/(High(Data)-Low(Data)+1);
|
||||||
s:=0;
|
s:=0;
|
||||||
ss:=0;
|
ss:=0;
|
||||||
sq:=0;
|
sq:=0;
|
||||||
@ -617,7 +614,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 1998-07-29 15:44:34 michael
|
Revision 1.3 1998-09-09 15:29:05 peter
|
||||||
|
* removed some warnings
|
||||||
|
|
||||||
|
Revision 1.2 1998/07/29 15:44:34 michael
|
||||||
included sysutils and math.pp as target. They compile now.
|
included sysutils and math.pp as target. They compile now.
|
||||||
|
|
||||||
Revision 1.1.1.1 1998/03/25 11:18:49 root
|
Revision 1.1.1.1 1998/03/25 11:18:49 root
|
||||||
|
Loading…
Reference in New Issue
Block a user