# HG changeset patch # User John W. Eaton # Date 1493925029 14400 # Node ID a41fdb801db67eb8e5cf4c11b484a28963aa579d # Parent 2699c59748443830d982459050eb01235262f5b8 use mark_global and mark_persistent consistently * ls-hdf5.cc, ls-hdf5.h, ls-mat5.cc, ls-mat5.h, ls-oct-binary.cc, ls-oct-binary.h, ls-oct-text.cc, ls-oct-text.h, oct-parse.in.yy, pt-decl.cc, pt-decl.h, pt-eval.cc, pt-id.h: Consistently use mark_global and mark_persistent instead of mark_as_global, mark_as_persistent, mark_static, or mark_as_static. diff -r 2699c5974844 -r a41fdb801db6 libinterp/corefcn/ls-hdf5.cc --- a/libinterp/corefcn/ls-hdf5.cc Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/corefcn/ls-hdf5.cc Thu May 04 15:10:29 2017 -0400 @@ -1048,7 +1048,7 @@ bool add_hdf5_data (octave_hdf5_id loc_id, const octave_value& tc, const std::string& name, const std::string& doc, - bool mark_as_global, bool save_as_floats) + bool mark_global, bool save_as_floats) { #if defined (HAVE_HDF5) @@ -1106,7 +1106,7 @@ retval = false; // if it's global, add an attribute "OCTAVE_GLOBAL" with value 1 - if (retval && mark_as_global) + if (retval && mark_global) retval = hdf5_add_attr (data_id, "OCTAVE_GLOBAL") >= 0; // We are saving in the new variable format, so mark it @@ -1143,7 +1143,7 @@ bool save_hdf5_data (std::ostream& os, const octave_value& tc, const std::string& name, const std::string& doc, - bool mark_as_global, bool save_as_floats) + bool mark_global, bool save_as_floats) { #if defined (HAVE_HDF5) @@ -1152,7 +1152,7 @@ hdf5_ofstream& hs = dynamic_cast (os); return add_hdf5_data (hs.file_id, tc, name, doc, - mark_as_global, save_as_floats); + mark_global, save_as_floats); #else err_disabled_feature ("save_hdf5_data", "HDF5"); diff -r 2699c5974844 -r a41fdb801db6 libinterp/corefcn/ls-hdf5.h --- a/libinterp/corefcn/ls-hdf5.h Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/corefcn/ls-hdf5.h Thu May 04 15:10:29 2017 -0400 @@ -132,7 +132,7 @@ extern OCTINTERP_API bool add_hdf5_data (octave_hdf5_id loc_id, const octave_value& tc, const std::string& name, const std::string& doc, - bool mark_as_global, bool save_as_floats); + bool mark_global, bool save_as_floats); extern OCTINTERP_API int save_hdf5_empty (octave_hdf5_id loc_id, const char *name, const dim_vector& d); @@ -148,7 +148,7 @@ extern OCTINTERP_API bool save_hdf5_data (std::ostream& os, const octave_value& tc, const std::string& name, const std::string& doc, - bool mark_as_global, bool save_as_floats); + bool mark_global, bool save_as_floats); extern OCTINTERP_API bool hdf5_check_attr (octave_hdf5_id loc_id, const char *attr_name); diff -r 2699c5974844 -r a41fdb801db6 libinterp/corefcn/ls-mat5.cc --- a/libinterp/corefcn/ls-mat5.cc Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/corefcn/ls-mat5.cc Thu May 04 15:10:29 2017 -0400 @@ -1862,7 +1862,7 @@ static bool write_mat5_cell_array (std::ostream& os, const Cell& cell, - bool mark_as_global, bool save_as_floats) + bool mark_global, bool save_as_floats) { octave_idx_type nel = cell.numel (); @@ -1870,7 +1870,7 @@ { octave_value ov = cell(i); - if (! save_mat5_binary_element (os, ov, "", mark_as_global, + if (! save_mat5_binary_element (os, ov, "", mark_global, false, save_as_floats)) return false; } @@ -2231,7 +2231,7 @@ bool save_mat5_binary_element (std::ostream& os, const octave_value& tc, const std::string& name, - bool mark_as_global, bool mat7_format, + bool mark_global, bool mat7_format, bool save_as_floats, bool compressing) { int32_t flags = 0; @@ -2296,7 +2296,7 @@ // The code seeks backwards in the stream to fix the header. // Can't do this with zlib, so use a stringstream. - ret = save_mat5_binary_element (buf, tc, name, mark_as_global, true, + ret = save_mat5_binary_element (buf, tc, name, mark_global, true, save_as_floats, true); if (ret) @@ -2338,7 +2338,7 @@ if (tc.is_bool_type ()) flags |= 0x0200; - if (mark_as_global) + if (mark_global) flags |= 0x0400; if (tc.is_complex_scalar () || tc.is_complex_matrix ()) @@ -2561,7 +2561,7 @@ { Cell cell = tc.cell_value (); - if (! write_mat5_cell_array (os, cell, mark_as_global, save_as_floats)) + if (! write_mat5_cell_array (os, cell, mark_global, save_as_floats)) error ("save: error while writing '%s' to MAT file", name.c_str ()); } else if (tc.is_complex_scalar () || tc.is_complex_matrix ()) @@ -2666,7 +2666,7 @@ for (octave_idx_type i = 0; i < nf; i++) { bool retval2 = save_mat5_binary_element (os, elts[i][j], "", - mark_as_global, + mark_global, false, save_as_floats); if (! retval2) diff -r 2699c5974844 -r a41fdb801db6 libinterp/corefcn/ls-mat5.h --- a/libinterp/corefcn/ls-mat5.h Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/corefcn/ls-mat5.h Thu May 04 15:10:29 2017 -0400 @@ -62,7 +62,7 @@ extern bool save_mat5_binary_element (std::ostream& os, const octave_value& tc, const std::string& name, - bool mark_as_global, bool mat7_format, + bool mark_global, bool mat7_format, bool save_as_floats, bool compressing = false); #endif diff -r 2699c5974844 -r a41fdb801db6 libinterp/corefcn/ls-oct-binary.cc --- a/libinterp/corefcn/ls-oct-binary.cc Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/corefcn/ls-oct-binary.cc Thu May 04 15:10:29 2017 -0400 @@ -252,7 +252,7 @@ bool save_binary_data (std::ostream& os, const octave_value& tc, const std::string& name, const std::string& doc, - bool mark_as_global, bool save_as_floats) + bool mark_global, bool save_as_floats) { int32_t name_len = name.length (); @@ -266,7 +266,7 @@ unsigned char tmp; - tmp = mark_as_global; + tmp = mark_global; os.write (reinterpret_cast (&tmp), 1); // 255 flags the new binary format diff -r 2699c5974844 -r a41fdb801db6 libinterp/corefcn/ls-oct-binary.h --- a/libinterp/corefcn/ls-oct-binary.h Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/corefcn/ls-oct-binary.h Thu May 04 15:10:29 2017 -0400 @@ -34,7 +34,7 @@ extern OCTINTERP_API bool save_binary_data (std::ostream& os, const octave_value& tc, const std::string& name, const std::string& doc, - bool mark_as_global, bool save_as_floats); + bool mark_global, bool save_as_floats); extern OCTINTERP_API std::string read_binary_data (std::istream& is, bool swap, diff -r 2699c5974844 -r a41fdb801db6 libinterp/corefcn/ls-oct-text.cc --- a/libinterp/corefcn/ls-oct-text.cc Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/corefcn/ls-oct-text.cc Thu May 04 15:10:29 2017 -0400 @@ -298,7 +298,7 @@ bool save_text_data (std::ostream& os, const octave_value& val_arg, - const std::string& name, bool mark_as_global, + const std::string& name, bool mark_global, int precision) { bool success = true; @@ -308,7 +308,7 @@ octave_value val = val_arg; - if (mark_as_global) + if (mark_global) os << "# type: global " << val.type_name () << "\n"; else os << "# type: " << val.type_name () << "\n"; diff -r 2699c5974844 -r a41fdb801db6 libinterp/corefcn/ls-oct-text.h --- a/libinterp/corefcn/ls-oct-text.h Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/corefcn/ls-oct-text.h Thu May 04 15:10:29 2017 -0400 @@ -54,7 +54,7 @@ extern OCTINTERP_API bool save_text_data (std::ostream& os, const octave_value& val_arg, - const std::string& name, bool mark_as_global, int precision); + const std::string& name, bool mark_global, int precision); extern OCTINTERP_API bool save_text_data_for_plotting (std::ostream& os, const octave_value& t, diff -r 2699c5974844 -r a41fdb801db6 libinterp/parse-tree/oct-parse.in.yy --- a/libinterp/parse-tree/oct-parse.in.yy Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/parse-tree/oct-parse.in.yy Thu May 04 15:10:29 2017 -0400 @@ -3861,7 +3861,7 @@ case GLOBAL: { retval = new tree_decl_command ("global", lst, l, c); - retval->mark_as_global (); + retval->mark_global (); } break; @@ -3869,7 +3869,7 @@ if (curr_fcn_depth > 0) { retval = new tree_decl_command ("persistent", lst, l, c); - retval->mark_as_persistent (); + retval->mark_persistent (); } else { diff -r 2699c5974844 -r a41fdb801db6 libinterp/parse-tree/pt-decl.cc --- a/libinterp/parse-tree/pt-decl.cc Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/parse-tree/pt-decl.cc Thu May 04 15:10:29 2017 -0400 @@ -78,9 +78,9 @@ if (t) { if (cmd_name == "global") - mark_as_global (); + mark_global (); else if (cmd_name == "persistent") - mark_as_persistent (); + mark_persistent (); else error ("tree_decl_command: unknown decl type: %s", cmd_name); } diff -r 2699c5974844 -r a41fdb801db6 libinterp/parse-tree/pt-decl.h --- a/libinterp/parse-tree/pt-decl.h Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/parse-tree/pt-decl.h Thu May 04 15:10:29 2017 -0400 @@ -81,10 +81,10 @@ return id ? id->lvalue (tw) : octave_lvalue (); } - void mark_as_global (void) { type = global; } + void mark_global (void) { type = global; } bool is_global (void) const { return type == global; } - void mark_as_persistent (void) { type = persistent; } + void mark_persistent (void) { type = persistent; } bool is_persistent (void) const { return type == persistent; } tree_identifier * ident (void) { return id; } @@ -136,16 +136,16 @@ } } - void mark_as_global (void) + void mark_global (void) { for (tree_decl_elt *elt : *this) - elt->mark_as_global (); + elt->mark_global (); } - void mark_as_persistent (void) + void mark_persistent (void) { for (tree_decl_elt *elt : *this) - elt->mark_as_persistent (); + elt->mark_persistent (); } tree_decl_init_list * dup (symbol_table::scope_id scope, @@ -177,16 +177,16 @@ ~tree_decl_command (void); - void mark_as_global (void) + void mark_global (void) { if (init_list) - init_list->mark_as_global (); + init_list->mark_global (); } - void mark_as_persistent (void) + void mark_persistent (void) { if (init_list) - init_list->mark_as_persistent (); + init_list->mark_persistent (); } tree_decl_init_list * initializer_list (void) { return init_list; } diff -r 2699c5974844 -r a41fdb801db6 libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/parse-tree/pt-eval.cc Thu May 04 15:10:29 2017 -0400 @@ -636,7 +636,7 @@ if (elt.is_global ()) id->mark_global (); else if (elt.is_persistent ()) - id->mark_as_static (); + id->mark_persistent (); else error ("declaration list element not global or persistent"); diff -r 2699c5974844 -r a41fdb801db6 libinterp/parse-tree/pt-id.h --- a/libinterp/parse-tree/pt-id.h Thu May 04 15:02:46 2017 -0400 +++ b/libinterp/parse-tree/pt-id.h Thu May 04 15:10:29 2017 -0400 @@ -103,7 +103,7 @@ void mark_global (void) { sym->mark_global (); } - void mark_as_static (void) { sym->init_persistent (); } + void mark_persistent (void) { sym->init_persistent (); } void mark_as_formal_parameter (void) { sym->mark_formal (); }