--- parser3/src/classes/double.C 2002/08/01 11:41:12 1.49 +++ parser3/src/classes/double.C 2002/10/09 11:49:14 1.52 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_DOUBLE_C="$Date: 2002/08/01 11:41:12 $"; +static const char* IDENT_DOUBLE_C="$Date: 2002/10/09 11:49:14 $"; #include "classes.h" #include "pa_request.h" @@ -29,20 +29,22 @@ public: // Methoded static void _int(Request& r, const String& method_name, MethodParams *params) { Pool& pool=r.pool(); - Value *default_code=params->size()>0? - default_code=¶ms->as_junction(0, "default must be int"):0; // (default) + // just checking (default) syntax validity, never really using it here, just for string.int compatibility + if(params->size()>0) + params->as_junction(0, "default must be int"); - VDouble *vdouble=static_cast(r.self); + VDouble *vdouble=static_cast(r.get_self()); Value& result=*new(pool) VInt(pool, vdouble->as_int()); r.write_no_lang(result); } static void _double(Request& r, const String& method_name, MethodParams *params) { Pool& pool=r.pool(); - Value *default_code=params->size()>0? - default_code=¶ms->as_junction(0, "default must be double"):0; // (default) + // just checking (default) syntax validity, never really using it here, just for string.doube compatibility + if(params->size()>0) + params->as_junction(0, "default must be double"); - VDouble *vdouble=static_cast(r.self); + VDouble *vdouble=static_cast(r.get_self()); Value& result=*new(pool) VDouble(pool, vdouble->as_double()); r.write_no_lang(result); } @@ -57,7 +59,7 @@ static void __mod(VDouble& vdouble, doub static void vdouble_op(Request& r, MethodParams *params, vdouble_op_func_ptr func) { - VDouble *vdouble=static_cast(r.self); + VDouble *vdouble=static_cast(r.get_self()); double param=params->size()? params->as_double(0, "param must be double", r):1/*used in inc/dec*/; (*func)(*vdouble, param); @@ -92,7 +94,7 @@ static void _sql(Request& r, const Strin val=0; //calm, compiler } VDouble& result=*new(pool) VDouble(pool, val); - r.write_assign_lang(result); + r.write_no_lang(result); } // constructor