--- parser3/src/main/pa_string.C 2003/10/03 09:40:57 1.184 +++ parser3/src/main/pa_string.C 2003/12/02 11:58:47 1.185.2.1 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_STRING_C="$Date: 2003/10/03 09:40:57 $"; +static const char* IDENT_STRING_C="$Date: 2003/12/02 11:58:47 $"; #include "pcre.h" @@ -15,6 +15,8 @@ static const char* IDENT_STRING_C="$Date #include "pa_dictionary.h" #include "pa_charset.h" +const String String::Empty; + // cord lib extension #ifndef DOXYGEN @@ -341,9 +343,9 @@ Table* String::match(Charset& source_cha *row+=&mid(prefinish, poststart); // .match *row+=&mid(poststart, postfinish); // .postmatch } else { - *row+=0; // .prematch column value - *row+=0; // .match - *row+=0; // .postmatch + *row+=&Empty; // .prematch column value + *row+=&Empty; // .match + *row+=&Empty; // .postmatch } for(int i=1; i(cur); cur+=sizeof(size_t); - buf_length-=sizeof(size_t); + // [WARNING: not cast, addresses must be %4=0 on sparc] + memcpy(&fragments_count, cur, sizeof(fragments_count)); cur+=sizeof(fragments_count); + buf_length-=sizeof(fragments_count); if(fragments_count) { // 3: lang info size_t total_length=0; for(size_t f=0; f(cur); cur+=sizeof(char); - size_t fragment_length=*reinterpret_cast(cur); cur+=sizeof(size_t); - langs.append(total_length, lang, fragment_length); + // lang + lang=*cur++; + // length [WARNING: not cast, addresses must be %4=0 on sparc] + memcpy(&fragment_length, cur, sizeof(fragment_length)); cur+=sizeof(fragment_length); + + // uchar needed to prevent propagating 0x80 bit to upper bytes + langs.append(total_length, (String::Language)(uchar)lang, fragment_length); total_length+=fragment_length; buf_length-=piece_length;