362 |
char_block::char_block(int length) |
char_block::char_block(int length) |
363 |
: used(0), next(NULL) |
: used(0), next(NULL) |
364 |
{ |
{ |
365 |
buffer = (char *)malloc(max(length, char_block::SIZE)); |
buffer = new char[max(length, char_block::SIZE)]; |
366 |
if (buffer == NULL) |
if (buffer == NULL) |
367 |
fatal("out of memory error"); |
fatal("out of memory error"); |
368 |
} |
} |
370 |
char_block::~char_block() |
char_block::~char_block() |
371 |
{ |
{ |
372 |
if (buffer != NULL) |
if (buffer != NULL) |
373 |
free(buffer); |
a_delete buffer; |
374 |
} |
} |
375 |
|
|
376 |
class char_buffer { |
class char_buffer { |
1688 |
while (xhead != NULL) { |
while (xhead != NULL) { |
1689 |
t = xhead; |
t = xhead; |
1690 |
xhead = xhead->next; |
xhead = xhead->next; |
1691 |
free((void *)t->val); |
a_delete t->val; |
1692 |
free((void *)t->id); |
a_delete t->id; |
1693 |
free(t); |
delete t; |
1694 |
} |
} |
1695 |
while (yhead != NULL) { |
while (yhead != NULL) { |
1696 |
t = yhead; |
t = yhead; |
1697 |
yhead = yhead->next; |
yhead = yhead->next; |
1698 |
free((void *)t->val); |
a_delete t->val; |
1699 |
free((void *)t->id); |
a_delete t->id; |
1700 |
free(t); |
delete t; |
1701 |
} |
} |
1702 |
} |
} |
1703 |
|
|
1724 |
compare(t, v, f, l); |
compare(t, v, f, l); |
1725 |
else { |
else { |
1726 |
if (t == NULL) { |
if (t == NULL) { |
1727 |
t = (assert_pos *)malloc(sizeof(struct assert_pos)); |
t = new assert_pos; |
1728 |
t->next = *h; |
t->next = *h; |
1729 |
(*h) = t; |
(*h) = t; |
1730 |
} |
} |
1740 |
} |
} |
1741 |
t->id = i; |
t->id = i; |
1742 |
t->val = v; |
t->val = v; |
1743 |
a_delete c; |
a_delete (char *)c; |
1744 |
a_delete f; |
a_delete (char *)f; |
1745 |
a_delete l; |
a_delete (char *)l; |
1746 |
} |
} |
1747 |
} |
} |
1748 |
|
|
1797 |
const char *replace_negate_str (const char *before, char *after) |
const char *replace_negate_str (const char *before, char *after) |
1798 |
{ |
{ |
1799 |
if (before != NULL) |
if (before != NULL) |
1800 |
a_delete before; |
a_delete (char *)before; |
1801 |
|
|
1802 |
if (strlen(after) > 0) { |
if (strlen(after) > 0) { |
1803 |
int d = atoi(after); |
int d = atoi(after); |
1818 |
const char *replace_str (const char *before, const char *after) |
const char *replace_str (const char *before, const char *after) |
1819 |
{ |
{ |
1820 |
if (before != NULL) |
if (before != NULL) |
1821 |
a_delete before; |
a_delete (char *)before; |
1822 |
return after; |
return after; |
1823 |
} |
} |
1824 |
|
|
4725 |
while ((s[i] != (char)0) && (s[i] != ',') && (s[i] != ']')) |
while ((s[i] != (char)0) && (s[i] != ',') && (s[i] != ']')) |
4726 |
i++; |
i++; |
4727 |
if (i>0) { |
if (i>0) { |
4728 |
v = (char *)malloc(i+1); |
v = new char[i+1]; |
4729 |
memcpy(v, s, i+1); |
memcpy(v, s, i+1); |
4730 |
v[i] = (char)0; |
v[i] = (char)0; |
4731 |
if (s[i] == ',') |
if (s[i] == ',') |