mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 12:35:55 +02:00
Support compiling more of Lazarus + its components with -Sy option.
This commit is contained in:
parent
dad81015b0
commit
db2bca3949
@ -4424,7 +4424,7 @@ begin
|
||||
StartPos:=ANode.StartPos;
|
||||
EndPos:=StartPos+20;
|
||||
if EndPos>ANode.EndPos then EndPos:=ANode.EndPos;
|
||||
Result:=crc32(0, @Tool.Src[StartPos], EndPos-StartPos);
|
||||
Result:=crc32(0, PByte(@Tool.Src[StartPos]), EndPos-StartPos);
|
||||
end else
|
||||
Result:=0;
|
||||
end;
|
||||
|
@ -4062,13 +4062,13 @@ begin
|
||||
if CIE64^.CIEId = QWord($ffffffffffffffff) then
|
||||
begin
|
||||
// It is a CIE
|
||||
CIE := LoadCiE(CIE64^.Version, @CIE64^.Augmentation[0], @CIE64^.CIEId+CIE64^.Length-@CIE64^.Augmentation[0]);
|
||||
CIE := LoadCiE(CIE64^.Version, @CIE64^.Augmentation[0], Pointer(@CIE64^.CIEId+CIE64^.Length)-Pointer(@CIE64^.Augmentation[0]));
|
||||
CFI.AddCIE(p-inf.RawData, CIE);
|
||||
end
|
||||
else
|
||||
begin
|
||||
// It is a FDE
|
||||
FDE := LoadFDE(CFI, FDE64^.CIEPointer, @FDE64^.InitialLocation, @FDE64^.CIEPointer+FDE64^.Length-@FDE64^.InitialLocation);
|
||||
FDE := LoadFDE(CFI, FDE64^.CIEPointer, @FDE64^.InitialLocation, Pointer(@FDE64^.CIEPointer+FDE64^.Length)-Pointer(@FDE64^.InitialLocation));
|
||||
if Assigned(FDE) then
|
||||
CFI.AddFDE(FDE);
|
||||
end;
|
||||
@ -4081,7 +4081,7 @@ begin
|
||||
if CIE32^.CIEId = $ffffffff then
|
||||
begin
|
||||
// It is a CIE
|
||||
CIE := LoadCiE(CIE32^.Version, @CIE32^.Augmentation[0], @CIE32^.CIEId+CIE32^.Length-@CIE32^.Augmentation[0]);
|
||||
CIE := LoadCiE(CIE32^.Version, @CIE32^.Augmentation[0], Pointer(@CIE32^.CIEId+CIE32^.Length)-Pointer(@CIE32^.Augmentation[0]));
|
||||
CFI.AddCIE(p-inf.RawData, CIE);
|
||||
end
|
||||
else
|
||||
@ -4937,7 +4937,7 @@ constructor TDwarfCompilationUnit.Create(AOwner: TFpDwarfInfo; ADebugFile: PDwar
|
||||
// directories & filenames
|
||||
FLineInfo.Directories := TStringList.Create;
|
||||
FLineInfo.Directories.Add(''); // current dir
|
||||
Name := @Info^.StandardOpcodeLengths;
|
||||
Name := PChar(@Info^.StandardOpcodeLengths);
|
||||
Inc(Name, Info^.OpcodeBase-1);
|
||||
// directories
|
||||
while Name^ <> #0 do
|
||||
|
@ -1,5 +1,6 @@
|
||||
unit FpImgReaderMachoFile;
|
||||
|
||||
{$T-} // TODO: Fix compilation with -Sy.
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
@ -37,11 +37,12 @@
|
||||
*
|
||||
******************************************************************)
|
||||
|
||||
Unit TTRASTER;
|
||||
Unit TTRaster;
|
||||
|
||||
interface
|
||||
|
||||
{$R-} // TODO: Fix out-of-bounds accesses.
|
||||
{$T-} // TODO: Fix compilation with -Sy.
|
||||
{$I TTCONFIG.INC}
|
||||
|
||||
uses
|
||||
|
@ -232,7 +232,7 @@ begin
|
||||
end;
|
||||
SetLength(Children,aCount);
|
||||
if aCount>1 then
|
||||
MergeSortWithLen(@Children[0],aCount,@CompareDomNodeNames); // sort ascending [0]<[1]
|
||||
MergeSortWithLen(PPointer(@Children[0]),aCount,@CompareDomNodeNames); // sort ascending [0]<[1]
|
||||
for m:=0 to aCount-2 do
|
||||
if Children[m].NodeName=Children[m+1].NodeName then begin
|
||||
// duplicate found: nodes with same name
|
||||
|
@ -1647,10 +1647,10 @@ begin
|
||||
|
||||
FNsAttHash := TDblHashArray.Create;
|
||||
SetLength(FWorkAtts, 16);
|
||||
FStdPrefix_xml := FNSHelper.GetPrefix(@PrefixDefault, 3);
|
||||
FStdPrefix_xmlns := FNSHelper.GetPrefix(@PrefixDefault, 5);
|
||||
FStdPrefix_xml := FNSHelper.GetPrefix(PChar(@PrefixDefault), 3);
|
||||
FStdPrefix_xmlns := FNSHelper.GetPrefix(PChar(@PrefixDefault), 5);
|
||||
// Set char rules to XML 1.0
|
||||
FNamePages := @NamePages;
|
||||
FNamePages := PByteArray(@NamePages);
|
||||
SetLength(FValidator, 16);
|
||||
end;
|
||||
|
||||
|
@ -572,7 +572,7 @@ implementation
|
||||
|
||||
function TLazListClassesInternalMem.GetDataPointer: PByte;
|
||||
begin
|
||||
Result := @(FMem^.Data);
|
||||
Result := PByte(@(FMem^.Data));
|
||||
end;
|
||||
|
||||
function TLazListClassesInternalMem.GetFirstItemIndex: Integer;
|
||||
|
@ -434,12 +434,13 @@ var
|
||||
const
|
||||
|
||||
(* When adding new entries, ensure that resourcestrings are re-assigned in InitLocale *)
|
||||
EditorOptionsDividerDefaults: array[TLazSyntaxHighlighter] of
|
||||
TEditorOptionsDividerRecord =
|
||||
EditorOptionsDividerDefaults: array[TLazSyntaxHighlighter] of TEditorOptionsDividerRecord =
|
||||
( (Count: 0; Info: nil), // none
|
||||
(Count: 0; Info: nil), // text
|
||||
{$T-} // Fix compilation with -Sy. Type mismatch here. PEditorOptionsDividerInfoList <> TEditorOptionsDividerInfo
|
||||
(Count: 9; Info: @EditorOptionsDividerInfoPas[0]), // Freepas
|
||||
(Count: 9; Info: @EditorOptionsDividerInfoPas[0]), // pas
|
||||
{$T+}
|
||||
(Count: 0; Info: nil), // lfm
|
||||
(Count: 0; Info: nil), // xml
|
||||
(Count: 0; Info: nil), // html
|
||||
@ -642,9 +643,9 @@ const
|
||||
)
|
||||
);
|
||||
|
||||
{$T-} // Fix compilation with -Sy. Type mismatch here.
|
||||
(* When adding new entries, ensure that resourcestrings are re-assigned in InitLocale *)
|
||||
EditorOptionsFoldDefaults: array[TLazSyntaxHighlighter] of
|
||||
TEditorOptionsFoldRecord =
|
||||
EditorOptionsFoldDefaults: array[TLazSyntaxHighlighter] of TEditorOptionsFoldRecord =
|
||||
( (Count: 0; HasMarkup: False; Info: nil), // none
|
||||
(Count: 0; HasMarkup: False; Info: nil), // text
|
||||
(Count: 27; HasMarkup: True; Info: @EditorOptionsFoldInfoPas[0]), // Freepas
|
||||
@ -667,6 +668,7 @@ const
|
||||
(Count: 0; HasMarkup: False; Info: nil), // PO
|
||||
(Count: 0; HasMarkup: False; Info: nil) // Pike
|
||||
);
|
||||
{$T+}
|
||||
|
||||
const
|
||||
EditorOptsFormatVersion = 13;
|
||||
|
@ -1105,7 +1105,7 @@ var
|
||||
{$IFDEF HasX}
|
||||
NetAtom: TGdkAtom;
|
||||
AtomType: TGdkAtom;
|
||||
AIndex, ADesktop: pguint;
|
||||
AIndex, ADesktop: Pguchar;
|
||||
AFormat: gint;
|
||||
ALength: gint;
|
||||
{$ENDIF}
|
||||
@ -1486,7 +1486,7 @@ begin
|
||||
|
||||
if (Event^.is_hint <> 0) and (Event^._type = GDK_MOTION_NOTIFY) then
|
||||
GTKGetDevicePointer(Event^.window, Event^.device,
|
||||
@Event^.x, @Event^.y, @Event^.state);
|
||||
@Event^.x, @Event^.y, PGdkModifierType(@Event^.state));
|
||||
|
||||
{$IFDEF VerboseMouseBugfix}
|
||||
DesignOnlySignal:=GetDesignOnlySignalFlag(Widget,dstMouseMotion);
|
||||
@ -1555,7 +1555,7 @@ begin
|
||||
|
||||
if (Event^.is_hint <> 0) and (Event^._type = GDK_MOTION_NOTIFY) then
|
||||
GTKGetDevicePointer(Event^.window, Event^.device,
|
||||
@Event^.x, @Event^.y, @Event^.state);
|
||||
@Event^.x, @Event^.y, PGdkModifierType(@Event^.state));
|
||||
|
||||
{$IFDEF VerboseMouseBugfix}
|
||||
DebugLn('[GTKMotionNotifyAfter] ',
|
||||
|
@ -138,7 +138,7 @@ var
|
||||
P: PPointer;
|
||||
begin
|
||||
// Do not change the order here!!
|
||||
P := @g_iface^.row_changed;
|
||||
P := PPointer(@g_iface^.row_changed);
|
||||
|
||||
P^ := @TLCLListViewModel.row_changed; Inc(P);
|
||||
P^ := @TLCLListViewModel.row_inserted; Inc(P);
|
||||
|
@ -56,9 +56,9 @@ var
|
||||
PixmapArray: array[1..3] of PPgchar =
|
||||
(
|
||||
{1 - MDIMINBUTTON}
|
||||
@XPM_MDIMINBUTTON,
|
||||
@XPM_MDIMINBUTTON[Low(XPM_MDIMINBUTTON)],
|
||||
{2 - MDIRESTOREBUTTON}
|
||||
@XPM_MDIRESTOREBUTTON,
|
||||
@XPM_MDIRESTOREBUTTON[Low(XPM_MDIRESTOREBUTTON)],
|
||||
{3 - MDICLOSEBUTTON}
|
||||
@XPM_MDICLOSEBUTTON
|
||||
@XPM_MDICLOSEBUTTON[Low(XPM_MDICLOSEBUTTON)]
|
||||
);
|
||||
|
@ -467,7 +467,9 @@ begin
|
||||
{$ifdef UseStatusIcon}
|
||||
if FStatusIcon <> nil then
|
||||
begin
|
||||
{$T-} // PPGdkScreen = PGdkScreen; in FPC libs. @AScreen should be OK.
|
||||
gtk_status_icon_get_geometry(FStatusIcon, @AScreen, @AArea, @AOrientation);
|
||||
{$T+}
|
||||
Result.x := AArea.x;
|
||||
Result.y := AArea.y;
|
||||
end
|
||||
|
@ -3623,7 +3623,7 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
|
||||
gdk_drawable_get_size(AAlpha, @W, @H);
|
||||
gdk_drawable_get_size(AAlpha, Pgint(@W), Pgint(@H));
|
||||
D := gdk_drawable_get_depth(AAlpha);
|
||||
if (D <> 1) and (D <> 8)
|
||||
then begin
|
||||
@ -4475,12 +4475,11 @@ var
|
||||
ScreenNum: Integer;
|
||||
RootWin: TWindow;
|
||||
WMAtom: TAtom;
|
||||
|
||||
typeReturned: TAtom;
|
||||
formatReturned: Integer;
|
||||
nitemsReturned: PtrInt;
|
||||
unused: PtrInt;
|
||||
WidgetIndex, DesktopIndex: Pointer;
|
||||
formatReturned: cint;
|
||||
nitemsReturned: culong;
|
||||
unused: culong;
|
||||
WidgetIndex, DesktopIndex: Pcuchar;
|
||||
WidgetWin: TWindow;
|
||||
begin
|
||||
Result := True;
|
||||
@ -4503,8 +4502,7 @@ begin
|
||||
@typeReturned, @formatReturned, @nitemsReturned,
|
||||
@unused, @WidgetIndex) = Success then
|
||||
begin
|
||||
if (typeReturned = XA_CARDINAL) and (formatReturned = 32) and
|
||||
(WidgetIndex <> nil) then
|
||||
if (typeReturned = XA_CARDINAL) and (formatReturned = 32) and (WidgetIndex <> nil) then
|
||||
begin
|
||||
// now get current active desktop index
|
||||
WMAtom := XInternAtom(Display,'_NET_CURRENT_DESKTOP', True);
|
||||
@ -4512,9 +4510,8 @@ begin
|
||||
XA_CARDINAL, @typeReturned, @formatReturned, @nitemsReturned,
|
||||
@unused, @DesktopIndex) = Success then
|
||||
begin
|
||||
if (typeReturned = XA_CARDINAL) and (formatReturned = 32) and
|
||||
(DesktopIndex <> nil) then
|
||||
Result := PtrUint(WidgetIndex^) = PtrUint(DesktopIndex^);
|
||||
if (typeReturned = XA_CARDINAL) and (formatReturned = 32) and (DesktopIndex <> nil) then
|
||||
Result := WidgetIndex^ = DesktopIndex^;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -4536,12 +4533,11 @@ var
|
||||
RootWin: TWindow;
|
||||
WMAtom: TAtom;
|
||||
WMWindow: TWindow;
|
||||
|
||||
typeReturned: TAtom;
|
||||
formatReturned: Integer;
|
||||
nitemsReturned: PtrInt;
|
||||
unused: PtrInt;
|
||||
data: Pointer;
|
||||
formatReturned: cint;
|
||||
nitemsReturned: culong;
|
||||
unused: culong;
|
||||
data: Pcuchar;
|
||||
// Screen: PGdkScreen;
|
||||
begin
|
||||
Result := '';
|
||||
@ -4570,7 +4566,7 @@ begin
|
||||
(Data <> nil) then
|
||||
begin
|
||||
// this is our window manager window
|
||||
WMWindow := TWindow(Data^);
|
||||
WMWindow := PWindow(Data)^;
|
||||
XFree(Data);
|
||||
Data := nil;
|
||||
end;
|
||||
@ -4583,7 +4579,7 @@ begin
|
||||
@unused, @data) = Success then
|
||||
begin
|
||||
if (typeReturned = WMAtom) and (formatReturned = 8) then
|
||||
Result := LowerCase(StrPas(Data));
|
||||
Result := LowerCase(StrPas(PWideChar(Data)));
|
||||
if Data <> nil then
|
||||
XFree(Data);
|
||||
Data := nil;
|
||||
@ -4599,9 +4595,9 @@ var
|
||||
RootWin, ResultWindow: TWindow;
|
||||
WMAtom: TAtom;
|
||||
ActualTypeReturn: TAtom;
|
||||
ActualFormatReturn: LongInt;
|
||||
NItemsReturn, BytesAfterReturn: Cardinal;
|
||||
Ptr: PByte;
|
||||
ActualFormatReturn: cint;
|
||||
NItemsReturn, BytesAfterReturn: culong;
|
||||
Ptr: Pcuchar;
|
||||
Valid: Boolean;
|
||||
begin
|
||||
Result := 0;
|
||||
@ -4634,10 +4630,10 @@ var
|
||||
X11Window: TWindow;
|
||||
WMAtom: TAtom;
|
||||
typeReturned: TAtom;
|
||||
formatReturned: Integer;
|
||||
nitemsReturned: PtrInt;
|
||||
unused: PtrInt;
|
||||
data: Pointer;
|
||||
formatReturned: cint;
|
||||
nitemsReturned: culong;
|
||||
unused: culong;
|
||||
data: Pcuchar;
|
||||
begin
|
||||
Result := False;
|
||||
Display := gdk_x11_get_default_xdisplay;
|
||||
@ -4681,7 +4677,7 @@ end;
|
||||
procedure TGtk2WidgetSet.HideAllHints;
|
||||
var
|
||||
TopList, List: PGList;
|
||||
Window: PGTKWindow;
|
||||
Window: gpointer;
|
||||
begin
|
||||
TopList := gdk_window_get_toplevels;
|
||||
List := TopList;
|
||||
@ -4689,16 +4685,16 @@ begin
|
||||
begin
|
||||
if (List^.Data <> nil) then
|
||||
begin
|
||||
gdk_window_get_user_data(PGDKWindow(List^.Data), Pgpointer(@Window));
|
||||
gdk_window_get_user_data(PGDKWindow(List^.Data), @Window);
|
||||
if GDK_IS_WINDOW(PGDKWindow(List^.Data)) then
|
||||
begin
|
||||
if gtk_is_window(Window) then
|
||||
begin
|
||||
if g_object_get_data(PGObject(Window),'lclhintwindow') <> nil then
|
||||
if g_object_get_data(Window,'lclhintwindow') <> nil then
|
||||
begin
|
||||
if gdk_window_is_visible(PGDKWindow(List^.Data)) then
|
||||
begin
|
||||
g_object_set_data(PGObject(Window),'lclneedrestorevisible',Pointer(1));
|
||||
g_object_set_data(Window,'lclneedrestorevisible',Pointer(1));
|
||||
gdk_window_hide(PGDKWindow(List^.Data));
|
||||
end;
|
||||
end;
|
||||
@ -6618,7 +6614,7 @@ begin
|
||||
{$ENDIF}
|
||||
if (ALeft <= 0) or (ATop <= 0) or (AWidth <= 0) or (AHeight <= 0) then
|
||||
begin
|
||||
gdk_screen_get_monitor_geometry(gdk_screen_get_default, 0, @R);
|
||||
gdk_screen_get_monitor_geometry(gdk_screen_get_default, 0, PGdkRectangle(@R));
|
||||
aRequisition.width := 75;
|
||||
aRequisition.height := 32;
|
||||
AAllocation.x := R.CenterPoint.x;
|
||||
|
Loading…
Reference in New Issue
Block a user