[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 20/34: [libgroff]: Drop `a_delete` preprocessor wrapper.
From: |
G. Branden Robinson |
Subject: |
[groff] 20/34: [libgroff]: Drop `a_delete` preprocessor wrapper. |
Date: |
Thu, 2 Sep 2021 02:48:36 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 61d2307000c457db0604a7833e29ca4ad15884f7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Aug 27 19:46:57 2021 +1000
[libgroff]: Drop `a_delete` preprocessor wrapper.
... for the `delete` operator. It has been rendered unnecessary by the
removal of support for ancient C++ compilers.
* src/include/lib.h (a_delete): Drop symbol definition.
* src/devices/grohtml/output.cpp (word::~word):
* src/devices/grohtml/post-html.cpp (char_block::char_block,
assert_state::~assert_state, assert_state::add,
assert_state::close, replace_negate_str):
* src/devices/grops/ps.cpp (ps_font::ps_font,
subencoding::subencoding, ps_printer::define_encoding,
ps_printer::encode_fonts):
* src/devices/grops/psrm.cpp (resource_manager::document_setup,
resource_manager::supply_resource):
* src/devices/grotty/tty.cpp (tty_printer::tty_color,
tty_printer::tty_printer, tty_printer::color_to_idx,
tty_printer::add_char):
* src/include/itable.h (ITABLE(T)::~ITABLE(T),
ITABLE(T)::define):
* src/include/ptable.h (PTABLE(T)::~PTABLE(T),
PTABLE(T)::define):
* src/libs/libbib/index.cpp
(index_search_item::~index_search_item, make_index_search_item,
index_search_item_iterator::index_search_item_iterator,
index_search_item::get_tag, index_search_item::munge_filename,
index_search_item::search):
* src/libs/libbib/linear.cpp (bmpattern::~bmpattern,
file_buffer::file_buffer, file_buffer::load,
linear_searcher::linear_searcher,
linear_searcher::~linear_searcher):
* src/libs/libbib/search.cpp
(search_list_iterator::search_list_iterator,
search_item::search_item):
* src/libs/libdriver/input.cpp (IntArray::~IntArray,
IntArray::append, StringBuf::~StringBuf, StringBuf::append,
get_integer_arg, parse_x_command, do_file):
* src/libs/libdriver/printer.cpp (printer::printer,
printer::load_font, text_file::~text_file, text_file::next,
font::~font, font_widths_cache::~font_widths_cache,
font:alloc_ch_index, font::extend_ch, font::compact,
font::load_desc):
* src/libs/libgroff/fontfile.cpp (font::open_file):
* src/libs/libgroff/relocate.cpp (searchpath, searchpathext,
set_current_prefix):
* src/libs/libgroff/searchpath.cpp (search_path::search_path,
search_path::command_line_dir, search_path::open_file,
search_path::open_file_cautious):
* src/libs/libgroff/string.cpp (sfree, srealloc,
string::remove_spaces):
* src/libs/libgroff/symbol.cpp (symbol::symbol, concat):
* src/libs/libgroff/tmpfile.cpp (temp_init::temp_init,
xtmpfile_list_init::~xtmpfile_list_init, xtmpfile):
* src/preproc/eqn/box.cpp (set_gfont, set_grfont, set_gbfont,
box_list::append, box_list::~box_list):
* src/preproc/eqn/delim.cpp (make_delim_box,
delim_box::~delim_box):
* src/preproc/eqn/eqn.ypp (number):
* src/preproc/eqn/lex.ypp (file_input::~file_input,
argument_macro_input::~argument_macro_input):
* src/preproc/eqn/pile.ypp (matrix_box::~matrix_box,
matrix_box::append):
* src/preproc/eqn/special.cpp (special_box::~special_box):
* src/preproc/eqn/text.ypp (set_char_type):
* src/preproc/html/pre-html.cpp (get_line, scanArguments):
* src/preproc/pic/object.cpp (output::~output,
output::set_args, text_item::~text_item,
object_spec::~object_spec, command_object::~command_object,
line_object::~line_object):
* src/preproc/pic/pic.ypp (placeless_element, reset_variables,
print_args, text_expr, object_spec, text, sprintf_args, path):
* src/preproc/refer/command.cpp (input_item::~input_item,
input_item::peek_char):
* src/preproc/refer/label.ypp (lookup_label):
* src/preproc/refer/refer.cpp (store_citation, store_reference):
* src/preproc/tbl/main.cpp (format::add_rows, format::~format):
* src/preproc/tbl/table.cpp (block_entry::~block_entry,
table::~table, table::allocate):
* src/roff/groff/groff.cpp (possible_command::~possible_command,
possible_command::clear_name):
* src/roff/troff/column.cpp
(justification_spec::~justification_spec,
justification_spec::append):
* src/roff/troff/dictionary.cpp (dictionary::lookup):
* src/roff/troff/env.cpp (override_sizes, tab_stops::to_string,
hyphen_word, hyphen_trie::insert_hyphenation):
* src/roff/troff/input.cpp (read_long_escape_name, token::next,
do_get_long_name, temp_iterator::~temp_iterator, get_delim_name,
pipe_source, read_string, pipe_output, system_request,
open_mac_file, do_macro_source, do_register_assignment,
do_string_assignment, read_draw_node, copy_mode_error):
* src/roff/troff/node.cpp (troff_output_file::set_font,
troff_output_file::~troff_output_file, draw_node::is_tag,
grow_font_table, font_family::~font_family,
font_family::make_definite):
* src/utils/hpftodit/hpftodit.cpp (name_list::~name_list,
read_map):
* src/utils/indxbib/indxbib.cpp (main, get_cwd):
* src/utils/tfmtodit/tfmtodit.cpp (tfm::~tfm, tfm::load): Port
uses of `a_delete(xxx)` to `delete[]`.
---
ChangeLog | 103 ++++++++++++++++++++++++++++++++++++++
src/devices/grohtml/output.cpp | 2 +-
src/devices/grohtml/post-html.cpp | 20 ++++----
src/devices/grops/ps.cpp | 8 +--
src/devices/grops/psrm.cpp | 8 +--
src/devices/grotty/tty.cpp | 8 +--
src/include/itable.h | 8 +--
src/include/lib.h | 3 --
src/include/ptable.h | 8 +--
src/libs/libbib/index.cpp | 26 +++++-----
src/libs/libbib/linear.cpp | 10 ++--
src/libs/libbib/search.cpp | 4 +-
src/libs/libdriver/input.cpp | 38 +++++++-------
src/libs/libdriver/printer.cpp | 4 +-
src/libs/libgroff/font.cpp | 30 +++++------
src/libs/libgroff/fontfile.cpp | 2 +-
src/libs/libgroff/relocate.cpp | 8 +--
src/libs/libgroff/searchpath.cpp | 8 +--
src/libs/libgroff/string.cpp | 12 ++---
src/libs/libgroff/symbol.cpp | 4 +-
src/libs/libgroff/tmpfile.cpp | 8 +--
src/preproc/eqn/box.cpp | 10 ++--
src/preproc/eqn/delim.cpp | 8 +--
src/preproc/eqn/eqn.ypp | 2 +-
src/preproc/eqn/lex.cpp | 6 +--
src/preproc/eqn/pile.cpp | 4 +-
src/preproc/eqn/special.cpp | 2 +-
src/preproc/eqn/text.cpp | 2 +-
src/preproc/html/pre-html.cpp | 4 +-
src/preproc/pic/lex.cpp | 4 +-
src/preproc/pic/object.cpp | 14 +++---
src/preproc/pic/pic.ypp | 44 ++++++++--------
src/preproc/refer/command.cpp | 4 +-
src/preproc/refer/label.ypp | 2 +-
src/preproc/refer/refer.cpp | 4 +-
src/preproc/tbl/main.cpp | 16 +++---
src/preproc/tbl/table.cpp | 22 ++++----
src/roff/groff/groff.cpp | 6 +--
src/roff/troff/column.cpp | 8 +--
src/roff/troff/dictionary.cpp | 2 +-
src/roff/troff/env.cpp | 8 +--
src/roff/troff/input.cpp | 54 ++++++++++----------
src/roff/troff/node.cpp | 12 ++---
src/utils/hpftodit/hpftodit.cpp | 4 +-
src/utils/indxbib/indxbib.cpp | 6 +--
src/utils/tfmtodit/tfmtodit.cpp | 26 +++++-----
46 files changed, 348 insertions(+), 248 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 144b059..f83b1a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,108 @@
2021-08-27 G. Branden Robinson <g.branden.robinson@gmail.com>
+ [libgroff]: Drop `a_delete` preprocessor wrapper for the
+ `delete` operator. It has been rendered unnecessary by the
+ removal of support for ancient C++ compilers.
+
+ * src/include/lib.h (a_delete): Drop symbol definition.
+
+ * src/devices/grohtml/output.cpp (word::~word):
+ * src/devices/grohtml/post-html.cpp (char_block::char_block,
+ assert_state::~assert_state, assert_state::add,
+ assert_state::close, replace_negate_str):
+ * src/devices/grops/ps.cpp (ps_font::ps_font,
+ subencoding::subencoding, ps_printer::define_encoding,
+ ps_printer::encode_fonts):
+ * src/devices/grops/psrm.cpp (resource_manager::document_setup,
+ resource_manager::supply_resource):
+ * src/devices/grotty/tty.cpp (tty_printer::tty_color,
+ tty_printer::tty_printer, tty_printer::color_to_idx,
+ tty_printer::add_char):
+ * src/include/itable.h (ITABLE(T)::~ITABLE(T),
+ ITABLE(T)::define):
+ * src/include/ptable.h (PTABLE(T)::~PTABLE(T),
+ PTABLE(T)::define):
+ * src/libs/libbib/index.cpp
+ (index_search_item::~index_search_item, make_index_search_item,
+ index_search_item_iterator::index_search_item_iterator,
+ index_search_item::get_tag, index_search_item::munge_filename,
+ index_search_item::search):
+ * src/libs/libbib/linear.cpp (bmpattern::~bmpattern,
+ file_buffer::file_buffer, file_buffer::load,
+ linear_searcher::linear_searcher,
+ linear_searcher::~linear_searcher):
+ * src/libs/libbib/search.cpp
+ (search_list_iterator::search_list_iterator,
+ search_item::search_item):
+ * src/libs/libdriver/input.cpp (IntArray::~IntArray,
+ IntArray::append, StringBuf::~StringBuf, StringBuf::append,
+ get_integer_arg, parse_x_command, do_file):
+ * src/libs/libdriver/printer.cpp (printer::printer,
+ printer::load_font, text_file::~text_file, text_file::next,
+ font::~font, font_widths_cache::~font_widths_cache,
+ font:alloc_ch_index, font::extend_ch, font::compact,
+ font::load_desc):
+ * src/libs/libgroff/fontfile.cpp (font::open_file):
+ * src/libs/libgroff/relocate.cpp (searchpath, searchpathext,
+ set_current_prefix):
+ * src/libs/libgroff/searchpath.cpp (search_path::search_path,
+ search_path::command_line_dir, search_path::open_file,
+ search_path::open_file_cautious):
+ * src/libs/libgroff/string.cpp (sfree, srealloc,
+ string::remove_spaces):
+ * src/libs/libgroff/symbol.cpp (symbol::symbol, concat):
+ * src/libs/libgroff/tmpfile.cpp (temp_init::temp_init,
+ xtmpfile_list_init::~xtmpfile_list_init, xtmpfile):
+ * src/preproc/eqn/box.cpp (set_gfont, set_grfont, set_gbfont,
+ box_list::append, box_list::~box_list):
+ * src/preproc/eqn/delim.cpp (make_delim_box,
+ delim_box::~delim_box):
+ * src/preproc/eqn/eqn.ypp (number):
+ * src/preproc/eqn/lex.ypp (file_input::~file_input,
+ argument_macro_input::~argument_macro_input):
+ * src/preproc/eqn/pile.ypp (matrix_box::~matrix_box,
+ matrix_box::append):
+ * src/preproc/eqn/special.cpp (special_box::~special_box):
+ * src/preproc/eqn/text.ypp (set_char_type):
+ * src/preproc/html/pre-html.cpp (get_line, scanArguments):
+ * src/preproc/pic/object.cpp (output::~output,
+ output::set_args, text_item::~text_item,
+ object_spec::~object_spec, command_object::~command_object,
+ line_object::~line_object):
+ * src/preproc/pic/pic.ypp (placeless_element, reset_variables,
+ print_args, text_expr, object_spec, text, sprintf_args, path):
+ * src/preproc/refer/command.cpp (input_item::~input_item,
+ input_item::peek_char):
+ * src/preproc/refer/label.ypp (lookup_label):
+ * src/preproc/refer/refer.cpp (store_citation, store_reference):
+ * src/preproc/tbl/main.cpp (format::add_rows, format::~format):
+ * src/preproc/tbl/table.cpp (block_entry::~block_entry,
+ table::~table, table::allocate):
+ * src/roff/groff/groff.cpp (possible_command::~possible_command,
+ possible_command::clear_name):
+ * src/roff/troff/column.cpp
+ (justification_spec::~justification_spec,
+ justification_spec::append):
+ * src/roff/troff/dictionary.cpp (dictionary::lookup):
+ * src/roff/troff/env.cpp (override_sizes, tab_stops::to_string,
+ hyphen_word, hyphen_trie::insert_hyphenation):
+ * src/roff/troff/input.cpp (read_long_escape_name, token::next,
+ do_get_long_name, temp_iterator::~temp_iterator, get_delim_name,
+ pipe_source, read_string, pipe_output, system_request,
+ open_mac_file, do_macro_source, do_register_assignment,
+ do_string_assignment, read_draw_node, copy_mode_error):
+ * src/roff/troff/node.cpp (troff_output_file::set_font,
+ troff_output_file::~troff_output_file, draw_node::is_tag,
+ grow_font_table, font_family::~font_family,
+ font_family::make_definite):
+ * src/utils/hpftodit/hpftodit.cpp (name_list::~name_list,
+ read_map):
+ * src/utils/indxbib/indxbib.cpp (main, get_cwd):
+ * src/utils/tfmtodit/tfmtodit.cpp (tfm::~tfm, tfm::load): Port
+ uses of `a_delete(xxx)` to `delete[]`.
+
+2021-08-27 G. Branden Robinson <g.branden.robinson@gmail.com>
+
[libgroff]: Drop `ad_delete` preprocessor wrapper for the
`delete` operator. It has been rendered unnecessary by the
removal of support for ancient C++ compilers.
diff --git a/src/devices/grohtml/output.cpp b/src/devices/grohtml/output.cpp
index 5ab257e..b8e0869 100644
--- a/src/devices/grohtml/output.cpp
+++ b/src/devices/grohtml/output.cpp
@@ -77,7 +77,7 @@ word::word (const char *w, int n)
word::~word ()
{
- a_delete s;
+ delete[] s;
}
/*
diff --git a/src/devices/grohtml/post-html.cpp
b/src/devices/grohtml/post-html.cpp
index d3a6cf4..0795abf 100644
--- a/src/devices/grohtml/post-html.cpp
+++ b/src/devices/grohtml/post-html.cpp
@@ -375,7 +375,7 @@ char_block::char_block(int length)
char_block::~char_block()
{
if (buffer != NULL)
- a_delete buffer;
+ delete[] buffer;
}
class char_buffer {
@@ -1696,15 +1696,15 @@ assert_state::~assert_state ()
while (xhead != NULL) {
t = xhead;
xhead = xhead->next;
- a_delete (char *)t->val;
- a_delete (char *)t->id;
+ delete[] (char *)t->val;
+ delete[] (char *)t->id;
delete t;
}
while (yhead != NULL) {
t = yhead;
yhead = yhead->next;
- a_delete (char *)t->val;
- a_delete (char *)t->id;
+ delete[] (char *)t->val;
+ delete[] (char *)t->id;
delete t;
}
}
@@ -1749,9 +1749,9 @@ void assert_state::add (assert_pos **h,
}
t->id = i;
t->val = v;
- a_delete (char *)c;
- a_delete (char *)f;
- a_delete (char *)l;
+ delete[] (char *)c;
+ delete[] (char *)f;
+ delete[] (char *)l;
}
}
@@ -1806,7 +1806,7 @@ void assert_state::close (const char *c)
const char *replace_negate_str (const char *before, char *after)
{
if (before != NULL)
- a_delete (char *)before;
+ delete[] (char *)before;
if (strlen(after) > 0) {
int d = atoi(after);
@@ -1827,7 +1827,7 @@ const char *replace_negate_str (const char *before, char
*after)
const char *replace_str (const char *before, const char *after)
{
if (before != NULL)
- a_delete (char *)before;
+ delete[] (char *)before;
return after;
}
diff --git a/src/devices/grops/ps.cpp b/src/devices/grops/ps.cpp
index 4eb6e2b..8bbc166 100644
--- a/src/devices/grops/ps.cpp
+++ b/src/devices/grops/ps.cpp
@@ -432,7 +432,7 @@ ps_font::ps_font(const char *nm)
ps_font::~ps_font()
{
free(encoding);
- a_delete reencoded_name;
+ delete[] reencoded_name;
}
void ps_font::handle_unknown_font_command(const char *command, const char *arg,
@@ -480,7 +480,7 @@ subencoding::subencoding(font *f, unsigned int n, int ix,
subencoding *s)
subencoding::~subencoding()
{
- a_delete subfont;
+ delete[] subfont;
}
struct style {
@@ -812,7 +812,7 @@ void ps_printer::define_encoding(const char *encoding, int
encoding_index)
out.put_literal_symbol(".notdef");
else {
out.put_literal_symbol(vec[i]);
- a_delete vec[i];
+ delete[] vec[i];
}
}
out.put_delimiter(']')
@@ -846,7 +846,7 @@ void ps_printer::encode_fonts()
reencode_font((ps_font *)f->p);
}
}
- a_delete done_encoding;
+ delete[] done_encoding;
}
void ps_printer::encode_subfont(subencoding *sub)
diff --git a/src/devices/grops/psrm.cpp b/src/devices/grops/psrm.cpp
index 9a012ef..fd8f04a 100644
--- a/src/devices/grops/psrm.cpp
+++ b/src/devices/grops/psrm.cpp
@@ -259,8 +259,8 @@ void resource_manager::document_setup(ps_output &out)
*tail[i] = resource_list;
resource_list = head[i];
}
- a_delete head;
- a_delete tail;
+ delete[] head;
+ delete[] tail;
// check it
for (r = resource_list; r; r = r->next)
if (r->next)
@@ -354,7 +354,7 @@ void resource_manager::supply_resource(resource *r, int
rank, FILE *outfp,
fp = font::open_file(r->filename, &path);
if (!fp) {
error("can't find '%1'", r->filename);
- a_delete r->filename;
+ delete[] r->filename;
r->filename = 0;
}
}
@@ -363,7 +363,7 @@ void resource_manager::supply_resource(resource *r, int
rank, FILE *outfp,
fp = include_search_path.open_file_cautious(r->filename);
if (!fp) {
error("can't open '%1': %2", r->filename, strerror(errno));
- a_delete r->filename;
+ delete[] r->filename;
r->filename = 0;
}
else
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index 72f963e..3efd852 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -240,7 +240,7 @@ int tty_printer::tty_color(unsigned int r,
tty_colors.define(s, i);
}
*idx = *i;
- a_delete s;
+ delete[] s;
return unknown_color;
}
@@ -273,7 +273,7 @@ tty_printer::tty_printer() : cached_v(0)
tty_printer::~tty_printer()
{
- a_delete lines;
+ delete[] lines;
}
void tty_printer::make_underline(int w)
@@ -326,7 +326,7 @@ schar tty_printer::color_to_idx(color *col)
if (tty_color(r, g, b, &idx)) {
char *s = col->print_color();
error("Unknown color (%1) mapped to default", s);
- a_delete s;
+ delete[] s;
}
return idx;
}
@@ -370,7 +370,7 @@ void tty_printer::add_char(output_character c, int w,
memcpy(lines, old_lines, nlines * sizeof(tty_glyph *));
for (int i = nlines; i <= vpos; i++)
lines[i] = 0;
- a_delete old_lines;
+ delete[] old_lines;
nlines = vpos + 1;
}
// Note that the first output line corresponds to groff
diff --git a/src/include/itable.h b/src/include/itable.h
index 0bca65f..3ea99f7 100644
--- a/src/include/itable.h
+++ b/src/include/itable.h
@@ -118,8 +118,8 @@ ITABLE(T)::ITABLE(T)()
\
ITABLE(T)::~ITABLE(T)()
\
{ \
for (unsigned i = 0; i < size; i++) \
- a_delete v[i].val; \
- a_delete v; \
+ delete[] v[i].val; \
+ delete[] v; \
} \
\
void ITABLE(T)::define(int key, T *val)
\
@@ -131,7 +131,7 @@ void ITABLE(T)::define(int key, T *val)
\
v[n].key >= 0; \
n = (n == 0 ? size - 1 : n - 1))
\
if (v[n].key == key) { \
- a_delete v[n].val; \
+ delete[] v[n].val; \
v[n].val = val; \
return; \
} \
@@ -158,7 +158,7 @@ void ITABLE(T)::define(int key, T *val)
\
v[n].key >= 0; \
n = (n == 0 ? size - 1 : n - 1)) \
;
\
- a_delete oldv; \
+ delete[] oldv; \
} \
v[n].key = key; \
v[n].val = val; \
diff --git a/src/include/lib.h b/src/include/lib.h
index 4b8edfa..be95b9b 100644
--- a/src/include/lib.h
+++ b/src/include/lib.h
@@ -131,6 +131,3 @@ extern "C" { int strncasecmp(const char *, const char *,
size_t); }
#endif
const double PI = 3.14159265358979323846;
-
-/* a_delete deletes an array of objects without destructors */
-#define a_delete delete []
diff --git a/src/include/ptable.h b/src/include/ptable.h
index edb11b8..8ac7bda 100644
--- a/src/include/ptable.h
+++ b/src/include/ptable.h
@@ -136,9 +136,9 @@ PTABLE(T)::~PTABLE(T)()
\
free(v[i].key); \
/* XXX leak, because we don't know whether */ \
/* 'free', 'delete', or 'delete[]' should be used */ \
- /* a_delete v[i].val; */ \
+ /* delete[] v[i].val; */ \
} \
- a_delete v; \
+ delete[] v; \
} \
\
const char *PTABLE(T)::define(const char *key, T *val) \
@@ -152,7 +152,7 @@ const char *PTABLE(T)::define(const char *key, T *val)
\
if (strcmp(v[n].key, key) == 0) { \
/* XXX leak, because we don't know whether */ \
/* 'free', 'delete', or 'delete[]' should be used */ \
- /* a_delete v[n].val; */ \
+ /* delete[] v[n].val; */ \
v[n].val = val; \
return v[n].key; \
} \
@@ -181,7 +181,7 @@ const char *PTABLE(T)::define(const char *key, T *val)
\
v[n].key != 0; \
n = (n == 0 ? size - 1 : n - 1)) \
;
\
- a_delete oldv; \
+ delete[] oldv; \
} \
char *temp = (char*)malloc(strlen(key)+1); \
strcpy(temp, key); \
diff --git a/src/libs/libbib/index.cpp b/src/libs/libbib/index.cpp
index 8b17667..f2eff6b 100644
--- a/src/libs/libbib/index.cpp
+++ b/src/libs/libbib/index.cpp
@@ -124,12 +124,12 @@ index_search_item::~index_search_item()
out_of_date_files = out_of_date_files->next;
delete tem;
}
- a_delete filename_buffer;
- a_delete key_buffer;
+ delete[] filename_buffer;
+ delete[] key_buffer;
if (common_words_table) {
for (int i = 0; i < common_words_table_size; i++)
- a_delete common_words_table[i];
- a_delete common_words_table;
+ delete[] common_words_table[i];
+ delete[] common_words_table;
}
}
@@ -282,7 +282,7 @@ search_item *make_index_search_item(const char *filename,
int fid)
if (fd < 0)
return 0;
index_search_item *item = new index_search_item(index_filename, fid);
- a_delete index_filename;
+ delete[] index_filename;
if (!item->load(fd)) {
close(fd);
delete item;
@@ -316,9 +316,9 @@
index_search_item_iterator::index_search_item_iterator(index_search_item *ind,
index_search_item_iterator::~index_search_item_iterator()
{
- a_delete temp_list;
- a_delete buf;
- a_delete query;
+ delete[] temp_list;
+ delete[] buf;
+ delete[] query;
delete out_of_date_files_iter;
}
@@ -405,7 +405,7 @@ int index_search_item_iterator::get_tag(int tagno,
}
if (!err) {
if (length + 2 > buflen) {
- a_delete buf;
+ delete[] buf;
buflen = length + 2;
buf = new char[buflen];
}
@@ -448,7 +448,7 @@ const char *index_search_item::munge_filename(const char
*filename)
&& strchr(DIR_SEPS, strchr(cwd, '\0')[-1]) == 0);
int len = strlen(cwd) + strlen(filename) + need_slash + 1;
if (len > filename_buflen) {
- a_delete filename_buffer;
+ delete[] filename_buffer;
filename_buflen = len;
filename_buffer = new char[len];
}
@@ -515,7 +515,7 @@ const int *index_search_item::search(const char *ptr, int
length,
{
const char *end = ptr + length;
if (*temp_listp) {
- a_delete *temp_listp;
+ delete[] *temp_listp;
*temp_listp = 0;
}
const int *first_list = 0;
@@ -546,12 +546,12 @@ const int *index_search_item::search(const char *ptr, int
length,
const int *list = search1(&ptr, end);
if (list != 0) {
if (*list < 0) {
- a_delete matches;
+ delete[] matches;
return list;
}
merge(matches, matches, list);
if (*matches < 0) {
- a_delete matches;
+ delete[] matches;
return &minus_one;
}
}
diff --git a/src/libs/libbib/linear.cpp b/src/libs/libbib/linear.cpp
index e4c4bb7..69fb6fc 100644
--- a/src/libs/libbib/linear.cpp
+++ b/src/libs/libbib/linear.cpp
@@ -142,7 +142,7 @@ const char *bmpattern::search(const char *buf, const char
*end) const
bmpattern::~bmpattern()
{
- a_delete pat;
+ delete[] pat;
}
inline int bmpattern::length() const
@@ -286,7 +286,7 @@ file_buffer::file_buffer()
file_buffer::~file_buffer()
{
- a_delete buffer;
+ delete[] buffer;
}
const char *file_buffer::get_start() const
@@ -348,7 +348,7 @@ int file_buffer::load(int fd, const char *filename)
return 1;
}
}
- a_delete buffer;
+ delete[] buffer;
buffer = 0;
}
close(fd);
@@ -382,7 +382,7 @@ linear_searcher::linear_searcher(const char *query, int
query_len,
}
assert(nkeys <= nk);
if (nkeys == 0) {
- a_delete keys;
+ delete[] keys;
keys = 0;
}
}
@@ -391,7 +391,7 @@ linear_searcher::~linear_searcher()
{
for (int i = 0; i < nkeys; i++)
delete keys[i];
- a_delete keys;
+ delete[] keys;
}
int linear_searcher::search(const char *buffer, const char *bufend,
diff --git a/src/libs/libbib/search.cpp b/src/libs/libbib/search.cpp
index 4736062..ba5ebb7 100644
--- a/src/libs/libbib/search.cpp
+++ b/src/libs/libbib/search.cpp
@@ -88,7 +88,7 @@ search_list_iterator::search_list_iterator(search_list *p,
const char *q)
search_list_iterator::~search_list_iterator()
{
list->niterators -= 1;
- a_delete query;
+ delete[] query;
delete iter;
}
@@ -113,7 +113,7 @@ search_item::search_item(const char *nm, int fid)
search_item::~search_item()
{
- a_delete name;
+ delete[] name;
}
int search_item::is_named(const char *nm) const
diff --git a/src/libs/libdriver/input.cpp b/src/libs/libdriver/input.cpp
index 09f50eb..96d400d 100644
--- a/src/libs/libdriver/input.cpp
+++ b/src/libs/libdriver/input.cpp
@@ -509,7 +509,7 @@ IntArray::IntArray(const size_t n)
IntArray::~IntArray(void)
{
- a_delete data;
+ delete[] data;
}
void
@@ -521,7 +521,7 @@ IntArray::append(IntArg x)
data = new IntArg[num_allocated];
for (size_t i = 0; i < num_stored; i++)
data[i] = old_data[i];
- a_delete old_data;
+ delete[] old_data;
}
data[num_stored] = x;
num_stored++;
@@ -536,7 +536,7 @@ StringBuf::StringBuf(void)
StringBuf::~StringBuf(void)
{
- a_delete data;
+ delete[] data;
}
void
@@ -548,7 +548,7 @@ StringBuf::append(const Char c)
data = new Char[num_allocated];
for (size_t i = 0; i < num_stored; i++)
data[i] = old_data[i];
- a_delete old_data;
+ delete[] old_data;
}
data[num_stored] = c;
num_stored++;
@@ -801,7 +801,7 @@ get_integer_arg(void)
error("integer argument too large");
number = 0;
}
- a_delete s;
+ delete[] s;
return (IntArg) number;
}
@@ -853,7 +853,7 @@ get_possibly_integer_args()
x = 0;
}
args->append((IntArg) x);
- a_delete s;
+ delete[] s;
}
// Here, c is not a digit.
// Terminate on comment, end of line, or end of file, while
@@ -1456,7 +1456,7 @@ parse_x_command(void)
IntArg n = get_integer_arg();
char *name = get_string_arg();
pr->load_font(n, name);
- a_delete name;
+ delete[] name;
skip_line_x();
break;
}
@@ -1467,7 +1467,7 @@ parse_x_command(void)
warning("empty argument for 'x F' command");
else {
remember_source_filename(str_arg);
- a_delete str_arg;
+ delete[] str_arg;
}
break;
}
@@ -1507,7 +1507,7 @@ parse_x_command(void)
{
char *str_arg = get_string_arg();
pr->special(str_arg, current_env, 'u');
- a_delete str_arg;
+ delete[] str_arg;
skip_line_x();
break;
}
@@ -1521,14 +1521,14 @@ parse_x_command(void)
pr->devtag(str_arg, current_env);
else
pr->special(str_arg, current_env);
- a_delete str_arg;
+ delete[] str_arg;
break;
}
default: // ignore unknown x commands, but warn
warning("unknown command 'x %1'", subcmd);
skip_line();
}
- a_delete subcmd_str;
+ delete[] subcmd_str;
return stopped;
}
@@ -1597,7 +1597,7 @@ do_file(const char *filename)
str_arg = get_string_arg();
if (str_arg[0] != 'T')
fatal("the first command must be 'x T'");
- a_delete str_arg;
+ delete[] str_arg;
char *tmp_dev = get_string_arg();
if (pr == 0) { // note: 'pr' initialized after prologue
device = tmp_dev;
@@ -1607,7 +1607,7 @@ do_file(const char *filename)
else {
if (device == 0 || strcmp(device, tmp_dev) != 0)
fatal("all files must use the same device");
- a_delete tmp_dev;
+ delete[] tmp_dev;
}
skip_line_x(); // ignore further arguments
current_env->size = 10 * font::sizescale;
@@ -1619,7 +1619,7 @@ do_file(const char *filename)
str_arg = get_string_arg();
if (str_arg[0] != 'r')
fatal("the second command must be 'x res'");
- a_delete str_arg;
+ delete[] str_arg;
int_arg = get_integer_arg();
EnvInt font_res = font::res;
if (int_arg != font_res)
@@ -1639,7 +1639,7 @@ do_file(const char *filename)
str_arg = get_string_arg();
if (str_arg[0] != 'i')
fatal("the third command must be 'x init'");
- a_delete str_arg;
+ delete[] str_arg;
skip_line_x();
}
@@ -1716,7 +1716,7 @@ do_file(const char *filename)
fatal_command(command);
char *str_arg = get_string_arg();
pr->set_special_char(str_arg, current_env);
- a_delete str_arg;
+ delete[] str_arg;
break;
}
case 'D': // drawing commands
@@ -1731,7 +1731,7 @@ do_file(const char *filename)
{
char *str_arg = get_extended_arg();
remember_source_filename(str_arg);
- a_delete str_arg;
+ delete[] str_arg;
break;
}
case 'h': // h: relative horizontal move
@@ -1781,7 +1781,7 @@ do_file(const char *filename)
pr->set_ascii_char((unsigned char) c, current_env, &w);
current_env->hpos += w;
}
- a_delete str_arg;
+ delete[] str_arg;
break;
}
case 'u': // u: print spaced word
@@ -1797,7 +1797,7 @@ do_file(const char *filename)
pr->set_ascii_char((unsigned char) c, current_env, &w);
current_env->hpos += w + kern;
}
- a_delete str_arg;
+ delete[] str_arg;
break;
}
case 'v': // v: relative vertical move
diff --git a/src/libs/libdriver/printer.cpp b/src/libs/libdriver/printer.cpp
index a4a03d1..24c43bf 100644
--- a/src/libs/libdriver/printer.cpp
+++ b/src/libs/libdriver/printer.cpp
@@ -84,7 +84,7 @@ printer::printer()
printer::~printer()
{
- a_delete font_table;
+ delete[] font_table;
while (font_list) {
font_pointer_list *tem = font_list;
font_list = font_list->next;
@@ -119,7 +119,7 @@ void printer::load_font(int n, const char *nm)
font_table[i] = old_font_table[i];
for (i = old_nfonts; i < nfonts; i++)
font_table[i] = 0;
- a_delete old_font_table;
+ delete[] old_font_table;
}
}
font *f = find_font(nm);
diff --git a/src/libs/libgroff/font.cpp b/src/libs/libgroff/font.cpp
index 46547ab..f45cb6e 100644
--- a/src/libs/libgroff/font.cpp
+++ b/src/libs/libgroff/font.cpp
@@ -89,7 +89,7 @@ text_file::text_file(FILE *p, char *s)
text_file::~text_file()
{
- a_delete buf;
+ delete[] buf;
free(path);
if (fp)
fclose(fp);
@@ -116,7 +116,7 @@ int text_file::next()
char *old_buf = buf;
buf = new char[size*2];
memcpy(buf, old_buf, size);
- a_delete old_buf;
+ delete[] old_buf;
size *= 2;
}
buf[i++] = c;
@@ -206,9 +206,9 @@ font::~font()
{
for (int i = 0; i < ch_used; i++)
if (ch[i].special_device_coding)
- a_delete ch[i].special_device_coding;
- a_delete ch;
- a_delete ch_index;
+ delete[] ch[i].special_device_coding;
+ delete[] ch;
+ delete[] ch_index;
if (kern_hash_table) {
for (int i = 0; i < KERN_HASH_TABLE_SIZE; i++) {
font_kern_list *kerns = kern_hash_table[i];
@@ -218,10 +218,10 @@ font::~font()
delete tem;
}
}
- a_delete kern_hash_table;
+ delete[] kern_hash_table;
}
- a_delete name;
- a_delete internalname;
+ delete[] name;
+ delete[] internalname;
while (widths_cache) {
font_widths_cache *tem = widths_cache;
widths_cache = widths_cache->next;
@@ -335,7 +335,7 @@ font_widths_cache::font_widths_cache(int ps, int ch_size,
font_widths_cache::~font_widths_cache()
{
- a_delete width;
+ delete[] width;
}
int font::get_width(glyph *g, int point_size)
@@ -615,7 +615,7 @@ void font::alloc_ch_index(int idx)
memcpy(ch_index, old_ch_index, sizeof(int)*old_nindices);
for (int i = old_nindices; i < nindices; i++)
ch_index[i] = -1;
- a_delete old_ch_index;
+ delete[] old_ch_index;
}
}
@@ -629,7 +629,7 @@ void font::extend_ch()
font_char_metric *old_ch = ch;
ch = new font_char_metric[ch_size];
memcpy(ch, old_ch, old_ch_size*sizeof(font_char_metric));
- a_delete old_ch;
+ delete[] old_ch;
}
}
@@ -644,14 +644,14 @@ void font::compact()
int *old_ch_index = ch_index;
ch_index = new int[i];
memcpy(ch_index, old_ch_index, i*sizeof(int));
- a_delete old_ch_index;
+ delete[] old_ch_index;
nindices = i;
}
if (ch_used < ch_size) {
font_char_metric *old_ch = ch;
ch = new font_char_metric[ch_used];
memcpy(ch, old_ch, ch_used*sizeof(font_char_metric));
- a_delete old_ch;
+ delete[] old_ch;
ch_size = ch_used;
}
}
@@ -1157,7 +1157,7 @@ int font::load_desc()
sizes = new int[n*2];
memcpy(sizes, old_sizes, n*sizeof(int));
n *= 2;
- a_delete old_sizes;
+ delete[] old_sizes;
}
sizes[i++] = lower;
if (lower == 0)
@@ -1189,7 +1189,7 @@ int font::load_desc()
style_table[j] = old_style_table[j];
for (; j < style_table_size; j++)
style_table[j] = 0;
- a_delete old_style_table;
+ delete[] old_style_table;
}
char *tem = new char[strlen(p) + 1];
strcpy(tem, p);
diff --git a/src/libs/libgroff/fontfile.cpp b/src/libs/libgroff/fontfile.cpp
index 3b375f2..c996c66 100644
--- a/src/libs/libgroff/fontfile.cpp
+++ b/src/libs/libgroff/fontfile.cpp
@@ -63,7 +63,7 @@ FILE *font::open_file(const char *nm, char **pathp)
char *filename = new char[strlen(nm) + strlen(device) + 5];
sprintf(filename, "dev%s/%s", device, nm);
FILE *fp = font_path.open_file(filename, pathp);
- a_delete filename;
+ delete[] filename;
return fp;
}
diff --git a/src/libs/libgroff/relocate.cpp b/src/libs/libgroff/relocate.cpp
index f18ad32..c24470e 100644
--- a/src/libs/libgroff/relocate.cpp
+++ b/src/libs/libgroff/relocate.cpp
@@ -115,7 +115,7 @@ char *searchpath(const char *name, const char *pathp)
#endif
return path;
}
- a_delete path;
+ delete[] path;
if (*end == '\0')
break;
p = end + 1;
@@ -135,12 +135,12 @@ char *searchpathext(const char *name, const char
*pathext, const char *pathp)
strcpy(namex, name);
strcat(namex, ext);
found = searchpath(namex, pathp);
- a_delete namex;
+ delete[] namex;
if (found)
break;
ext = strtok(0, PATH_SEP);
}
- a_delete tmpathext;
+ delete[] tmpathext;
return found;
}
@@ -176,7 +176,7 @@ void set_current_prefix()
if (!pathextstr)
pathextstr = strsave(PATH_EXT);
curr_prefix = searchpathext(program_name, pathextstr, getenv("PATH"));
- a_delete pathextstr;
+ delete[] pathextstr;
}
#else /* !_WIN32 */
curr_prefix = searchpath(program_name, getenv("PATH"));
diff --git a/src/libs/libgroff/searchpath.cpp b/src/libs/libgroff/searchpath.cpp
index d478c51..b6921ba 100644
--- a/src/libs/libgroff/searchpath.cpp
+++ b/src/libs/libgroff/searchpath.cpp
@@ -67,7 +67,7 @@ search_path::search_path(const char *envvar, const char
*standard,
search_path::~search_path()
{
// dirs is always allocated
- a_delete dirs;
+ delete[] dirs;
}
void search_path::command_line_dir(const char *s)
@@ -89,7 +89,7 @@ void search_path::command_line_dir(const char *s)
p += init_len;
}
*p++ = '\0';
- a_delete old;
+ delete[] old;
}
FILE *search_path::open_file(const char *name, char **pathp)
@@ -121,7 +121,7 @@ FILE *search_path::open_file(const char *name, char **pathp)
fprintf(stderr, "origpath '%s'\n", origpath);
#endif
char *path = relocate(origpath);
- a_delete origpath;
+ delete[] origpath;
#if 0
fprintf(stderr, "trying '%s'\n", path);
#endif
@@ -182,7 +182,7 @@ FILE *search_path::open_file_cautious(const char *name,
char **pathp,
fprintf(stderr, "origpath '%s'\n", origpath);
#endif
char *path = relocate(origpath);
- a_delete origpath;
+ delete[] origpath;
#if 0
fprintf(stderr, "trying '%s'\n", path);
#endif
diff --git a/src/libs/libgroff/string.cpp b/src/libs/libgroff/string.cpp
index 8eb50be..2cf267a 100644
--- a/src/libs/libgroff/string.cpp
+++ b/src/libs/libgroff/string.cpp
@@ -44,7 +44,7 @@ static char *salloc(int len, int *sizep)
static void sfree(char *ptr, int)
{
- a_delete ptr;
+ delete[] ptr;
}
static char *sfree_alloc(char *ptr, int oldsz, int len, int *sizep)
@@ -53,7 +53,7 @@ static char *sfree_alloc(char *ptr, int oldsz, int len, int
*sizep)
*sizep = oldsz;
return ptr;
}
- a_delete ptr;
+ delete[] ptr;
if (len == 0) {
*sizep = 0;
return 0;
@@ -69,7 +69,7 @@ static char *srealloc(char *ptr, int oldsz, int oldlen, int
newlen, int *sizep)
return ptr;
}
if (newlen == 0) {
- a_delete ptr;
+ delete[] ptr;
*sizep = 0;
return 0;
}
@@ -77,7 +77,7 @@ static char *srealloc(char *ptr, int oldsz, int oldlen, int
newlen, int *sizep)
char *p = new char[*sizep = newlen*2];
if (oldlen < newlen && oldlen != 0)
memcpy(p, ptr, oldlen);
- a_delete ptr;
+ delete[] ptr;
return p;
}
}
@@ -317,13 +317,13 @@ void string::remove_spaces()
len = l + 1;
char *tmp = new char[sz];
memcpy(tmp, p, len);
- a_delete ptr;
+ delete[] ptr;
ptr = tmp;
}
else {
len = 0;
if (ptr) {
- a_delete ptr;
+ delete[] ptr;
ptr = 0;
sz = 0;
}
diff --git a/src/libs/libgroff/symbol.cpp b/src/libs/libgroff/symbol.cpp
index cc1d241..4f50627 100644
--- a/src/libs/libgroff/symbol.cpp
+++ b/src/libs/libgroff/symbol.cpp
@@ -121,7 +121,7 @@ symbol::symbol(const char *p, int how)
symbol temp(*pp, 1); /* insert it into the new table */
unused(&temp);
}
- a_delete old_table;
+ delete[] old_table;
for (pp = table + hc % table_size;
*pp != 0;
(pp == table ? pp = table + table_size - 1 : --pp))
@@ -150,7 +150,7 @@ symbol concat(symbol s1, symbol s2)
strcpy(buf, s1.contents());
strcat(buf, s2.contents());
symbol res(buf);
- a_delete buf;
+ delete[] buf;
return res;
}
diff --git a/src/libs/libgroff/tmpfile.cpp b/src/libs/libgroff/tmpfile.cpp
index c3c9db2..f054ff1 100644
--- a/src/libs/libgroff/tmpfile.cpp
+++ b/src/libs/libgroff/tmpfile.cpp
@@ -93,12 +93,12 @@ temp_init::temp_init()
tmpfile_prefix = new char[tmpfile_prefix_len + 1];
strcpy(tmpfile_prefix, tem2);
strcat(tmpfile_prefix, tem3);
- a_delete tem2;
+ delete[] tem2;
}
temp_init::~temp_init()
{
- a_delete tmpfile_prefix;
+ delete[] tmpfile_prefix;
}
/*
@@ -149,7 +149,7 @@ xtmpfile_list_init::~xtmpfile_list_init()
error("cannot unlink '%1': %2", x->fname, strerror(errno));
xtmpfile_list *tmp = x;
x = x->next;
- a_delete tmp->fname;
+ delete[] tmp->fname;
delete tmp;
}
}
@@ -183,6 +183,6 @@ FILE *xtmpfile(char **namep,
if (namep)
*namep = templ;
else
- a_delete templ;
+ delete[] templ;
return fp;
}
diff --git a/src/preproc/eqn/box.cpp b/src/preproc/eqn/box.cpp
index adb6ec7..df051bb 100644
--- a/src/preproc/eqn/box.cpp
+++ b/src/preproc/eqn/box.cpp
@@ -203,19 +203,19 @@ const char *get_gbfont()
void set_gfont(const char *s)
{
- a_delete gfont;
+ delete[] gfont;
gfont = strsave(s);
}
void set_grfont(const char *s)
{
- a_delete grfont;
+ delete[] grfont;
grfont = strsave(s);
}
void set_gbfont(const char *s)
{
- a_delete gbfont;
+ delete[] gbfont;
gbfont = strsave(s);
}
@@ -457,7 +457,7 @@ void box_list::append(box *pp)
maxlen *= 2;
p = new box*[maxlen];
memcpy(p, oldp, sizeof(box*)*len);
- a_delete oldp;
+ delete[] oldp;
}
p[len++] = pp;
}
@@ -466,7 +466,7 @@ box_list::~box_list()
{
for (int i = 0; i < len; i++)
delete p[i];
- a_delete p;
+ delete[] p;
}
void box_list::list_check_tabs(int level)
diff --git a/src/preproc/eqn/delim.cpp b/src/preproc/eqn/delim.cpp
index b76e971..c667653 100644
--- a/src/preproc/eqn/delim.cpp
+++ b/src/preproc/eqn/delim.cpp
@@ -176,11 +176,11 @@ public:
box *make_delim_box(char *l, box *pp, char *r)
{
if (l != 0 && *l == '\0') {
- a_delete l;
+ delete[] l;
l = 0;
}
if (r != 0 && *r == '\0') {
- a_delete r;
+ delete[] r;
r = 0;
}
return new delim_box(l, pp, r);
@@ -193,8 +193,8 @@ delim_box::delim_box(char *l, box *pp, char *r)
delim_box::~delim_box()
{
- a_delete left;
- a_delete right;
+ delete[] left;
+ delete[] right;
delete p;
}
diff --git a/src/preproc/eqn/eqn.ypp b/src/preproc/eqn/eqn.ypp
index 5beeb67..a22ad59 100644
--- a/src/preproc/eqn/eqn.ypp
+++ b/src/preproc/eqn/eqn.ypp
@@ -265,7 +265,7 @@ number:
int n;
if (sscanf($1, "%d", &n) == 1)
$$ = n;
- a_delete $1;
+ delete[] $1;
}
;
diff --git a/src/preproc/eqn/lex.cpp b/src/preproc/eqn/lex.cpp
index dfe3197..115617b 100644
--- a/src/preproc/eqn/lex.cpp
+++ b/src/preproc/eqn/lex.cpp
@@ -402,7 +402,7 @@ file_input::file_input(FILE *f, const char *fn, input *p)
file_input::~file_input()
{
- a_delete filename;
+ delete[] filename;
fclose(fp);
}
@@ -542,8 +542,8 @@ argument_macro_input::argument_macro_input(const char
*body, int ac,
argument_macro_input::~argument_macro_input()
{
for (int i = 0; i < argc; i++)
- a_delete argv[i];
- a_delete s;
+ delete[] argv[i];
+ delete[] s;
}
int argument_macro_input::get()
diff --git a/src/preproc/eqn/pile.cpp b/src/preproc/eqn/pile.cpp
index f9b8672..b94dff7 100644
--- a/src/preproc/eqn/pile.cpp
+++ b/src/preproc/eqn/pile.cpp
@@ -278,7 +278,7 @@ matrix_box::~matrix_box()
{
for (int i = 0; i < len; i++)
delete p[i];
- a_delete p;
+ delete[] p;
}
void matrix_box::append(column *pp)
@@ -288,7 +288,7 @@ void matrix_box::append(column *pp)
maxlen *= 2;
p = new column*[maxlen];
memcpy(p, oldp, sizeof(column*)*len);
- a_delete oldp;
+ delete[] oldp;
}
p[len++] = pp;
}
diff --git a/src/preproc/eqn/special.cpp b/src/preproc/eqn/special.cpp
index 25c3724..8ad8238 100644
--- a/src/preproc/eqn/special.cpp
+++ b/src/preproc/eqn/special.cpp
@@ -64,7 +64,7 @@ special_box::special_box(char *s, box *pp) : pointer_box(pp),
macro_name(s)
special_box::~special_box()
{
- a_delete macro_name;
+ delete[] macro_name;
}
int special_box::compute_metrics(int style)
diff --git a/src/preproc/eqn/text.cpp b/src/preproc/eqn/text.cpp
index 6d518b7..272f3fe 100644
--- a/src/preproc/eqn/text.cpp
+++ b/src/preproc/eqn/text.cpp
@@ -705,7 +705,7 @@ void set_char_type(const char *type, char *ch)
int ft = lookup_font_type(type);
if (st < 0 && ft < 0) {
error("bad character type '%1'", type);
- a_delete ch;
+ delete[] ch;
return;
}
box *b = split_text(ch);
diff --git a/src/preproc/html/pre-html.cpp b/src/preproc/html/pre-html.cpp
index f5b15a2..49c69e9 100644
--- a/src/preproc/html/pre-html.cpp
+++ b/src/preproc/html/pre-html.cpp
@@ -276,7 +276,7 @@ int get_line(FILE *f)
char *old_linebuf = linebuf;
linebuf = new char[linebufsize * 2];
memcpy(linebuf, old_linebuf, linebufsize);
- a_delete old_linebuf;
+ delete[] old_linebuf;
linebufsize *= 2;
}
linebuf[i++] = c;
@@ -1741,7 +1741,7 @@ static int scanArguments(int argc, char **argv)
return i;
i++;
}
- a_delete troff_name;
+ delete[] troff_name;
return argc;
}
diff --git a/src/preproc/pic/lex.cpp b/src/preproc/pic/lex.cpp
index 986321d..47bab35 100644
--- a/src/preproc/pic/lex.cpp
+++ b/src/preproc/pic/lex.cpp
@@ -1555,8 +1555,8 @@ copy_thru_input::copy_thru_input(const char *b, const
char *u)
copy_thru_input::~copy_thru_input()
{
- a_delete body;
- a_delete until;
+ delete[] body;
+ delete[] until;
}
int copy_thru_input::get()
diff --git a/src/preproc/pic/object.cpp b/src/preproc/pic/object.cpp
index 291fbcb..e207fb1 100644
--- a/src/preproc/pic/object.cpp
+++ b/src/preproc/pic/object.cpp
@@ -40,7 +40,7 @@ output::output() : args(0), desired_height(0.0),
desired_width(0.0)
output::~output()
{
- a_delete args;
+ delete[] args;
}
void output::set_desired_width_height(double wid, double ht)
@@ -51,7 +51,7 @@ void output::set_desired_width_height(double wid, double ht)
void output::set_args(const char *s)
{
- a_delete args;
+ delete[] args;
if (s == 0 || *s == '\0')
args = 0;
else
@@ -404,7 +404,7 @@ text_item::text_item(char *t, const char *fn, int ln)
text_item::~text_item()
{
- a_delete text;
+ delete[] text;
}
object_spec::object_spec(object_type t) : type(t)
@@ -443,8 +443,8 @@ object_spec::~object_spec()
delete tem;
}
delete with;
- a_delete shaded;
- a_delete outlined;
+ delete[] shaded;
+ delete[] outlined;
}
class command_object : public object {
@@ -465,7 +465,7 @@ command_object::command_object(char *p, const char *fn, int
ln)
command_object::~command_object()
{
- a_delete s;
+ delete[] s;
}
void command_object::print()
@@ -1445,7 +1445,7 @@ void spline_object::print()
line_object::~line_object()
{
- a_delete v;
+ delete[] v;
}
linear_object *object_spec::make_line(position *curpos, direction *dirp)
diff --git a/src/preproc/pic/pic.ypp b/src/preproc/pic/pic.ypp
index eaec38c..0cbf556 100644
--- a/src/preproc/pic/pic.ypp
+++ b/src/preproc/pic/pic.ypp
@@ -306,10 +306,10 @@ separator:
placeless_element:
FIGNAME '=' macro_name
{
- a_delete graphname;
+ delete[] graphname;
graphname = new char[strlen($3) + 1];
strcpy(graphname, $3);
- a_delete $3;
+ delete[] $3;
}
|
VARIABLE '=' any_expr
@@ -350,7 +350,7 @@ placeless_element:
| PRINT print_args
{
fprintf(stderr, "%s\n", $2.str);
- a_delete $2.str;
+ delete[] $2.str;
fflush(stderr);
}
| SH
@@ -362,7 +362,7 @@ placeless_element:
lex_error("unsafe to run command '%1'", $3);
else
system($3);
- a_delete $3;
+ delete[] $3;
}
| COPY TEXT
{
@@ -381,8 +381,8 @@ placeless_element:
do_lookahead();
copy_file_thru($2.str, $5, $7);
// do not delete the filename
- a_delete $5;
- a_delete $7;
+ delete[] $5;
+ delete[] $7;
}
| COPY THRU
{ delim_flag = 2; }
@@ -393,8 +393,8 @@ placeless_element:
if (yychar < 0)
do_lookahead();
copy_rest_thru($4, $6);
- a_delete $4;
- a_delete $6;
+ delete[] $4;
+ delete[] $6;
}
| FOR VARIABLE '=' expr TO expr optional_by DO
{ delim_flag = 1; }
@@ -411,7 +411,7 @@ placeless_element:
do_lookahead();
if ($1.x != 0.0)
push_body($1.body);
- a_delete $1.body;
+ delete[] $1.body;
}
| simple_if ELSE
{ delim_flag = 1; }
@@ -441,17 +441,17 @@ reset_variables:
RESET VARIABLE
{
reset($2);
- a_delete $2;
+ delete[] $2;
}
| reset_variables VARIABLE
{
reset($2);
- a_delete $2;
+ delete[] $2;
}
| reset_variables ',' VARIABLE
{
reset($3);
- a_delete $3;
+ delete[] $3;
}
;
@@ -463,8 +463,8 @@ print_args:
$$.str = new char[strlen($1.str) + strlen($2.str) + 1];
strcpy($$.str, $1.str);
strcat($$.str, $2.str);
- a_delete $1.str;
- a_delete $2.str;
+ delete[] $1.str;
+ delete[] $2.str;
if ($1.filename) {
$$.filename = $1.filename;
$$.lineno = $1.lineno;
@@ -524,14 +524,14 @@ text_expr:
text EQUALEQUAL text
{
$$ = strcmp($1.str, $3.str) == 0;
- a_delete $1.str;
- a_delete $3.str;
+ delete[] $1.str;
+ delete[] $3.str;
}
| text NOTEQUAL text
{
$$ = strcmp($1.str, $3.str) != 0;
- a_delete $1.str;
- a_delete $3.str;
+ delete[] $1.str;
+ delete[] $3.str;
}
| text_expr ANDAND text_expr
{ $$ = ($1 != 0.0 && $3 != 0.0); }
@@ -689,7 +689,7 @@ object_spec:
$$ = new object_spec(TEXT_OBJECT);
$$->text = new text_item(format_number($3.str, $2),
$3.filename, $3.lineno);
- a_delete $3.str;
+ delete[] $3.str;
}
| '['
{
@@ -1109,7 +1109,7 @@ text:
$$.filename = $3.filename;
$$.lineno = $3.lineno;
$$.str = do_sprintf($3.str, $4.v, $4.nv);
- a_delete $4.v;
+ delete[] $4.v;
free($3.str);
}
;
@@ -1142,7 +1142,7 @@ sprintf_args:
memcpy(foo, oldv, $$.nv*sizeof(double));
$$.v = foo;
#endif
- a_delete oldv;
+ delete[] oldv;
}
}
$$.v[$$.nv] = $3;
@@ -1409,7 +1409,7 @@ path:
| LABEL relative_path
{
lex_warning("initial '%1' in 'with' argument ignored", $1);
- a_delete $1;
+ delete[] $1;
$$ = $2;
}
;
diff --git a/src/preproc/refer/command.cpp b/src/preproc/refer/command.cpp
index 75b1978..7860e3d 100644
--- a/src/preproc/refer/command.cpp
+++ b/src/preproc/refer/command.cpp
@@ -52,7 +52,7 @@ input_item::input_item(string &s, const char *fn, int ln)
input_item::~input_item()
{
- a_delete filename;
+ delete[] filename;
}
inline int input_item::peek_char()
@@ -787,7 +787,7 @@ static void command_loop()
for (int i = 0; i < argc; i++)
argv[i].s = ptr = strchr(ptr, '\0') + 1;
execute_command(command.contents(), argc, argv);
- a_delete argv;
+ delete[] argv;
if (res == -1)
break;
}
diff --git a/src/preproc/refer/label.ypp b/src/preproc/refer/label.ypp
index ed02052..89876b6 100644
--- a/src/preproc/refer/label.ypp
+++ b/src/preproc/refer/label.ypp
@@ -995,7 +995,7 @@ label_info *lookup_label(const string &label)
;
*p = old_table[i];
}
- a_delete old_table;
+ delete[] old_table;
}
return result;
}
diff --git a/src/preproc/refer/refer.cpp b/src/preproc/refer/refer.cpp
index ce5204a..5cf05c2 100644
--- a/src/preproc/refer/refer.cpp
+++ b/src/preproc/refer/refer.cpp
@@ -692,7 +692,7 @@ static void store_citation(reference *ref)
citation_max *= 2;
citation = new reference *[citation_max];
memcpy(citation, old_citation, ncitations*sizeof(reference *));
- a_delete old_citation;
+ delete[] old_citation;
}
}
citation[ncitations++] = ref;
@@ -751,7 +751,7 @@ static unsigned store_reference(const string &str)
;
*p = old_table[i];
}
- a_delete old_table;
+ delete[] old_table;
}
}
if (label_in_text)
diff --git a/src/preproc/tbl/main.cpp b/src/preproc/tbl/main.cpp
index 59c92ed..8cb19e8 100644
--- a/src/preproc/tbl/main.cpp
+++ b/src/preproc/tbl/main.cpp
@@ -664,7 +664,7 @@ void format::add_rows(int n)
vline = new char*[nrows + n];
for (i = 0; i < nrows; i++)
vline[i] = old_vline[i];
- a_delete old_vline;
+ delete[] old_vline;
for (i = 0; i < n; i++) {
vline[nrows + i] = new char[ncolumns + 1];
for (int j = 0; j < ncolumns + 1; j++)
@@ -674,7 +674,7 @@ void format::add_rows(int n)
entry = new entry_format *[nrows + n];
for (i = 0; i < nrows; i++)
entry[i] = old_entry[i];
- a_delete old_entry;
+ delete[] old_entry;
for (i = 0; i < n; i++)
entry[nrows + i] = new entry_format[ncolumns];
nrows += n;
@@ -682,16 +682,16 @@ void format::add_rows(int n)
format::~format()
{
- a_delete separation;
+ delete[] separation;
delete[] width;
- a_delete equal;
- a_delete expand;
+ delete[] equal;
+ delete[] expand;
for (int i = 0; i < nrows; i++) {
- a_delete vline[i];
+ delete[] vline[i];
delete[] entry[i];
}
- a_delete vline;
- a_delete entry;
+ delete[] vline;
+ delete[] entry;
}
struct input_entry_format : public entry_format {
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index e3a1133..11950f1 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -642,7 +642,7 @@ block_entry::block_entry(const table *p, const
entry_modifier *m, char *s)
block_entry::~block_entry()
{
- a_delete contents;
+ delete[] contents;
}
void block_entry::position_vertically()
@@ -1262,20 +1262,20 @@ table::table(int nc, unsigned f, int ls, char dpc)
table::~table()
{
for (int i = 0; i < nrows; i++) {
- a_delete entry[i];
- a_delete vline[i];
+ delete[] entry[i];
+ delete[] vline[i];
}
- a_delete entry;
- a_delete vline;
+ delete[] entry;
+ delete[] vline;
while (entry_list) {
table_entry *tem = entry_list;
entry_list = entry_list->next;
delete tem;
}
delete[] minimum_width;
- a_delete column_separation;
- a_delete equal;
- a_delete expand;
+ delete[] column_separation;
+ delete[] equal;
+ delete[] expand;
while (stuff_list) {
stuff *tem = stuff_list;
stuff_list = stuff_list->next;
@@ -1286,7 +1286,7 @@ table::~table()
vrule_list = vrule_list->next;
delete tem;
}
- a_delete row_is_all_lines;
+ delete[] row_is_all_lines;
while (span_list) {
horizontal_span *tem = span_list;
span_list = span_list->next;
@@ -1368,11 +1368,11 @@ void table::allocate(int r)
allocated_rows = r + 1;
entry = new PPtable_entry[allocated_rows];
memcpy(entry, old_entry, sizeof(table_entry**)*old_allocated_rows);
- a_delete old_entry;
+ delete[] old_entry;
char **old_vline = vline;
vline = new char*[allocated_rows];
memcpy(vline, old_vline, sizeof(char*)*old_allocated_rows);
- a_delete old_vline;
+ delete[] old_vline;
}
}
assert(allocated_rows > r);
diff --git a/src/roff/groff/groff.cpp b/src/roff/groff/groff.cpp
index 73d30c5..f83ab27 100644
--- a/src/roff/groff/groff.cpp
+++ b/src/roff/groff/groff.cpp
@@ -587,7 +587,7 @@ possible_command::possible_command()
possible_command::~possible_command()
{
free(name);
- a_delete argv;
+ delete[] argv;
}
void possible_command::set_name(const char *s)
@@ -598,8 +598,8 @@ void possible_command::set_name(const char *s)
void possible_command::clear_name()
{
- a_delete name;
- a_delete argv;
+ delete[] name;
+ delete[] argv;
name = NULL;
argv = NULL;
}
diff --git a/src/roff/troff/column.cpp b/src/roff/troff/column.cpp
index cc023f1..0009494 100644
--- a/src/roff/troff/column.cpp
+++ b/src/roff/troff/column.cpp
@@ -463,8 +463,8 @@ justification_spec::justification_spec(vunits h)
justification_spec::~justification_spec()
{
- a_delete type;
- a_delete amount;
+ delete[] type;
+ delete[] amount;
}
void justification_spec::append(symbol t, vunits v)
@@ -485,12 +485,12 @@ void justification_spec::append(symbol t, vunits v)
int i;
for (i = 0; i < n; i++)
type[i] = old_type[i];
- a_delete old_type;
+ delete[] old_type;
vunits *old_amount = amount;
amount = new vunits[maxn];
for (i = 0; i < n; i++)
amount[i] = old_amount[i];
- a_delete old_amount;
+ delete[] old_amount;
}
assert(n < maxn);
type[n] = t;
diff --git a/src/roff/troff/dictionary.cpp b/src/roff/troff/dictionary.cpp
index 81c009b..08afbd3 100644
--- a/src/roff/troff/dictionary.cpp
+++ b/src/roff/troff/dictionary.cpp
@@ -75,7 +75,7 @@ void *dictionary::lookup(symbol s, void *v)
for (i = 0; i < old_size; i++)
if (old_table[i].v != 0)
(void)lookup(old_table[i].s, old_table[i].v);
- a_delete old_table;
+ delete[] old_table;
}
return 0;
}
diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index d6e005f..3434cf7 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1248,7 +1248,7 @@ void override_sizes()
sizes = new int[n*2];
memcpy(sizes, old_sizes, n*sizeof(int));
n *= 2;
- a_delete old_sizes;
+ delete[] old_sizes;
}
sizes[i++] = lower;
if (lower == 0)
@@ -2624,7 +2624,7 @@ const char *tab_stops::to_string()
int need = count*12 + 3;
if (buf == 0 || need > buf_size) {
if (buf)
- a_delete buf;
+ delete[] buf;
buf_size = need;
buf = new char[buf_size];
}
@@ -3578,7 +3578,7 @@ static void hyphen_word()
tem = (unsigned char *)current_language->exceptions.lookup(symbol(buf),
tem);
if (tem)
- a_delete tem;
+ delete[] tem;
}
}
skip_line();
@@ -3700,7 +3700,7 @@ void hyphen_trie::insert_hyphenation(dictionary *ex,
const char *pat,
memcpy(tem, pos, npos + 1);
tem = (unsigned char *)ex->lookup(symbol(buf), tem);
if (tem)
- a_delete tem;
+ delete[] tem;
}
}
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 24b661c..6cfa03d 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -875,7 +875,7 @@ static symbol read_long_escape_name(read_mode mode)
c = get_char_for_escape_name(have_char && mode == WITH_ARGS);
if (c == 0) {
if (buf != abuf)
- a_delete buf;
+ delete[] buf;
return NULL_SYMBOL;
}
have_char = 1;
@@ -892,7 +892,7 @@ static symbol read_long_escape_name(read_mode mode)
buf = new char[buf_size*2];
memcpy(buf, old_buf, buf_size);
buf_size *= 2;
- a_delete old_buf;
+ delete[] old_buf;
}
}
if (c == ']' && input_stack::get_level() == start_level)
@@ -912,7 +912,7 @@ static symbol read_long_escape_name(read_mode mode)
}
else {
symbol s(buf);
- a_delete buf;
+ delete[] buf;
return s;
}
}
@@ -2281,7 +2281,7 @@ void token::next()
strcpy(buf, "u");
strcat(buf, gn);
nm = symbol(buf);
- a_delete buf;
+ delete[] buf;
}
}
else
@@ -2542,7 +2542,7 @@ static symbol do_get_long_name(bool required, char end)
buf = new char[buf_size*2];
memcpy(buf, old_buf, buf_size);
buf_size *= 2;
- a_delete old_buf;
+ delete[] old_buf;
}
}
if ((buf[i] = tok.ch()) == 0 || buf[i] == end)
@@ -2562,7 +2562,7 @@ static symbol do_get_long_name(bool required, char end)
return symbol(buf);
else {
symbol s(buf);
- a_delete buf;
+ delete[] buf;
return s;
}
}
@@ -3611,7 +3611,7 @@ temp_iterator::temp_iterator(const char *s, int len)
temp_iterator::~temp_iterator()
{
- a_delete base;
+ delete[] base;
}
@@ -5182,7 +5182,7 @@ static symbol get_delim_name()
buf = new char[buf_size*2];
memcpy(buf, old_buf, buf_size);
buf_size *= 2;
- a_delete old_buf;
+ delete[] old_buf;
}
}
tok.next();
@@ -5192,7 +5192,7 @@ static symbol get_delim_name()
if ((buf[i] = tok.ch()) == 0) {
error("missing delimiter (got %1)", tok.description());
if (buf != abuf)
- a_delete buf;
+ delete[] buf;
return NULL_SYMBOL;
}
i++;
@@ -5208,7 +5208,7 @@ static symbol get_delim_name()
}
else {
symbol s(buf);
- a_delete buf;
+ delete[] buf;
return s;
}
}
@@ -6027,7 +6027,7 @@ void pipe_source()
buf_size *= 2;
buf = new char[buf_size];
memcpy(buf, old_buf, old_buf_size);
- a_delete old_buf;
+ delete[] old_buf;
}
strcpy(buf + buf_used, s);
buf_used += slen;
@@ -6039,7 +6039,7 @@ void pipe_source()
input_stack::push(new file_iterator(fp, symbol(buf).contents(), 1));
else
error("can't open pipe to process '%1': %2", buf, strerror(errno));
- a_delete buf;
+ delete[] buf;
}
tok.next();
#endif /* not POPEN_MISSING */
@@ -7535,7 +7535,7 @@ char *read_string()
s = new char[len*2];
memcpy(s, tem, len);
len *= 2;
- a_delete tem;
+ delete[] tem;
}
s[i++] = c;
}
@@ -7544,7 +7544,7 @@ char *read_string()
s[i] = '\0';
tok.next();
if (i == 0) {
- a_delete s;
+ delete[] s;
return 0;
}
return s;
@@ -7574,8 +7574,8 @@ void pipe_output()
strcpy(s, pipe_command);
strcat(s, "|");
strcat(s, pc);
- a_delete pipe_command;
- a_delete pc;
+ delete[] pipe_command;
+ delete[] pc;
pipe_command = s;
}
else
@@ -7599,7 +7599,7 @@ void system_request()
error("empty command");
else {
system_status = system(command);
- a_delete command;
+ delete[] command;
}
}
}
@@ -7754,7 +7754,7 @@ static FILE *open_mac_file(const char *mac, char **path)
FILE *fp = mac_path->open_file(s1, path);
if (!fp && ENOENT != errno)
error("can't open macro file '%1': %2", s1, strerror(errno));
- a_delete s1;
+ delete[] s1;
if (!fp) {
char *s2 = new char[strlen(mac)+strlen(MACRO_PREFIX)+1];
strcpy(s2, MACRO_PREFIX);
@@ -7762,7 +7762,7 @@ static FILE *open_mac_file(const char *mac, char **path)
fp = mac_path->open_file(s2, path);
if (!fp && ENOENT != errno)
error("can't open macro file '%1': %2", s2, strerror(errno));
- a_delete s2;
+ delete[] s2;
}
return fp;
}
@@ -7817,7 +7817,7 @@ void do_macro_source(bool quietly)
strcpy(s, fn + sizeof(MACRO_PREFIX) - 1);
strcat(s, MACRO_POSTFIX);
fp = mac_path->open_file(s, &path);
- a_delete s;
+ delete[] s;
}
if (!fp) {
if (strncasecmp(fn + fnlen - sizeof(MACRO_POSTFIX) + 1,
@@ -7826,7 +7826,7 @@ void do_macro_source(bool quietly)
strcpy(s, MACRO_PREFIX);
strncat(s, fn, fnlen - sizeof(MACRO_POSTFIX) + 1);
fp = mac_path->open_file(s, &path);
- a_delete s;
+ delete[] s;
}
}
}
@@ -7907,7 +7907,7 @@ static void do_register_assignment(const char *s)
units n;
if (evaluate_expression(p + 1, &n))
set_number_reg(buf, n);
- a_delete buf;
+ delete[] buf;
}
}
@@ -7934,7 +7934,7 @@ static void do_string_assignment(const char *s)
memcpy(buf, s, p - s);
buf[p - s] = 0;
set_string(buf, p + 1);
- a_delete buf;
+ delete[] buf;
}
}
@@ -8511,7 +8511,7 @@ static node *read_draw_node()
for (int j = 0; j < maxpoints; j++)
point[j] = oldpoint[j];
maxpoints *= 2;
- a_delete oldpoint;
+ delete[] oldpoint;
}
if (!get_hunits(&point[i].h,
type == 'f' || type == 't' ? 'u' : 'm')) {
@@ -8578,11 +8578,11 @@ static node *read_draw_node()
curenv->get_font_size(),
curenv->get_glyph_color(),
curenv->get_fill_color());
- a_delete point;
+ delete[] point;
return dn;
}
else {
- a_delete point;
+ delete[] point;
}
}
}
@@ -8700,7 +8700,7 @@ static void copy_mode_error(const char *format,
strcpy(s, prefix);
strcat(s, format);
warning(WARN_IG, s, arg1, arg2, arg3);
- a_delete s;
+ delete[] s;
}
else
error(format, arg1, arg2, arg3);
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index bd75877..3dbc573 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -1200,7 +1200,7 @@ void troff_output_file::set_font(tfont *tf)
font_position = new symbol[nfont_positions];
memcpy(font_position, old_font_position,
old_nfont_positions*sizeof(symbol));
- a_delete old_font_position;
+ delete[] old_font_position;
}
font_position[n] = nm;
}
@@ -1573,7 +1573,7 @@ void troff_output_file::really_transparent_char(unsigned
char c)
troff_output_file::~troff_output_file()
{
- a_delete font_position;
+ delete[] font_position;
}
void troff_output_file::trailer(vunits page_length)
@@ -4533,7 +4533,7 @@ int draw_node::is_tag()
draw_node::~draw_node()
{
if (point)
- a_delete point;
+ delete[] point;
}
hunits draw_node::width()
@@ -5914,7 +5914,7 @@ static void grow_font_table(int n)
if (old_font_table_size)
memcpy(font_table, old_font_table,
old_font_table_size*sizeof(font_info *));
- a_delete old_font_table;
+ delete[] old_font_table;
for (int i = old_font_table_size; i < font_table_size; i++)
font_table[i] = 0;
}
@@ -6057,7 +6057,7 @@ font_family::font_family(symbol s)
font_family::~font_family()
{
- a_delete map;
+ delete[] map;
}
int font_family::make_definite(int i)
@@ -6076,7 +6076,7 @@ int font_family::make_definite(int i)
map_size = i + 10;
map = new int[map_size];
memcpy(map, old_map, old_map_size*sizeof(int));
- a_delete old_map;
+ delete[] old_map;
for (int j = old_map_size; j < map_size; j++)
map[j] = -1;
}
diff --git a/src/utils/hpftodit/hpftodit.cpp b/src/utils/hpftodit/hpftodit.cpp
index 2647a6f..415dbd5 100644
--- a/src/utils/hpftodit/hpftodit.cpp
+++ b/src/utils/hpftodit/hpftodit.cpp
@@ -178,7 +178,7 @@ struct name_list {
char *name;
name_list *next;
name_list(const char *s, name_list *p) : name(strsave(s)), next(p) { }
- ~name_list() { a_delete name; }
+ ~name_list() { delete[] name; }
};
struct symbol_set {
@@ -1419,7 +1419,7 @@ read_map(const char *file, const int tfm_type)
charcode_name_table = new name_list *[charcode_name_table_size];
if (old_table) {
memcpy(charcode_name_table, old_table, old_size*sizeof(name_list *));
- a_delete old_table;
+ delete[] old_table;
}
for (size_t i = old_size; i < charcode_name_table_size; i++)
charcode_name_table[i] = NULL;
diff --git a/src/utils/indxbib/indxbib.cpp b/src/utils/indxbib/indxbib.cpp
index f57b2e9..b9e0802 100644
--- a/src/utils/indxbib/indxbib.cpp
+++ b/src/utils/indxbib/indxbib.cpp
@@ -191,7 +191,7 @@ int main(int argc, char **argv)
if (!directory) {
char *path = get_cwd();
store_filename(path);
- a_delete path;
+ delete[] path;
}
else
store_filename(directory);
@@ -215,7 +215,7 @@ int main(int argc, char **argv)
char *dir = strsave(base_name);
dir[p - base_name] = '\0';
name_max = file_name_max(dir);
- a_delete dir;
+ delete[] dir;
}
else
name_max = file_name_max(".");
@@ -354,7 +354,7 @@ static char *get_cwd()
break;
if (errno != ERANGE)
fatal("cannot get current working directory: %1", strerror(errno));
- a_delete buf;
+ delete[] buf;
if (size == INT_MAX)
fatal("current working directory longer than INT_MAX");
if (size > INT_MAX/2)
diff --git a/src/utils/tfmtodit/tfmtodit.cpp b/src/utils/tfmtodit/tfmtodit.cpp
index 91e5cc5..734beeb 100644
--- a/src/utils/tfmtodit/tfmtodit.cpp
+++ b/src/utils/tfmtodit/tfmtodit.cpp
@@ -243,14 +243,14 @@ int tfm::get_design_size()
tfm::~tfm()
{
- a_delete char_info;
- a_delete width;
- a_delete height;
- a_delete depth;
- a_delete italic;
- a_delete lig_kern;
- a_delete kern;
- a_delete param;
+ delete[] char_info;
+ delete[] width;
+ delete[] height;
+ delete[] depth;
+ delete[] italic;
+ delete[] lig_kern;
+ delete[] kern;
+ delete[] param;
}
int read2(unsigned char *&s)
@@ -294,14 +294,14 @@ int tfm::load(const char *file)
error("unexpected end of file on '%1'", file);
else
error("error on file '%1'", file);
- a_delete buf;
+ delete[] buf;
fclose(fp);
return 0;
}
fclose(fp);
if (lf < 6) {
error("bad TFM file '%1': impossibly short", file);
- a_delete buf;
+ delete[] buf;
return 0;
}
unsigned char *ptr = buf;
@@ -319,12 +319,12 @@ int tfm::load(const char *file)
if ((6 + lh + (ec - bc + 1) + nw + nh + nd + ni + nl + nk + ne + np)
!= lf) {
error("bad TFM file '%1': lengths do not sum", file);
- a_delete buf;
+ delete[] buf;
return 0;
}
if (lh < 2) {
error("bad TFM file '%1': header too short", file);
- a_delete buf;
+ delete[] buf;
return 0;
}
char_info = new char_info_word[ec - bc + 1];
@@ -369,7 +369,7 @@ int tfm::load(const char *file)
for (i = 0; i < np; i++)
param[i] = read4(ptr);
assert(ptr == buf + lf*4 - 2);
- a_delete buf;
+ delete[] buf;
return 1;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 20/34: [libgroff]: Drop `a_delete` preprocessor wrapper.,
G. Branden Robinson <=