From 08306b3601c6e0b47be41c0a1ad73514bbc1f4ba Mon Sep 17 00:00:00 2001 From: Freeman Date: Sun, 10 Jan 2021 10:12:00 +0300 Subject: [PATCH] SysUtils helper types moved to System unit --- Examples/Console/ReadFolder/ReadFolder.dpr | 2 +- Lib/SysUtils.pas | 35 ++++++---------------- Lib/System.pas | 30 +++++++++++++++++++ 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/Examples/Console/ReadFolder/ReadFolder.dpr b/Examples/Console/ReadFolder/ReadFolder.dpr index 4e1a758..94e11e8 100644 --- a/Examples/Console/ReadFolder/ReadFolder.dpr +++ b/Examples/Console/ReadFolder/ReadFolder.dpr @@ -1,7 +1,7 @@ program ReadFolderApp; uses - KolibriOS, CRT, SysUtils; + KolibriOS, CRT; const Path = '/sys'; diff --git a/Lib/SysUtils.pas b/Lib/SysUtils.pas index f99fa8b..78fa4fb 100644 --- a/Lib/SysUtils.pas +++ b/Lib/SysUtils.pas @@ -9,35 +9,18 @@ unit SysUtils; interface type - WordRec = packed record - case Byte of - 0: (Lo, Hi: Byte); - 1: (Bytes: array [0..1] of Byte); - end; + WordRec = System.WordRec; + LongRec = System.LongRec; + Int64Rec = System.Int64Rec; - LongRec = packed record - case Byte of - 0: (Lo, Hi: Word); - 1: (Words: array [0..1] of Word); - 2: (Bytes: array [0..3] of Byte); - end; + PByteArray = System.PByteArray; + TByteArray = System.TByteArray; - Int64Rec = packed record - case Byte of - 0: (Lo, Hi: LongWord); - 1: (LongWords: array [0..1] of LongWord); - 2: (Words: array [0..3] of Word); - 3: (Bytes: array [0..7] of Byte); - end; + PWordArray = System.PWordArray; + TWordArray = System.TWordArray; - PByteArray = ^TByteArray; - TByteArray = array[0..MaxInt - 1] of Byte; - - PWordArray = ^TWordArray; - TWordArray = array[0..MaxInt div SizeOf(Word) - 1] of Word; - - PLongWordArray = ^TLongWordArray; - TLongWordArray = array[0..MaxInt div SizeOf(LongWord) - 1] of LongWord; + PLongWordArray = System.PLongWordArray; + TLongWordArray = System.TLongWordArray; implementation diff --git a/Lib/System.pas b/Lib/System.pas index eebaf79..2907996 100644 --- a/Lib/System.pas +++ b/Lib/System.pas @@ -68,6 +68,36 @@ type PVariant = ^Variant; + WordRec = packed record + case Byte of + 0: (Lo, Hi: Byte); + 1: (Bytes: array [0..1] of Byte); + end; + + LongRec = packed record + case Byte of + 0: (Lo, Hi: Word); + 1: (Words: array [0..1] of Word); + 2: (Bytes: array [0..3] of Byte); + end; + + Int64Rec = packed record + case Byte of + 0: (Lo, Hi: LongWord); + 1: (LongWords: array [0..1] of LongWord); + 2: (Words: array [0..3] of Word); + 3: (Bytes: array [0..7] of Byte); + end; + + PByteArray = ^TByteArray; + TByteArray = array[0..0] of Byte; + + PWordArray = ^TWordArray; + TWordArray = array[0..0] of Word; + + PLongWordArray = ^TLongWordArray; + TLongWordArray = array[0..0] of LongWord; + PGUID = ^TGUID; TGUID = record D1: LongWord;