浏览代码

* fix nested for-loop with same index

peter 21 年之前
父节点
当前提交
574bc1f6ab
共有 2 个文件被更改,包括 15 次插入9 次删除
  1. 8 5
      fcl/passrc/pparser.pp
  2. 7 4
      utils/fpdoc/makeskel.pp

+ 8 - 5
fcl/passrc/pparser.pp

@@ -631,7 +631,7 @@ var
   TypeEl: TPasType;
   ClassEl: TPasClassType;
   List: TList;
-  i: Integer;
+  i,j: Integer;
   VarEl: TPasVariable;
 begin
   Module := nil;
@@ -716,11 +716,11 @@ begin
                       if CompareText(ClassEl.Name, TypeEl.Name) = 0 then
                       begin
                         Section.Classes.Delete(i);
-                        for i := 0 to Section.Declarations.Count - 1 do
+                        for j := 0 to Section.Declarations.Count - 1 do
                           if CompareText(TypeEl.Name,
-                            TPasElement(Section.Declarations[i]).Name) = 0 then
+                            TPasElement(Section.Declarations[j]).Name) = 0 then
                           begin
-                            Section.Declarations.Delete(i);
+                            Section.Declarations.Delete(j);
                             break;
                           end;
                         ClassEl.Release;
@@ -1822,7 +1822,10 @@ end.
 
 {
   $Log$
-  Revision 1.7  2004-07-23 23:40:35  michael
+  Revision 1.8  2004-09-13 16:02:36  peter
+    * fix nested for-loop with same index
+
+  Revision 1.7  2004/07/23 23:40:35  michael
   + Fixed value of constant strings (added quotes)
 
   Revision 1.6  2004/05/16 13:24:59  peter

+ 7 - 4
utils/fpdoc/makeskel.pp

@@ -276,7 +276,7 @@ end;
 
 
 var
-  i: Integer;
+  i,j: Integer;
   Module: TPasModule;
   
 begin
@@ -318,8 +318,8 @@ begin
        try
          Engine.SetPackageName(PackageName);
          if UpdateMode then
-           For I:=0 to DescrFiles.Count-1 do
-             Engine.AddDocFile(DescrFiles[i]);
+           For j:=0 to DescrFiles.Count-1 do
+             Engine.AddDocFile(DescrFiles[j]);
          Module := ParseSource(Engine, InputFiles[i], OSTarget, CPUTarget);
    	 WriteLn(f, '</module> <!-- ', Module.Name, ' -->');
        except
@@ -349,7 +349,10 @@ end.
 
 {
   $Log$
-  Revision 1.12  2004-08-29 15:32:41  michael
+  Revision 1.13  2004-09-13 16:04:52  peter
+    * fix nested for-loop with same index
+
+  Revision 1.12  2004/08/29 15:32:41  michael
   + More intelligent handling of nodes. Do not write unused nodes.
 
   Revision 1.11  2004/08/28 18:18:59  michael