X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=aft.c;h=f690e81951b4c7911c2f726b36fee9a673badce7;hb=ac9cc8f21ddeb821134e657f509bb83cec8c1da4;hp=e0bde7fc78c8365f33aa8e5aae9f751a3dabb751;hpb=26243a4b963bc3c59020b0469f1e469025da0ad8;p=paraslash.git diff --git a/aft.c b/aft.c index e0bde7fc..f690e819 100644 --- a/aft.c +++ b/aft.c @@ -412,7 +412,7 @@ static void load_chunk_table(struct afh_info *afhi, const struct osl_object *ct) return; } sz = PARA_MIN(((size_t)afhi->chunks_total + 1) * 4, ct->size) + 1; - afhi->chunk_table = para_malloc(sz); + afhi->chunk_table = alloc(sz); for (i = 0; i <= afhi->chunks_total && i * 4 + 3 < ct->size; i++) afhi->chunk_table[i] = read_u32(ct->data + 4 * i); } @@ -1066,7 +1066,7 @@ again: if (ret < 0) return ret; if (!d->hash) - d->hash = para_malloc(HASH_SIZE); + d->hash = alloc(HASH_SIZE); memcpy(d->hash, tmp_hash, HASH_SIZE); free(d->path); ret = get_audio_file_path_of_row(current_aft_row, &d->path); @@ -1224,7 +1224,7 @@ static int sort_matching_paths(struct ls_options *options) int (*compar)(const void *, const void *); int i; - options->data_ptr = para_malloc(nmemb * sizeof(*options->data_ptr)); + options->data_ptr = arr_alloc(nmemb, sizeof(*options->data_ptr)); for (i = 0; i < nmemb; i++) options->data_ptr[i] = options->data + i; @@ -1317,8 +1317,8 @@ static int prepare_ls_row(struct osl_row *row, void *ls_opts) if (options->num_matching_paths > options->array_size) { options->array_size++; options->array_size *= 2; - options->data = para_realloc(options->data, options->array_size - * sizeof(*options->data)); + options->data = arr_realloc(options->data, options->array_size, + sizeof(*options->data)); } d = options->data + tmp; ret = get_afsi_of_row(aft_row, &d->afsi); @@ -1424,7 +1424,7 @@ static int com_ls(struct command_context *cc, struct lls_parse_result *lpr) ret = lls_serialize_parse_result(lpr, cmd, NULL, &query.size); assert(ret >= 0); query.size += sizeof(*opts); - query.data = para_malloc(query.size); + query.data = alloc(query.size); opts = query.data; memset(opts, 0, sizeof(*opts)); slpr = query.data + sizeof(*opts); @@ -1553,7 +1553,7 @@ static void save_add_callback_buffer(unsigned char *hash, const char *path, size_t afhi_size = sizeof_afhi_buf(afhi); size_t size = CAB_PATH_OFFSET + path_len + afhi_size + sizeof_chunk_table(afhi) + slpr_size; - char *buf = para_malloc(size); + char *buf = alloc(size); uint32_t pos; assert(size <= ~(uint32_t)0); @@ -2320,7 +2320,7 @@ static int com_setatt_callback(struct afs_callback_arg *aca) goto out; /* no attribute modifier given */ goto set_atts; } - p = para_malloc(len); + p = alloc(len); memcpy(p, arg, len - 1); p[len - 1] = '\0'; ret = get_attribute_bitnum_by_name(p, &bitnum);