Skip to content

Commit

Permalink
Remove now-redundant hidden-liinkage attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
wjk committed Nov 27, 2018
1 parent f3bd1d6 commit 93d9282
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/libnv/libsbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ struct sbuf {
int s_flags; /* flags, unused */
};

__attribute__((visibility("hidden")))
struct sbuf *sbuf_new_auto(void) {
struct sbuf *sb = calloc(1, sizeof(*sb));
sb->s_buf = malloc(1024);
Expand All @@ -21,21 +20,18 @@ struct sbuf *sbuf_new_auto(void) {
return sb;
}

__attribute__((visibility("hidden")))
void sbuf_clear(struct sbuf *sb) {
free(sb->s_buf);
sb->s_buf = malloc(1024);
sb->s_size = 1024;
sb->s_len = 0;
}

__attribute__((visibility("hidden")))
int sbuf_setpos(struct sbuf *sb, int pos) {
// Unimplemented.
return sb->s_len;
}

__attribute__((visibility("hidden")))
int sbuf_bcat(struct sbuf *sb, const void *ptr, size_t len) {
if ((sb->s_len + len) > sb->s_size) {
sb->s_size *= 2;
Expand All @@ -47,7 +43,6 @@ int sbuf_bcat(struct sbuf *sb, const void *ptr, size_t len) {
return sb->s_len;
}

__attribute__((visibility("hidden")))
int sbuf_bcpy(struct sbuf *sb, const void *ptr, size_t len) {
if (len > sb->s_size) {
sb->s_size *= 2;
Expand All @@ -59,25 +54,21 @@ int sbuf_bcpy(struct sbuf *sb, const void *ptr, size_t len) {
return sb->s_len;
}

__attribute__((visibility("hidden")))
int sbuf_cat(struct sbuf *sb, const char *str) {
return sbuf_bcat(sb, str, (int)strlen(str) * sizeof(char));
}

__attribute__((visibility("hidden")))
int sbuf_cpy(struct sbuf *sb, const char *str) {
return sbuf_bcpy(sb, str, (int)strlen(str) * sizeof(char));
}

__attribute__((visibility("hidden")))
int sbuf_vprintf(struct sbuf *sb, const char *fmt, va_list ap) {
char *str; vasprintf(&str, fmt, ap);
int ret = sbuf_cat(sb, str);
free(str);
return ret;
}

__attribute__((visibility("hidden")))
int sbuf_printf(struct sbuf *sb, const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
Expand All @@ -86,46 +77,38 @@ int sbuf_printf(struct sbuf *sb, const char *fmt, ...) {
return ret;
}

__attribute__((visibility("hidden")))
int sbuf_putc(struct sbuf *sb, int c) {
return sbuf_bcat(sb, &c, sizeof(int));
}

__attribute__((visibility("hidden")))
int sbuf_trim(struct sbuf *sb) {
// Don't know what this does.
return 0;
}

__attribute__((visibility("hidden")))
int sbuf_overflowed(struct sbuf *sb) {
// Don't know what this does.
return 0;
}

__attribute__((visibility("hidden")))
void sbuf_finish(struct sbuf *sb) {
// Don't know what this does.
}

__attribute__((visibility("hidden")))
char *sbuf_data(struct sbuf *sb) {
bzero(sb->s_buf + sb->s_len, sb->s_size - sb->s_len);
return sb->s_buf;
}

__attribute__((visibility("hidden")))
int sbuf_len(struct sbuf *sb) {
return sb->s_len;
}

__attribute__((visibility("hidden")))
int sbuf_done(struct sbuf *sb) {
// Don't know what this does.
return 0;
}

__attribute__((visibility("hidden")))
void sbuf_delete(struct sbuf *sb) {
free(sb->s_buf);
free(sb);
Expand Down

0 comments on commit 93d9282

Please sign in to comment.