]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
string: Rename para_calloc() -> zalloc().
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 9 Nov 2021 17:41:17 +0000 (18:41 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 29 Jul 2022 17:22:09 +0000 (19:22 +0200)
Reword the documentation a bit since the function has never been a
wrapper for calloc(3). No code changes.

44 files changed:
aacdec_filter.c
afh_recv.c
alsa_mix.c
alsa_write.c
amp_filter.c
audiod.c
audiod_command.c
buffer_tree.c
check_wav.c
client_common.c
compress_filter.c
dccp_send.c
fec.c
fecdec_filter.c
file_write.c
filter.c
flac_afh.c
flacdec_filter.c
grab_client.c
http_recv.c
imdct.c
mood.c
mp.c
mp3dec_filter.c
ogg_afh_common.c
oggdec_filter.c
opusdec_filter.c
oss_write.c
play.c
prebuffer_filter.c
resample_filter.c
ringbuffer.c
send_common.c
sideband.c
signal.c
spxdec_filter.c
string.c
string.h
sync_filter.c
udp_send.c
vss.c
wma_afh.c
wmadec_filter.c
write.c

index 694e399aac5302a3264b8ac1d3d57fe1e7dbd4b7..64baa48c7f850c2f26c41e9354ba5ece694c3ef2 100644 (file)
@@ -52,7 +52,7 @@ static int aacdec_execute(struct btr_node *btrn, const char *cmd, char **result)
 static void aacdec_open(struct filter_node *fn)
 {
        NeAACDecConfigurationPtr c;
-       struct private_aacdec_data *padd = para_calloc(sizeof(*padd));
+       struct private_aacdec_data *padd = zalloc(sizeof(*padd));
 
        padd->handle = NeAACDecOpen();
        c = NeAACDecGetCurrentConfiguration(padd->handle);
index e7f85a1bd5a6dce0c8c256b22e52e2c1c9bf9ece..e9d24e41f0a75d400807c16da03d0953abf15d90 100644 (file)
@@ -75,7 +75,7 @@ static int afh_recv_open(struct receiver_node *rn)
 
        if (!fn || *fn == '\0')
                return -E_AFH_RECV_BAD_FILENAME;
-       rn->private_data = pard = para_calloc(sizeof(*pard));
+       rn->private_data = pard = zalloc(sizeof(*pard));
        afhi = &pard->afhi;
        ret = mmap_full_file(fn, O_RDONLY, &pard->map,
                &pard->map_size, &pard->fd);
index 1d81e5d9dbabbcef772d182eabe6a03ba5a51915..af4adc46382da236e7fec5786fa3d40234f16546 100644 (file)
@@ -52,7 +52,7 @@ static int alsa_mix_open(const char *dev, struct mixer_handle **handle)
 
        PARA_INFO_LOG("snd_mixer_{open,attach,register,load}\n");
        *handle = NULL;
-       h = para_calloc(sizeof(*h));
+       h = zalloc(sizeof(*h));
        h->card = para_strdup(dev? dev : "hw:0");
        ret = snd_mixer_open(&h->mixer, 0);
        if (ret < 0) {
index bbbf8b650ac86c4952ac46f22c166583018bfb88..1dee5ac812eed336f007c8ee25b3cca2eb1e9eb4 100644 (file)
@@ -296,7 +296,7 @@ again:
 
                if (bytes == 0) /* no data available */
                        return 0;
-               pad = wn->private_data = para_calloc(sizeof(*pad));
+               pad = wn->private_data = zalloc(sizeof(*pad));
                ret = get_btr_sample_rate(btrn, &val);
                if (ret < 0)
                        goto err;
index 54ff0adeaabdca3efceb640ae2e381c3075d75c3..3f0aa11e34d061b584da3e21655124564078d5fc 100644 (file)
@@ -29,7 +29,7 @@ static void amp_close(struct filter_node *fn)
 
 static void amp_open(struct filter_node *fn)
 {
-       struct private_amp_data *pad = para_calloc(sizeof(*pad));
+       struct private_amp_data *pad = zalloc(sizeof(*pad));
        unsigned given = FILTER_CMD_OPT_GIVEN(AMP, AMP, fn->lpr);
        uint32_t amp_arg = FILTER_CMD_OPT_UINT32_VAL(AMP, AMP, fn->lpr);
 
index 305fcf3f10ef2fe51ed05c95a68352f486769392..2a59d56a1b79c28996489bd374b407e8aeb80b65 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -564,7 +564,7 @@ static void open_filters(struct slot_info *s)
                return;
        PARA_INFO_LOG("opening %s filters\n", audio_formats[s->format]);
        assert(s->fns == NULL);
-       s->fns = para_calloc(nf * sizeof(struct filter_node));
+       s->fns = zalloc(nf * sizeof(struct filter_node));
        parent = s->receiver_node->btrn;
        for (i = 0; i < nf; i++) {
                char buf[20];
@@ -602,7 +602,7 @@ static void open_writers(struct slot_info *s)
        struct btr_node *parent = s->fns[a->num_filters - 1].btrn;
 
        assert(s->wns == NULL);
-       s->wns = para_calloc(PARA_MAX(1U, a->num_writers)
+       s->wns = zalloc(PARA_MAX(1U, a->num_writers)
                * sizeof(struct writer_node));
        for (i = 0; i < a->num_writers; i++) {
                wn = s->wns + i;
@@ -629,7 +629,7 @@ static int open_receiver(int format)
        if (ret < 0)
                return ret;
        slot_num = ret;
-       rn = para_calloc(sizeof(*rn));
+       rn = zalloc(sizeof(*rn));
        rn->receiver = r;
        rn->lpr = a->receiver_lpr;
        rn->btrn = btr_new_node(&(struct btr_node_description)
index bb54dfab87f7965a18f6cccbe6bc4077c147fa29..89fdc1acabdeb45a9f708a2a8ca72cdb1c85ffa3 100644 (file)
@@ -114,7 +114,7 @@ static int stat_client_add(int fd, uint64_t mask, int parser_friendly)
        ret = dup(fd);
        if (ret < 0)
                return -ERRNO_TO_PARA_ERROR(errno);
-       new_client = para_calloc(sizeof(*new_client));
+       new_client = zalloc(sizeof(*new_client));
        new_client->fd = ret;
        PARA_INFO_LOG("adding client on fd %d\n", new_client->fd);
        new_client->item_mask = mask;
index b80e707a5e432fba824a8e660ca66009c47d0427..4c17e824bb81631929fc5526140d38f74d52b1f1 100644 (file)
@@ -307,7 +307,7 @@ out:
  */
 static struct btr_buffer *new_btrb(char *buf, size_t size)
 {
-       struct btr_buffer *btrb = para_calloc(sizeof(*btrb));
+       struct btr_buffer *btrb = zalloc(sizeof(*btrb));
 
        btrb->buf = buf;
        btrb->size = size;
@@ -354,7 +354,7 @@ static void add_btrb_to_children(struct btr_buffer *btrb,
        if (btrn->start.tv_sec == 0)
                btrn->start = *now;
        FOR_EACH_CHILD(ch, btrn) {
-               struct btr_buffer_reference *br = para_calloc(sizeof(*br));
+               struct btr_buffer_reference *br = zalloc(sizeof(*br));
                br->btrb = btrb;
                br->consumed = consumed;
                list_add_tail(&br->node, &ch->input_queue);
@@ -1012,7 +1012,7 @@ next:
                        buf1, sz1, buf2, sz2, buf, sz);
                memcpy(buf, buf1, sz1);
                memcpy(buf + sz1, buf2, sz2);
-               br = para_calloc(sizeof(*br));
+               br = zalloc(sizeof(*br));
                br->btrb = new_btrb(buf, sz);
                br->btrb->refcount = 1;
                br->consumed = 0;
@@ -1073,7 +1073,7 @@ static int merge_input(struct btr_node *btrn)
        memcpy(buf, bufs[0], szs[0]);
        memcpy(buf + szs[0], bufs[1], szs[1]);
 
-       br = para_calloc(sizeof(*br));
+       br = zalloc(sizeof(*br));
        br->btrb = new_btrb(buf, sz);
        br->btrb->refcount = 1;
 
index 89ebdacc0805e9575acea92d09ed3b2dd81ebac3..c24a402eccb46a5ece335c99cab75f3c982b71fb 100644 (file)
@@ -207,7 +207,7 @@ struct check_wav_context *check_wav_init(struct btr_node *parent,
                struct btr_node *child, struct wav_params *params,
                struct btr_node **cw_btrn)
 {
-       struct check_wav_context *cwc = para_calloc(sizeof(*cwc));
+       struct check_wav_context *cwc = zalloc(sizeof(*cwc));
 
        cwc->state = CWS_NEED_HEADER;
        cwc->min_iqs = WAV_HEADER_LEN;
index 68c3747bc62d2cefe2eceb25f14c46f5045b6821..a4f48a2755454aeffa9c6da5f1e03c39f0f636a9 100644 (file)
@@ -584,7 +584,7 @@ int client_parse_config(int argc, char *argv[], struct client_task **ct_ptr,
        PARA_INFO_LOG("user: %s\n", user);
        PARA_INFO_LOG("key file: %s\n", kf);
        PARA_INFO_LOG("loglevel: %d\n", ll);
-       ct = para_calloc(sizeof(*ct));
+       ct = zalloc(sizeof(*ct));
        ct->scc.fd = -1;
        ct->lpr = lpr;
        ct->key_file = kf;
index 7bd3027105f95ba4ab1f3adf5d89ec2ad9722755..dd892ca2119506abe6bf6c7a158c651063598be2 100644 (file)
@@ -116,7 +116,7 @@ err:
 
 static void compress_open(struct filter_node *fn)
 {
-       struct private_compress_data *pcd = para_calloc(sizeof(*pcd));
+       struct private_compress_data *pcd = zalloc(sizeof(*pcd));
        uint32_t inertia = U32_OPTVAL(INERTIA, fn->lpr);
        uint32_t aggressiveness = U32_OPTVAL(AGGRESSIVENESS, fn->lpr);
 
index bca7ad6781e29d2bb1bea686d3971e02ede59909..475177071c8428ca5a67ecf6966b5d796750b247 100644 (file)
@@ -148,7 +148,7 @@ static void dccp_post_select(fd_set *rfds, __a_unused fd_set *wfds)
                shutdown_client(sc, dss);
                return;
        }
-       dfc = para_calloc(sizeof(*dfc));
+       dfc = zalloc(sizeof(*dfc));
        sc->private_data = dfc;
        k = OPT_UINT32_VAL(DCCP_DATA_SLICES_PER_GROUP);
        n = OPT_UINT32_VAL(DCCP_SLICES_PER_GROUP);
diff --git a/fec.c b/fec.c
index 056b923eb30c0351912876dfcb32246a8ffe83c5..ce2bc4fd729042261d1c3349647df55cf7d28117 100644 (file)
--- a/fec.c
+++ b/fec.c
@@ -610,7 +610,7 @@ int fec_decode(struct fec_parms *parms, unsigned char **data, int *idx,
        slice = alloc(k * sizeof(unsigned char *));
        for (row = 0; row < k; row++) {
                if (idx[row] >= k) {
-                       slice[row] = para_calloc(sz);
+                       slice[row] = zalloc(sz);
                        for (col = 0; col < k; col++)
                                addmul(slice[row], data[col],
                                        m_dec[row * k + col], sz);
index d7162adc64c172cece6573be3e6bd90112227a52..8efb2af7719d189723a52651cda95c84a8958e2d 100644 (file)
@@ -226,7 +226,7 @@ static int add_slice(char *buf, struct fecdec_group *fg)
        if (fg->num_slices == 0) {
                fg->num_slices = fg->h.slices_per_group;
                fg->idx = alloc(fg->num_slices * sizeof(int));
-               fg->data = para_calloc(fg->num_slices * sizeof(unsigned char *));
+               fg->data = zalloc(fg->num_slices * sizeof(unsigned char *));
        }
        r = fg->num_received_slices;
        /* Check if we already have this slice. */
@@ -471,7 +471,7 @@ out:
 static void fecdec_open(struct filter_node *fn)
 {
        struct private_fecdec_data *pfd;
-       pfd = para_calloc(sizeof(*pfd));
+       pfd = zalloc(sizeof(*pfd));
        fn->private_data = pfd;
        fn->min_iqs = FEC_HEADER_SIZE;
 }
index 9a5ed5d7fab7dc01fe46fa5ecab6940ea3a28828..eb615153578741f7cdd2a37fb568ea8c5fcaf719 100644 (file)
@@ -64,7 +64,7 @@ static int prepare_output_file(struct writer_node *wn)
                close(fd);
                return ret;
        }
-       pfwd = wn->private_data = para_calloc(sizeof(*pfwd));
+       pfwd = wn->private_data = zalloc(sizeof(*pfwd));
        pfwd->fd = fd;
        return 1;
 }
index 05d1d4d380d340b5d42b73839a3d1c081d66b3b9..04640692993bf3413f4d47dbc10add10899148d9 100644 (file)
--- a/filter.c
+++ b/filter.c
@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
                struct filter_node *fn;
                struct task_info ti;
 
-               fn = fns[i] = para_calloc(sizeof(*fn));
+               fn = fns[i] = zalloc(sizeof(*fn));
                fn->filter_num = filter_setup(fa, &fn->conf, &filter_lpr);
                name = filter_name(fn->filter_num);
                fn->lpr = filter_lpr;
index 6e23683937f6932aaa739095ef8281fc9075da55..730f954bdd80294ef406f45122d6f7cfcffbfc7b 100644 (file)
@@ -481,7 +481,7 @@ static int flac_rewrite_tags(const char *map, size_t map_bytes,
        FLAC__Metadata_Iterator *iter;
        FLAC__StreamMetadata *b = NULL;
        FLAC__bool ok;
-       struct private_flac_afh_data *pfad = para_calloc(sizeof(*pfad));
+       struct private_flac_afh_data *pfad = zalloc(sizeof(*pfad));
 
        pfad->map = map;
        pfad->map_bytes = map_bytes;
index f859c840735626cae4e18e9c9a14e2d40013698e..d3a481cf07bf06988224a6efaeae8fac2995be62 100644 (file)
@@ -286,7 +286,7 @@ static void flacdec_close(struct filter_node *fn)
 
 static void flacdec_open(struct filter_node *fn)
 {
-       struct private_flacdec_data *pfd = para_calloc(sizeof(*pfd));
+       struct private_flacdec_data *pfd = zalloc(sizeof(*pfd));
        fn->private_data = pfd;
        fn->min_iqs = 0;
 }
index 8370649301906eaef68a4c30d1b1f3975283dea8..8191e114946a0e6ca304f24c0e12adca856a59cf 100644 (file)
@@ -261,7 +261,7 @@ static int gc_check_args(struct lls_parse_result *lpr, struct grab_client *gc)
 int grab_client_new(int fd, struct lls_parse_result *lpr, struct sched *s)
 {
        int ret;
-       struct grab_client *gc = para_calloc(sizeof(struct grab_client));
+       struct grab_client *gc = zalloc(sizeof(struct grab_client));
 
        ret = gc_check_args(lpr, gc);
        if (ret < 0)
index 1fb60bad810d86dbbb0098a3714c2caa3d9e835b..8f9f1af11d841b6344fd2f864462b6cb7a6987e2 100644 (file)
@@ -160,7 +160,7 @@ static int http_recv_open(struct receiver_node *rn)
                close(fd);
                return ret;
        }
-       rn->private_data = phd = para_calloc(sizeof(struct private_http_recv_data));
+       rn->private_data = phd = zalloc(sizeof(struct private_http_recv_data));
        rn->fd = fd;
        phd->status = HTTP_CONNECTED;
        rn->btrp = btr_pool_new("http_recv", 320 * 1024);
diff --git a/imdct.c b/imdct.c
index 518d4782e8f33de5fd3c9d8ff1ce61cf25ead8e1..d49ae852a82167524674f708bf1fb21250be2331 100644 (file)
--- a/imdct.c
+++ b/imdct.c
@@ -366,7 +366,7 @@ int imdct_init(int nbits, struct mdct_context **result)
        double alpha;
        struct mdct_context *s;
 
-       s = para_calloc(sizeof(*s));
+       s = zalloc(sizeof(*s));
        n = 1 << nbits;
        s->nbits = nbits;
        s->n = n;
diff --git a/mood.c b/mood.c
index b3f007b68fe07c46f500d1aaa7dffdfe9503f451..161d8df0bb344c336f0754e72b127948330bc0a3 100644 (file)
--- a/mood.c
+++ b/mood.c
@@ -138,7 +138,7 @@ static void destroy_mood(struct mood *m)
 
 static struct mood *alloc_new_mood(const char *name)
 {
-       struct mood *m = para_calloc(sizeof(struct mood));
+       struct mood *m = zalloc(sizeof(struct mood));
        if (name)
                m->name = para_strdup(name);
        return m;
diff --git a/mp.c b/mp.c
index f85ded85184eeff8a4f6d2495d4435c86d06737c..fb5a0c07472c46bb7d5ca42fcb4061d54755f96b 100644 (file)
--- a/mp.c
+++ b/mp.c
@@ -518,7 +518,7 @@ int mp_init(const char *definition, int nbytes, struct mp_context **result,
                        *errmsg = NULL;
                return 0;
        }
-       ctx = para_calloc(sizeof(*ctx));
+       ctx = zalloc(sizeof(*ctx));
        ctx->errmsg = NULL;
        ctx->ast = NULL;
 
index 69112c76c6fe49dffd78917b804e1e2b8f41daa2..9403a71d59907e2d4d91eeb6b9d5f2a32139438b 100644 (file)
@@ -166,7 +166,7 @@ err:
 
 static void mp3dec_open(struct filter_node *fn)
 {
-       struct private_mp3dec_data *pmd = para_calloc(sizeof(*pmd));
+       struct private_mp3dec_data *pmd = zalloc(sizeof(*pmd));
 
        fn->private_data = pmd;
        mad_stream_init(&pmd->stream);
index 155a1899133846eef148db29d971637c8cbb2cd9..3909a2916b09fb455a19b53f785d9e680bb38b13 100644 (file)
@@ -367,7 +367,7 @@ struct oac_custom_header {
  */
 struct oac_custom_header *oac_custom_header_new(void)
 {
-       return para_calloc(sizeof(struct oac_custom_header));
+       return zalloc(sizeof(struct oac_custom_header));
 }
 
 /**
index 143648c88ab5bd5afac3af31714b0c70d4ecb72a..b05691c3f57ac60efc430f6518b077ed7697e0a9 100644 (file)
@@ -88,7 +88,7 @@ static const ov_callbacks ovc = {
 
 static void ogg_open(struct filter_node *fn)
 {
-       fn->private_data = para_calloc(sizeof(struct private_oggdec_data));
+       fn->private_data = zalloc(sizeof(struct private_oggdec_data));
        fn->min_iqs = 8000;
 }
 
index 7878b422ad4bb65a584039be38d10bcfd67a36b0..942cce37fc5de28676cb2b099b397c39b3f74da0 100644 (file)
@@ -86,7 +86,7 @@ static int opusdec_execute(struct btr_node *btrn, const char *cmd,
 
 static void opusdec_open(struct filter_node *fn)
 {
-       struct opusdec_context *ctx = para_calloc(sizeof(*ctx));
+       struct opusdec_context *ctx = zalloc(sizeof(*ctx));
 
        ogg_sync_init(&ctx->oy);
        fn->private_data = ctx;
index 0565167c256a43bfe86a6442f195a320e1458db8..2afad677377825a8cafd48426fc965613c04b8a0 100644 (file)
@@ -101,7 +101,7 @@ static int oss_init(struct writer_node *wn, unsigned sample_rate,
 {
        int ret, format;
        unsigned ch, rate;
-       struct private_oss_write_data *powd = para_calloc(sizeof(*powd));
+       struct private_oss_write_data *powd = zalloc(sizeof(*powd));
        const char *dev = WRITE_CMD_OPT_STRING_VAL(OSS, DEVICE, wn->lpr);
 
        PARA_INFO_LOG("opening %s\n", dev);
diff --git a/play.c b/play.c
index 7c4118506b33a4541cd8330993aef4cda68c3dd7..d46c16cdfc4222816d52b2d9e248bee07b880025 100644 (file)
--- a/play.c
+++ b/play.c
@@ -1259,7 +1259,7 @@ int main(int argc, char *argv[])
        session_open();
        num_inputs = lls_num_inputs(play_lpr);
        init_shuffle_map();
-       pt->invalid = para_calloc(sizeof(*pt->invalid) * num_inputs);
+       pt->invalid = zalloc(sizeof(*pt->invalid) * num_inputs);
        pt->rq = CRT_FILE_CHANGE;
        pt->playing = true;
        pt->task = task_register(&(struct task_info){
index 9a801900c157e1da2da979c92d7bd60d03e21b9c..ef66ffa13f2308eb4ac1571d9314ba4aee17e8b2 100644 (file)
@@ -80,7 +80,7 @@ fail:
 
 static void prebuffer_open(struct filter_node *fn)
 {
-       struct private_prebuffer_data *ppd = para_calloc(sizeof(*ppd));
+       struct private_prebuffer_data *ppd = zalloc(sizeof(*ppd));
        fn->private_data = ppd;
 }
 
index acbf1b417f764f1c1453640d4ae03edfc7ec170f..6540c3e938f7984b2085ea3209100457ac76de00 100644 (file)
@@ -51,7 +51,7 @@ static void resample_close(struct filter_node *fn)
 
 static void resample_open(struct filter_node *fn)
 {
-       struct resample_context *ctx = para_calloc(sizeof(*ctx));
+       struct resample_context *ctx = zalloc(sizeof(*ctx));
        struct btr_node *btrn = fn->btrn;
        struct wav_params wp;
 
index 76e2d7afc8ab7caea1207a36c37c8b6452af2816..0e706f0f1ad6e906732f3bc95e8b653da53f9a6d 100644 (file)
@@ -41,8 +41,8 @@ struct ringbuffer
  */
 struct ringbuffer *ringbuffer_new(unsigned size)
 {
-       struct ringbuffer *rb = para_calloc(sizeof(struct ringbuffer));
-       rb->entries = para_calloc(size * sizeof(void *));
+       struct ringbuffer *rb = zalloc(sizeof(struct ringbuffer));
+       rb->entries = zalloc(size * sizeof(void *));
        rb->size = size;
        return rb;
 }
index 4574c6979f2593b58d99471543e9542eb5fbe526..492f275d67e5560200460891aa74cfc120bf013b 100644 (file)
@@ -391,7 +391,7 @@ struct sender_client *accept_sender_client(struct sender_status *ss, fd_set *rfd
                if (ret < 0)
                        goto close_fd_and_warn;
                ss->num_clients++;
-               sc = para_calloc(sizeof(*sc));
+               sc = zalloc(sizeof(*sc));
                sc->fd = fd;
                sc->name = para_strdup(remote_name(fd));
                sc->cq = cq_new(MAX_CQ_BYTES);
index cd549ddccb9d98fe43a4605b2c9632f6804490ad..d4876234a192a956f112c48f871ed1fb0d5321b7 100644 (file)
@@ -37,7 +37,7 @@ struct sb_context {
 struct sb_context *sb_new_recv(size_t max_size, sb_transformation t,
                void *trafo_context)
 {
-       struct sb_context *c = para_calloc(sizeof(*c));
+       struct sb_context *c = zalloc(sizeof(*c));
 
        c->max_size = max_size;
        c->trafo = t;
@@ -62,7 +62,7 @@ struct sb_context *sb_new_recv(size_t max_size, sb_transformation t,
 struct sb_context *sb_new_send(struct sb_buffer *sbb, bool dont_free,
                sb_transformation t, void *trafo_context)
 {
-       struct sb_context *c = para_calloc(sizeof(*c));
+       struct sb_context *c = zalloc(sizeof(*c));
        struct iovec src, dst, *srcp, *dstp;
 
        assert(sbb);
index 32d6ab6624e5f493ac393b630a603c0968f11497..4e876cfe6f6d01cb6b51ca05c283a8a466e7b286 100644 (file)
--- a/signal.c
+++ b/signal.c
@@ -48,7 +48,7 @@ struct signal_task *signal_init_or_die(void)
        ret = mark_fd_nonblocking(signal_pipe[1]);
        if (ret < 0)
                goto err_out;
-       st = para_calloc(sizeof(*st));
+       st = zalloc(sizeof(*st));
        st->fd = signal_pipe[0];
        return st;
 err_out:
index 1a4fe9a716ce0419b813ce269f8b2cd8c4d7cfc9..18b50267af27ec26fc0fe3a09cb8a6a9425d4e9b 100644 (file)
@@ -81,7 +81,7 @@ struct private_spxdec_data {
 
 static void spxdec_open(struct filter_node *fn)
 {
-       struct private_spxdec_data *psd = para_calloc(sizeof(*psd));
+       struct private_spxdec_data *psd = zalloc(sizeof(*psd));
 
        fn->private_data = psd;
        fn->min_iqs = 200;
index b75d0af33959619a01a812b7838389ea1b95761a..bbc322eb52dd2c529bd0622e84b2f2eeabe290fb 100644 (file)
--- a/string.c
+++ b/string.c
@@ -70,18 +70,16 @@ __must_check __malloc void *alloc(size_t size)
 }
 
 /**
- * Paraslash's version of calloc().
+ * Allocate and initialize memory.
  *
  * \param size The desired new size.
  *
- * A wrapper for calloc(3) which exits on errors.
- *
  * \return A pointer to the allocated and zeroed-out memory, which is suitably
  * aligned for any kind of variable.
  *
- * \sa calloc(3)
+ * \sa \ref alloc(), calloc(3).
  */
-__must_check __malloc void *para_calloc(size_t size)
+__must_check __malloc void *zalloc(size_t size)
 {
        void *ret = alloc(size);
 
index 02e315776d8833000f3375fac0cd7ce13f84f2ee..29dc388f9373b185117974e41d3ac7c9c1c45a6b 100644 (file)
--- a/string.h
+++ b/string.h
@@ -69,7 +69,7 @@ int for_each_line(unsigned flags, char *buf, size_t size,
 
 __must_check void *para_realloc(void *p, size_t size);
 __must_check __malloc void *alloc(size_t size);
-__must_check __malloc void *para_calloc(size_t size);
+__must_check __malloc void *zalloc(size_t size);
 __must_check __malloc char *para_strdup(const char *s);
 
 __printf_2_0 unsigned xvasprintf(char **result, const char *fmt, va_list ap);
index 6fdf8e4664c8dce0b46ab233a85d8ef218a8a032..9c1767e41aaa4cd65c790a48ed6078cf98d43aaf 100644 (file)
@@ -102,7 +102,7 @@ static void sync_open(struct filter_node *fn)
        unsigned buddy_given;
        const struct lls_opt_result *r_b;
 
-       ctx = fn->private_data = para_calloc(sizeof(*ctx));
+       ctx = fn->private_data = zalloc(sizeof(*ctx));
        init_list_head(&ctx->buddies);
 
        /* create socket to listen for incoming packets */
index 68d75e3c3ef87dc089a3a1eec4d59fb647e73e44..baeec439fac345ce7856891a25fe38d84a363267 100644 (file)
@@ -326,8 +326,8 @@ static int udp_com_add(struct sender_command_data *scd)
                                sc->name);
                return -E_TARGET_EXISTS;
        }
-       ut = para_calloc(sizeof(*ut));
-       sc = para_calloc(sizeof(*sc));
+       ut = zalloc(sizeof(*ut));
+       sc = zalloc(sizeof(*sc));
        ut->fcp.slices_per_group      = scd->slices_per_group;
        ut->fcp.data_slices_per_group = scd->data_slices_per_group;
        ut->fcp.init_fec              = udp_init_fec;
diff --git a/vss.c b/vss.c
index 00dff8a8c28d8753b000ce7fbb9c7b47ecc63ba3..c6c57845e0b7f682e2fbe6d697e09b2403f9b899 100644 (file)
--- a/vss.c
+++ b/vss.c
@@ -671,7 +671,7 @@ size_t vss_get_fec_eof_packet(const char **buf)
 struct fec_client *vss_add_fec_client(struct sender_client *sc,
                                      struct fec_client_parms *fcp)
 {
-       struct fec_client *fc = para_calloc(sizeof(*fc));
+       struct fec_client *fc = zalloc(sizeof(*fc));
 
        fc->sc  = sc;
        fc->fcp = fcp;
index f2afae3bfda9430265c10d708be4f343f9b3f52a..a6fbecca59252e9ee403d7c9e0f454a0eff16e13 100644 (file)
--- a/wma_afh.c
+++ b/wma_afh.c
@@ -318,7 +318,7 @@ static int convert_utf8_to_utf16(char *src, char **dst)
        int ret;
 
        if (!src || !*src) {
-               *dst = para_calloc(2);
+               *dst = zalloc(2);
                return 0;
        }
        /*
index 88f69896bf7ea7fd3d2e80bad28a014e079b5c7c..1f308785fc9e026f53f72280a6066945b0748b78 100644 (file)
@@ -428,7 +428,7 @@ static int wma_decode_init(char *initial_buf, int len, struct private_wmadec_dat
        int ret, i;
 
        PARA_NOTICE_LOG("initial buf: %d bytes\n", len);
-       pwd = para_calloc(sizeof(*pwd));
+       pwd = zalloc(sizeof(*pwd));
        ret = read_asf_header(initial_buf, len, &pwd->ahi);
        if (ret <= 0) {
                free(pwd);
diff --git a/write.c b/write.c
index acfb94605b53d259a89ea41e75507b81e2cb2ca4..9e0f22bdafae79d502ae2628fa1a07d6a1ccaf34 100644 (file)
--- a/write.c
+++ b/write.c
@@ -89,7 +89,7 @@ static int setup_and_schedule(struct lls_parse_result *lpr)
        }, &s);
 
        n = writer_given? writer_given : 1;
-       wns = para_calloc(n * sizeof(*wns));
+       wns = zalloc(n * sizeof(*wns));
        for (i = 0; i < n; i++) {
                const char *arg = i < writer_given?
                        lls_string_val(i, OPT_RESULT(WRITER, lpr)) : NULL;