--- parser3/src/main/pa_string.C 2001/09/07 17:11:51 1.102.2.1 +++ parser3/src/main/pa_string.C 2001/09/26 10:32:26 1.104 @@ -2,10 +2,10 @@ Parser: string class. @see untasize_t.C. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + + $Id: pa_string.C,v 1.104 2001/09/26 10:32:26 parser Exp $ */ -static const char *RCSId="$Id: pa_string.C,v 1.102.2.1 2001/09/07 17:11:51 parser Exp $"; #include "pa_config_includes.h" @@ -712,13 +712,10 @@ double String::as_double() const { else result=(double)strtod(cstr, &error_pos); - if(error_pos==cstr/*empty*/) - result=0; - else - if(*error_pos/*not eos*/) - THROW(0, 0, - this, - "invalid number (double)"); + if(*error_pos/*not EOS*/) + THROW(0, 0, + this, + "invalid number (double)"); return result; } @@ -735,13 +732,10 @@ int String::as_int() const { else result=(int)strtol(cstr, &error_pos, 0); - if(error_pos==cstr/*empty*/) - result=0; - else - if(*error_pos/*not eos*/) - THROW(0, 0, - this, - "invalid number (int)"); + if(*error_pos/*not EOS*/) + THROW(0, 0, + this, + "invalid number (int)"); return result; }