2018-03-30 Simon Marchi <simon.marchi@polymtl.ca>
+ * guile/scm-utils.c (gdbscm_parse_function_args): Replace VEC
+ with std::vector.
+ * common/gdb_vecs.h (DEF_VEC_P (char_ptr)): Remove.
+
+2018-03-30 Simon Marchi <simon.marchi@polymtl.ca>
+
* tracepoint.h (struct uploaded_tp): Initialize fields.
<actions, step_actions, cmd_strings>: Change type to
std::vector<char *>.
typedef char *char_ptr;
typedef const char *const_char_ptr;
-DEF_VEC_P (char_ptr);
-
DEF_VEC_P (const_char_ptr);
/* Split STR, a list of DELIMITER-separated fields, into a char pointer vector.
SCM status;
SCM rest = SCM_EOL;
/* Keep track of malloc'd strings. We need to free them upon error. */
- VEC (char_ptr) *allocated_strings = NULL;
+ std::vector<char *> allocated_strings;
char *ptr;
have_rest = validate_arg_format (format);
if (!gdbscm_is_false (status))
goto fail;
if (*p == 's')
- VEC_safe_push (char_ptr, allocated_strings, *(char **) arg_ptr);
+ allocated_strings.push_back (*(char **) arg_ptr);
}
++p;
++position;
if (!gdbscm_is_false (status))
goto fail;
if (p[i] == 's')
- {
- VEC_safe_push (char_ptr, allocated_strings,
- *(char **) arg_ptr);
- }
+ allocated_strings.push_back (*(char **) arg_ptr);
}
}
}
}
va_end (args);
- VEC_free (char_ptr, allocated_strings);
return;
fail:
va_end (args);
- for (i = 0; VEC_iterate (char_ptr, allocated_strings, i, ptr); ++i)
+ for (char *ptr : allocated_strings)
xfree (ptr);
- VEC_free (char_ptr, allocated_strings);
gdbscm_throw (status);
}
\f