TvPlanIt: Less hints and warnings

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8132 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2021-10-27 18:12:33 +00:00
parent 4e7896f9a4
commit 03dcab679a
24 changed files with 84 additions and 57 deletions

View File

@ -901,11 +901,11 @@ begin
inherited Create;
FOwner := AOwner;
FActiveRange := TVpTimeRange.Create(Self);
FInactive := OFF_COLOR; //$0080FFFF;
FHoliday := HOLIDAY_COLOR; //$00FF80FF;
FWeekend := WEEKEND_COLOR; //$00FFFF80;
FInactive := OFF_COLOR; // $0080FFFF;
FHoliday := HOLIDAY_COLOR; // $00FF80FF;
FWeekend := WEEKEND_COLOR; // $00FFFF80;
FActive := clWhite;
FWeekday := WEEKDAY_COLOR; //clWhite;
FWeekday := WEEKDAY_COLOR; // clWhite;
end;
destructor TVpTimeSlotColor.Destroy;

View File

@ -105,6 +105,7 @@ begin
valuepart := copy(AText, p+1, MaxInt);
// Process key part
Attr := nil;
p := pos(KEY_DELIMITER, keypart);
if p = 0 then begin
AKey := keypart;

View File

@ -26,10 +26,14 @@
{* *}
{* ***** END LICENSE BLOCK ***** *}
unit VpBaseDS; { Base DataStore classes }
{$IF FPC_FullVersion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
{$I vp.inc}
unit VpBaseDS;
{ Base DataStore classes }
interface

View File

@ -26,10 +26,13 @@
{* *}
{* ***** END LICENSE BLOCK ***** *}
{$I vp.inc}
unit VpCalendar; { Calendar component }
unit VpCalendar;
{-Calendar component}
{$IF FPC_FullVersion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
{$I vp.inc}
interface
@ -173,7 +176,7 @@ type
function GetDay: Integer;
function GetMonth: Integer;
function GetYear: Integer;
procedure SetBorderStyle(Value: TBorderStyle);
procedure SetBorderStyle(Value: TBorderStyle); reintroduce;
procedure SetDate(Value: TDateTime);
procedure SetDateFormat(Value: TVpDateFormat);
procedure SetDayNameWidth(Value: TVpDayNameWidth);

View File

@ -54,7 +54,7 @@ implementation
uses
LCLProc, LazUtf8,
VpConst, VpCanvasUtils;
{%H-}VpConst, VpCanvasUtils;
type
TVpCalendarOpener = class(TVpCustomCalendar);

View File

@ -1047,7 +1047,7 @@ end;
procedure TVpExCanvas.PolyBezier(const Points: array of TPoint);
var
i: Integer;
P: array of TPoint;
P: array of TPoint = nil;
begin
if not Assigned(FCanvas) then
raise EVpCanvasError.Create(RSNoCanvas);
@ -1062,7 +1062,7 @@ end;
procedure TVpExCanvas.PolyBezierTo(const Points: array of TPoint);
var
i: Integer;
P: array of TPoint;
P: array of TPoint = nil;
begin
if not Assigned(FCanvas) then
raise EVpCanvasError.Create(RSNoCanvas);
@ -1077,7 +1077,7 @@ end;
procedure TVpExCanvas.Polygon(Points: array of TPoint);
var
i: Integer;
P: array of TPoint;
P: array of TPoint = nil;
begin
if not Assigned(FCanvas) then
raise EVpCanvasError.Create(RSNoCanvas);
@ -1092,7 +1092,7 @@ end;
procedure TVpExCanvas.Polyline(Points: array of TPoint);
var
i: Integer;
P: array of TPoint;
P: array of TPoint = nil;
begin
if not Assigned(FCanvas) then
raise EVpCanvasError.Create(RSNoCanvas);

View File

@ -42,7 +42,7 @@ uses
{$IFDEF VERSION6} Variants, {$ENDIF}
Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ComCtrls,
EditBtn,
VpData, VpException, VpMisc, VpBase, VpSR, VpDlg, VpBaseDS;
VpData, VpMisc, VpBase, VpSR, VpDlg, VpBaseDS;
type
{ forward declarations }
@ -505,8 +505,8 @@ type
TLabelArray = array of TLabel;
TComboboxArray = array of TCombobox;
var
Labels: TLabelArray;
Comboboxes: TComboboxArray;
Labels: TLabelArray = nil;
Comboboxes: TComboboxArray = nil;
largestLabelWidth: Integer;
comboArrowWidth: Integer;
i: Integer;

View File

@ -49,12 +49,16 @@
provide multi-line editing capabilities.
}
unit VpDayView;
{$IF FPC_FullVersion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
{$I vp.inc}
{.$DEFINE DEBUGDV} { Causes the DayView to operate in debug mode }
unit VpDayView;
interface
uses
@ -323,7 +327,7 @@ type
function GetLastVisibleDate: TDateTime;
function GetRealNumDays(WorkDate: TDateTime) : Integer;
procedure SetDrawingStyle(Value: TVpDrawingStyle);
procedure SetColor(Value: TColor);
procedure SetColor(Value: TColor); reintroduce;
procedure SetLineColor(Value: TColor);
procedure SetTopHour(Value: TVpHours);
procedure SetTopLine(Value: Integer);

View File

@ -154,7 +154,7 @@ function TVpDayViewPainter.CountOverlappingEvents(Event: TVpEvent;
var
K, SelfLevel: Integer;
Tmp: TVpEvent;
Levels: array of Integer;
Levels: array of Integer = nil;
begin
{ initialize the levels array }
SetLength(Levels, MaxEventDepth);

View File

@ -26,7 +26,12 @@
{* *}
{* ***** END LICENSE BLOCK ***** *}
{$IF FPC_FullVersion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
{$I Vp.INC}
unit VpDBDS;
interface

View File

@ -26,10 +26,14 @@
{* *}
{* ***** END LICENSE BLOCK ***** *}
{$I Vp.INC}
unit VpEdFmtLst;
{$IF FPC_FullVersion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
{$I Vp.INC}
interface
uses

View File

@ -140,7 +140,7 @@ type
CIVerifying: Boolean;
{$IFDEF NEW_TIME_EDIT}
procedure AcceptStartTimeHandler(Sender: TObject; var ATime: TDateTime;
var AcceptTime: Boolean);
var {%H-}AcceptTime: Boolean);
{$ENDIF}
procedure PopLists;
procedure PositionControls;

View File

@ -26,6 +26,10 @@
{* *}
{* ***** END LICENSE BLOCK ***** *}
{$IF FPC_FullVersion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
{$I vp.inc}
unit VpFlxDS;

View File

@ -155,17 +155,6 @@ uses
// Examples: 19970702T160000, or T123000, or 20120101
function iCalDateTime(AText: String; out IsUTC: Boolean): TDateTime;
type
TDateMask = packed record
year: array[1..4] of char;
month: array[1..2] of char;
day: array[1..2] of char;
end;
TTimeMask = packed record
hour: array[1..2] of char;
minute: array[1..2] of char;
second: array[1..2] of char;
end;
var
shour, smin, ssec: String;
yr, mon, day, hr, min, sec: Integer;

View File

@ -253,7 +253,7 @@ begin
L.AddField('State1', AContact.State1); // 10
L.AddField('Zip1', AContact.Zip1);
L.AddField('Country1', AContact.Country1);
L.AddField('Notes', EncodeLineEndings(AContact.Note));
L.AddField('Notes', EncodeLineEndings(AContact.Notes));
L.AddField('Phone1', AContact.Phone1);
L.AddField('Phone2', AContact.Phone2); // 15
L.AddField('Phone3', AContact.Phone3);

View File

@ -541,8 +541,8 @@ end;
procedure TVpCustomLEDLabel.SetSize(Value : TSegmentSize);
begin
if FSize <> Value then begin
if Value < 2 then
Value := 2;
if Value {%H-}< 2 then
{%H-}Value := 2;
if Integer(Value) > 10 then
Value := 10;
ResizeControl(FRows, FColumns, Value);

View File

@ -209,6 +209,7 @@ var
L: TStrings;
i: Integer;
begin
Result := nil;
L := TStringList.Create;
try
L.Delimiter := ADelimiter;

View File

@ -26,6 +26,10 @@
{* *}
{* ***** END LICENSE BLOCK ***** *}
{$IF FPC_FullVersion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
{$I vp.inc}
unit VpMonthView;
@ -195,7 +199,7 @@ type
{ property methods }
procedure SetDrawingStyle(Value: TVpDrawingStyle);
procedure SetColor(Value: TColor);
procedure SetColor(Value: TColor); reintroduce;
procedure SetLineColor(Value: TColor);
procedure SetOffDayColor(Value: TColor);
procedure SetOffDayFontColor(Value: TColor);

View File

@ -2070,7 +2070,7 @@ var
State: TVpVariableState;
SLen: Integer;
i: Integer;
VarName: string;
VarName: string = '';
ForceTerm: Boolean;
VarsOk: Boolean;
Value: string;
@ -2495,8 +2495,8 @@ begin
Unused(oOwner, bSpecified);
Item := TVpAttributeItem(FAttributes.Add);
Item.Name := sName;
Item.Value := sValue;
Item.Name := UTF8Encode(sName);
Item.Value := UTF8Encode(sValue);
end;
{=====}

View File

@ -136,7 +136,7 @@ type
procedure RemoveHScrollbar;
procedure RemoveVScrollbar;
procedure SetBorderColor(const v: TColor);
procedure SetBorderStyle(const v: TBorderStyle);
procedure SetBorderStyle(const v: TBorderStyle); reintroduce;
procedure SetControlLink(const v: TVpControlLink);
procedure SetCurPage(const v: Integer);
procedure SetDrawingStyle(const v: TVpDrawingStyle);

View File

@ -258,7 +258,7 @@ begin
with ER^ do begin
erEnabled := True;
erHandle := tpCreateTriggerHandle;
erInitTime := GetTickCount;
erInitTime := GetTickCount64;
erElapsed := 0;
erInterval := Interval;
erLastTrigger := erInitTime;
@ -289,7 +289,7 @@ var
I : Integer;
ET : longint;
begin
TC := GetTickCount;
TC := GetTickCount64;
{cycle through all triggers}
I := 0;
@ -344,7 +344,7 @@ begin
if ER^.erElapsed = High(LongInt) then
Result := High(LongInt)
else begin
TC := GetTickCount;
TC := GetTickCount64;
if (TC < ER^.erInitTime) then begin
ET := (High(LongInt) - ER^.erInitTime) + (TC - Low(LongInt));
if (ET < ER^.erElapsed) then
@ -447,7 +447,7 @@ var
begin
I := tpEventIndex(Handle);
if (I > -1) then
PEventRec(tpList[I])^.erInitTime := LongInt(GetTickCount)
PEventRec(tpList[I])^.erInitTime := LongInt(GetTickCount64)
else
raise EInvalidTriggerHandle.Create;
end;
@ -475,7 +475,7 @@ begin
PEventRec(tpList[I])^.erEnabled := Value;
{If the timer is being activated, then initialize LastTrigger}
if PEventRec(tpList[I])^.erEnabled then
PEventRec(tpList[I])^.erLastTrigger := GetTickCount;
PEventRec(tpList[I])^.erLastTrigger := GetTickCount64;
tpEnabledCount := tpCountEnabledTriggers;
tpCalcNewInterval;
tpUpdateTimer;
@ -511,7 +511,7 @@ var
Done : Boolean;
begin
{find shortest trigger interval}
TC := GetTickCount;
TC := GetTickCount64;
tpInterval := High(Cardinal);
for I := 0 to tpList.Count-1 do begin
ER := PEventRec(tpList[I]);

View File

@ -40,10 +40,17 @@
functions in VpCanvasUtils are used to go between the rendering of the
control and the TCanvas that it needs to render to.
}
{$I vp.inc}
unit VpWeekView;
{$I vp.inc}
{$IF FPC_FullVersion >= 30200}
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
{$IFEND}
interface
uses
@ -175,7 +182,7 @@ type
{ property methods }
procedure SetDrawingStyle(Value: TVpDrawingStyle);
procedure SetColor(Value: TColor);
procedure SetColor(Value: TColor); reintroduce;
procedure SetLineColor(Value: TColor);
procedure SetDateLabelFormat(Value: string);
procedure SetEventFont(Value: TVpFont);

View File

@ -574,7 +574,7 @@ procedure TVpWeekViewPainter.DrawHeader;
var
HeadRect: TRect;
HeadTextRect: TRect;
HeadStr: string;
HeadStr: string = '';
HeadStrLen: Integer;
weekNo: Integer;
begin

View File

@ -675,8 +675,9 @@ var
HasEntRef: Boolean;
begin
Unused(sElemName);
SetLength(Result, 0);
Result := '';
HasEntRef := False;
if aIdx >= 0 then begin
oAttrList := TVpElementInfo(FElementInfo.Objects[aIdx]).AttributeList;
@ -1495,7 +1496,7 @@ end;
{--------}
procedure TVpParser.ParsePCData(aInEntityRef : Boolean);
var
TempBuff : DOMString;
TempBuff : DOMString = '';
TempChar : DOMChar;
CurrLength : Longint;
BuffLength : Longint;
@ -1967,7 +1968,7 @@ end;
{--------}
procedure TVpParser.Require(const S : array of Longint);
var
TempStr : AnsiString;
TempStr : AnsiString = '';
TempChar : AnsiChar;
i : Integer;
begin