Skip to content

Commit 1b79457

Browse files
committed
clean up include files
1 parent c87f112 commit 1b79457

File tree

10 files changed

+98
-204
lines changed

10 files changed

+98
-204
lines changed

SimpleBaseLib.Benchmark/src/uBase64.pas

Lines changed: 6 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,77 +2,11 @@
22
(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
33
{$IFDEF FPC}
44
{$UNDEF DELPHI}
5-
{$MODE delphi}
6-
{$DEFINE USE_UNROLLED_VARIANT}
7-
// Disable Overflow and RangeChecks.
8-
{$OVERFLOWCHECKS OFF}
9-
{$RANGECHECKS OFF}
10-
// Enable Pointer Math
11-
{$POINTERMATH ON}
12-
// Disable Warnings and Hints.
13-
{$WARNINGS OFF}
14-
{$HINTS OFF}
15-
{$NOTES OFF}
16-
// Optimizations
17-
{$OPTIMIZATION LEVEL3}
18-
{$OPTIMIZATION PEEPHOLE}
19-
{$OPTIMIZATION REGVAR}
20-
{$OPTIMIZATION LOOPUNROLL}
21-
{$OPTIMIZATION STRENGTH}
22-
{$OPTIMIZATION CSE}
23-
{$OPTIMIZATION DFA}
24-
{$IFDEF CPUI386}
25-
{$OPTIMIZATION USEEBP}
26-
{$ENDIF}
27-
{$IFDEF CPUX86_64}
28-
{$OPTIMIZATION USERBP}
29-
{$ENDIF}
5+
{$MODE DELPHI}
306
{$ENDIF FPC}
317
(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
328

339
{$IFDEF DELPHI}
34-
{$DEFINE USE_UNROLLED_VARIANT}
35-
// This option is needed to enable code browsing (aka Ctrl+Click)
36-
// It does not affect the binary size or generated code
37-
{$DEFINITIONINFO ON}
38-
// Disable Hints.
39-
{$HINTS OFF}
40-
// Disable Overflow and RangeChecks.
41-
{$OVERFLOWCHECKS OFF}
42-
{$RANGECHECKS OFF}
43-
// Enable Pointer Math
44-
{$POINTERMATH ON}
45-
// Disable String Checks
46-
{$STRINGCHECKS OFF}
47-
// Disable Duplicate Constructor Warnings
48-
{$WARN DUPLICATE_CTOR_DTOR OFF}
49-
// 2010 only
50-
{$IF CompilerVersion = 21.0}
51-
{$DEFINE DELPHI2010}
52-
{$IFEND}
53-
// 2010 and Above
54-
{$IF CompilerVersion >= 21.0}
55-
{$DEFINE DELPHI2010_UP}
56-
{$IFEND}
57-
// XE and Above
58-
{$IF CompilerVersion >= 22.0}
59-
{$DEFINE DELPHIXE_UP}
60-
{$IFEND}
61-
// XE2 and Above
62-
{$IF CompilerVersion >= 23.0}
63-
{$DEFINE DELPHIXE2_UP}
64-
{$DEFINE HAS_UNITSCOPE}
65-
{$IFEND}
66-
// XE3 and Below
67-
{$IF CompilerVersion <= 24.0}
68-
{$DEFINE DELPHIXE3_DOWN}
69-
{$IFEND}
70-
// XE3 and Above
71-
{$IF CompilerVersion >= 24.0}
72-
{$DEFINE DELPHIXE3_UP}
73-
{$LEGACYIFEND ON}
74-
{$ZEROBASEDSTRINGS OFF}
75-
{$IFEND}
7610
// XE7 and Above
7711
{$IF CompilerVersion >= 28.0}
7812
{$DEFINE DELPHIXE7_UP}
@@ -81,10 +15,7 @@
8115
{$IF CompilerVersion >= 32.0}
8216
{$DEFINE DELPHI10.2_TOKYO_UP}
8317
{$IFEND}
84-
// 2010 and Above
85-
{$IFNDEF DELPHI2010_UP}
86-
{$MESSAGE ERROR 'This Library requires Delphi 2010 or higher.'}
87-
{$ENDIF}
18+
8819
// 10.2 Tokyo and Above
8920
{$IFDEF DELPHI10.2_TOKYO_UP}
9021
{$WARN COMBINING_SIGNED_UNSIGNED OFF}
@@ -95,6 +26,10 @@
9526

9627
unit uBase64;
9728

29+
{$IFDEF FPC}
30+
{$MODE DELPHI}
31+
{$ENDIF FPC}
32+
9833
interface
9934

10035
uses

SimpleBaseLib/src/Bases/SbpBase32Alphabet.pas

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,9 @@ procedure TBase32Alphabet.MapLowerCaseCounterParts(const alphabet: String);
5656
LowPoint, HighPoint, I: Int32;
5757
c: Char;
5858
begin
59-
{$IFDEF DELPHIXE3_UP}
60-
LowPoint := System.Low(alphabet);
61-
HighPoint := System.High(alphabet);
62-
{$ELSE}
6359
LowPoint := 1;
6460
HighPoint := System.Length(alphabet);
65-
{$ENDIF DELPHIXE3_UP}
61+
6662
for I := LowPoint to HighPoint do
6763
begin
6864
c := alphabet[I];

SimpleBaseLib/src/Bases/SbpBase58.pas

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,8 @@ function TBase58.Decode(const text: TSimpleBaseLibCharArray)
113113

114114
pEnd := inputPtr + textLen;
115115
pInput := inputPtr;
116-
{$IFDEF DELPHIXE3_UP}
117-
LowPoint := System.Low(String);
118-
{$ELSE}
119116
LowPoint := 1;
120-
{$ENDIF DELPHIXE3_UP}
117+
121118
Value := Falphabet.Value;
122119
FirstChar := Value[LowPoint];
123120
while ((pInput^ = FirstChar) and (pInput <> pEnd)) do

SimpleBaseLib/src/Bases/SbpEncodingAlphabet.pas

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,8 @@ constructor TEncodingAlphabet.Create(length: Int32; const alphabet: String);
8686
System.SetLength(FReverseLookupTable, lookupLength);
8787
FLength := length;
8888
FValue := alphabet;
89-
90-
{$IFDEF DELPHIXE3_UP}
91-
LowPoint := System.Low(alphabet);
92-
{$ELSE}
9389
LowPoint := 1;
94-
{$ENDIF DELPHIXE3_UP}
90+
9591
for I := LowPoint to length do
9692
begin
9793
Map(alphabet[I], I - 1);
Lines changed: 20 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,31 @@
1-
{ *********************************************************************************** }
2-
{ * SimpleBaseLib Library * }
3-
{ * Copyright (c) 2018 - 2019 Ugochukwu Mmaduekwe * }
4-
{ * Github Repository <https://github.com/Xor-el> * }
1+
{ * ************************************************************************ * }
2+
{ * SimpleBaseLib Library * }
3+
{ * Author - Ugochukwu Mmaduekwe * }
4+
{ * Github Repository <https://github.com/Xor-el> * }
5+
{ * * }
6+
{ * Distributed under the MIT software license, see the accompanying file * }
7+
{ * LICENSE * }
8+
{ * or visit http://www.opensource.org/licenses/mit-license. * }
9+
{ * * }
10+
{ * ************************************************************************ * }
511

6-
{ * Distributed under the MIT software license, see the accompanying file LICENSE * }
7-
{ * or visit http://www.opensource.org/licenses/mit-license.php. * }
12+
(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
813

9-
{ * ******************************************************************************* * }
1014

11-
(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
12-
13-
{$DEFINE DELPHI}
14-
15-
(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
15+
{---------------------------- Compiler Family Switch --------------------------}
1616
{$IFDEF FPC}
17-
{$I SimpleBaseLibHelper.inc} // Had to Include this Since Delphi Does not allow "FPC_FULLVERSION" to Compile.
18-
{$UNDEF DELPHI}
19-
{$MODE delphi}
20-
21-
{$DEFINE USE_UNROLLED_VARIANT}
17+
{$I SimpleBaseLibFPC.inc} // FPC-specific settings
18+
{$ELSE}
19+
{$DEFINE DELPHI}
20+
{$I ../../SimpleBaseLib/src/Include/SimpleBaseLibDelphi.inc} // Delphi-specific settings
21+
{$ENDIF}
2222

23-
// Disable Overflow and RangeChecks.
23+
{-------------------------- Common Compiler Settings --------------------------}
24+
{$SCOPEDENUMS ON}
2425
{$OVERFLOWCHECKS OFF}
2526
{$RANGECHECKS OFF}
26-
27-
// Enable Pointer Math
2827
{$POINTERMATH ON}
29-
30-
// Disable Warnings and Hints.
3128
{$WARNINGS OFF}
3229
{$HINTS OFF}
33-
{$NOTES OFF}
34-
35-
// Optimizations
36-
{$OPTIMIZATION LEVEL3}
37-
{$OPTIMIZATION PEEPHOLE}
38-
{$OPTIMIZATION REGVAR}
39-
{$OPTIMIZATION LOOPUNROLL}
40-
{$OPTIMIZATION STRENGTH}
41-
{$OPTIMIZATION CSE}
42-
{$OPTIMIZATION DFA}
43-
44-
{$IFDEF CPUI386}
45-
{$OPTIMIZATION USEEBP}
46-
{$ENDIF}
47-
48-
{$IFDEF CPUX86_64}
49-
{$OPTIMIZATION USERBP}
50-
{$ENDIF}
51-
52-
{$ENDIF FPC}
53-
54-
(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
55-
56-
{$IFDEF DELPHI}
57-
58-
{$DEFINE USE_UNROLLED_VARIANT}
59-
60-
// This option is needed to enable code browsing (aka Ctrl+Click)
61-
// It does not affect the binary size or generated code
62-
{$DEFINITIONINFO ON}
63-
64-
// Disable Overflow and RangeChecks.
65-
{$OVERFLOWCHECKS OFF}
66-
{$RANGECHECKS OFF}
67-
68-
// Enable Pointer Math
69-
{$POINTERMATH ON}
70-
71-
// Disable String Checks
72-
{$STRINGCHECKS OFF}
73-
74-
// Disable Duplicate Constructor Warnings
75-
{$WARN DUPLICATE_CTOR_DTOR OFF}
76-
77-
// XE3 and Above
78-
{$IF CompilerVersion >= 24.0}
79-
{$DEFINE DELPHIXE3_UP}
80-
{$LEGACYIFEND ON}
81-
{$ZEROBASEDSTRINGS OFF}
82-
{$IFEND}
83-
84-
// 2010 and Above
85-
{$IF CompilerVersion >= 21.0}
86-
{$DEFINE DELPHI2010_UP}
87-
{$IFEND}
88-
89-
// XE and Above
90-
{$IF CompilerVersion >= 22.0}
91-
{$DEFINE DELPHIXE_UP}
92-
{$IFEND}
93-
94-
// 2010 and Above
95-
{$IFNDEF DELPHI2010_UP}
96-
{$MESSAGE ERROR 'This Library requires Delphi 2010 or higher.'}
97-
{$ENDIF}
98-
99-
100-
{$ENDIF DELPHI}
101-
102-
(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
10330

31+
(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{ * ************************************************************************ * }
2+
{ * SimpleBaseLib Library * }
3+
{ * Author - Ugochukwu Mmaduekwe * }
4+
{ * Github Repository <https://github.com/Xor-el> * }
5+
{ * * }
6+
{ * Distributed under the MIT software license, see the accompanying file * }
7+
{ * LICENSE * }
8+
{ * or visit http://www.opensource.org/licenses/mit-license. * }
9+
{ * * }
10+
{ * ************************************************************************ * }
11+
12+
(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
13+
14+
{$IFDEF DELPHI}
15+
{$DEFINITIONINFO ON} // IDE navigation; no binary impact
16+
{$STRINGCHECKS OFF}
17+
{$WARN DUPLICATE_CTOR_DTOR OFF}
18+
19+
// XE and Above
20+
{$IF CompilerVersion >= 22.0}
21+
{$DEFINE DELPHIXE_UP}
22+
{$IFEND}
23+
24+
{$IF CompilerVersion < 21.0}
25+
{$MESSAGE ERROR 'This Library requires Delphi 2010 or higher.'}
26+
{$IFEND}
27+
{$ENDIF}
28+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{ * ************************************************************************ * }
2+
{ * SimpleBaseLib Library * }
3+
{ * Author - Ugochukwu Mmaduekwe * }
4+
{ * Github Repository <https://github.com/Xor-el> * }
5+
{ * * }
6+
{ * Distributed under the MIT software license, see the accompanying file * }
7+
{ * LICENSE * }
8+
{ * or visit http://www.opensource.org/licenses/mit-license. * }
9+
{ * * }
10+
{ * ************************************************************************ * }
11+
12+
(* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& *)
13+
14+
{$IFDEF FPC}
15+
{$IFDEF ENDIAN_BIG}
16+
{$MESSAGE FATAL 'This Library does not support "Big Endian" processors yet.'}
17+
{$ENDIF}
18+
19+
// FPC 3.0.0 and Above
20+
{$IF FPC_FULLVERSION < 30000}
21+
{$MESSAGE ERROR 'This Library requires FreePascal 3.0.0 or higher.'}
22+
{$IFEND}
23+
24+
{$MODE DELPHI}
25+
{$MACRO ON}
26+
{$NOTES OFF}
27+
{$OPTIMIZATION LEVEL3}
28+
{$OPTIMIZATION PEEPHOLE}
29+
{$OPTIMIZATION REGVAR}
30+
{$OPTIMIZATION LOOPUNROLL}
31+
{$OPTIMIZATION STRENGTH}
32+
{$OPTIMIZATION CSE}
33+
{$OPTIMIZATION DFA}
34+
{$IFDEF CPUI386} {$OPTIMIZATION USEEBP} {$ENDIF}
35+
{$IFDEF CPUX86_64} {$OPTIMIZATION USERBP} {$ENDIF}
36+
{$ENDIF}
37+

SimpleBaseLib/src/Include/SimpleBaseLibHelper.inc

Lines changed: 0 additions & 21 deletions
This file was deleted.

SimpleBaseLib/src/Packages/FPC/SimpleBaseLib4PascalPackage.lpk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</CompilerOptions>
2222
<Description Value="SimpleBaseLib4Pascal as the name implies is a simple to use Base Encoding Package for Delphi/FreePascal Compilers that provides at the moment support for encoding and decoding various bases such as Base16, Base32 (various variants), Base58 (various variants), Base64 (various variants) and Base85 (various variants)."/>
2323
<License Value="MIT License"/>
24-
<Version Major="2" Minor="5"/>
24+
<Version Major="2" Minor="6"/>
2525
<Files Count="24">
2626
<Item1>
2727
<Filename Value="..\..\Bases\SbpBase16.pas"/>
@@ -52,7 +52,7 @@
5252
<UnitName Value="SbpBase64Alphabet"/>
5353
</Item7>
5454
<Item8>
55-
<Filename Value="..\..\Include\SimpleBaseLibHelper.inc"/>
55+
<Filename Value="..\..\Include\SimpleBaseLibFPC.inc"/>
5656
<Type Value="Include"/>
5757
</Item8>
5858
<Item9>

SimpleBaseLib/src/Utils/SbpUtilities.pas

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,9 @@ class function TUtilities.TrimRight(const S: String;
114114
begin
115115
System.Dec(I);
116116
end;
117-
{$IFDEF DELPHIXE3_UP}
118-
LowPoint := System.Low(S);
119-
{$ELSE}
117+
120118
LowPoint := 1;
121-
{$ENDIF DELPHIXE3_UP}
119+
122120
if I < LowPoint then
123121
begin
124122
Result := ''

0 commit comments

Comments
 (0)