Print this page
Rich's feedback
*** 16,26 ****
#include <sys/debug.h>
#include <sys/sysmacros.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
! #include "sysdemangle_int.h"
#include "cxx.h"
#define CHUNK_SIZE (8U)
/*
--- 16,26 ----
#include <sys/debug.h>
#include <sys/sysmacros.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
! #include "demangle_int.h"
#include "cxx.h"
#define CHUNK_SIZE (8U)
/*
*** 76,86 ****
for (size_t i = 0; i < n->nm_len; i++) {
str_pair_t *sp = &n->nm_items[i];
sysdem_ops_t *ops = sp->strp_l.str_ops;
str_pair_fini(sp);
! str_pair_init(sp, ops);
}
n->nm_len = 0;
}
--- 76,86 ----
for (size_t i = 0; i < n->nm_len; i++) {
str_pair_t *sp = &n->nm_items[i];
sysdem_ops_t *ops = sp->strp_l.str_ops;
str_pair_fini(sp);
! (void) str_pair_init(sp, ops);
}
n->nm_len = 0;
}
*** 128,138 ****
boolean_t
name_add_str(name_t *n, str_t *l, str_t *r)
{
str_pair_t sp;
! str_pair_init(&sp, n->nm_ops);
if (!name_reserve(n, 1))
return (B_FALSE);
if (l != NULL) {
--- 128,138 ----
boolean_t
name_add_str(name_t *n, str_t *l, str_t *r)
{
str_pair_t sp;
! (void) str_pair_init(&sp, n->nm_ops);
if (!name_reserve(n, 1))
return (B_FALSE);
if (l != NULL) {
*** 195,205 ****
* A join of 0 elements places an empty string on the stack. This
* simplifies code that wants to do things like:
* name_join(...); name_fmt(.., "({0})", ...)
*/
if (amt == 0) {
! name_add(n, "", 0, "", 0);
return (B_TRUE);
}
/* A join of 1 element just implies merging the top str_pair_t */
if (amt == 1) {
--- 195,205 ----
* A join of 0 elements places an empty string on the stack. This
* simplifies code that wants to do things like:
* name_join(...); name_fmt(.., "({0})", ...)
*/
if (amt == 0) {
! (void) name_add(n, "", 0, "", 0);
return (B_TRUE);
}
/* A join of 1 element just implies merging the top str_pair_t */
if (amt == 1) {
*** 245,255 ****
if (fmt == NULL)
return (B_TRUE);
for (p = fmt; *p != '\0'; p++) {
if (*p != '{') {
! str_append_c(s, *p);
continue;
}
errno = 0;
char *q = NULL;
--- 245,255 ----
if (fmt == NULL)
return (B_TRUE);
for (p = fmt; *p != '\0'; p++) {
if (*p != '{') {
! (void) str_append_c(s, *p);
continue;
}
errno = 0;
char *q = NULL;
*** 428,438 ****
const str_pair_t *src_sp = name_at(n, depth - 1);
for (size_t i = 0; i < depth; i++, src_sp++) {
str_pair_t copy = { 0 };
! str_pair_init(©, n->nm_ops);
if (!str_pair_copy(src_sp, ©)) {
str_pair_fini(©);
name_fini(dest);
return (B_FALSE);
}
--- 428,438 ----
const str_pair_t *src_sp = name_at(n, depth - 1);
for (size_t i = 0; i < depth; i++, src_sp++) {
str_pair_t copy = { 0 };
! (void) str_pair_init(©, n->nm_ops);
if (!str_pair_copy(src_sp, ©)) {
str_pair_fini(©);
name_fini(dest);
return (B_FALSE);
}