• R/O
  • SSH

SOM-Delphi: Commit

Delphi 7 bindings generator for IBM System Object Model 2.1


Commit MetaInfo

Revision9867440701d4a19bae3db29047d4196ca8811550 (tree)
Zeit2016-10-27 21:42:54
AutorIvan Levashev <bo_ <gen@octa...>
CommiterIvan Levashev <bo_

Log Message

Left TODO for future; commented sources for testing TypeCode_size

Ändern Zusammenfassung

Diff

diff -r 6cf4a2b6944c -r 9867440701d4 Old-Manual-SOM-3.0/som3-enum-compatibility.txt
--- a/Old-Manual-SOM-3.0/som3-enum-compatibility.txt Wed Oct 26 20:41:39 2016 +0700
+++ b/Old-Manual-SOM-3.0/som3-enum-compatibility.txt Thu Oct 27 19:42:54 2016 +0700
@@ -2,9 +2,9 @@
22 headers when using SOM emitters and being reinserted via "passthru" for C and
33 C++. So when we import these enums from SOM.IR, we get incorrect results. The
44 default enum size in SOM is 4 bytes and the count starts from 1. But these
5-hacked enums start from 0, and what is worse, they seem to 1 byte, as this is
6-the default enum size in VAC. Also, some difference is found between SOM 2.1
7-and SOM 3.0. This needs to be sorted out.
5+hacked enums start from 0, and what is worse, they seem to be 1 byte, as this
6+is the default enum size in VAC. Also, some difference is found between SOM
7+2.1 and SOM 3.0. This needs to be sorted out.
88
99 SOMTTypes is the usual enum, so checking on it.
1010
diff -r 6cf4a2b6944c -r 9867440701d4 SOMIRTest.TestOut.dpr
--- a/SOMIRTest.TestOut.dpr Wed Oct 26 20:41:39 2016 +0700
+++ b/SOMIRTest.TestOut.dpr Thu Oct 27 19:42:54 2016 +0700
@@ -50,6 +50,41 @@
5050 o.somUninit;
5151 end;
5252
53+(*
54+function TypeCodeNew(tag: TCKind): TypeCode; cdecl; varargs; external 'somtc.dll' name 'tcNew';
55+
56+procedure TestAlignmentAndSize;
57+var
58+ MyTC: TypeCode;
59+begin
60+ MyTC := TypeCodeNew(tk_struct, 'Test_1',
61+ 'Byte', TypeCodeNew(tk_octet),
62+ 'Integer', TypeCodeNew(tk_long),
63+ nil);
64+ WriteLn('Test_1 size: ', MyTC.Size);
65+ MyTC.Free;
66+ MyTC := TypeCodeNew(tk_struct, 'Test_2',
67+ 'Byte', TypeCodeNew(tk_octet),
68+ 'Subrecord', TypeCodeNew(tk_struct, 'Test_1',
69+ 'Byte', TypeCodeNew(tk_octet),
70+ 'Integer', TypeCodeNew(tk_long),
71+ nil),
72+ nil);
73+ WriteLn('Test_2 size: ', MyTC.Size);
74+ MyTC.Free;
75+ MyTC := TypeCodeNew(tk_struct, 'Test_3',
76+ 'Byte', TypeCodeNew(tk_octet),
77+ 'Subrecord', TypeCodeNew(tk_struct, 'Test_4',
78+ 'Byte', TypeCodeNew(tk_octet),
79+ 'Byte', TypeCodeNew(tk_octet),
80+ 'Integer', TypeCodeNew(tk_long),
81+ nil),
82+ nil);
83+ WriteLn('Test_3 size: ', MyTC.Size);
84+ MyTC.Free;
85+end;
86+*)
87+
5388 begin
5489 try
5590 WriteLn('Testing SOMObject v', SOM_MajorVersion, '.', SOM_MinorVersion);
@@ -57,6 +92,7 @@
5792 SOMObject.NewClass;
5893 TestSOM_Basic;
5994 TestSOM_Renew;
95+ // TestAlignmentAndSize;
6096 except
6197 on e: Exception do
6298 WriteLn(GetTypeData(e.ClassInfo).UnitName + '.' + e.ClassName + ':' + e.Message);
diff -r 6cf4a2b6944c -r 9867440701d4 TODO.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/TODO.txt Thu Oct 27 19:42:54 2016 +0700
@@ -0,0 +1,5 @@
1+packed records and arrays to match SOM 2.1 ABI
2+InstanceSize, InitInstance and convert Create from class function to constructor
3+fix argument type in default assignment and copying constructor (implement Clone?)
4+make Supports return False if class is not created yet
5+memory management hints in arguments
Show on old repository browser