Index: trunk/workflow/inc/smarty/internals/core.write_compiled_include.php
===================================================================
--- trunk/workflow/inc/smarty/internals/core.write_compiled_include.php	(revision 795)
+++ trunk/workflow/inc/smarty/internals/core.write_compiled_include.php	(revision 7655)
@@ -38,5 +38,5 @@
 
     $this_varname = ((double)phpversion() >= 5.0) ? '_smarty' : 'this';
-    for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) {
+    for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; ++$_i) {
         $_match =& $_match_source[$_i];
         $source = $_match[4];
@@ -57,5 +57,5 @@
             }
 
-            for ($i=0, $count = count($tokens); $i < $count; $i++) {
+            for ($i=0, $count = count($tokens); $i < $count; ++$i) {
                 if (is_array($tokens[$i])) {
                     if ($tokens[$i][0] == T_VARIABLE && $tokens[$i][1] == '$this') {
Index: trunk/workflow/inc/smarty/internals/core.write_cache_file.php
===================================================================
--- trunk/workflow/inc/smarty/internals/core.write_cache_file.php	(revision 795)
+++ trunk/workflow/inc/smarty/internals/core.write_cache_file.php	(revision 7655)
@@ -44,5 +44,5 @@
         $level = 0;
         $j = 0;
-        for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) {
+        for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; ++$i) {
             if ($results[$i] == $match[0][$j]) {
                 // nocache tag
@@ -53,5 +53,5 @@
                     if ($level++ > 0) unset($results[$i]);
                 }
-                $j++;
+                ++$j;
             } elseif ($level > 0) {
                 unset($results[$i]);
Index: trunk/workflow/inc/smarty/internals/core.process_cached_inserts.php
===================================================================
--- trunk/workflow/inc/smarty/internals/core.process_cached_inserts.php	(revision 795)
+++ trunk/workflow/inc/smarty/internals/core.process_cached_inserts.php	(revision 7655)
@@ -18,5 +18,5 @@
     list($cached_inserts, $insert_args) = $match;
 
-    for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) {
+    for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; ++$i) {
         if ($smarty->debugging) {
             $_params = array();
Index: trunk/workflow/inc/smarty/plugins/modifier.escape.php
===================================================================
--- trunk/workflow/inc/smarty/plugins/modifier.escape.php	(revision 795)
+++ trunk/workflow/inc/smarty/plugins/modifier.escape.php	(revision 7655)
@@ -42,5 +42,5 @@
             // escape every character into hex
             $return = '';
-            for ($x=0; $x < strlen($string); $x++) {
+            for ($x=0; $x < strlen($string); ++$x) {
                 $return .= '%' . bin2hex($string[$x]);
             }
@@ -49,5 +49,5 @@
         case 'hexentity':
             $return = '';
-            for ($x=0; $x < strlen($string); $x++) {
+            for ($x=0; $x < strlen($string); ++$x) {
                 $return .= '&#x' . bin2hex($string[$x]) . ';';
             }
@@ -56,5 +56,5 @@
         case 'decentity':
             $return = '';
-            for ($x=0; $x < strlen($string); $x++) {
+            for ($x=0; $x < strlen($string); ++$x) {
                 $return .= '&#' . ord($string[$x]) . ';';
             }
@@ -72,5 +72,5 @@
            // escape non-standard chars, such as ms document quotes
            $_res = '';
-           for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) {
+           for($_i = 0, $_len = strlen($string); $_i < $_len; ++$_i) {
                $_ord = ord(substr($string, $_i, 1));
                // non-standard char, escape it
Index: trunk/workflow/inc/smarty/plugins/block.textformat.php
===================================================================
--- trunk/workflow/inc/smarty/plugins/block.textformat.php	(revision 795)
+++ trunk/workflow/inc/smarty/plugins/block.textformat.php	(revision 7655)
@@ -76,5 +76,5 @@
     $_output = '';
 
-    for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) {
+    for($_x = 0, $_y = count($_paragraphs); $_x < $_y; ++$_x) {
         if ($_paragraphs[$_x] == '') {
             continue;
Index: trunk/workflow/inc/smarty/plugins/outputfilter.trimwhitespace.php
===================================================================
--- trunk/workflow/inc/smarty/plugins/outputfilter.trimwhitespace.php	(revision 795)
+++ trunk/workflow/inc/smarty/plugins/outputfilter.trimwhitespace.php	(revision 7655)
@@ -65,5 +65,5 @@
     $_len = strlen($search_str);
     $_pos = 0;
-    for ($_i=0, $_count=count($replace); $_i<$_count; $_i++)
+    for ($_i=0, $_count=count($replace); $_i<$_count; ++$_i)
         if (($_pos=strpos($subject, $search_str, $_pos))!==false)
             $subject = substr_replace($subject, $replace[$_i], $_pos, $_len);
Index: trunk/workflow/inc/smarty/plugins/function.html_table.php
===================================================================
--- trunk/workflow/inc/smarty/plugins/function.html_table.php	(revision 795)
+++ trunk/workflow/inc/smarty/plugins/function.html_table.php	(revision 7655)
@@ -128,5 +128,5 @@
         $output .= "<thead><tr>\n";
 
-        for ($r=0; $r<$cols_count; $r++) {
+        for ($r=0; $r<$cols_count; ++$r) {
             $output .= '<th' . smarty_function_html_table_cycle('th', $th_attr, $r) . '>';
             $output .= $cols[$r];
@@ -137,9 +137,9 @@
 
     $output .= "<tbody>\n";
-    for ($r=0; $r<$rows; $r++) {
+    for ($r=0; $r<$rows; ++$r) {
         $output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n";
         $rx =  ($vdir == 'down') ? $r*$cols_count : ($rows-1-$r)*$cols_count;
 
-        for ($c=0; $c<$cols_count; $c++) {
+        for ($c=0; $c<$cols_count; ++$c) {
             $x =  ($hdir == 'right') ? $rx+$c : $rx+$cols_count-1-$c;
             if ($inner!='cols') {
Index: trunk/workflow/inc/smarty/plugins/function.html_select_time.php
===================================================================
--- trunk/workflow/inc/smarty/plugins/function.html_select_time.php	(revision 795)
+++ trunk/workflow/inc/smarty/plugins/function.html_select_time.php	(revision 7655)
@@ -85,5 +85,5 @@
         $hours       = $use_24_hours ? range(0, 23) : range(1, 12);
         $hour_fmt = $use_24_hours ? '%H' : '%I';
-        for ($i = 0, $for_max = count($hours); $i < $for_max; $i++)
+        for ($i = 0, $for_max = count($hours); $i < $for_max; ++$i)
             $hours[$i] = sprintf('%02d', $hours[$i]);
         $html_result .= '<select name=';
Index: trunk/workflow/inc/smarty/plugins/function.mailto.php
===================================================================
--- trunk/workflow/inc/smarty/plugins/function.mailto.php	(revision 795)
+++ trunk/workflow/inc/smarty/plugins/function.mailto.php	(revision 7655)
@@ -89,5 +89,6 @@
 
     $mail_parm_vals = '';
-    for ($i=0; $i<count($mail_parms); $i++) {
+    $mail_parms_count = count($mail_parms);
+    for ($i=0; $i<$mail_parms_count; ++$i) {
         $mail_parm_vals .= (0==$i) ? '?' : '&';
         $mail_parm_vals .= $mail_parms[$i];
@@ -105,5 +106,5 @@
 
         $js_encode = '';
-        for ($x=0; $x < strlen($string); $x++) {
+        for ($x=0; $x < strlen($string); ++$x) {
             $js_encode .= '%' . bin2hex($string[$x]);
         }
@@ -114,5 +115,5 @@
         $string = '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
 
-        for($x = 0, $y = strlen($string); $x < $y; $x++ ) {
+        for($x = 0, $y = strlen($string); $x < $y; ++$x ) {
             $ord[] = ord($string[$x]);   
         }
@@ -138,5 +139,5 @@
         }
         $address_encode = '';
-        for ($x=0; $x < strlen($address); $x++) {
+        for ($x=0; $x < strlen($address); ++$x) {
             if(preg_match('!\w!',$address[$x])) {
                 $address_encode .= '%' . bin2hex($address[$x]);
@@ -146,5 +147,5 @@
         }
         $text_encode = '';
-        for ($x=0; $x < strlen($text); $x++) {
+        for ($x=0; $x < strlen($text); ++$x) {
             $text_encode .= '&#x' . bin2hex($text[$x]).';';
         }
Index: trunk/workflow/inc/smarty/plugins/function.html_select_date.php
===================================================================
--- trunk/workflow/inc/smarty/plugins/function.html_select_date.php	(revision 795)
+++ trunk/workflow/inc/smarty/plugins/function.html_select_date.php	(revision 7655)
@@ -181,5 +181,5 @@
     $field_separator_count = -1;
     if ($display_months) {
-    	$field_separator_count++;
+    	++$field_separator_count;
         $month_names = array();
         $month_values = array();
@@ -188,5 +188,5 @@
             $month_values[''] = '';
         }
-        for ($i = 1; $i <= 12; $i++) {
+        for ($i = 1; $i <= 12; ++$i) {
             $month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));
             $month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000));
@@ -225,5 +225,5 @@
             $day_values[''] = '';
         }
-        for ($i = 1; $i <= 31; $i++) {
+        for ($i = 1; $i <= 31; ++$i) {
             $days[] = sprintf($day_format, $i);
             $day_values[] = sprintf($day_value_format, $i);
@@ -255,5 +255,5 @@
 
     if ($display_years) {
-    	$field_separator_count++;
+    	++$field_separator_count;
         if (null !== $field_array){
             $year_name = $field_array . '[' . $prefix . 'Year]';
@@ -303,5 +303,5 @@
 
     // Loop thru the field_order field
-    for ($i = 0; $i <= 2; $i++){
+    for ($i = 0; $i <= 2; ++$i){
         $c = substr($field_order, $i, 1);
         switch ($c){
Index: trunk/workflow/inc/smarty/plugins/function.config_load.php
===================================================================
--- trunk/workflow/inc/smarty/plugins/function.config_load.php	(revision 795)
+++ trunk/workflow/inc/smarty/plugins/function.config_load.php	(revision 7655)
@@ -121,5 +121,5 @@
                 $smarty->_config[1]['files'][$_file] = true;
         } else if ($_scope == 'global') {
-            for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) {
+            for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; ++$i) {
                 $smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars);
                 $smarty->_config[$i]['files'][$_file] = true;
Index: trunk/workflow/inc/smarty/Smarty_Compiler.class.php
===================================================================
--- trunk/workflow/inc/smarty/Smarty_Compiler.class.php	(revision 795)
+++ trunk/workflow/inc/smarty/Smarty_Compiler.class.php	(revision 7655)
@@ -277,5 +277,5 @@
 
         /* loop through text blocks */
-        for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; $curr_tb++) {
+        for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; ++$curr_tb) {
             /* match anything resembling php tags */
             if (preg_match_all('~(<\?(?:\w+|=)?|\?>|language\s*=\s*[\"\']?\s*php\s*[\"\']?)~is', $text_blocks[$curr_tb], $sp_match)) {
@@ -283,9 +283,9 @@
                 $sp_match[1] = array_unique($sp_match[1]);
                 usort($sp_match[1], '_smarty_sort_length');
-                for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {
+                for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; ++$curr_sp) {
                     $text_blocks[$curr_tb] = str_replace($sp_match[1][$curr_sp],'%%%SMARTYSP'.$curr_sp.'%%%',$text_blocks[$curr_tb]);
                 }
                 /* process each one */
-                for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) {
+                for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; ++$curr_sp) {
                     if ($this->php_handling == SMARTY_PHP_PASSTHRU) {
                         /* echo php contents */
@@ -308,5 +308,5 @@
         /* Compile the template tags into PHP code. */
         $compiled_tags = array();
-        for ($i = 0, $for_max = count($template_tags); $i < $for_max; $i++) {
+        for ($i = 0, $for_max = count($template_tags); $i < $for_max; ++$i) {
             $this->_current_line_no += substr_count($text_blocks[$i], "\n");
             $compiled_tags[] = $this->_compile_tag($template_tags[$i]);
@@ -331,5 +331,5 @@
             if ($strip) {
                 /* strip all $text_blocks before the next '/strip' */
-                for ($j = $i + 1; $j < $for_max; $j++) {
+                for ($j = $i + 1; $j < $for_max; ++$j) {
                     /* remove leading and trailing whitespaces of each line */
                     $text_blocks[$j] = preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $text_blocks[$j]);
@@ -354,5 +354,5 @@
         
         /* Interleave the compiled contents and text blocks to get the final result. */
-        for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) {
+        for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; ++$i) {
             if ($compiled_tags[$i] == '') {
                 // tag result empty, remove first newline from following text block
@@ -1279,6 +1279,7 @@
 
         $is_arg_stack = array();
-
-        for ($i = 0; $i < count($tokens); $i++) {
+        $tokens_count = count($tokens);
+        
+        for ($i = 0; $i < $tokens_count; ++$i) {
 
             $token = &$tokens[$i];
@@ -1470,5 +1471,5 @@
             case 'even':
                 if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') {
-                    $expr_end++;
+                    ++$expr_end;
                     $expr_arg = $tokens[$expr_end++];
                     $expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
@@ -1479,5 +1480,5 @@
             case 'odd':
                 if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') {
-                    $expr_end++;
+                    ++$expr_end;
                     $expr_arg = $tokens[$expr_end++];
                     $expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
@@ -1488,5 +1489,5 @@
             case 'div':
                 if (@$tokens[$expr_end] == 'by') {
-                    $expr_end++;
+                    ++$expr_end;
                     $expr_arg = $tokens[$expr_end++];
                     $expr = "!($is_arg % " . $this->_parse_var_props($expr_arg) . ")";
@@ -1843,5 +1844,5 @@
         $this->_parse_vars_props($match);
         $replace = array();
-        for ($i = 0, $count = count($match); $i < $count; $i++) {
+        for ($i = 0, $count = count($match); $i < $count; ++$i) {
             $replace[$orig_vals[$i]] = $match[$i];
         }
@@ -1905,5 +1906,5 @@
         list(, $_modifiers, $modifier_arg_strings) = $_match;
 
-        for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; $_i++) {
+        for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; ++$_i) {
             $_modifier_name = $_modifiers[$_i];
 
Index: trunk/workflow/inc/smarty/Config_File.class.php
===================================================================
--- trunk/workflow/inc/smarty/Config_File.class.php	(revision 795)
+++ trunk/workflow/inc/smarty/Config_File.class.php	(revision 7655)
@@ -282,5 +282,5 @@
         preg_match_all('!^.*\r?\n?!m', $contents, $match);
         $lines = $match[0];
-        for ($i=0, $count=count($lines); $i<$count; $i++) {
+        for ($i=0, $count=count($lines); $i<$count; ++$i) {
             $line = $lines[$i];
             if (empty($line)) continue;
