Skip to content

Commit f640c65

Browse files
author
Arnaud Bouchez
committed
all: normalized ShortString type casing
1 parent d5707ff commit f640c65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+193
-193
lines changed

src/core/mormot.core.base.pas

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ procedure AppendShortCurr64(const value: Int64; var dest: ShortString;
958958
fixeddecimals: PtrInt = 0);
959959

960960
/// simple concatenation of no banker rounding floating point value as TwoDigits()
961-
procedure AppendShortTwoDigits(const Value: double; var Dest: shortstring);
961+
procedure AppendShortTwoDigits(const Value: double; var Dest: ShortString);
962962

963963
/// simple concatenation of a character into a @shorstring, checking its length
964964
// - dest is @shortstring and not shortstring to circumvent a Delphi inlining bug
@@ -4418,7 +4418,7 @@ TSynMemoryStream = class(TCustomMemoryStream)
44184418
end;
44194419

44204420
/// raise a EStreamError exception - e.g. from TSynMemoryStream.Write
4421-
function RaiseStreamError(Caller: TObject; const Context: shortstring): PtrInt;
4421+
function RaiseStreamError(Caller: TObject; const Context: ShortString): PtrInt;
44224422

44234423

44244424
{ ************ Raw Shared Constants / Types Definitions }
@@ -5392,7 +5392,7 @@ procedure AppendShortCurr64(const value: Int64; var dest: ShortString;
53925392
AppendShortBuffer(p, l, @dest);
53935393
end;
53945394

5395-
procedure AppendShortTwoDigits(const Value: double; var Dest: shortstring);
5395+
procedure AppendShortTwoDigits(const Value: double; var Dest: ShortString);
53965396
var
53975397
v: Int64;
53985398
begin
@@ -12920,8 +12920,8 @@ function SortDynArrayPUtf8Char(const A, B): integer;
1292012920

1292112921
function SortDynArrayShortString(const A, B): integer;
1292212922
var
12923-
sa: shortstring absolute A;
12924-
sb: shortstring absolute B;
12923+
sa: ShortString absolute A;
12924+
sb: ShortString absolute B;
1292512925
la, lb: PtrInt;
1292612926
begin
1292712927
la := ord(sa[0]);
@@ -13051,7 +13051,7 @@ procedure Exchg(P1, P2: PAnsiChar; count: PtrInt);
1305113051

1305213052
{ ************ Some Convenient TStream descendants }
1305313053

13054-
function {%H-}RaiseStreamError(Caller: TObject; const Context: shortstring): PtrInt;
13054+
function {%H-}RaiseStreamError(Caller: TObject; const Context: ShortString): PtrInt;
1305513055
begin
1305613056
raise EStreamError.CreateFmt('Unexpected %s.%s', [ClassNameShort(Caller)^, Context]);
1305713057
end;

src/core/mormot.core.buffers.pas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ TAlgoCompress = class
215215
fAlgoID: byte;
216216
fAlgoHasForcedFormat: boolean;
217217
fAlgoFileExt: TFileName;
218-
procedure EnsureAlgoHasNoForcedFormat(const caller: shortstring);
218+
procedure EnsureAlgoHasNoForcedFormat(const caller: ShortString);
219219
public
220220
/// computes by default the crc32c() digital signature of the buffer
221221
function AlgoHash(Previous: cardinal;
@@ -691,7 +691,7 @@ TFastReader = record
691691
/// raise a EFastReader with "Incorrect Data: ...." error message
692692
procedure ErrorData(const fmt: RawUtf8; const args: array of const); overload;
693693
/// raise a EFastReader with "Incorrect Data: ...." error message
694-
procedure ErrorData(const msg: shortstring); overload;
694+
procedure ErrorData(const msg: ShortString); overload;
695695
/// read the next 32-bit signed value from the buffer
696696
function VarInt32: integer;
697697
{$ifdef HASINLINE}inline;{$endif}
@@ -2784,7 +2784,7 @@ TRawByteStringBuffer = record
27842784
{$ifdef HASINLINE}inline;{$endif}
27852785
/// add some number as text content to the Buffer, resizing it if needed
27862786
procedure Append(Value: QWord); overload;
2787-
/// add some UTF-8 shortstring content to the Buffer, resizing it if needed
2787+
/// add some UTF-8 ShortString content to the Buffer, resizing it if needed
27882788
procedure AppendShort(const Text: ShortString);
27892789
{$ifdef HASINLINE}inline;{$endif}
27902790
/// just after Append/AppendShort, append a #13#10 end of line
@@ -3554,7 +3554,7 @@ procedure TFastReader.ErrorData(const fmt: RawUtf8; const args: array of const);
35543554
raise EFastReader.CreateUtf8('Incorrect Data: ' + fmt, args);
35553555
end;
35563556

3557-
procedure TFastReader.ErrorData(const msg: shortstring);
3557+
procedure TFastReader.ErrorData(const msg: ShortString);
35583558
begin
35593559
ErrorData('%', [msg]);
35603560
end;
@@ -5300,7 +5300,7 @@ function TAlgoCompress.AlgoName: TShort16;
53005300
end;
53015301
end;
53025302

5303-
procedure TAlgoCompress.EnsureAlgoHasNoForcedFormat(const caller: shortstring);
5303+
procedure TAlgoCompress.EnsureAlgoHasNoForcedFormat(const caller: ShortString);
53045304
begin
53055305
if fAlgoHasForcedFormat then
53065306
EAlgoCompress.RaiseUtf8('%.% is unsupported', [self, caller]);

src/core/mormot.core.data.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,7 @@ TDynArrayHasher = record
18831883
{$ifdef HASINLINE}inline;{$endif}
18841884
procedure HashAdd(aHashCode: cardinal; var result: PtrInt);
18851885
procedure HashDelete(aArrayIndex, aHashTableIndex: PtrInt; aHashCode: cardinal);
1886-
function RaiseFatalCollision(const caller: shortstring; aHashCode: cardinal): integer;
1886+
function RaiseFatalCollision(const caller: ShortString; aHashCode: cardinal): integer;
18871887
procedure RaiseNoHasher;
18881888
procedure HashTableInit(aHasher: THasher);
18891889
procedure SetEventCompare(const Value: TOnDynArraySortCompare);
@@ -9793,7 +9793,7 @@ function TDynArrayHasher.FindBeforeDelete(Item: pointer): PtrInt;
97939793
result := -1;
97949794
end;
97959795

9796-
function TDynArrayHasher.RaiseFatalCollision(const caller: shortstring;
9796+
function TDynArrayHasher.RaiseFatalCollision(const caller: ShortString;
97979797
aHashCode: cardinal): integer;
97989798
begin // a dedicated sub-procedure reduces code size
97999799
result := 0; // make compiler happy

src/core/mormot.core.datetime.pas

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ TSynSystemTime = record
527527
// - returns the number of chars added to P, i.e. always 21
528528
function ToNcsaText(P: PUtf8Char): PtrInt;
529529
/// convert the stored date and time to its text in apache-like format
530-
procedure ToNcsaShort(var text: shortstring; const tz: RawUtf8 = 'GMT');
530+
procedure ToNcsaShort(var text: ShortString; const tz: RawUtf8 = 'GMT');
531531
/// convert the stored date and time to its text in HTTP-like format
532532
// - i.e. "Tue, 15 Nov 1994 12:45:26 GMT" to be used as a value of
533533
// "Date", "Expires" or "Last-Modified" HTTP header
@@ -536,12 +536,12 @@ TSynSystemTime = record
536536
const prefix: RawUtf8 = '');
537537
/// convert the stored date and time to its text in HTTP-like format
538538
// - e.g. "Tue, 15 Nov 1994 12:45:26 GMT"
539-
procedure ToHttpDateShort(var text: shortstring; const tz: RawUtf8 = 'GMT';
539+
procedure ToHttpDateShort(var text: ShortString; const tz: RawUtf8 = 'GMT';
540540
const prefix: RawUtf8 = '');
541541
/// convert the stored date into its '19 Sep 2023' English-readable date text
542542
procedure ToTextDateShort(var text: TShort15);
543543
/// convert the stored date and time into its Iso-8601 text, with no Milliseconds
544-
procedure ToIsoDateTimeShort(var text: shortstring; FirstTimeChar: AnsiChar = 'T');
544+
procedure ToIsoDateTimeShort(var text: ShortString; FirstTimeChar: AnsiChar = 'T');
545545
/// convert the stored date and time into its Iso-8601 text, with no Milliseconds
546546
procedure ToIsoDateTime(out text: RawUtf8; FirstTimeChar: AnsiChar = 'T');
547547
/// convert the stored date into its Iso-8601 text with no time part
@@ -2544,7 +2544,7 @@ procedure TSynSystemTime.AddNcsaText(WR: TTextWriter; const TZD: RawUtf8);
25442544

25452545
procedure TSynSystemTime.AddHttpDate(WR: TTextWriter; const TZD: RawUtf8);
25462546
var
2547-
tmp: shortstring;
2547+
tmp: ShortString;
25482548
begin
25492549
ToHttpDateShort(tmp, TZD);
25502550
WR.AddShort(tmp);
@@ -2580,22 +2580,22 @@ function TSynSystemTime.ToNcsaText(P: PUtf8Char): PtrInt;
25802580
result := 21;
25812581
end;
25822582

2583-
procedure TSynSystemTime.ToNcsaShort(var text: shortstring; const tz: RawUtf8);
2583+
procedure TSynSystemTime.ToNcsaShort(var text: ShortString; const tz: RawUtf8);
25842584
begin
25852585
text[0] := AnsiChar(ToNcsaText(@text[1]));
25862586
AppendShortAnsi7String(tz, text);
25872587
end;
25882588

25892589
procedure TSynSystemTime.ToHttpDate(out text: RawUtf8; const tz, prefix: RawUtf8);
25902590
var
2591-
tmp: shortstring;
2591+
tmp: ShortString;
25922592
begin
25932593
ToHttpDateShort(tmp, tz, prefix);
25942594
FastSetString(text, @tmp[1], ord(tmp[0]));
25952595
end;
25962596

25972597
procedure TSynSystemTime.ToHttpDateShort(
2598-
var text: shortstring; const tz, prefix: RawUtf8);
2598+
var text: ShortString; const tz, prefix: RawUtf8);
25992599
begin
26002600
if DayOfWeek = 0 then
26012601
PSynDate(@self)^.ComputeDayOfWeek; // first 4 fields do match
@@ -2620,13 +2620,13 @@ procedure TSynSystemTime.ToTextDateShort(var text: TShort15);
26202620

26212621
procedure TSynSystemTime.ToIsoDateTime(out text: RawUtf8; FirstTimeChar: AnsiChar);
26222622
var
2623-
tmp: shortstring;
2623+
tmp: ShortString;
26242624
begin
26252625
ToIsoDateTimeShort(tmp, FirstTimeChar);
26262626
ShortStringToAnsi7String(tmp, text);
26272627
end;
26282628

2629-
procedure TSynSystemTime.ToIsoDateTimeShort(var text: shortstring;
2629+
procedure TSynSystemTime.ToIsoDateTimeShort(var text: ShortString;
26302630
FirstTimeChar: AnsiChar);
26312631
begin
26322632
FormatShort('%-%-%%%:%:%', [
@@ -2945,7 +2945,7 @@ function HttpDateNowUtc(Tix64: Int64): THttpDateNowUtc;
29452945
var
29462946
c: cardinal;
29472947
T: TSynSystemTime;
2948-
now: shortstring; // use a temp variable for _HttpDateNowUtc atomic set
2948+
now: ShortString; // use a temp variable for _HttpDateNowUtc atomic set
29492949
begin
29502950
if Tix64 = 0 then
29512951
Tix64 := GetTickCount64;

src/core/mormot.core.fpcx64mm.pas

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,7 +2985,7 @@ function SetSmallBlockContention(var res: TResArray; maxcount: integer): integer
29852985
WrStrPos: PtrInt;
29862986
WrStrOnSameLine: boolean;
29872987

2988-
procedure W(const txt: shortstring);
2988+
procedure W(const txt: ShortString);
29892989
var
29902990
p, n: PtrInt;
29912991
begin
@@ -3004,11 +3004,11 @@ procedure W(const txt: shortstring);
30043004
K_: array[0..4] of string[1] = (
30053005
'P', 'T', 'G', 'M', 'K');
30063006

3007-
procedure K(const txt: shortstring; i: PtrUInt);
3007+
procedure K(const txt: ShortString; i: PtrUInt);
30083008
var
30093009
j, n: PtrUInt;
30103010
kk: PShortString;
3011-
tmp: shortstring;
3011+
tmp: ShortString;
30123012
begin
30133013
W(txt);
30143014
kk := nil;
@@ -3028,16 +3028,16 @@ procedure K(const txt: shortstring; i: PtrUInt);
30283028
W(kk^);
30293029
end;
30303030

3031-
procedure S(const txt: shortstring; i: PtrUInt);
3031+
procedure S(const txt: ShortString; i: PtrUInt);
30323032
var
3033-
tmp: shortstring;
3033+
tmp: ShortString;
30343034
begin
30353035
W(txt);
30363036
str(i, tmp);
30373037
W(tmp);
30383038
end;
30393039

3040-
procedure LF(const txt: shortstring = '');
3040+
procedure LF(const txt: ShortString = '');
30413041
begin
30423042
if txt[0] <> #0 then
30433043
W(txt);
@@ -3048,7 +3048,7 @@ procedure LF(const txt: shortstring = '');
30483048
end;
30493049

30503050
procedure WriteHeapStatusDetail(const arena: TMMStatusArena;
3051-
const name: shortstring);
3051+
const name: ShortString);
30523052
begin
30533053
K(name, arena.CurrentBytes);
30543054
K('B/', arena.CumulativeBytes);
@@ -3063,7 +3063,7 @@ procedure WriteHeapStatusDetail(const arena: TMMStatusArena;
30633063
LF;
30643064
end;
30653065

3066-
function GetHeapStatus(const context: shortstring; smallblockstatuscount,
3066+
function GetHeapStatus(const context: ShortString; smallblockstatuscount,
30673067
smallblockcontentioncount: integer; compilationflags, onsameline: boolean): PAnsiChar;
30683068
var
30693069
res: TResArray; // no heap allocation involved
@@ -3160,7 +3160,7 @@ function GetHeapStatus(const context: shortstring; smallblockstatuscount,
31603160
result := @WrStrBuf;
31613161
end;
31623162

3163-
procedure WriteHeapStatus(const context: shortstring; smallblockstatuscount,
3163+
procedure WriteHeapStatus(const context: ShortString; smallblockstatuscount,
31643164
smallblockcontentioncount: integer; compilationflags: boolean);
31653165
begin
31663166
GetHeapStatus(context, smallblockstatuscount, smallblockcontentioncount,

src/core/mormot.core.interfaces.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2582,7 +2582,7 @@ function PerThreadRunningContextAddress: pointer;
25822582
[optExecInMainThread, optFreeInMainThread]);
25832583

25842584
/// return the interface execution options set as text
2585-
function ToText(opt: TInterfaceMethodOptions): shortstring; overload;
2585+
function ToText(opt: TInterfaceMethodOptions): ShortString; overload;
25862586

25872587

25882588
{ ************ SetWeak and SetWeakZero Weak Interface Reference }
@@ -6624,7 +6624,7 @@ function PerThreadRunningContextAddress: pointer;
66246624
result := @PerThreadRunningContext;
66256625
end;
66266626

6627-
function ToText(opt: TInterfaceMethodOptions): shortstring;
6627+
function ToText(opt: TInterfaceMethodOptions): ShortString;
66286628
begin
66296629
GetSetNameShort(TypeInfo(TInterfaceMethodOptions), opt, result);
66306630
end;

src/core/mormot.core.json.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4618,7 +4618,7 @@ function GetSetNameValue(Names: PShortString; MinValue, MaxValue: integer;
46184618
var P: PUtf8Char; out EndOfObject: AnsiChar): QWord;
46194619
var
46204620
info: TGetJsonField;
4621-
tmp: shortstring;
4621+
tmp: ShortString;
46224622
begin
46234623
result := 0;
46244624
if (P = nil) or
@@ -11705,7 +11705,7 @@ function RecordLoadJson(var Rec; const Json: RawUtf8; TypeInfo: PRttiInfo;
1170511705
JSONPARSER_DEFAULTORTOLERANTOPTIONS[Tolerant], CustomVariantOptions, Interning);
1170611706
end;
1170711707

11708-
function EnsureDynArray(const Ctxt: shortstring;
11708+
function EnsureDynArray(const Ctxt: ShortString;
1170911709
TypeInfo: PRttiInfo; Tolerant, GuessCount: boolean): TJsonParserOptions;
1171011710
begin
1171111711
if (TypeInfo = nil) or

src/core/mormot.core.log.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5480,7 +5480,7 @@ procedure TSynLog.AddErrorMessage(Error: cardinal);
54805480

54815481
procedure TSynLog.AddSysInfo;
54825482
var
5483-
tmp: shortstring;
5483+
tmp: ShortString;
54845484
begin
54855485
fWriter.AddDirect(' ', '{');
54865486
RetrieveSysInfoText(tmp);

0 commit comments

Comments
 (0)