Reduce compiler warnings, initialize some uninitialized variables.

git-svn-id: trunk@56869 -
This commit is contained in:
juha 2017-12-29 18:47:51 +00:00
parent 91c7a31267
commit c3e1dc4ad5
11 changed files with 29 additions and 26 deletions

View File

@ -546,6 +546,7 @@ end;
function TComponentTreeView.GetImageFor(APersistent: TPersistent): integer;
begin
Result := -1;
if Assigned(APersistent) then
begin
if (APersistent is TControl)
@ -563,10 +564,7 @@ begin
else
if (APersistent is TCollectionItem) then
Result := ImgIndexItem;
end
else
Result := -1;
end;
// finally, ask the designer such as TDesignerMediator to override it, if any
if Assigned(OnComponentGetImageIndex) then
OnComponentGetImageIndex(APersistent, Result);

View File

@ -17,7 +17,7 @@ unit IDEHelpIntf;
interface
uses
Classes, Types, SysUtils, strutils,
Classes, Types, SysUtils,
// LCL
LMessages, LCLType, LCLProc, Forms, Controls, Graphics,
HelpIntfs, LazHelpIntf, LCLIntf,

View File

@ -4788,10 +4788,6 @@ end;
procedure TfrDesignerForm.SelectionChanged;
var
t: TfrView;
i, j, L: Integer;
B: TfrObject;
C: TComponent;
M: TMenuItem;
begin
{$IFDEF DebugLR}
debugLnEnter('TfrDesignerForm.SelectionChanged INIT, SelNum=%d',[SelNum]);

View File

@ -645,7 +645,6 @@ var
i, aWidth, aHeight, BDeltaW, BDeltaH, BIndex,Cw,Ch: Integer;
PaperRect: TPaperRect;
ValidSize: Boolean;
CurDx, CurDy: Integer;
{$ifdef DbgPrinter_detail}
BestDw, BestDh: Integer;

View File

@ -176,7 +176,6 @@ type
procedure FormActivate(Sender: TObject);
procedure FormDeactivate(Sender: TObject);
private
{ Private declarations }
Doc: Pointer;
EMFPages: Pointer;
PBox: TfrPBox;
@ -217,13 +216,12 @@ type
procedure CreateExportFilterItems;
procedure ExportFilterItemExecClick(Sender: TObject);
public
{ Public declarations }
procedure Show_Modal(ADoc: Pointer);
end;
implementation
uses LR_Class, LR_Prntr, LR_Srch, LR_PrDlg, Printers, strutils, lr_PreviewToolsAbstract;
uses LR_Class, LR_Prntr, LR_Srch, LR_PrDlg, Printers, lr_PreviewToolsAbstract;
{$R *.lfm}

View File

@ -66,9 +66,9 @@ begin
begin
QPrinterInfo_printerName(Prntr, @PrnName);
if QPrinterInfo_isDefault(Prntr) then
Lst.InsertObject(0, PrnName, Prntr)
Lst.InsertObject(0, PrnName{%H-}, Prntr)
else
Lst.AddObject(PrnName, Prntr);
Lst.AddObject(PrnName{%H-}, Prntr);
end;
end;
finally

View File

@ -855,6 +855,7 @@ var
i: integer;
RtlLen: Integer;
begin
Result := 0;
FAdjustedLogToPhysOrigin := ABytePos;
{$IFDEF AssertSynMemIndex}
if (ABytePos <= 0) then

View File

@ -888,7 +888,9 @@ begin
end;
end;
end;
end;
end
else
p := Point(0,0);
// 2) See, if the current-1 line can be matched
r := False;

View File

@ -1041,7 +1041,9 @@ begin
CharWidthsArr := FLines.GetPhysicalCharWidths(Pchar(L), length(L), FLinePos-1);
LogLen := Length(CharWidthsArr);
if LogLen > 0 then
CharWidths := @CharWidthsArr[0];
CharWidths := @CharWidthsArr[0]
else
CharWidths := Nil;
end;
ScreenPos := 1;
@ -1525,15 +1527,14 @@ function TSynEditSelection.GetSelText : string;
Result := Copy(S, Index, Count)
else begin
SetLength(Result, DstLen);
P := PChar(Pointer(Result));
P := PChar(Result);
StrPCopy(P, Copy(S, Index, Count));
Inc(P, SrcLen);
FillChar(P^, DstLen - Srclen, $20);
end;
end;
procedure CopyAndForward(const S: string; Index, Count: Integer; var P:
PChar);
procedure CopyAndForward(const S: string; Index, Count: Integer; var P: PChar);
var
pSrc: PChar;
SrcLen: Integer;
@ -1573,9 +1574,9 @@ var
Col, Len: array of Integer;
begin
if not SelAvail then
Result := ''
else begin
Result := '';
if SelAvail then
begin
if IsBackwardSel then begin
ColFrom := FEndBytePos;
First := FEndLinePos - 1;

View File

@ -3376,8 +3376,11 @@ var
r, r2: Pointer;
begin
Assert(CurrentRanges <> nil, 'TSynCustomFoldHighlighter.FoldBlockEndLevel requires CurrentRanges');
Result := 0;
inf.EndLevelIfDef := 0;
inf.MinLevelIfDef := 0;
inf.EndLevelRegion := 0;
inf.MinLevelRegion := 0;
if (ALineIndex < 0) or (ALineIndex >= CurrentLines.Count - 1) then
exit;
@ -3426,8 +3429,11 @@ var
r, r2: Pointer;
begin
Assert(CurrentRanges <> nil, 'TSynCustomFoldHighlighter.FoldBlockMinLevel requires CurrentRanges');
Result := 0;
inf.EndLevelIfDef := 0;
inf.MinLevelIfDef := 0;
inf.EndLevelRegion := 0;
inf.MinLevelRegion := 0;
if (ALineIndex < 0) or (ALineIndex >= CurrentLines.Count - 1) then
exit;

View File

@ -1582,7 +1582,9 @@ begin
if (y1 < 0) or (y1 > Editor.LinesInWindow + 1) then
y := -1; // not visible
if y > 1 then
y2 := Editor.RowToScreenRow(y-1);
y2 := Editor.RowToScreenRow(y-1)
else
y2 := -1;
if (y > 0) and (y1 <> y2) or (y=1) then begin
if Carets.Visual[Result] = nil then