From b327ed7872ca83c3a4249039ba1a3d8dd3ece630 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 17 Jan 2017 17:19:19 +0300 Subject: useless field DBEVENTINFO::cbSize removed --- plugins/HistoryPlusPlus/HistoryForm.pas | 6 +++--- plugins/HistoryPlusPlus/hpp_events.pas | 3 --- plugins/HistoryPlusPlus/hpp_externalgrid.pas | 9 ++++----- plugins/HistoryPlusPlus/hpp_sessionsthread.pas | 1 - 4 files changed, 7 insertions(+), 12 deletions(-) (limited to 'plugins/HistoryPlusPlus') diff --git a/plugins/HistoryPlusPlus/HistoryForm.pas b/plugins/HistoryPlusPlus/HistoryForm.pas index ba0337d818..eed0d360f1 100644 --- a/plugins/HistoryPlusPlus/HistoryForm.pas +++ b/plugins/HistoryPlusPlus/HistoryForm.pas @@ -3917,13 +3917,13 @@ begin begin DBEventInfo := GetEventInfo(hDBEvent); DBEventInfo.szModule := nil; - Item.Size := Cardinal(DBEventInfo.cbSize) + Cardinal(DBEventInfo.cbBlob); + Item.Size := sizeof(DBEventInfo) + Cardinal(DBEventInfo.cbBlob); end; if Item.Size > 0 then begin GetMem(Item.Buffer, Item.Size); - DataOffset := PAnsiChar(Item.Buffer) + DBEventInfo.cbSize; - Move(DBEventInfo, Item.Buffer^, DBEventInfo.cbSize); + DataOffset := PAnsiChar(Item.Buffer) + sizeof(DBEventInfo); + Move(DBEventInfo, Item.Buffer^, sizeof(DBEventInfo)); Move(DBEventInfo.pBlob^, DataOffset^, DBEventInfo.cbBlob); end; end diff --git a/plugins/HistoryPlusPlus/hpp_events.pas b/plugins/HistoryPlusPlus/hpp_events.pas index f3493adf03..84e21102f4 100644 --- a/plugins/HistoryPlusPlus/hpp_events.pas +++ b/plugins/HistoryPlusPlus/hpp_events.pas @@ -251,7 +251,6 @@ begin if RecentEvent <> hDBEvent then begin ZeroMemory(@RecentEventInfo, SizeOf(RecentEventInfo)); - RecentEventInfo.cbSize := SizeOf(RecentEventInfo); RecentEventInfo.cbBlob := 0; db_event_get(hDBEvent, @RecentEventInfo); RecentEvent := hDBEvent; @@ -266,7 +265,6 @@ begin if RecentEvent <> hDBEvent then begin ZeroMemory(@RecentEventInfo, SizeOf(RecentEventInfo)); - RecentEventInfo.cbSize := SizeOf(RecentEventInfo); RecentEventInfo.cbBlob := 0; db_event_get(hDBEvent, @RecentEventInfo); RecentEvent := hDBEvent; @@ -428,7 +426,6 @@ var BlobSize: integer; begin ZeroMemory(@Result, SizeOf(Result)); - Result.cbSize := SizeOf(Result); BlobSize := db_event_getBlobSize(hDBEvent); if BlobSize > 0 then begin diff --git a/plugins/HistoryPlusPlus/hpp_externalgrid.pas b/plugins/HistoryPlusPlus/hpp_externalgrid.pas index 2bf5dd6c8c..e0a5f3ea53 100644 --- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas +++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas @@ -1246,7 +1246,6 @@ begin if Items[Index].Custom then begin ZeroMemory(@DBEventInfo, SizeOf(DBEventInfo)); - DBEventInfo.cbSize := SizeOf(DBEventInfo); DBEventInfo.timestamp := Items[Index].CustomEvent.Time; DBEventInfo.flags := DBEF_READ or DBEF_UTF; if Items[Index].CustomEvent.Sent then @@ -1255,7 +1254,7 @@ begin TextUTF := UTF8Encode(Items[Index].CustomEvent.Text) + #0; DBEventInfo.cbBlob := Length(TextUTF) + 1; DBEventInfo.pBlob := Pointer(PAnsiChar(TextUTF)); - Item.Size := Cardinal(DBEventInfo.cbSize) + Cardinal(DBEventInfo.cbBlob); + Item.Size := sizeof(DBEventInfo) + Cardinal(DBEventInfo.cbBlob); end else begin @@ -1264,14 +1263,14 @@ begin begin DBEventInfo := GetEventInfo(hDBEvent); DBEventInfo.szModule := nil; - Item.Size := Cardinal(DBEventInfo.cbSize) + Cardinal(DBEventInfo.cbBlob); + Item.Size := sizeof(DBEventInfo) + Cardinal(DBEventInfo.cbBlob); end; end; if Item.Size > 0 then begin GetMem(Item.Buffer, Item.Size); - DataOffset := PAnsiChar(Item.Buffer) + DBEventInfo.cbSize; - Move(DBEventInfo, Item.Buffer^, DBEventInfo.cbSize); + DataOffset := PAnsiChar(Item.Buffer) + sizeof(DBEventInfo); + Move(DBEventInfo, Item.Buffer^, sizeof(DBEventInfo)); Move(DBEventInfo.pBlob^, DataOffset^, DBEventInfo.cbBlob); end; end diff --git a/plugins/HistoryPlusPlus/hpp_sessionsthread.pas b/plugins/HistoryPlusPlus/hpp_sessionsthread.pas index d86372feaf..b9a9109bf1 100644 --- a/plugins/HistoryPlusPlus/hpp_sessionsthread.pas +++ b/plugins/HistoryPlusPlus/hpp_sessionsthread.pas @@ -180,7 +180,6 @@ begin while (hDBEvent <> 0) and not Terminated do begin ZeroMemory(@Event, SizeOf(Event)); - Event.cbSize := SizeOf(Event); Event.cbBlob := 0; db_event_get(hDBEvent, @Event); CurTime := Event.Timestamp; -- cgit v1.2.3