From: <sja...@us...> - 2003-09-02 03:29:35
|
Update of /cvsroot/binaryphp/binaryphp In directory sc8-pr-cvs1:/tmp/cvs-serv29746 Modified Files: php_var.cpp Log Message: went back to "type = PHP_TYPE", because I've realized its better not to do "type.is_type=true", because if something sets "type.is_string=true" then later sets "type.is_array=true" then both are true, and the actual type remains a string (because its first in the list). Index: php_var.cpp =================================================================== RCS file: /cvsroot/binaryphp/binaryphp/php_var.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** php_var.cpp 2 Sep 2003 02:04:02 -0000 1.32 --- php_var.cpp 2 Sep 2003 03:29:27 -0000 1.33 *************** *** 17,46 **** { container = ""; ! type.is_null = true; // Make the var, but make it null. } php_var::php_var(const char* str) { container = str; ! type.is_string = true; } php_var::php_var(double i) { container = doublestring(i); ! type.is_float = true; } php_var::php_var(int i) { container = intstring(i); ! type.is_int = true; } php_var::php_var(unsigned int i) { container = intstring(i); ! type.is_int = true; } php_var::php_var(long i) { container = intstring(i); ! type.is_int = true; } php_var::php_var(const php_var &temp) --- 17,46 ---- { container = ""; ! type = PHP_NULL; // Make the var, but make it null. } php_var::php_var(const char* str) { container = str; ! type = PHP_STRING; } php_var::php_var(double i) { container = doublestring(i); ! type = PHP_FLOAT; } php_var::php_var(int i) { container = intstring(i); ! type = PHP_INT; } php_var::php_var(unsigned int i) { container = intstring(i); ! type = PHP_INT; } php_var::php_var(long i) { container = intstring(i); ! type = PHP_INT; } php_var::php_var(const php_var &temp) *************** *** 55,64 **** { container = str; ! type.is_string = true; } php_var::php_var(string str) { container = str; ! type.is_string = true; } php_var::php_var(bool b) --- 55,64 ---- { container = str; ! type = PHP_STRING; } php_var::php_var(string str) { container = str; ! type = PHP_STRING; } php_var::php_var(bool b) *************** *** 68,72 **** else container = "0"; ! type.is_bool = true; } php_var::operator const char*() --- 68,72 ---- else container = "0"; ! type = PHP_BOOL; } php_var::operator const char*() *************** *** 296,300 **** container = intstring(atol(container.c_str()) + atoi(str.container.c_str())); if(!type.is_int && !type.is_string) ! type.is_int = true; } else --- 296,300 ---- container = intstring(atol(container.c_str()) + atoi(str.container.c_str())); if(!type.is_int && !type.is_string) ! type = PHP_INT; } else *************** *** 302,306 **** container += str.container; if(!type.is_string) ! type.is_string = true; } } --- 302,306 ---- container += str.container; if(!type.is_string) ! type = PHP_STRING; } } |