summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-03-11 21:49:34 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-03-11 21:49:34 +0000
commit0129e86a920fb386e327ae09f4dcad66d7e47090 (patch)
tree9fb4c876603d18fd3d9c10e390d8c6ebf74dde65
parent2435740b858a20773cd35ba0e6b21110fc727367 (diff)
downloadfpc-0129e86a920fb386e327ae09f4dcad66d7e47090.tar.gz
Merged revisions 6770,6778,6782-6783 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk r6770 (florian) * experimental ie fix for dispinterfaces with rtti r6778 (florian) * fix memory leak in graph, resolves #8467 * small cleanups r6782 (marco) * patch from #8480 committed. #0#0 also copied. r6783 (florian) * fixed patch for #8480 git-svn-id: http://svn.freepascal.org/svn/fpc/branches/fixes_2_2@6796 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/ncgrtti.pas5
-rw-r--r--packages/base/graph/inc/graph.inc51
-rw-r--r--packages/base/graph/inc/modes.inc6
-rw-r--r--rtl/inc/wstrings.inc9
4 files changed, 29 insertions, 42 deletions
diff --git a/compiler/ncgrtti.pas b/compiler/ncgrtti.pas
index 0746ce33b7..567ba7db97 100644
--- a/compiler/ncgrtti.pas
+++ b/compiler/ncgrtti.pas
@@ -705,10 +705,10 @@ implementation
longint([
{$endif USE_PACKSET1}
TCompilerIntfFlag(ord(ifHasGuid)*ord(assigned(def.iidguid))),
- TCompilerIntfFlag(ord(ifHasStrGUID)*ord(assigned(def.iidstr)))
+ TCompilerIntfFlag(ord(ifHasStrGUID)*ord(assigned(def.iidstr))),
+ TCompilerIntfFlag(ord(ifDispInterface)*ord(def.objecttype=odt_dispinterface))
])
{
- ifDispInterface,
ifDispatch, }
));
{$ifdef cpurequiresproperalignment}
@@ -751,6 +751,7 @@ implementation
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkclass));
odt_object:
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkobject));
+ odt_dispinterface,
odt_interfacecom:
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkinterface));
odt_interfacecorba:
diff --git a/packages/base/graph/inc/graph.inc b/packages/base/graph/inc/graph.inc
index 3627a29cfa..3a324cc9e1 100644
--- a/packages/base/graph/inc/graph.inc
+++ b/packages/base/graph/inc/graph.inc
@@ -47,8 +47,6 @@ const
StdBufferSize = 4096; { Buffer size for FloodFill }
type
-
-
tinttable = array[0..16383] of smallint;
pinttable = ^tinttable;
@@ -1864,31 +1862,23 @@ end;
FillPattern:=FillpatternTable[UserFill];
end;
-
-
-
-
-
procedure DrawPoly(numpoints : word;var polypoints);
-
- type
- ppointtype = ^pointtype;
- pt = array[0..16000] of pointtype;
-
- var
- i : longint;
-
+ type
+ ppointtype = ^pointtype;
+ pt = array[0..16000] of pointtype;
+ var
+ i : longint;
begin
- if numpoints < 2 then
- begin
- _GraphResult := grError;
- exit;
- end;
- for i:=0 to numpoints-2 do
- line(pt(polypoints)[i].x,
- pt(polypoints)[i].y,
- pt(polypoints)[i+1].x,
- pt(polypoints)[i+1].y);
+ if numpoints < 2 then
+ begin
+ _GraphResult := grError;
+ exit;
+ end;
+ for i:=0 to numpoints-2 do
+ line(pt(polypoints)[i].x,
+ pt(polypoints)[i].y,
+ pt(polypoints)[i+1].x,
+ pt(polypoints)[i+1].y);
end;
@@ -1984,8 +1974,7 @@ end;
DriverName:=InternalDriverName; { DOS Graphics driver }
if (Graphdriver=Detect)
- or (GraphMode = detectMode)
- then
+ or (GraphMode = detectMode) then
begin
internDetectGraph(GraphDriver,GraphMode,true);
If _GraphResult = grNotDetected then Exit;
@@ -2001,7 +1990,7 @@ end;
{ Actually set the graph mode...}
if firstCallOfInitgraph then
begin
- SaveVideoState;
+ SaveVideoState;
firstCallOfInitgraph := false;
end;
SetGraphMode(GraphMode);
@@ -2026,7 +2015,7 @@ end;
if firstCallOfInitgraph then
begin
- SaveVideoState;
+ SaveVideoState;
firstCallOfInitgraph := false;
end;
SetGraphMode(GraphMode);
@@ -2059,8 +2048,8 @@ end;
{ release memory allocated for fonts }
for c := 1 to installedfonts do
with fonts[c] Do
- If assigned(instr) Then
- Freemem(instr,instrlength);
+ If assigned(instr) Then
+ System.Freemem(instr,instrlength);
{ release memory allocated for modelist }
list := ModeList;
while assigned(list) do
diff --git a/packages/base/graph/inc/modes.inc b/packages/base/graph/inc/modes.inc
index 2e2594f8de..8e6000f2a4 100644
--- a/packages/base/graph/inc/modes.inc
+++ b/packages/base/graph/inc/modes.inc
@@ -132,10 +132,7 @@ end;
logln('Adding resolution '+strf(modenr)+' for drivernr '+strf(drivernr)+
' ('+strf(mode.maxx)+'x'+strf(mode.maxy)+')');
{$endif logging}
- if assigned(list) then
- newLst^.next := list^.next
- else
- newLst^.next := nil;
+ newLst^.next := list;
if assigned(prev) then
prev^.next := newLst
else
@@ -170,7 +167,6 @@ end;
list^.next := NewLst;
move(mode, NewLst^, sizeof(Mode));
end;
-
end;
diff --git a/rtl/inc/wstrings.inc b/rtl/inc/wstrings.inc
index b1b02c2268..baf867b779 100644
--- a/rtl/inc/wstrings.inc
+++ b/rtl/inc/wstrings.inc
@@ -238,12 +238,13 @@ Procedure fpc_WideStr_Incr_Ref(Var S : Pointer);[Public,Alias:'FPC_WIDESTR_INCR_
exit;
{$ifdef FPC_WINLIKEWIDESTRING}
p:=NewWidestring(length(WideString(S)));
- move(s^,p^,length(WideString(s))*sizeof(widechar));
+ move(s^,p^,(length(WideString(s))+1)*sizeof(widechar)); // double #0 too
s:=p;
{$else FPC_WINLIKEWIDESTRING}
{ Let's be paranoid : Constant string ??}
- If PWideRec(S-WideFirstOff)^.Ref<0 then exit;
- inclocked(PWideRec(S-WideFirstOff)^.Ref);
+ If PWideRec(S-WideFirstOff)^.Ref<0 then
+ exit;
+ inclocked(PWideRec(S-WideFirstOff)^.Ref);
{$endif FPC_WINLIKEWIDESTRING}
end;
@@ -377,7 +378,7 @@ begin
if S2<>nil then
begin
S1:=NewWidestring(length(WideString(S2)));
- move(s2^,s1^,length(WideString(s1))*sizeof(widechar));
+ move(s2^,s1^,(length(WideString(s1))+1)*sizeof(widechar));
end
else
S1:=nil;