"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "base_class/string/EST_String.cc" between
speech_tools-2.4-release.tar.gz and speech_tools-2.5.0-release.tar.gz

About: The speech_tools - Edinburgh Speech Tools Library (used by the Festival Speech Synthesis System).

EST_String.cc  (speech_tools-2.4-release):EST_String.cc  (speech_tools-2.5.0-release)
skipping to change at line 913 skipping to change at line 913
if (!len) if (!len)
memory = NULL; memory = NULL;
else if (!shareing() && len < size) else if (!shareing() && len < size)
memcpy((char *)memory, str, len+1); memcpy((char *)memory, str, len+1);
else if (len) else if (len)
memory = chunk_allocate(len+1, str, len); memory = chunk_allocate(len+1, str, len);
size=len; size=len;
return *this; return *this;
} }
#if 0
EST_String &EST_String::operator = (const char c) EST_String &EST_String::operator = (const char c)
{ {
memory = chunk_allocate(2, &c, 1); memory = chunk_allocate(2, &c, 1);
size=1; size=1;
return *this; return *this;
} }
EST_String &EST_String::operator = (const EST_String &s) EST_String &EST_String::operator = (const EST_String &s)
{ {
#if 1 const char *str = (const char *)s;
/* static EST_ChunkPtr hack = s.memory; */ CHECK_STRING_ARG(str);
memory = NON_CONST_CHUNKPTR(s.memory); int len = safe_strlen(str);
size = s.size; if (!len)
#else memory = NULL;
*(struct EST_dumb_string *)this = *(struct EST_dumb_string *)(&s); else if (!shareing() && len < size)
#endif memcpy((char *)memory, str, len+1);
return *this; else if (len)
memory = chunk_allocate(len+1, str, len);
size=len;
return *this;
//
//#if 1
///* static EST_ChunkPtr hack = s.memory; */
// memory = NON_CONST_CHUNKPTR(s.memory);
// size = s.size;
//#else
// *(struct EST_dumb_string *)this = *(struct EST_dumb_string *)(&s);
//#endif
// return *this;
} }
#endif
EST_String downcase(const EST_String &s) EST_String downcase(const EST_String &s)
{ {
EST_String t = EST_String(s.size, chunk_allocate(s.size+1, s.str(), s.size)) ; EST_String t = EST_String(s.size, chunk_allocate(s.size+1, s.str(), s.size)) ;
int i; int i;
for (i=0; i < s.length(); i++) for (i=0; i < s.length(); i++)
if (isupper(s(i))) if (isupper(s(i)))
t[i] = tolower(s(i)); t[i] = tolower(s(i));
else else
 End of changes. 3 change blocks. 
8 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)