From 03dcab679ab22747607fdab4a7a758bdd21d0447 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 27 Oct 2021 18:12:33 +0000 Subject: [PATCH] TvPlanIt: Less hints and warnings git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8132 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/source/vpbase.pas | 8 ++++---- components/tvplanit/source/vpbasedatafiles.pas | 1 + components/tvplanit/source/vpbaseds.pas | 8 ++++++-- components/tvplanit/source/vpcalendar.pas | 11 +++++++---- components/tvplanit/source/vpcalendarpainter.pas | 2 +- components/tvplanit/source/vpcanvasutils.pas | 8 ++++---- components/tvplanit/source/vpcontacteditdlg.pas | 6 +++--- components/tvplanit/source/vpdayview.pas | 10 +++++++--- components/tvplanit/source/vpdayviewpainter.pas | 2 +- components/tvplanit/source/vpdbds.pas | 5 +++++ components/tvplanit/source/vpedfmtlst.pas | 8 ++++++-- components/tvplanit/source/vpevnteditdlg.pas | 2 +- components/tvplanit/source/vpflxds.pas | 4 ++++ components/tvplanit/source/vpical.pas | 11 ----------- components/tvplanit/source/vpinids.pas | 2 +- components/tvplanit/source/vpledlabel.pas | 4 ++-- components/tvplanit/source/vpmisc.pas | 1 + components/tvplanit/source/vpmonthview.pas | 6 +++++- components/tvplanit/source/vpprtfmt.pas | 6 +++--- components/tvplanit/source/vpprtprv.pas | 2 +- components/tvplanit/source/vptimerpool.pas | 12 ++++++------ components/tvplanit/source/vpweekview.pas | 11 +++++++++-- components/tvplanit/source/vpweekviewpainter.pas | 2 +- components/tvplanit/source/vpxparsr.pas | 9 +++++---- 24 files changed, 84 insertions(+), 57 deletions(-) diff --git a/components/tvplanit/source/vpbase.pas b/components/tvplanit/source/vpbase.pas index f6f03430f..19047c9ab 100644 --- a/components/tvplanit/source/vpbase.pas +++ b/components/tvplanit/source/vpbase.pas @@ -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; diff --git a/components/tvplanit/source/vpbasedatafiles.pas b/components/tvplanit/source/vpbasedatafiles.pas index e41e432b5..b3a79ff5a 100644 --- a/components/tvplanit/source/vpbasedatafiles.pas +++ b/components/tvplanit/source/vpbasedatafiles.pas @@ -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; diff --git a/components/tvplanit/source/vpbaseds.pas b/components/tvplanit/source/vpbaseds.pas index 1946c9fd2..6a6747dd1 100644 --- a/components/tvplanit/source/vpbaseds.pas +++ b/components/tvplanit/source/vpbaseds.pas @@ -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 diff --git a/components/tvplanit/source/vpcalendar.pas b/components/tvplanit/source/vpcalendar.pas index af3799e04..9794c53ad 100644 --- a/components/tvplanit/source/vpcalendar.pas +++ b/components/tvplanit/source/vpcalendar.pas @@ -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); diff --git a/components/tvplanit/source/vpcalendarpainter.pas b/components/tvplanit/source/vpcalendarpainter.pas index aacca10dc..800af84ec 100644 --- a/components/tvplanit/source/vpcalendarpainter.pas +++ b/components/tvplanit/source/vpcalendarpainter.pas @@ -54,7 +54,7 @@ implementation uses LCLProc, LazUtf8, - VpConst, VpCanvasUtils; + {%H-}VpConst, VpCanvasUtils; type TVpCalendarOpener = class(TVpCustomCalendar); diff --git a/components/tvplanit/source/vpcanvasutils.pas b/components/tvplanit/source/vpcanvasutils.pas index 07462209a..6c407192f 100644 --- a/components/tvplanit/source/vpcanvasutils.pas +++ b/components/tvplanit/source/vpcanvasutils.pas @@ -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); diff --git a/components/tvplanit/source/vpcontacteditdlg.pas b/components/tvplanit/source/vpcontacteditdlg.pas index 326cb8d8f..cf15793de 100644 --- a/components/tvplanit/source/vpcontacteditdlg.pas +++ b/components/tvplanit/source/vpcontacteditdlg.pas @@ -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; diff --git a/components/tvplanit/source/vpdayview.pas b/components/tvplanit/source/vpdayview.pas index b4ec36e86..a65976b17 100644 --- a/components/tvplanit/source/vpdayview.pas +++ b/components/tvplanit/source/vpdayview.pas @@ -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); diff --git a/components/tvplanit/source/vpdayviewpainter.pas b/components/tvplanit/source/vpdayviewpainter.pas index 1565a4237..093eddc70 100644 --- a/components/tvplanit/source/vpdayviewpainter.pas +++ b/components/tvplanit/source/vpdayviewpainter.pas @@ -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); diff --git a/components/tvplanit/source/vpdbds.pas b/components/tvplanit/source/vpdbds.pas index 395f9645d..077a22610 100644 --- a/components/tvplanit/source/vpdbds.pas +++ b/components/tvplanit/source/vpdbds.pas @@ -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 diff --git a/components/tvplanit/source/vpedfmtlst.pas b/components/tvplanit/source/vpedfmtlst.pas index 3fa89d628..01658532b 100644 --- a/components/tvplanit/source/vpedfmtlst.pas +++ b/components/tvplanit/source/vpedfmtlst.pas @@ -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 diff --git a/components/tvplanit/source/vpevnteditdlg.pas b/components/tvplanit/source/vpevnteditdlg.pas index 1f6f07c12..0bba26c1c 100644 --- a/components/tvplanit/source/vpevnteditdlg.pas +++ b/components/tvplanit/source/vpevnteditdlg.pas @@ -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; diff --git a/components/tvplanit/source/vpflxds.pas b/components/tvplanit/source/vpflxds.pas index e1193f2e1..f3ce144e4 100644 --- a/components/tvplanit/source/vpflxds.pas +++ b/components/tvplanit/source/vpflxds.pas @@ -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; diff --git a/components/tvplanit/source/vpical.pas b/components/tvplanit/source/vpical.pas index e36785b70..2a3816ea1 100644 --- a/components/tvplanit/source/vpical.pas +++ b/components/tvplanit/source/vpical.pas @@ -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; diff --git a/components/tvplanit/source/vpinids.pas b/components/tvplanit/source/vpinids.pas index 7acadcbb7..31cd5bafa 100644 --- a/components/tvplanit/source/vpinids.pas +++ b/components/tvplanit/source/vpinids.pas @@ -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); diff --git a/components/tvplanit/source/vpledlabel.pas b/components/tvplanit/source/vpledlabel.pas index 7a684567c..82e7068b6 100644 --- a/components/tvplanit/source/vpledlabel.pas +++ b/components/tvplanit/source/vpledlabel.pas @@ -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); diff --git a/components/tvplanit/source/vpmisc.pas b/components/tvplanit/source/vpmisc.pas index abe9534f0..5c8829f82 100644 --- a/components/tvplanit/source/vpmisc.pas +++ b/components/tvplanit/source/vpmisc.pas @@ -209,6 +209,7 @@ var L: TStrings; i: Integer; begin + Result := nil; L := TStringList.Create; try L.Delimiter := ADelimiter; diff --git a/components/tvplanit/source/vpmonthview.pas b/components/tvplanit/source/vpmonthview.pas index a8b8dac92..fe79549f3 100644 --- a/components/tvplanit/source/vpmonthview.pas +++ b/components/tvplanit/source/vpmonthview.pas @@ -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); diff --git a/components/tvplanit/source/vpprtfmt.pas b/components/tvplanit/source/vpprtfmt.pas index 6df6d8b80..4c73eec30 100644 --- a/components/tvplanit/source/vpprtfmt.pas +++ b/components/tvplanit/source/vpprtfmt.pas @@ -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; {=====} diff --git a/components/tvplanit/source/vpprtprv.pas b/components/tvplanit/source/vpprtprv.pas index 4fbd2ef82..bff81c904 100644 --- a/components/tvplanit/source/vpprtprv.pas +++ b/components/tvplanit/source/vpprtprv.pas @@ -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); diff --git a/components/tvplanit/source/vptimerpool.pas b/components/tvplanit/source/vptimerpool.pas index 96f9014fa..e6356b12c 100644 --- a/components/tvplanit/source/vptimerpool.pas +++ b/components/tvplanit/source/vptimerpool.pas @@ -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]); diff --git a/components/tvplanit/source/vpweekview.pas b/components/tvplanit/source/vpweekview.pas index 3a0331a6e..a09675de0 100644 --- a/components/tvplanit/source/vpweekview.pas +++ b/components/tvplanit/source/vpweekview.pas @@ -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); diff --git a/components/tvplanit/source/vpweekviewpainter.pas b/components/tvplanit/source/vpweekviewpainter.pas index 78c5917f0..4317c0734 100644 --- a/components/tvplanit/source/vpweekviewpainter.pas +++ b/components/tvplanit/source/vpweekviewpainter.pas @@ -574,7 +574,7 @@ procedure TVpWeekViewPainter.DrawHeader; var HeadRect: TRect; HeadTextRect: TRect; - HeadStr: string; + HeadStr: string = ''; HeadStrLen: Integer; weekNo: Integer; begin diff --git a/components/tvplanit/source/vpxparsr.pas b/components/tvplanit/source/vpxparsr.pas index 94d595f4b..965085ed8 100644 --- a/components/tvplanit/source/vpxparsr.pas +++ b/components/tvplanit/source/vpxparsr.pas @@ -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