Browse Source

-- Date: 2010/02/18
Reference: noref
Issue type: improvement
Severity: None
Module(s): Parser
Description: Algorithm of generation of >>>GLOBAL<<< function changed.
Now it does not include empty lines at the end.

-- Date: 2010/02/18
Reference: noref
Issue type: fix
Severity: Minor
Module(s): Launcher
Description: Exit code is now a sum of codes from scanner and appraiser

-- Date: 2010/02/18
Reference: noref
Issue type: improvement
Severity: None
Module(s): Launcher
Description: Status message added at the end of execution

avkonst 15 years ago
parent
commit
5d266bb0c9
3 changed files with 42 additions and 5 deletions
  1. 23 0
      changelog.txt
  2. 3 2
      lib/SWI/Launcher.pm
  3. 16 3
      lib/SWI/Processor.pm

+ 23 - 0
changelog.txt

@@ -22,6 +22,28 @@ ____________________________________________
 
 -- 2010/02/XX: VERSION 0.9.2 not yet released
 
+       -- Date:         2010/02/18
+          Reference:    noref
+          Issue type:   improvement
+          Severity:     None
+          Module(s):    Parser
+          Description:  Algorithm of generation of >>>GLOBAL<<< function changed.
+                        Now it does not include empty lines at the end.
+
+       -- Date:         2010/02/18
+          Reference:    noref
+          Issue type:   fix
+          Severity:     Minor
+          Module(s):    Launcher
+          Description:  Exit code is now a sum of codes from scanner and appraiser
+
+       -- Date:         2010/02/18
+          Reference:    noref
+          Issue type:   improvement
+          Severity:     None
+          Module(s):    Launcher
+          Description:  Status message added at the end of execution
+
        -- Date:         2010/02/16
           Reference:    noref
           Issue type:   fix
@@ -167,4 +189,4 @@ ____________________________________________
 ____________________________________________
 
 
+-- 2009/07/13: VERSION 0.7.0 released for internal beta testing

+ 3 - 2
lib/SWI/Launcher.pm

@@ -107,7 +107,7 @@ sub swiLaunch
             elsif ( $result > 0 )
             {
                 STATUS("The are scan warnings and/or errors.");
-                $returnCode = $result;
+                $returnCode += $result;
             }
             else
             {
@@ -160,7 +160,7 @@ sub swiLaunch
         {
             STATUS(
                 "Report has been converted. There are exceeded limitations.");
-            $returnCode = $result;
+            $returnCode += $result;
         }
         else
         {
@@ -168,6 +168,7 @@ sub swiLaunch
         }
     }
 
+    STATUS("Execution completed with exit code '$returnCode'.");
     return $returnCode;
 }
 

+ 16 - 3
lib/SWI/Processor.pm

@@ -592,7 +592,8 @@ sub swiSourceCodeGlobalGet
 
     if ( !defined($endLine) )
     {
-        $endLine = $#blockCode + 100;    # Just with overhead
+        # end line is the last by default
+        $endLine = $#blockCode + 1;
     }
 
     foreach my $function ( values %{$functionsData} )
@@ -610,14 +611,26 @@ sub swiSourceCodeGlobalGet
     }
 
     my $result = "";
-    foreach (@blockCode)
+    my $emptyLines = "";
+    foreach my $line (@blockCode)
     {
+        # Check if it is necessary to finish
         $endLine--;
         if ( $endLine < 0 )
         {
             last;
         }
-        $result .= $_ . "\n";
+        
+        # attach frag only if it is not empty
+        if ($line =~ m/[^ \t]/)
+        {
+            $result .= $emptyLines . $line . "\n";
+            $emptyLines = "";      
+        }
+        else
+        {
+            $emptyLines .= $line . "\n";
+        }
     }
 
     return $result;