/[groff]/groff/src/devices/grohtml/post-html.cpp
ViewVC logotype

Diff of /groff/src/devices/grohtml/post-html.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by wl, Sat Apr 2 12:49:11 2005 UTC revision 1.23 by wl, Tue May 3 10:05:32 2005 UTC
# Line 362  char_block::char_block() Line 362  char_block::char_block()
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  }  }
# Line 370  char_block::char_block(int length) Line 370  char_block::char_block(int length)
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 {
# Line 1688  assert_state::~assert_state () Line 1688  assert_state::~assert_state ()
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    
# Line 1724  void assert_state::add (assert_pos **h, Line 1724  void assert_state::add (assert_pos **h,
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      }      }
# Line 1740  void assert_state::add (assert_pos **h, Line 1740  void assert_state::add (assert_pos **h,
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    
# Line 1797  void assert_state::close (const char *c) Line 1797  void assert_state::close (const char *c)
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);
# Line 1818  const char *replace_negate_str (const ch Line 1818  const char *replace_negate_str (const ch
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    
# Line 4725  static char *get_str (const char *s, cha Line 4725  static char *get_str (const char *s, cha
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] == ',')

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26