Page 1 of 2

[patch_done] ZeosLib7 rev1684 warning fix

Posted: 01.09.2012, 12:11
by Goaul
With Delphi MX2, got these warnings:

[DCC Warning] ZCollections.pas(77): W1000 Symbol 'MaxListSize' is deprecated
suggested fix:

Code: Select all

-TZInterfaceList = array[0..MaxListSize - 1] of IZInterface;
+TZInterfaceList = array[0..Maxint div 16 - 1] of IZInterface;
[DCC Warning] ZCollections.pas(314): W1000 Symbol 'MaxListSize' is deprecated
[DCC Warning] ZCollections.pas(336): W1000 Symbol 'MaxListSize' is deprecated
suggested fix:

Code: Select all

-if (NewCount < 0) or (NewCount > MaxListSize) then
+if (NewCount < 0) or (NewCount > Maxint div 16) then
fix source:
https://forums.embarcadero.com/thread.j ... eID=404910

Posted: 01.09.2012, 17:30
by EgonHugeist
Goaul,

Thanks for this fix. I propose to introduce an additional define "WITH_MAXLISTSIZE_DEPRECATED" for the Zeos.inc in the Ver230 section for the new code instead of replacing the old.

If i've the time i'll add it or can you attach a patch file?

Posted: 01.09.2012, 18:45
by Goaul
EgonHugeist wrote:Goaul,

Thanks for this fix. I propose to introduce an additional define "WITH_MAXLISTSIZE_DEPRECATED" for the Zeos.inc in the Ver230 section for the new code instead of replacing the old.

If i've the time i'll add it or can you attach a patch file?
Here it is, i hope this will speed up things :)

also there are such hints:
[DCC Hint] ZMySqlToken.pas(261): H2077 Value assigned to 'QuoteCount' never used
[DCC Hint] ZMySqlToken.pas(249): H2077 Value assigned to 'QuoteCount' never used

Code: Select all

begin
  Result.Value := FirstChar;
  QuoteCount := 1;
  If FirstChar = '`' then
    Result.TokenType := ttQuotedIdentifier
  Else
    Result.TokenType := ttQuoted;

  QuoteChar := FirstChar;

  LastChar := #0;

  while Stream.Read(ReadChar, SizeOf(Char)) > 0 do
  begin
    if ReadChar = QuoteChar then Inc(QuoteCount);
    if (LastChar = FirstChar) and (ReadChar <> FirstChar) then
    begin
      //if QuoteCount mod 2 = 0 then // only valid for Pascal AnsiQuoted/QuotedStr

Posted: 02.09.2012, 02:56
by EgonHugeist
Goaul,

both warnings solved. Patch done R1698

Btw 10 moths ago we had over 600 comiler warnings and this for a period of 5 years..

Posted: 02.09.2012, 08:36
by Goaul
Yeah saw them on previos revs, great job :)
thnx

on rev1698 missed 1 warning:
[DCC Warning] ZCollections.pas(336): W1000 Symbol 'MaxListSize' is deprecated

also if interested, there are lot of hints: :)

Code: Select all

[DCC Hint] ZSelectSchema.pas(276): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(287): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(311): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(322): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(348): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(359): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(387): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(400): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(412): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(426): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(448): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(460): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(488): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(495): H2443 Inline function 'TObjectList.Add' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(510): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(512): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(512): H2443 Inline function 'TObjectList.Add' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(521): H2443 Inline function 'TObjectList.Add' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(526): H2443 Inline function 'TObjectList.Add' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(541): H2443 Inline function 'TObjectList.Add' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(551): H2443 Inline function 'TObjectList.Insert' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(560): H2443 Inline function 'TObjectList.Remove' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(569): H2443 Inline function 'TObjectList.Add' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(579): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list
[DCC Hint] ZSelectSchema.pas(598): H2443 Inline function 'TObjectList.GetItem' has not been expanded because unit 'System.Classes' is not specified in USES list

Posted: 02.09.2012, 19:15
by EgonHugeist
Goaul,
on rev1698 missed 1 warning:
[DCC Warning] ZCollections.pas(336): W1000 Symbol 'MaxListSize' is deprecated
this warning is gone. If somebody has the time to fix the hints and remaining warnings (component layer) then this would be nice (always think on backward compatibility from D7/FPC to XE2)..

Posted: 02.09.2012, 21:17
by Goaul
if u could sow how to fix atleast 1 from those hints, i could try to finish rest and make patch.

[DCC Hint] ZConnectionGroup.pas(131): H2164 Variable 'Curren

Posted: 03.09.2012, 16:21
by merovingio
procedure TZConnectionGroup.Change;
var i:Integer;
// Current: TZConnectionGroupLink; I have only commented.
begin
if Assigned(FOnChange) then
begin
FOnChange(Self);
end;
if FClients <> nil then
for I := 0 to FClients.Count - 1 do
TZConnectionGroupLink(FClients).Change;
end;

Posted: 03.09.2012, 16:29
by EgonHugeist
merovingio,

have you ever worked with TortoiseSVN? I propose you kill some more hints like these. Btw. you can drop such lines if they are no longer used in the procedure body. But not if somebody commented lines in the body out, in this case your patch is right. :) Then you can make a patch file with TortoiseSVN which i can easiely apply. I know cleaned sources looking allways better on compiling.

What do you think? :?:

Posted: 03.09.2012, 16:43
by merovingio
Hi!
I never work with TortoiseSVN.
Today I found a little manual (or look on youtube).
Scuse me... for poor english.

Posted: 03.09.2012, 16:50
by merovingio
I need User and Password.

Posted: 03.09.2012, 19:39
by EgonHugeist
merovingio,

you need you sourceforge.net username+password. But i must admit i want to have a look to your fixes for a while before granting svn commit privileges. I hope you can understand it. Use Tortois, rightclick to the root of your Zeos-Folder -> TortoiseSVN -> Create Patch. Then attach the file.

Anyway thank you for your constribution.

I try

Posted: 04.09.2012, 21:26
by merovingio
I try... thanks!

Posted: 05.09.2012, 07:48
by merovingio
Hi! I have created "delphi Xe2.patch" where are add several files at XE2 projects.

Posted: 09.09.2012, 16:33
by Goaul
why u changing paths to files?