|
From: <sja...@us...> - 2003-09-20 17:10:16
|
Update of /cvsroot/binaryphp/binaryphp
In directory sc8-pr-cvs1:/tmp/cvs-serv10007
Modified Files:
convert.php php_var.cpp
Log Message:
Applied fixes from in...@us...
Fixed a whole lot of whitespace in convert.php
Index: convert.php
===================================================================
RCS file: /cvsroot/binaryphp/binaryphp/convert.php,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** convert.php 9 Aug 2003 03:58:34 -0000 1.24
--- convert.php 20 Sep 2003 17:10:12 -0000 1.25
***************
*** 2,50 ****
<?php
! function showUsage()
! {
! echo 'Usage: convert.php --if <inputfile.php> --of <output> [-v | --verbose] [-h | --help]' , "\n";
! }
! $debug = false;
! /* If there are arguments, cycle through em */
! if ($_SERVER['argc'] > 4) {
! for($i = 1; $i <= $_SERVER['argc']; ++$i) {
! if(@$_SERVER['argv'][$i] == '-v' OR @$_SERVER['argv'][$i] == '--verbose') {
! $debug = true;
! }
! if(@$_SERVER['argv'][$i] == '--if') {
! $input = '';
! $input = $_SERVER['argv'][$i + 1];
! }
! if(@$_SERVER['argv'][$i] == '--of') {
! $output = '';
! $output = $_SERVER['argv'][$i + 1];
! $outputfile = $output . '.cpp';
! }
! if(@$_SERVER['argv'][$i] == '--help' OR @$_SERVER['argv'][$i] == '-h') {
! showUsage();
! }
! }
! } else {
! showUsage();
! die ("Too Few Arguments\n");
! }
!
! if(!(isset($input) && strlen(trim($input)) && is_file($input))) {
! showUsage();
! die ($input . " isn't a file\n");
! }
! if(!(isset($output) && strlen(trim($output)))) {
! showUsage();
! die ($output . "isn't a valid output file\n");
! }
!
! if($debug == true) {
! define('DEBUG', true);
! } else {
! define('DEBUG', false);
! }
!
! if (substr(PHP_OS, 0, 3) == 'WIN') {
define('BINARYPHP_OS', 'Windows');
} else {
--- 2,50 ----
<?php
! function showUsage()
! {
! echo 'Usage: convert.php --if <inputfile.php> --of <output> [-v | --verbose] [-h | --help]' , "\n";
! }
! $debug = false;
! /* If there are arguments, cycle through em */
! if ($_SERVER['argc'] > 4) {
! for($i = 1; $i <= $_SERVER['argc']; ++$i) {
! if(@$_SERVER['argv'][$i] == '-v' OR @$_SERVER['argv'][$i] == '--verbose') {
! $debug = true;
! }
! if(@$_SERVER['argv'][$i] == '--if') {
! $input = '';
! $input = $_SERVER['argv'][$i + 1];
! }
! if(@$_SERVER['argv'][$i] == '--of') {
! $output = '';
! $output = $_SERVER['argv'][$i + 1];
! $outputfile = $output . '.cpp';
! }
! if(@$_SERVER['argv'][$i] == '--help' OR @$_SERVER['argv'][$i] == '-h') {
! showUsage();
! }
! }
! } else {
! showUsage();
! die ("Too Few Arguments\n");
! }
!
! if(!(isset($input) && strlen(trim($input)) && is_file($input))) {
! showUsage();
! die ($input . " isn't a file\n");
! }
! if(!(isset($output) && strlen(trim($output)))) {
! showUsage();
! die ($output . "isn't a valid output file\n");
! }
!
! if($debug == true) {
! define('DEBUG', true);
! } else {
! define('DEBUG', false);
! }
!
! if (substr(PHP_OS, 0, 3) == 'WIN') {
define('BINARYPHP_OS', 'Windows');
} else {
***************
*** 67,74 ****
$flag = (string) null;
$lines = explode("\n", $code);
! if(DEBUG == true) {
! foreach($lines as $line => $cod)
! echo $line + 1, ': ', $cod, "\n";
! }
$fp = fopen($output . '.cpp', 'wt');
fwrite($fp, $code);
--- 67,74 ----
$flag = (string) null;
$lines = explode("\n", $code);
! if(DEBUG == true) {
! foreach($lines as $line => $cod)
! echo $line + 1, ': ', $cod, "\n";
! }
$fp = fopen($output . '.cpp', 'wt');
fwrite($fp, $code);
***************
*** 77,90 ****
touch('log');
if(BINARYPHP_OS == 'Windows') {
- $comp = 'cl -c /nologo /MT /W3 /GX /FD -DWIN32 /Fotest.obj ' . $outputfile . ' >> log';
- echo $comp, "\n\n";
- shell_exec($comp);
if(DEBUG==true)
$opt='-debug';
else
! $opt='-$comp';
! $release = 'link ' .$output . '.obj -nologo ' .$opt .' -incremental:no -opt:ref '.$flags.' -out:' . $output . ' >> log';
echo $comp, "\n\n";
shell_exec($comp);
} else {
if(!file_exists('php_var.lo'))
--- 77,96 ----
touch('log');
if(BINARYPHP_OS == 'Windows') {
if(DEBUG==true)
$opt='-debug';
else
! $opt='';
! $comp = 'cl -c /nologo /MT /W3 /GX /FD -DWIN32 /Fo'.$output.'.obj ' . $outputfile . ' >> log';
echo $comp, "\n\n";
shell_exec($comp);
+ if(!file_exists('php_var.obj')) {
+ $comp = 'cl -c /nologo /MT /W3 /GX /FD -DWIN32 /Fophp_var.obj php_var.cpp >> log';
+ `echo $comp >> log`;
+ shell_exec($comp);
+ }
+
+ $release = 'link php_var.obj ' .$output . '.obj -nologo ' .$opt .' -incremental:no -opt:ref '.$flags.' -out:' . $output . '.exe >> log';
+ echo $release, "\n\n";
+ shell_exec($release);
} else {
if(!file_exists('php_var.lo'))
Index: php_var.cpp
===================================================================
RCS file: /cvsroot/binaryphp/binaryphp/php_var.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** php_var.cpp 2 Sep 2003 03:29:27 -0000 1.33
--- php_var.cpp 20 Sep 2003 17:10:12 -0000 1.34
***************
*** 96,100 ****
php_var::operator float()
{
! return atof(container.c_str());
}
php_var::operator int()
--- 96,100 ----
php_var::operator float()
{
! return (float)atof(container.c_str());
}
php_var::operator int()
***************
*** 139,143 ****
{
php_var key = subscript;
! int i = 0;
for(i = 0;i < keys.size(); ++i)
{
--- 139,143 ----
{
php_var key = subscript;
! unsigned int i = 0;
for(i = 0;i < keys.size(); ++i)
{
|