From d6f218a8d3f112ce8d8a00022c384dd4f5a2f55b Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 1 Mar 2015 14:18:24 +0000 Subject: [PATCH] IDE: quick fixes for 5036,5037,5057..5060,5090..5094: does not seem to be initialized git-svn-id: trunk@48080 - --- ide/etquickfixes.pas | 23 +++++++++++++++++++++-- lcl/languages/lclstrconsts.ca.po | 6 ------ lcl/languages/lclstrconsts.cs.po | 6 ------ lcl/languages/lclstrconsts.de.po | 6 ------ lcl/languages/lclstrconsts.es.po | 6 ------ lcl/languages/lclstrconsts.fi.po | 6 ------ lcl/languages/lclstrconsts.fr.po | 6 ------ lcl/languages/lclstrconsts.he.po | 6 ------ lcl/languages/lclstrconsts.hu.po | 6 ------ lcl/languages/lclstrconsts.id.po | 6 ------ lcl/languages/lclstrconsts.it.po | 6 ------ lcl/languages/lclstrconsts.ja.po | 6 ------ lcl/languages/lclstrconsts.lt.po | 6 ------ lcl/languages/lclstrconsts.nl.po | 6 ------ lcl/languages/lclstrconsts.no.po | 6 ------ lcl/languages/lclstrconsts.pl.po | 6 ------ lcl/languages/lclstrconsts.po | 6 ------ lcl/languages/lclstrconsts.pt_BR.po | 6 ------ lcl/languages/lclstrconsts.ru.po | 6 ------ lcl/languages/lclstrconsts.sk.po | 6 ------ lcl/languages/lclstrconsts.tr.po | 6 ------ lcl/languages/lclstrconsts.uk.po | 6 ------ lcl/languages/lclstrconsts.zh_CN.po | 6 ------ 23 files changed, 21 insertions(+), 134 deletions(-) diff --git a/ide/etquickfixes.pas b/ide/etquickfixes.pas index 214df5eff8..384c0ef170 100644 --- a/ide/etquickfixes.pas +++ b/ide/etquickfixes.pas @@ -260,16 +260,35 @@ end; function TQuickFixLocalVarNotInitialized_AddAssignment.IsApplicable( Msg: TMessageLine; out Identifier: string): boolean; + + function IsMsgId(MsgID: integer): boolean; + var + Dummy: string; + begin + Result:=TIDEFPCParser.MsgLineIsId(Msg,MsgID,Identifier,Dummy); + end; + var Tool: TCodeTool; CleanPos: integer; Node: TCodeTreeNode; - Dummy: string; Code: TCodeBuffer; begin Result:=false; // Check: Local variable "$1" does not seem to be initialized - if not TIDEFPCParser.MsgLineIsId(Msg,5036,Identifier,Dummy) then + if not IsMsgId(5036) // W_Local variable "$1" does not seem to be initialized + or not IsMsgId(5037) // W_Variable "$1" does not seem to be initialized + or not IsMsgId(5057) // H_Local variable "$1" does not seem to be initialized + or not IsMsgId(5058) // H_Variable "$1" does not seem to be initialized + or not IsMsgId(5059) // W_Function result variable does not seem to initialized + or not IsMsgId(5060) // H_Function result variable does not seem to be initialized + or not IsMsgId(5089) // W_Local variable "$1" of a managed type does not seem to be initialized + or not IsMsgId(5090) // W_Variable "$1" of a managed type does not seem to be initialized + or not IsMsgId(5091) // H_Local variable "$1" of a managed type does not seem to be initialized + or not IsMsgId(5092) // H_Variable "$1" of a managed type does not seem to be initialized + or not IsMsgId(5093) // W_function result variable of a managed type does not seem to initialized + or not IsMsgId(5094) // H_Function result variable of a managed type does not seem to be initialized + then exit; if not Msg.HasSourcePosition or not IsValidIdent(Identifier) then exit; diff --git a/lcl/languages/lclstrconsts.ca.po b/lcl/languages/lclstrconsts.ca.po index 621e0f808e..1ab30a95a8 100644 --- a/lcl/languages/lclstrconsts.ca.po +++ b/lcl/languages/lclstrconsts.ca.po @@ -1572,12 +1572,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.cs.po b/lcl/languages/lclstrconsts.cs.po index c44e891d5c..292b7ac341 100644 --- a/lcl/languages/lclstrconsts.cs.po +++ b/lcl/languages/lclstrconsts.cs.po @@ -1534,12 +1534,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.de.po b/lcl/languages/lclstrconsts.de.po index 019aa231c9..68f3a1e788 100644 --- a/lcl/languages/lclstrconsts.de.po +++ b/lcl/languages/lclstrconsts.de.po @@ -1535,12 +1535,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.es.po b/lcl/languages/lclstrconsts.es.po index 395484b437..8e9f106b3e 100644 --- a/lcl/languages/lclstrconsts.es.po +++ b/lcl/languages/lclstrconsts.es.po @@ -1570,12 +1570,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.fi.po b/lcl/languages/lclstrconsts.fi.po index 753ecb44e9..05ea075e3d 100644 --- a/lcl/languages/lclstrconsts.fi.po +++ b/lcl/languages/lclstrconsts.fi.po @@ -1528,12 +1528,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.fr.po b/lcl/languages/lclstrconsts.fr.po index e7d56caf75..06571c1573 100644 --- a/lcl/languages/lclstrconsts.fr.po +++ b/lcl/languages/lclstrconsts.fr.po @@ -1532,12 +1532,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.he.po b/lcl/languages/lclstrconsts.he.po index c2982ca085..7f0c5ad083 100644 --- a/lcl/languages/lclstrconsts.he.po +++ b/lcl/languages/lclstrconsts.he.po @@ -1584,12 +1584,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.hu.po b/lcl/languages/lclstrconsts.hu.po index cd834f686d..0a46e042d5 100644 --- a/lcl/languages/lclstrconsts.hu.po +++ b/lcl/languages/lclstrconsts.hu.po @@ -1530,12 +1530,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.id.po b/lcl/languages/lclstrconsts.id.po index 989de77ce5..8fbc940cc0 100644 --- a/lcl/languages/lclstrconsts.id.po +++ b/lcl/languages/lclstrconsts.id.po @@ -1571,12 +1571,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.it.po b/lcl/languages/lclstrconsts.it.po index c44769fc11..5568abf6f1 100644 --- a/lcl/languages/lclstrconsts.it.po +++ b/lcl/languages/lclstrconsts.it.po @@ -1534,12 +1534,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.ja.po b/lcl/languages/lclstrconsts.ja.po index 212de5c305..e7430dad62 100644 --- a/lcl/languages/lclstrconsts.ja.po +++ b/lcl/languages/lclstrconsts.ja.po @@ -1561,12 +1561,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.lt.po b/lcl/languages/lclstrconsts.lt.po index e2fbfd1437..59b3b9bbf4 100644 --- a/lcl/languages/lclstrconsts.lt.po +++ b/lcl/languages/lclstrconsts.lt.po @@ -1561,12 +1561,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.nl.po b/lcl/languages/lclstrconsts.nl.po index 96a6c0c59c..0e4bad6787 100644 --- a/lcl/languages/lclstrconsts.nl.po +++ b/lcl/languages/lclstrconsts.nl.po @@ -1564,12 +1564,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.no.po b/lcl/languages/lclstrconsts.no.po index a4bf397825..4fff52d318 100644 --- a/lcl/languages/lclstrconsts.no.po +++ b/lcl/languages/lclstrconsts.no.po @@ -1576,12 +1576,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.pl.po b/lcl/languages/lclstrconsts.pl.po index 0bd492b206..e51180aa9b 100644 --- a/lcl/languages/lclstrconsts.pl.po +++ b/lcl/languages/lclstrconsts.pl.po @@ -1542,12 +1542,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.po b/lcl/languages/lclstrconsts.po index 69743ffd69..7c4519f1e6 100644 --- a/lcl/languages/lclstrconsts.po +++ b/lcl/languages/lclstrconsts.po @@ -1523,12 +1523,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.pt_BR.po b/lcl/languages/lclstrconsts.pt_BR.po index bc54b55479..6d83e1b977 100644 --- a/lcl/languages/lclstrconsts.pt_BR.po +++ b/lcl/languages/lclstrconsts.pt_BR.po @@ -1558,12 +1558,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.ru.po b/lcl/languages/lclstrconsts.ru.po index bf00350efd..707329b1f4 100644 --- a/lcl/languages/lclstrconsts.ru.po +++ b/lcl/languages/lclstrconsts.ru.po @@ -1536,12 +1536,6 @@ msgstr "%s МБ" msgid "Name" msgstr "Имя" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "Размер" diff --git a/lcl/languages/lclstrconsts.sk.po b/lcl/languages/lclstrconsts.sk.po index c5f693f5d1..51473d1a50 100644 --- a/lcl/languages/lclstrconsts.sk.po +++ b/lcl/languages/lclstrconsts.sk.po @@ -1571,12 +1571,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.tr.po b/lcl/languages/lclstrconsts.tr.po index 7168476a21..f01d937fc4 100644 --- a/lcl/languages/lclstrconsts.tr.po +++ b/lcl/languages/lclstrconsts.tr.po @@ -1571,12 +1571,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.uk.po b/lcl/languages/lclstrconsts.uk.po index 4432f49a4a..271c205bce 100644 --- a/lcl/languages/lclstrconsts.uk.po +++ b/lcl/languages/lclstrconsts.uk.po @@ -1561,12 +1561,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr "" diff --git a/lcl/languages/lclstrconsts.zh_CN.po b/lcl/languages/lclstrconsts.zh_CN.po index 68eda436d1..06def95dd0 100644 --- a/lcl/languages/lclstrconsts.zh_CN.po +++ b/lcl/languages/lclstrconsts.zh_CN.po @@ -1577,12 +1577,6 @@ msgstr "" msgid "Name" msgstr "" -#: lclstrconsts.sshellctrlsselecteditemdoesnotexists -msgid "" -"The selected item does not exist on disk:\n" -"\"%s\"\n" -msgstr "" - #: lclstrconsts.sshellctrlssize msgid "Size" msgstr ""