--- parser3/src/classes/date.C 2002/11/29 12:13:42 1.41 +++ parser3/src/classes/date.C 2003/03/17 14:48:04 1.42.4.1 @@ -1,11 +1,11 @@ /** @file Parser: @b date parser class. - Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_DATE_C="$Date: 2002/11/29 12:13:42 $"; +static const char* IDENT_DATE_C="$Date: 2003/03/17 14:48:04 $"; #include "classes.h" #include "pa_request.h" @@ -134,7 +134,7 @@ static void _sql_string(Request& r, cons Pool& pool=r.pool(); VDate *vdate=static_cast(r.get_self()); int size=1+ 4+1+2+1+2 +1+ 2+1+2+1+2 +1 +1; - char *buf=(char *)pool.malloc(size); + char *buf=(char *)pool.malloc_atomic(size); time_t time=vdate->get_time(); size=strftime(buf, size, "%Y-%m-%d %H:%M:%S", localtime(&time)); @@ -244,7 +244,7 @@ static Table *fill_month_days(Request& r for(int wday=0; wday<7; wday++, _day++) { String *cell=new(pool) String(pool); if(_day>=1 && _day<=monthDays) { - char *buf=(char *)pool.malloc(2+1); + char *buf=(char *)pool.malloc_atomic(2+1); cell->APPEND_CLEAN(buf, sprintf(buf, "%02d", _day), method_name.origin().file, method_name.origin().line); } @@ -261,7 +261,7 @@ static Table *fill_month_days(Request& r // http://www.merlyn.demon.co.uk/weekinfo.htm const int FirstThurs[] = {7,5,4,3,2,7,6,5,4,2,1,7,6,4,3,2,1,6,5,4,3,1,7,6,5,3,2,1}; int n=1 + (tms.tm_yday-(FirstThurs[weekyear % 28]-3))/7; - weekno_buf=(char *)pool.malloc(weekno_buf_size); + weekno_buf=(char *)pool.malloc_atomic(weekno_buf_size); weekno_size=snprintf(weekno_buf, weekno_buf_size, "%02d", n); } @@ -276,7 +276,7 @@ static Table *fill_month_days(Request& r // appending year week year { String *cell=new(pool) String(pool); - char *buf=(char *)pool.malloc(4+1); + char *buf=(char *)pool.malloc_atomic(4+1); cell->APPEND_CLEAN(buf, sprintf(buf, "%02d", weekyear), method_name.origin().file, method_name.origin().line); row+=cell; @@ -319,7 +319,7 @@ static Table *fill_week_days(Request& r, tm *tmOut=localtime(&t); Array& row=*new(pool) Array(pool, 4); #define WDFILL(size, value) { \ - char *buf=(char *)pool.malloc(size+1); \ + char *buf=(char *)pool.malloc_atomic(size+1); \ String *cell=new(pool) String(pool); \ cell->APPEND_CLEAN(buf, sprintf(buf, "%0"#size"d", value), \ method_name.origin().file, \