<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Custom Drawers.<br>
<br>
I deleted and re-downloaded the Lazarus trunk and after this I
can't even run an empty form any more. It generates the said
Rangecheck errors, so nothing seems to have been improved on that
behalf since March. <br>
<br>
.-Michael <br>
<br>
<br>
<br>
<br>
On 07/03/2012 12:00 PM, Michael Schnell wrote:<br>
</div>
<blockquote cite="mid:4FF2C2CF.3040100@lumino.de" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">On 07/03/2012 10:48 AM, Felipe
Monteiro de Carvalho wrote:<br>
</div>
<blockquote
cite="mid:CACyNnZOVhV1uqw5gadcqJK8FdP1SyDHVopXJaNKOjKaZTpYKAQ@mail.gmail.com"
type="cite"> Could you send me a patch? </blockquote>
trying to remember which file(s) I modified ..... <span
class="moz-smiley-s2"><span> :-( </span></span><br>
I'll try to look this up. (I'm not yet up to speed with svn but
trying <span class="moz-smiley-s1"><span> :-) </span></span> )
...<br>
<br>
OK. See below. Not sure which changes in fact did the trick for
the form and which were done trying to debug and to get e.g TLable
running. And which might be shown due to me not merging and the
repository getting changes. <br>
<br>
I do remember the Get_Long / Get_ULong issue. Here I definitely
found that the types Long and ULong were used in a sloppy way,
resulting in a range check condition when an ULong value >
$7FFFFFFF is assigned to a signed Long. <br>
<br>
Similar with <tt>PtrInt vs THandle. <br>
<br>
</tt>Maybe you want to take a look at my old posts on this in the
this forum.....<br>
<br>
<tt>-Michael<br>
</tt> <br>
<blockquote
cite="mid:CACyNnZOVhV1uqw5gadcqJK8FdP1SyDHVopXJaNKOjKaZTpYKAQ@mail.gmail.com"
type="cite">
<pre wrap="">TTInterp Line 481:
exc.opcode := exc.Code^[exc.IP];
</pre>
<pre wrap="">In which unit?</pre>
</blockquote>
(*******************************************************************<br>
*<br>
* TTInterp.pas 2.0<br>
*<br>
* TrueType bytecode intepreter.<br>
* <br>
<br>
IFAIR, all these range check problems are due to glitches in these
Font related functions that seem to be implemented in a way that
relies on range check beeing off. I don't think this is a good
idea and I think that these issues should be fixed by using the
correct types and/or explicit typecasts when appropriate. <br>
<br>
-Michael<br>
<br>
svn diff: <br>
<hr size="2" width="100%"><tt>---
components/lazutils/ttload.pas (revision 37854)<br>
+++ components/lazutils/ttload.pas (working copy)<br>
@@ -56,6 +56,8 @@<br>
<br>
implementation<br>
<br>
+{$R-}<br>
+<br>
uses TTError, TTMemory, TTFile;<br>
<br>
(* Composite glyph decoding flags *)<br>
@@ -248,25 +250,27 @@<br>
exit;<br>
end;<br>
<br>
- with face^ do<br>
- begin<br>
+// with face^ do<br>
+// begin<br>
<br>
- numTables := tableDir.numTables;<br>
+ face^.numTables := tableDir.numTables;<br>
<br>
- if Alloc( dirTables, numTables * sizeof( TTableDirEntry )
) or<br>
- TT_Access_Frame( 16 * numTables ) then exit;<br>
+ if Alloc( face^.dirTables, face^.numTables * sizeof(
TTableDirEntry ) ) or<br>
+ TT_Access_Frame( 16 * face^.numTables ) then exit;<br>
<br>
- for n := 0 to numTables-1 do with dirTables^[n] do<br>
+ for n := 0 to face^.numTables-1 do<br>
begin<br>
- Tag := GET_ULong;<br>
- Checksum := GET_ULong;<br>
- Offset := GET_Long;<br>
- Length := Get_Long;<br>
+ face^.dirTables^[n].Tag := GET_ULong;<br>
+ face^.dirTables^[n].Checksum := GET_ULong;<br>
+// face^.dirTables^[n].Tag := GET_Long;<br>
+// face^.dirTables^[n].Checksum := GET_Long;<br>
+ face^.dirTables^[n].Offset := GET_Long;<br>
+ face^.dirTables^[n].Length := Get_Long;<br>
end;<br>
<br>
TT_Forget_Frame;<br>
<br>
- end;<br>
+// end;<br>
<br>
{$IFDEF FREETYPE_DEBUG} Writeln('loaded'); {$ENDIF}<br>
<br>
Index: components/lazutils/lazfreetype.pas<br>
===================================================================<br>
--- components/lazutils/lazfreetype.pas (revision 37854)<br>
+++ components/lazutils/lazfreetype.pas (working copy)<br>
@@ -464,6 +464,8 @@<br>
TTGLoad,<br>
TTRaster;<br>
<br>
+{$R-}<br>
+<br>
(*****************************************************************)<br>
(*
*)<br>
(*
*)<br>
Index: components/lazutils/ttobjs.pas<br>
===================================================================<br>
--- components/lazutils/ttobjs.pas (revision 37854)<br>
+++ components/lazutils/ttobjs.pas (working copy)<br>
@@ -796,6 +796,8 @@<br>
<br>
<br>
<br>
+{$R-}<br>
+<br>
const<br>
objs_face_class : TCache_Class<br>
= (object_size: sizeof(TFace);<br>
Index: components/lazutils/ttmemory.pas<br>
===================================================================<br>
--- components/lazutils/ttmemory.pas (revision 37854)<br>
+++ components/lazutils/ttmemory.pas (working copy)<br>
@@ -64,6 +64,7 @@<br>
<br>
uses TTTypes;<br>
<br>
+{$R-}<br>
{$I TTCONFIG.INC}<br>
<br>
type<br>
Index: components/lazutils/ttfile.pas<br>
===================================================================<br>
--- components/lazutils/ttfile.pas (revision 37854)<br>
+++ components/lazutils/ttfile.pas (working copy)<br>
@@ -48,6 +48,8 @@<br>
<br>
{$I TTCONFIG.INC}<br>
<br>
+{$R-}<br>
+<br>
uses TTTypes,<br>
TTError;<br>
<br>
Index: lcl/interfaces/customdrawn/customdrawndefines.inc<br>
===================================================================<br>
--- lcl/interfaces/customdrawn/customdrawndefines.inc
(revision 37854)<br>
+++ lcl/interfaces/customdrawn/customdrawndefines.inc (working
copy)<br>
@@ -3,6 +3,12 @@<br>
{$modeswitch objectivec1}{$H+}// modeswitch seams to deactivate
H+<br>
{$endif}<br>
<br>
+<br>
+<br>
+{$define CD_Debug_TTF}<br>
+<br>
+<br>
+<br>
// For now default to Android for arm-linux,<br>
// because LCL-CustomDrawn is our main Android widgetset.<br>
// Remove this when Android gets it's own target<br>
Index: lcl/interfaces/fpgui/fpguiobject.inc<br>
===================================================================<br>
--- lcl/interfaces/fpgui/fpguiobject.inc (revision 37854)<br>
+++ lcl/interfaces/fpgui/fpguiobject.inc (working copy)<br>
@@ -150,7 +150,7 @@<br>
begin<br>
Timer := TFPGUITimer.Create(Interval, TimerFunc);<br>
<br>
- Result := PtrInt(Timer);<br>
+ Result := THandle(Timer);<br>
end;<br>
<br>
{------------------------------------------------------------------------------<br>
</tt><br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Customdrawn mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Customdrawn@lists.lazarus.freepascal.org">Customdrawn@lists.lazarus.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/customdrawn">http://lists.lazarus.freepascal.org/mailman/listinfo/customdrawn</a>
</pre>
</blockquote>
<br>
</body>
</html>