diff --git a/src/acconfig.h b/src/acconfig.h index 12f6bd9fa8a2ac38a498446308d6dbf4863d2cd6..320c04eb30caa60a8c2d66f2a748484cc4cf8624 100644 --- a/src/acconfig.h +++ b/src/acconfig.h @@ -312,9 +312,6 @@ /* Define if you have memmem. */ #undef HAVE_MEMMEM -/* Define if you have memcpy. */ -#undef HAVE_MEMCPY - /* Define if you have strcoll */ #undef HAVE_STRCOLL diff --git a/src/array.c b/src/array.c index 2f32e37ab3cd0ad103cd2aa5014350e4f90361ce..e7c34c9f45245e1169fe41a8b9e76768984d2f18 100644 --- a/src/array.c +++ b/src/array.c @@ -417,8 +417,8 @@ PMOD_EXPORT struct array *array_insert(struct array *v,struct svalue *s,INT32 in v->flags); ret->type_field = v->type_field; - MEMCPY(ITEM(ret), ITEM(v), sizeof(struct svalue) * index); - MEMCPY(ITEM(ret)+index+1, ITEM(v)+index, + memcpy(ITEM(ret), ITEM(v), sizeof(struct svalue) * index); + memcpy(ITEM(ret)+index+1, ITEM(v)+index, sizeof(struct svalue) * (v->size-index)); assert_free_svalue (ITEM(ret) + index); if (v->refs == 1) { @@ -556,7 +556,7 @@ PMOD_EXPORT struct array *array_shrink(struct array *v, ptrdiff_t size) a->type_field = v->type_field; } - MEMCPY(ITEM(a), ITEM(v), size*sizeof(struct svalue)); + memcpy(ITEM(a), ITEM(v), size*sizeof(struct svalue)); v->size=0; free_array(v); return a; @@ -595,7 +595,7 @@ PMOD_EXPORT struct array *resize_array(struct array *a, INT32 size) } else { struct array *ret; ret = array_set_flags(low_allocate_array(size, size + 1), a->flags); - MEMCPY(ITEM(ret), ITEM(a), sizeof(struct svalue)*a->size); + memcpy(ITEM(ret), ITEM(a), sizeof(struct svalue)*a->size); ret->type_field = DO_NOT_WARN((TYPE_FIELD)(a->type_field | BIT_INT)); a->size=0; free_array(a); @@ -638,9 +638,9 @@ PMOD_EXPORT struct array *array_remove(struct array *v,INT32 index) a->type_field = v->type_field; if(index>0) - MEMCPY(ITEM(a), ITEM(v), index*sizeof(struct svalue)); + memcpy(ITEM(a), ITEM(v), index*sizeof(struct svalue)); if(v->size-index>1) - MEMCPY(ITEM(a)+index, + memcpy(ITEM(a)+index, ITEM(v)+index+1, (v->size-index-1)*sizeof(struct svalue)); v->size=0; @@ -2158,7 +2158,7 @@ PMOD_EXPORT void push_array_items(struct array *a) check_array_for_destruct(a); if(a->refs == 1) { - MEMCPY(Pike_sp,ITEM(a),sizeof(struct svalue)*a->size); + memcpy(Pike_sp,ITEM(a),sizeof(struct svalue)*a->size); Pike_sp += a->size; a->size=0; free_array(a); @@ -2255,7 +2255,7 @@ PMOD_EXPORT struct array *aggregate_array(INT32 args) a=allocate_array_no_init(args,0); if (args) { - MEMCPY((char *)ITEM(a),(char *)(Pike_sp-args),args*sizeof(struct svalue)); + memcpy((char *)ITEM(a),(char *)(Pike_sp-args),args*sizeof(struct svalue)); array_fix_type_field (a); Pike_sp-=args; DO_IF_DMALLOC(while(args--) dmalloc_touch_svalue(Pike_sp + args)); diff --git a/src/array.h b/src/array.h index 1333f709304b6afe2565d65ed7e73874a87d33d4..12d6f12dd5c14596e22ccb1d9c23a464ce4cc1b2 100644 --- a/src/array.h +++ b/src/array.h @@ -259,7 +259,7 @@ void assign_array_level( struct array *a, struct array *b, int level ); } END_ACCEPT_UNFINISHED_TYPE_FIELDS; \ /* Unless the user does something, the type field will contain */ \ /* BIT_MIXED|BIT_UNFINISHED from the allocation above. */ \ - MEMCPY((char *) (ITEM(base_sval[-1].u.array) + oldsize__), \ + memcpy((char *) (ITEM(base_sval[-1].u.array) + oldsize__), \ (char *) base_sval, diff__ * sizeof(struct svalue)); \ Pike_sp = base_sval; \ } \ diff --git a/src/backend.cmod b/src/backend.cmod index 84e339f7e1864b20928d1a892dcf807bb3c53723..486a571846fd455f0b68f3779045f32a5d14a523 100644 --- a/src/backend.cmod +++ b/src/backend.cmod @@ -2937,7 +2937,7 @@ static void pb_copy_selectors(struct pb_selectors *to, } } - MEMCPY(to->poll_fds, + memcpy(to->poll_fds, from->poll_fds, sizeof(struct pollfd)*from->num_in_poll); to->num_in_poll=from->num_in_poll; diff --git a/src/builtin_functions.c b/src/builtin_functions.c index e80141525cce231a462359b9c90eea2b71be89c2..77fa452e3287536fa7fa00791ae3f52625f6964c 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -662,7 +662,7 @@ PMOD_EXPORT void f_lower_case(INT32 args) ret = begin_wide_shared_string(orig->len, orig->size_shift); - MEMCPY(ret->str, orig->str, orig->len << orig->size_shift); + memcpy(ret->str, orig->str, orig->len << orig->size_shift); i = orig->len; @@ -738,7 +738,7 @@ PMOD_EXPORT void f_upper_case(INT32 args) } ret=begin_wide_shared_string(orig->len,orig->size_shift); - MEMCPY(ret->str, orig->str, orig->len << orig->size_shift); + memcpy(ret->str, orig->str, orig->len << orig->size_shift); i = orig->len; @@ -1725,7 +1725,7 @@ PMOD_EXPORT void f_string_to_unicode(INT32 args) * FIXME: Future optimization: Check if refcount is == 1, * and perform sufficient magic to be able to convert in place. */ - MEMCPY(out->str, in->str, len); + memcpy(out->str, in->str, len); #else /* Other endianness, may need to do byte-order conversion also. */ { @@ -1904,7 +1904,7 @@ PMOD_EXPORT void f_unicode_to_string(INT32 args) * FIXME: Future optimization: Perform sufficient magic * to do the conversion in place if the ref-count is == 1. */ - MEMCPY(out->str, (char *)(str0-len), len*2); + memcpy(out->str, (char *)(str0-len), len*2); } else { /* Reverse endian */ diff --git a/src/configure.in b/src/configure.in index 9798733eb0f24ae98e22a578ee19aed3c5850750..d805d81be695e25f4ffc10a9391ea7885bdefa92 100644 --- a/src/configure.in +++ b/src/configure.in @@ -5843,20 +5843,6 @@ char *d="gazonk"; ######################################################################## -MY_CHECK_FUNCTION(memcpy, -[ -#include <string.h> -char *a="foo bar gazonk"; -char foo[23]; -], [ - memcpy(foo, a, strlen(a)+1); - memcpy(foo, a+4, 3); - if(strcmp(foo,"bar bar gazonk")) exit(1); - exit(0); -]) - -######################################################################## - MY_CHECK_FUNCTION(memmove, [ #include <string.h> diff --git a/src/cpp.c b/src/cpp.c index 872798c16f47ba8fa94390738d8a2cb850a3af99..40f49c580f7feffff503100fe53bf8fd1f481249 100644 --- a/src/cpp.c +++ b/src/cpp.c @@ -1801,7 +1801,7 @@ static struct pike_string *recode_string(struct cpp *this, struct pike_string *d new_str = begin_shared_string(len); - MEMCPY(new_str->str, data->str, len); + memcpy(new_str->str, data->str, len); push_string(end_shared_string(new_str)); @@ -1855,7 +1855,7 @@ static struct pike_string *recode_string(struct cpp *this, struct pike_string *d new_str = begin_shared_string(data->len - len); - MEMCPY(new_str->str, data->str + len, data->len - len); + memcpy(new_str->str, data->str + len, data->len - len); push_string(end_shared_string(new_str)); @@ -1872,7 +1872,7 @@ static struct pike_string *recode_string(struct cpp *this, struct pike_string *d new_str = begin_shared_string(len); - MEMCPY(new_str->str, p, len); + memcpy(new_str->str, p, len); pop_stack(); ref_push_string(new_str = end_shared_string(new_str)); @@ -3638,17 +3638,17 @@ void add_predefine(const char *s) if(pos) { tmp->name=xalloc(pos-s+1); - MEMCPY(tmp->name,s,pos-s); + memcpy(tmp->name,s,pos-s); tmp->name[pos-s]=0; tmp->value=xalloc(s+strlen(s)-pos); - MEMCPY(tmp->value,pos+1,s+strlen(s)-pos); + memcpy(tmp->value,pos+1,s+strlen(s)-pos); }else{ tmp->name=xalloc(strlen(s)+1); - MEMCPY(tmp->name,s,strlen(s)+1); + memcpy(tmp->name,s,strlen(s)+1); tmp->value=xalloc(4); - MEMCPY(tmp->value," 1 ",4); + memcpy(tmp->value," 1 ",4); } tmp->next = NULL; if (first_predef) { diff --git a/src/docode.c b/src/docode.c index fa6f225c91961396e59693a9948565118bd3a049..8971db960c040409014db6253508709236d484d3 100644 --- a/src/docode.c +++ b/src/docode.c @@ -173,7 +173,7 @@ static struct switch_data current_switch = {0, 0, 0, 0, 0, NULL, NULL}; void upd_int(int offset, INT32 tmp) { - MEMCPY(Pike_compiler->new_program->program+offset, (char *)&tmp,sizeof(tmp)); + memcpy(Pike_compiler->new_program->program+offset, (char *)&tmp,sizeof(tmp)); } INT32 read_int(int offset) diff --git a/src/dynamic_buffer.c b/src/dynamic_buffer.c index 116915042edf1751c39565bb954cec51fd6afd22..7597790585c632263b9f8a0a0d4c24f5db828411 100644 --- a/src/dynamic_buffer.c +++ b/src/dynamic_buffer.c @@ -53,7 +53,7 @@ PMOD_EXPORT void low_my_binary_strcat(const char *b, size_t l, Pike_fatal("Error in internal buffering.\n"); #endif - MEMCPY(low_make_buf_space(l, buf),b, l); + memcpy(low_make_buf_space(l, buf),b, l); } PMOD_EXPORT void debug_initialize_buf(dynamic_buffer *buf) diff --git a/src/encode.c b/src/encode.c index e4d8b0d7ea833c6f13306b86766e94e14919b172..3db5ba196662b6774183aae1b5df6a4fb4ec9bdf 100644 --- a/src/encode.c +++ b/src/encode.c @@ -2124,7 +2124,7 @@ static DECLSPEC(noreturn) void decode_error ( decode_error (data, NULL, "Too large size %td (max is %td).\n", \ sz, data->len - data->ptr); \ STR=begin_wide_shared_string(num, what); \ - MEMCPY(STR->str, data->data + data->ptr, sz); \ + memcpy(STR->str, data->data + data->ptr, sz); \ data->ptr += sz; \ BITFLIP(STR); \ STR=end_shared_string(STR); \ diff --git a/src/fdlib.c b/src/fdlib.c index 44c8c0f4df89bc277f31109d3af4f130b5257446..3057f5266c69238fdb8667faf66112b5cbe43353 100644 --- a/src/fdlib.c +++ b/src/fdlib.c @@ -441,7 +441,7 @@ int debug_fd_stat(const char *file, PIKE_STAT_T *buf) errno=EINVAL; return -1; } - MEMCPY(fname, file, l); + memcpy(fname, file, l); fname[l]=0; file=fname; } @@ -651,7 +651,7 @@ PMOD_EXPORT FD debug_fd_open(const char *file, int open_mode, int create_mode) errno=EINVAL; return -1; } - MEMCPY(fname, file, l); + memcpy(fname, file, l); fname[l]=0; file=fname; } @@ -1567,7 +1567,7 @@ PMOD_EXPORT DIR *opendir(char *dir) return 0; } foo=sizeof(DIR) + (char *)ret; - MEMCPY(foo, dir, len); + memcpy(foo, dir, len); if(len && foo[len-1]!='/') foo[len++]='/'; foo[len++]='*'; diff --git a/src/fdlib.h b/src/fdlib.h index bffc25b2e897657d08ba3092879918eda2aa3f0c..3b653652b10b706b40c61b0718b60e05e8b0ae99 100644 --- a/src/fdlib.h +++ b/src/fdlib.h @@ -422,7 +422,7 @@ typedef struct my_fd_set_s my_fd_set; #define my_FD_ZERO(S) FD_ZERO(& (S)->tmp) #define fd_copy_my_fd_set_to_fd_set(TO,FROM,max) \ - MEMCPY((TO),&(FROM)->tmp,sizeof(*(TO))) + memcpy((TO),&(FROM)->tmp,sizeof(*(TO))) #define FILE_CAPABILITIES (fd_INTERPROCESSABLE | fd_CAN_NONBLOCK) #ifndef __amigaos__ diff --git a/src/fsort.c b/src/fsort.c index b60b20705906b723c520eeb631db8fee1c6f9d8a..3715724f51d54731c72efe7453fe86e75e0711e0 100644 --- a/src/fsort.c +++ b/src/fsort.c @@ -65,9 +65,9 @@ #define XARGS , cmpfun, tmp_area, size #define SWAP(X,Y) do { \ - MEMCPY(tmp_area,X,size); \ - MEMCPY(X,Y,size); \ - MEMCPY(Y,tmp_area,size); \ + memcpy(tmp_area,X,size); \ + memcpy(X,Y,size); \ + memcpy(Y,tmp_area,size); \ } while(0) #define STEP(X,Y) ((X)+(Y)*size) diff --git a/src/interpret_functions.h b/src/interpret_functions.h index 16cd70b2839b091c704608ae2dfed1819c2fe10b..bf53c9bcbc1f92e654c316ac9d9c85fc571c87f3 100644 --- a/src/interpret_functions.h +++ b/src/interpret_functions.h @@ -264,9 +264,9 @@ OPCODE1(F_CONSTANT, "constant", I_UPDATE_SP, { */ OPCODE2(F_REARRANGE,"rearrange",0,{ check_stack(arg2); - MEMCPY(Pike_sp,Pike_sp-arg1-arg2,sizeof(struct svalue)*arg2); + memcpy(Pike_sp,Pike_sp-arg1-arg2,sizeof(struct svalue)*arg2); MEMMOVE(Pike_sp-arg1-arg2,Pike_sp-arg1,sizeof(struct svalue)*arg1); - MEMCPY(Pike_sp-arg2,Pike_sp,sizeof(struct svalue)*arg2); + memcpy(Pike_sp-arg2,Pike_sp,sizeof(struct svalue)*arg2); }); /* The rest of the basic 'push value' instructions */ diff --git a/src/las.c b/src/las.c index 8602c50ed8512ee0e9b0d4a3c15f77a91e7950e8..362738c791acdafc0efda500ead2cc660ab61ba6 100644 --- a/src/las.c +++ b/src/las.c @@ -2446,7 +2446,7 @@ static struct used_vars *copy_vars(struct used_vars *a) Pike_error("Out of memory in copy_vars.\n"); return NULL; /* Make sure that the optimizer knows we exit here. */ } - MEMCPY(*dst, src, sizeof(struct scope_info)); + memcpy(*dst, src, sizeof(struct scope_info)); src = src->next; dst = &((*dst)->next); *dst = NULL; @@ -2473,7 +2473,7 @@ static struct used_vars *copy_vars(struct used_vars *a) Pike_error("Out of memory in copy_vars.\n"); return NULL; /* Make sure that the optimizer knows we exit here. */ } - MEMCPY(*dst, src, sizeof(struct scope_info)); + memcpy(*dst, src, sizeof(struct scope_info)); src = src->next; dst = &((*dst)->next); *dst = NULL; @@ -3981,7 +3981,7 @@ static void find_usage(node *n, unsigned char *usage, unsigned char catch_usage[MAX_LOCAL]; int i; - MEMCPY(catch_usage, usage, MAX_LOCAL); + memcpy(catch_usage, usage, MAX_LOCAL); find_usage(CAR(n), usage, switch_u, cont_u, catch_usage, catch_usage); for(i=0; i < MAX_LOCAL; i++) { usage[i] |= catch_usage[i]; @@ -4017,11 +4017,11 @@ static void find_usage(node *n, unsigned char *usage, return; case F_CONTINUE: - MEMCPY(usage, cont_u, MAX_LOCAL); + memcpy(usage, cont_u, MAX_LOCAL); return; case F_BREAK: - MEMCPY(usage, break_u, MAX_LOCAL); + memcpy(usage, break_u, MAX_LOCAL); return; case F_DEFAULT: @@ -4045,7 +4045,7 @@ static void find_usage(node *n, unsigned char *usage, int i; memset(switch_usage, 0, MAX_LOCAL); - MEMCPY(break_usage, usage, MAX_LOCAL); + memcpy(break_usage, usage, MAX_LOCAL); find_usage(CDR(n), usage, switch_usage, cont_u, break_usage, catch_u); @@ -4070,7 +4070,7 @@ static void find_usage(node *n, unsigned char *usage, unsigned char trail_usage[MAX_LOCAL]; int i; - MEMCPY(trail_usage, usage, MAX_LOCAL); + memcpy(trail_usage, usage, MAX_LOCAL); find_usage(CDR(n), usage, switch_u, cont_u, break_u, catch_u); @@ -4088,8 +4088,8 @@ static void find_usage(node *n, unsigned char *usage, unsigned char cddr_usage[MAX_LOCAL]; int i; - MEMCPY(cadr_usage, usage, MAX_LOCAL); - MEMCPY(cddr_usage, usage, MAX_LOCAL); + memcpy(cadr_usage, usage, MAX_LOCAL); + memcpy(cddr_usage, usage, MAX_LOCAL); find_usage(CADR(n), cadr_usage, switch_u, cont_u, break_u, catch_u); find_usage(CDDR(n), cddr_usage, switch_u, cont_u, break_u, catch_u); @@ -4106,11 +4106,11 @@ static void find_usage(node *n, unsigned char *usage, unsigned char break_usage[MAX_LOCAL]; unsigned char continue_usage[MAX_LOCAL]; - MEMCPY(break_usage, usage, MAX_LOCAL); + memcpy(break_usage, usage, MAX_LOCAL); find_usage(CDR(n), usage, switch_u, cont_u, break_usage, catch_u); - MEMCPY(continue_usage, usage, MAX_LOCAL); + memcpy(continue_usage, usage, MAX_LOCAL); find_usage(CAR(n), usage, switch_u, break_usage, continue_usage, catch_u); @@ -4124,7 +4124,7 @@ static void find_usage(node *n, unsigned char *usage, unsigned char continue_usage[MAX_LOCAL]; int i; - MEMCPY(break_usage, usage, MAX_LOCAL); + memcpy(break_usage, usage, MAX_LOCAL); /* for(;a;b) c; is handled like: * @@ -4138,7 +4138,7 @@ static void find_usage(node *n, unsigned char *usage, find_usage(CDDR(n), loop_usage, switch_u, cont_u, break_usage, catch_u); - MEMCPY(continue_usage, loop_usage, MAX_LOCAL); + memcpy(continue_usage, loop_usage, MAX_LOCAL); find_usage(CADR(n), loop_usage, switch_u, continue_usage, break_usage, catch_u); @@ -4159,13 +4159,13 @@ static void find_usage(node *n, unsigned char *usage, unsigned char continue_usage[MAX_LOCAL]; int i; - MEMCPY(break_usage, usage, MAX_LOCAL); + memcpy(break_usage, usage, MAX_LOCAL); /* Find the usage from the loop */ memset(loop_usage, 0, MAX_LOCAL); - MEMCPY(continue_usage, usage, MAX_LOCAL); + memcpy(continue_usage, usage, MAX_LOCAL); find_usage(CDR(n), loop_usage, switch_u, continue_usage, break_usage, catch_u); @@ -4274,7 +4274,7 @@ static node *low_localopt(node *n, unsigned char catch_usage[MAX_LOCAL]; int i; - MEMCPY(catch_usage, usage, MAX_LOCAL); + memcpy(catch_usage, usage, MAX_LOCAL); car = low_localopt(CAR(n), usage, switch_u, cont_u, catch_usage, catch_usage); for(i=0; i < MAX_LOCAL; i++) { @@ -4328,12 +4328,12 @@ static node *low_localopt(node *n, cont_u, break_u, catch_u)); case F_CONTINUE: - MEMCPY(usage, cont_u, MAX_LOCAL); + memcpy(usage, cont_u, MAX_LOCAL); ADD_NODE_REF(n); return n; case F_BREAK: - MEMCPY(usage, break_u, MAX_LOCAL); + memcpy(usage, break_u, MAX_LOCAL); ADD_NODE_REF(n); return n; @@ -4358,7 +4358,7 @@ static node *low_localopt(node *n, int i; memset(switch_usage, 0, MAX_LOCAL); - MEMCPY(break_usage, usage, MAX_LOCAL); + memcpy(break_usage, usage, MAX_LOCAL); cdr = low_localopt(CDR(n), usage, switch_usage, cont_u, break_usage, catch_u); @@ -4385,7 +4385,7 @@ static node *low_localopt(node *n, unsigned char trail_usage[MAX_LOCAL]; int i; - MEMCPY(trail_usage, usage, MAX_LOCAL); + memcpy(trail_usage, usage, MAX_LOCAL); cdr = low_localopt(CDR(n), usage, switch_u, cont_u, break_u, catch_u); @@ -4404,8 +4404,8 @@ static node *low_localopt(node *n, unsigned char cddr_usage[MAX_LOCAL]; int i; - MEMCPY(cadr_usage, usage, MAX_LOCAL); - MEMCPY(cddr_usage, usage, MAX_LOCAL); + memcpy(cadr_usage, usage, MAX_LOCAL); + memcpy(cddr_usage, usage, MAX_LOCAL); car = low_localopt(CADR(n), cadr_usage, switch_u, cont_u, break_u, catch_u); @@ -4426,12 +4426,12 @@ static node *low_localopt(node *n, unsigned char continue_usage[MAX_LOCAL]; int i; - MEMCPY(break_usage, usage, MAX_LOCAL); + memcpy(break_usage, usage, MAX_LOCAL); /* Find the usage from the loop */ find_usage(CDR(n), usage, switch_u, cont_u, break_u, catch_u); - MEMCPY(continue_usage, usage, MAX_LOCAL); + memcpy(continue_usage, usage, MAX_LOCAL); find_usage(CAR(n), usage, switch_u, continue_usage, break_usage, catch_u); @@ -4443,7 +4443,7 @@ static node *low_localopt(node *n, cdr = low_localopt(CDR(n), usage, switch_u, cont_u, break_usage, catch_u); - MEMCPY(continue_usage, usage, MAX_LOCAL); + memcpy(continue_usage, usage, MAX_LOCAL); car = low_localopt(CAR(n), usage, switch_u, continue_usage, break_usage, catch_u); @@ -4458,7 +4458,7 @@ static node *low_localopt(node *n, unsigned char continue_usage[MAX_LOCAL]; int i; - MEMCPY(break_usage, usage, MAX_LOCAL); + memcpy(break_usage, usage, MAX_LOCAL); /* * if (a A|B) { @@ -4486,7 +4486,7 @@ static node *low_localopt(node *n, find_usage(CDDR(n), loop_usage, switch_u, cont_u, break_usage, catch_u); - MEMCPY(continue_usage, loop_usage, MAX_LOCAL); + memcpy(continue_usage, loop_usage, MAX_LOCAL); find_usage(CADR(n), loop_usage, switch_u, continue_usage, break_usage, catch_u); @@ -4506,7 +4506,7 @@ static node *low_localopt(node *n, cddr = low_localopt(CDDR(n), usage, switch_u, cont_u, break_usage, catch_u); - MEMCPY(continue_usage, usage, MAX_LOCAL); + memcpy(continue_usage, usage, MAX_LOCAL); /* The body */ cadr = low_localopt(CADR(n), usage, switch_u, continue_usage, @@ -4533,7 +4533,7 @@ static node *low_localopt(node *n, unsigned char continue_usage[MAX_LOCAL]; int i; - MEMCPY(break_usage, usage, MAX_LOCAL); + memcpy(break_usage, usage, MAX_LOCAL); /* * D @@ -4555,7 +4555,7 @@ static node *low_localopt(node *n, /* Find the usage from the loop */ memset(loop_usage, 0, MAX_LOCAL); - MEMCPY(continue_usage, usage, MAX_LOCAL); + memcpy(continue_usage, usage, MAX_LOCAL); find_usage(CDR(n), loop_usage, switch_u, continue_usage, break_usage, catch_u); @@ -4571,7 +4571,7 @@ static node *low_localopt(node *n, usage[i] |= loop_usage[i]; } - MEMCPY(continue_usage, usage, MAX_LOCAL); + memcpy(continue_usage, usage, MAX_LOCAL); cdr = low_localopt(CDR(n), usage, switch_u, continue_usage, break_usage, catch_u); if (CDAR(n)->token == F_LOCAL) { diff --git a/src/mapping.c b/src/mapping.c index ab52f4d18303a1ed5a3bd480d61c8054c9506728..cfe0e2afaf6ae2076f974059ed9a9af4dea740a8 100644 --- a/src/mapping.c +++ b/src/mapping.c @@ -590,7 +590,7 @@ struct mapping_data *copy_mapping_data(struct mapping_data *md) size=MAPPING_DATA_SIZE(md->hashsize, md->num_keypairs); nmd=(struct mapping_data *)xalloc(size); - MEMCPY(nmd, md, size); + memcpy(nmd, md, size); off=((char *)nmd) - ((char *)md); RELOC(nmd->free_list); diff --git a/src/modules/Gmp/mpf.cmod b/src/modules/Gmp/mpf.cmod index 91bb0cecc913abe00681619de6642a4660dc5d9d..8bd79768a37553ca1cd6b21a8ed8f8f5743d2f50 100644 --- a/src/modules/Gmp/mpf.cmod +++ b/src/modules/Gmp/mpf.cmod @@ -264,7 +264,7 @@ PIKECLASS mpf /* Copy numbers straight */ if(len) { - MEMCPY(out,in,len); + memcpy(out,in,len); out+=len; }else{ *(out++)='0'; @@ -275,18 +275,18 @@ PIKECLASS mpf /* N.NNNNNNNeNNN */ *(out++)=*(in++); *(out++)='.'; - MEMCPY(out,in,len-1); + memcpy(out,in,len-1); out+=len-1; in+=len+1; sprintf(out,"e%ld",(long)(expptr-1)); out+=strlen(out); }else{ /* NNNNNNN.NNNNNNN */ - MEMCPY(out,in,expptr); + memcpy(out,in,expptr); out+=expptr; in+=expptr; *(out++)='.'; - MEMCPY(out,in,len-expptr); + memcpy(out,in,len-expptr); out += len-expptr; } } diff --git a/src/modules/HTTPLoop/accept_and_parse.c b/src/modules/HTTPLoop/accept_and_parse.c index 6cd66a43b5ad5edd81260a3400039bb358cb97b8..ca963e11e3f5cdd16838816c19c80e0bbe7958a7 100644 --- a/src/modules/HTTPLoop/accept_and_parse.c +++ b/src/modules/HTTPLoop/accept_and_parse.c @@ -309,7 +309,7 @@ void aap_handle_connection(struct args *arg) return; } buffer_len = arg->res.leftovers_len; - MEMCPY(buffer, arg->res.leftovers, arg->res.leftovers_len); + memcpy(buffer, arg->res.leftovers, arg->res.leftovers_len); pos = arg->res.leftovers_len; arg->res.leftovers=0; if((tmp = my_memmem("\r\n\r\n", 4, buffer, pos))) @@ -446,7 +446,7 @@ static void low_accept_loop(struct args *arg) ACCEPT_SIZE_T len = sizeof(arg->from); while(1) { - MEMCPY(arg2, arg, sizeof(struct args)); + memcpy(arg2, arg, sizeof(struct args)); arg2->fd = fd_accept(arg->fd, (struct sockaddr *)&arg2->from, &len); if(arg2->fd != -1) { diff --git a/src/modules/HTTPLoop/cache.c b/src/modules/HTTPLoop/cache.c index 53542e5a03c88a0dfd6231dae8de20839669c9b7..8752d7aaf44f89bfd0cefcca1851cb037b2661ec 100644 --- a/src/modules/HTTPLoop/cache.c +++ b/src/modules/HTTPLoop/cache.c @@ -229,8 +229,8 @@ void aap_cache_insert(struct cache_entry *ce, struct cache *c) } else { c->entries++; t = malloc( ce->url_len + ce->host_len ); - MEMCPY(t,ce->url,ce->url_len); ce->url = t; t+=ce->url_len; - MEMCPY(t,ce->host,ce->host_len); ce->host = t; + memcpy(t,ce->url,ce->url_len); ce->url = t; t+=ce->url_len; + memcpy(t,ce->host,ce->host_len); ce->host = t; ce->next = c->htable[hv]; ce->refs = 1; c->htable[hv] = ce; diff --git a/src/modules/HTTPLoop/log.c b/src/modules/HTTPLoop/log.c index d92f81fc073b57a2046d7087b0474c112249dac4..05c96679464dbfa3b8673d823a35b4d11007fade 100644 --- a/src/modules/HTTPLoop/log.c +++ b/src/modules/HTTPLoop/log.c @@ -257,7 +257,7 @@ void aap_log_append(int sent, struct args *arg, int reply) le->sent_bytes = sent; le->reply = reply; le->received_bytes = arg->res.body_start + arg->res.content_len; - MEMCPY(data_to, arg->res.data, arg->res.body_start-4); + memcpy(data_to, arg->res.data, arg->res.body_start-4); le->raw.str = data_to; le->raw.len = arg->res.body_start-4; le->url.str = (data_to + (size_t)(arg->res.url-arg->res.data)); diff --git a/src/modules/HTTPLoop/requestobject.c b/src/modules/HTTPLoop/requestobject.c index 3393d91c7517b2abd90141244fc2956d4940ae12..4a0309c436cb6fc31c958df9f83c9b7319c70236 100644 --- a/src/modules/HTTPLoop/requestobject.c +++ b/src/modules/HTTPLoop/requestobject.c @@ -679,7 +679,7 @@ static void actually_send(struct send_args *a) #endif if(data) { - MEMCPY(foo, data+MINIMUM((data_len-4),9), 4); + memcpy(foo, data+MINIMUM((data_len-4),9), 4); first=1; #ifdef TCP_CORK #ifdef AAP_DEBUG @@ -762,7 +762,7 @@ static void actually_send(struct send_args *a) if(!first) { first=1; - MEMCPY(foo,a->buffer+9,5); + memcpy(foo,a->buffer+9,5); } if(nread <= 0) { diff --git a/src/modules/Image/blit.c b/src/modules/Image/blit.c index a472361aa66822901d5fcbeb26b49dff54a45b72..654c1f2f44fa58097106baba33be59635cec3b69 100644 --- a/src/modules/Image/blit.c +++ b/src/modules/Image/blit.c @@ -129,11 +129,11 @@ void img_clear(rgb_group *dest, rgb_group rgb, ptrdiff_t size) size -= 1; while (size>increment) { - MEMCPY(dest,from,increment*sizeof(rgb_group)); + memcpy(dest,from,increment*sizeof(rgb_group)); size-=increment,dest+=increment; if (increment<1024) increment *= 2; } - if(size>0) MEMCPY(dest,from,size*sizeof(rgb_group)); + if(size>0) memcpy(dest,from,size*sizeof(rgb_group)); } THREADS_DISALLOW(); } @@ -162,7 +162,7 @@ void img_box_nocheck(INT32 x1,INT32 y1,INT32 x2,INT32 y2) if(!length) break; /* Break to the while(0). */ for(x=0; x<length; x++) *(foo+x) = rgb; - while(--y) MEMCPY((foo+=xs), from, length*sizeof(rgb_group)); + while(--y) memcpy((foo+=xs), from, length*sizeof(rgb_group)); } while(0); THREADS_DISALLOW(); } @@ -189,11 +189,11 @@ CHRONO("image_blit begin"); THREADS_ALLOW(); if(!moddest && !modsrc) - MEMCPY(dest,src,sizeof(rgb_group)*width*lines); + memcpy(dest,src,sizeof(rgb_group)*width*lines); else while (lines--) { - MEMCPY(dest,src,sizeof(rgb_group)*width); + memcpy(dest,src,sizeof(rgb_group)*width); dest+=moddest; src+=modsrc; } @@ -222,7 +222,7 @@ void img_crop(struct image *dest, { *dest=*img; THREADS_ALLOW(); - MEMCPY(new,img->img,(x2-x1+1)*(y2-y1+1)*sizeof(rgb_group)); + memcpy(new,img->img,(x2-x1+1)*(y2-y1+1)*sizeof(rgb_group)); THREADS_DISALLOW(); dest->img=new; return; @@ -261,7 +261,7 @@ void img_clone(struct image *newimg,struct image *img) if (newimg->img) free(newimg->img); newimg->img=xalloc(sizeof(rgb_group)*img->xsize*img->ysize+RGB_VEC_PAD); THREADS_ALLOW(); - MEMCPY(newimg->img,img->img,sizeof(rgb_group)*img->xsize*img->ysize); + memcpy(newimg->img,img->img,sizeof(rgb_group)*img->xsize*img->ysize); THREADS_DISALLOW(); newimg->xsize=img->xsize; newimg->ysize=img->ysize; diff --git a/src/modules/Image/colortable.c b/src/modules/Image/colortable.c index 5cbe326289a575433538f51dd336f840cf7c7125..90363d594e30d2fa7b3b66da889e57b4a4b4dedd 100644 --- a/src/modules/Image/colortable.c +++ b/src/modules/Image/colortable.c @@ -2019,11 +2019,11 @@ int image_colortable_initiate_dither(struct neo_colortable *nct, if (dith->u.ordered.bdiff) free(dith->u.ordered.bdiff); return 0; } - MEMCPY(dith->u.ordered.rdiff,nct->du.ordered.rdiff, + memcpy(dith->u.ordered.rdiff,nct->du.ordered.rdiff, sizeof(int)*nct->du.ordered.xs*nct->du.ordered.ys); - MEMCPY(dith->u.ordered.gdiff,nct->du.ordered.gdiff, + memcpy(dith->u.ordered.gdiff,nct->du.ordered.gdiff, sizeof(int)*nct->du.ordered.xs*nct->du.ordered.ys); - MEMCPY(dith->u.ordered.bdiff,nct->du.ordered.bdiff, + memcpy(dith->u.ordered.bdiff,nct->du.ordered.bdiff, sizeof(int)*nct->du.ordered.xs*nct->du.ordered.ys); dith->u.ordered.row=0; diff --git a/src/modules/Image/encodings/pcx.c b/src/modules/Image/encodings/pcx.c index dc3035ee42a447ac6ae3be0fe3e7c7f683be7606..d8bbc56365053bbdb7276718358a72a805f7846a 100644 --- a/src/modules/Image/encodings/pcx.c +++ b/src/modules/Image/encodings/pcx.c @@ -110,7 +110,7 @@ void get_rle_decoded_from_data( unsigned char *dest, struct buffer * source, { unsigned char *c = get_chunk( source, nelems ); if(c) - MEMCPY( dest, c, nelems ); + memcpy( dest, c, nelems ); else memset( dest, 0, nelems ); return; diff --git a/src/modules/Image/encodings/png.c b/src/modules/Image/encodings/png.c index 3326ff411517398ed39ad01db249fb2bda0f73ca..bfc41ea4e1d3ee888d4060b7b6fb49191346270a 100644 --- a/src/modules/Image/encodings/png.c +++ b/src/modules/Image/encodings/png.c @@ -1709,7 +1709,7 @@ static void image_png_encode(INT32 args) *(d++)=0; /* filter */ if (bpp==8) { - MEMCPY(d,ts,x); + memcpy(d,ts,x); ts += x; d += x; } diff --git a/src/modules/Image/encodings/pnm.c b/src/modules/Image/encodings/pnm.c index bd336b4e65c1783c114014d189fdc61b7cc63815..233e20823a34eea37d68fe6c79014195890c4b20 100644 --- a/src/modules/Image/encodings/pnm.c +++ b/src/modules/Image/encodings/pnm.c @@ -188,7 +188,7 @@ void img_pnm_decode(INT32 args) if (type=='6' && maxval==255 && sizeof(rgb_group)==3) /* optimize */ { if (pos<s->len) - MEMCPY(d,s->str+pos,MINIMUM(n*3,s->len-pos)); + memcpy(d,s->str+pos,MINIMUM(n*3,s->len-pos)); } else while (n--) { diff --git a/src/modules/Image/encodings/tga.c b/src/modules/Image/encodings/tga.c index 3a87adb8d6d7919f1e44df0dd61a3cb9d7a51f42..d5bdbee10d635cad6ca6c98b394248b5d35d9d49 100644 --- a/src/modules/Image/encodings/tga.c +++ b/src/modules/Image/encodings/tga.c @@ -171,7 +171,7 @@ static struct image_alpha load_image(struct pike_string *str) DO_NOT_WARN((long)buffer.len)); -/* MEMCPY(&footer, (buffer.str+(buffer.len-sizeof(struct tga_footer))), */ +/* memcpy(&footer, (buffer.str+(buffer.len-sizeof(struct tga_footer))), */ /* sizeof( struct tga_footer) ); */ hdr = *((struct tga_header *)buffer.str); @@ -196,7 +196,7 @@ static ptrdiff_t std_fread (unsigned char *buf, size_t datasize, size_t nelems, struct buffer *fp) { size_t amnt = MINIMUM((nelems*datasize), fp->len); - MEMCPY(buf, fp->str, amnt); + memcpy(buf, fp->str, amnt); fp->len -= amnt; fp->str += amnt; return amnt / datasize; @@ -206,7 +206,7 @@ static ptrdiff_t std_fwrite (unsigned char *buf, size_t datasize, size_t nelems, struct buffer *fp) { size_t amnt = MINIMUM((nelems*datasize), fp->len); - MEMCPY(fp->str, buf, amnt); + memcpy(fp->str, buf, amnt); fp->len -= amnt; fp->str += amnt; return amnt / datasize; @@ -261,7 +261,7 @@ static ptrdiff_t rle_fread (guchar *buf, size_t datasize, size_t nelems, { /* Copy bytes from our previously decoded buffer. */ bytes = MINIMUM (buflen - j, statelen - laststate); - MEMCPY (buf + j, statebuf + laststate, bytes); + memcpy (buf + j, statebuf + laststate, bytes); j += bytes; laststate += bytes; @@ -317,7 +317,7 @@ static ptrdiff_t rle_fread (guchar *buf, size_t datasize, size_t nelems, memset (p + 1, *p, bytes - 1); else for (k = datasize; k < bytes; k += datasize) - MEMCPY (p + k, p, datasize); + memcpy (p + k, p, datasize); } else { diff --git a/src/modules/Image/encodings/wbf.c b/src/modules/Image/encodings/wbf.c index af8d53f3a4e7a33007e3b8e326b0614ed34bc692..4719f3df39b034daa6bbc08a959dd7fc091b133c 100644 --- a/src/modules/Image/encodings/wbf.c +++ b/src/modules/Image/encodings/wbf.c @@ -71,7 +71,7 @@ static void read_string( struct buffer *from, unsigned int len, char *to ) { if( from->len < len ) Pike_error("Invalid data format\n"); - MEMCPY( from->str, to, len ); + memcpy( from->str, to, len ); from->str += len; from->len -= len; } diff --git a/src/modules/Image/encodings/x.c b/src/modules/Image/encodings/x.c index bb425b9d7ae9508dffc1e965b94428f23fb198fa..323987a4aa52ae7f270c956e3e09f26afeeb9681 100644 --- a/src/modules/Image/encodings/x.c +++ b/src/modules/Image/encodings/x.c @@ -527,7 +527,7 @@ static void image_x_encode_pseudocolor_1byte_exact(INT32 args, { if (translate) { x=img->xsize; while (x--) *(d++)=translate[(*(s++))&mask]; } - else MEMCPY(d,s,img->xsize),d+=img->xsize,s+=img->xsize; + else memcpy(d,s,img->xsize),d+=img->xsize,s+=img->xsize; m=linemod; while (m--) *(d++)=0; } diff --git a/src/modules/Image/image.c b/src/modules/Image/image.c index 8040acaac5f52f89f413adddd1ab3494ecf94009..54586e63c98cece1fdc591d79ef2e01968e5495a 100644 --- a/src/modules/Image/image.c +++ b/src/modules/Image/image.c @@ -1069,7 +1069,7 @@ void image_clone(INT32 args) { if (img->xsize==THIS->xsize && img->ysize==THIS->ysize) - MEMCPY(img->img,THIS->img,sizeof(rgb_group)*img->xsize*img->ysize); + memcpy(img->img,THIS->img,sizeof(rgb_group)*img->xsize*img->ysize); else img_crop(img,THIS, 0,0,img->xsize-1,img->ysize-1); @@ -1812,7 +1812,7 @@ image_tuned_box_leftright(const rgba_group left, const rgba_group right, (dest+x)->g = DO_NOT_WARN((COLORTYPE)((((long)left.g)*(length-x)+((long)right.g)*(x))/length)); (dest+x)->b = DO_NOT_WARN((COLORTYPE)((((long)left.b)*(length-x)+((long)right.b)*(x))/length)); } - while(--y) MEMCPY((dest+=xsize), from, maxlength*sizeof(rgb_group)); + while(--y) memcpy((dest+=xsize), from, maxlength*sizeof(rgb_group)); } @@ -1839,13 +1839,13 @@ image_tuned_box_topbottom(const rgba_group left, const rgba_group right, color.b = DO_NOT_WARN((COLORTYPE)((((long)left.b)*(height-y)+((long)right.b)*(y))/height)); if(y && color_equal(old, color)) { - MEMCPY(dest,dest-xsize,length*sizeof(rgb_group)); + memcpy(dest,dest-xsize,length*sizeof(rgb_group)); dest+=xsize; } else { from = dest; for(x=0; x<64; x++) *(dest++) = color; for(;x<length-64;x+=64,dest+=64) - MEMCPY(dest, from, 64*sizeof(rgb_group)); + memcpy(dest, from, 64*sizeof(rgb_group)); for(;x<length; x++) *(dest++) = color; dest += xsize-length; old = color; @@ -1859,7 +1859,7 @@ image_tuned_box_topbottom(const rgba_group left, const rgba_group right, color.b = DO_NOT_WARN((COLORTYPE)((((long)left.b)*(height-y)+((long)right.b)*(y))/height)); if(y && color_equal(old, color)) { - MEMCPY(dest,dest-xsize,length*sizeof(rgb_group)); + memcpy(dest,dest-xsize,length*sizeof(rgb_group)); dest+=xsize; } else { for(x=0; x<length; x++) *(dest++) = color; @@ -4169,7 +4169,7 @@ static void image_apply_curve( INT32 args ) push_int( THIS->xsize ); push_int( THIS->ysize ); o = clone_object( image_program, 2 ); - MEMCPY( ((struct image*)get_storage(o,image_program))->img, + memcpy( ((struct image*)get_storage(o,image_program))->img, THIS->img, THIS->xsize*THIS->ysize*sizeof(rgb_group) ); } @@ -4240,7 +4240,7 @@ static void img_make_gammatable(COLORTYPE *d,double gamma) static int had_gamma=0; if (had_gamma && last_gamma==gamma) - MEMCPY(d,last_gammatable,sizeof(COLORTYPE)*256); + memcpy(d,last_gammatable,sizeof(COLORTYPE)*256); else { int i; @@ -4251,7 +4251,7 @@ static void img_make_gammatable(COLORTYPE *d,double gamma) double d=pow(i*q,gamma)*255; *(dd++)=testrange(d); } - MEMCPY(last_gammatable,d,sizeof(COLORTYPE)*256); + memcpy(last_gammatable,d,sizeof(COLORTYPE)*256); last_gamma=gamma; had_gamma=1; } diff --git a/src/modules/Image/layer_channel.h b/src/modules/Image/layer_channel.h index d401ba30a84d8ddb6ef7bfe91e595a52de886120..7dff7855d97fc6bfd865134ed7401002a9e73b32 100644 --- a/src/modules/Image/layer_channel.h +++ b/src/modules/Image/layer_channel.h @@ -11,13 +11,13 @@ static void LM_FUNC(rgb_group *s,rgb_group *l,rgb_group *d, int len,double alpha) { if (da != sa) - MEMCPY(da,sa,sizeof(rgb_group)*len); /* always copy alpha channel */ + memcpy(da,sa,sizeof(rgb_group)*len); /* always copy alpha channel */ #define da da da /* protect */ if (alpha==0.0) { #ifdef LAYER_DUAL if (d != s) - MEMCPY(d,s,sizeof(rgb_group)*len); + memcpy(d,s,sizeof(rgb_group)*len); #endif return; } diff --git a/src/modules/Image/layer_oper.h b/src/modules/Image/layer_oper.h index e25e3958d228774f84b52a9d43d6c6657ef76308..49623e0c9d3918ffe9b2f82abff5897aaf55b047 100644 --- a/src/modules/Image/layer_oper.h +++ b/src/modules/Image/layer_oper.h @@ -16,15 +16,15 @@ static void LM_FUNC(rgb_group *s,rgb_group *l,rgb_group *d, if (alpha==0.0) { #ifdef LAYER_DUAL - MEMCPY(d,s,sizeof(rgb_group)*len); - MEMCPY(da,sa,sizeof(rgb_group)*len); + memcpy(d,s,sizeof(rgb_group)*len); + memcpy(da,sa,sizeof(rgb_group)*len); #endif return; } else if (alpha==1.0) { #ifdef L_COPY_ALPHA - MEMCPY(da,sa,sizeof(rgb_group)*len); + memcpy(da,sa,sizeof(rgb_group)*len); #define da da da da /* error */ #endif if (!la) /* no layer alpha => full opaque */ @@ -157,7 +157,7 @@ static void LM_FUNC(rgb_group *s,rgb_group *l,rgb_group *d, { #ifdef L_COPY_ALPHA #undef da - MEMCPY(da,sa,sizeof(rgb_group)*len); + memcpy(da,sa,sizeof(rgb_group)*len); #define da da da #endif if (!la) /* no layer alpha => full opaque */ diff --git a/src/modules/Image/layers.c b/src/modules/Image/layers.c index a0a90886a6a9563f4f83034d5ec0deb10e06c846..75f32fed8c38602a351dc490204ceb15e2ab8980 100644 --- a/src/modules/Image/layers.c +++ b/src/modules/Image/layers.c @@ -1499,8 +1499,8 @@ static void lm_normal(rgb_group *s,rgb_group *l,rgb_group *d, if (alpha==0.0) /* optimized */ { #ifdef LAYERS_DUAL - MEMCPY(d,s,sizeof(rgb_group)*len); - MEMCPY(da,sa,sizeof(rgb_group)*len); + memcpy(d,s,sizeof(rgb_group)*len); + memcpy(da,sa,sizeof(rgb_group)*len); #endif return; } @@ -1508,7 +1508,7 @@ static void lm_normal(rgb_group *s,rgb_group *l,rgb_group *d, { if (!la) /* no layer alpha => full opaque */ { - MEMCPY(d,l,sizeof(rgb_group)*len); + memcpy(d,l,sizeof(rgb_group)*len); smear_color(da,white,len); } else @@ -2208,8 +2208,8 @@ static void lm_dissolve(rgb_group *s,rgb_group *l,rgb_group *d, if (alpha==0.0) { #ifdef LAYERS_DUAL - MEMCPY(d,s,sizeof(rgb_group)*len); - MEMCPY(da,sa,sizeof(rgb_group)*len); + memcpy(d,s,sizeof(rgb_group)*len); + memcpy(da,sa,sizeof(rgb_group)*len); #endif return; } @@ -2217,7 +2217,7 @@ static void lm_dissolve(rgb_group *s,rgb_group *l,rgb_group *d, { if (!la) /* no layer alpha => full opaque */ { - MEMCPY(d,l,sizeof(rgb_group)*len); + memcpy(d,l,sizeof(rgb_group)*len); smear_color(da,white,len); } else @@ -2267,8 +2267,8 @@ static void lm_behind(rgb_group *s,rgb_group *l,rgb_group *d, if (alpha==0.0) /* optimized */ { #ifdef LAYERS_DUAL - MEMCPY(d,s,sizeof(rgb_group)*len); - MEMCPY(da,sa,sizeof(rgb_group)*len); + memcpy(d,s,sizeof(rgb_group)*len); + memcpy(da,sa,sizeof(rgb_group)*len); #endif return; } @@ -2337,7 +2337,7 @@ static void lm_erase(rgb_group *UNUSED(s),rgb_group *UNUSED(l),rgb_group *UNUSED /* la may be NULL, no other */ #ifdef LAYERS_DUAL - MEMCPY(d,s,sizeof(rgb_group)*len); + memcpy(d,s,sizeof(rgb_group)*len); #endif if (alpha==1.0) @@ -2381,8 +2381,8 @@ static void lm_spec_burn_alpha(struct layer *ly, if (!la) { #ifdef LAYERS_DUAL - MEMCPY(d,s,len*sizeof(rgb_group)); - MEMCPY(da,sa,len*sizeof(rgb_group)); + memcpy(d,s,len*sizeof(rgb_group)); + memcpy(da,sa,len*sizeof(rgb_group)); #endif return; } @@ -2407,7 +2407,7 @@ static void lm_spec_burn_alpha(struct layer *ly, else { #ifdef LAYERS_DUAL - MEMCPY(d,s,len*sizeof(rgb_group)); + memcpy(d,s,len*sizeof(rgb_group)); #endif while (len--) { @@ -2512,9 +2512,9 @@ static INLINE void img_lay_first_line(struct layer *l, } if (len<xsize) /* copy bit, fill right */ { - if (s) MEMCPY(d,s,len*sizeof(rgb_group)); + if (s) memcpy(d,s,len*sizeof(rgb_group)); else smear_color(d,l->fill,len); - if (sa) MEMCPY(da,sa,len*sizeof(rgb_group)); + if (sa) memcpy(da,sa,len*sizeof(rgb_group)); else smear_color(da,white,len); smear_color(d+len,l->fill,xsize-len); @@ -2522,9 +2522,9 @@ static INLINE void img_lay_first_line(struct layer *l, } else /* copy rest */ { - if (s) MEMCPY(d,s,xsize*sizeof(rgb_group)); + if (s) memcpy(d,s,xsize*sizeof(rgb_group)); else smear_color(d,l->fill,xsize); - if (sa) MEMCPY(da,sa,xsize*sizeof(rgb_group)); + if (sa) memcpy(da,sa,xsize*sizeof(rgb_group)); else smear_color(da,white,xsize); } return; @@ -2549,22 +2549,22 @@ static INLINE void img_lay_first_line(struct layer *l, { int len=l->xsize-xoffs; if (len>l->xsize) len=l->xsize; - if (s) MEMCPY(d,s+xoffs,len*sizeof(rgb_group)); - if (sa) MEMCPY(da,sa+xoffs,len*sizeof(rgb_group)); + if (s) memcpy(d,s+xoffs,len*sizeof(rgb_group)); + if (sa) memcpy(da,sa+xoffs,len*sizeof(rgb_group)); da+=len; d+=len; xsize-=len; } while (xsize>l->xsize) { - if (s) MEMCPY(d,s,l->xsize*sizeof(rgb_group)); - if (sa) MEMCPY(d,sa,l->xsize*sizeof(rgb_group)); + if (s) memcpy(d,s,l->xsize*sizeof(rgb_group)); + if (sa) memcpy(d,sa,l->xsize*sizeof(rgb_group)); da+=l->xsize; d+=l->xsize; xsize-=l->xsize; } - if (s) MEMCPY(d,s,xsize*sizeof(rgb_group)); - if (sa) MEMCPY(d,sa,xsize*sizeof(rgb_group)); + if (s) memcpy(d,s,xsize*sizeof(rgb_group)); + if (sa) memcpy(d,sa,xsize*sizeof(rgb_group)); } } @@ -2595,8 +2595,8 @@ static INLINE void img_lay_stroke(struct layer *ly, { /* fprintf(stderr,"fast skip ly->yoffs=%d\n",ly->yoffs); */ #ifdef LAYERS_DUAL - MEMCPY(d,s,len*sizeof(rgb_group)); - MEMCPY(da,sa,len*sizeof(rgb_group)); + memcpy(d,s,len*sizeof(rgb_group)); + memcpy(da,sa,len*sizeof(rgb_group)); #endif return; } @@ -3033,8 +3033,8 @@ static INLINE struct layer *clone_this_layer(void) l->alpha_value=THIS->alpha_value; l->fill=THIS->fill; l->fill_alpha=THIS->fill_alpha; - MEMCPY(l->sfill,THIS->sfill,sizeof(rgb_group)*SNUMPIXS); - MEMCPY(l->sfill_alpha,THIS->sfill_alpha,sizeof(rgb_group)*SNUMPIXS); + memcpy(l->sfill,THIS->sfill,sizeof(rgb_group)*SNUMPIXS); + memcpy(l->sfill_alpha,THIS->sfill_alpha,sizeof(rgb_group)*SNUMPIXS); l->tiled=THIS->tiled; l->row_func=THIS->row_func; l->optimize_alpha=THIS->optimize_alpha; diff --git a/src/modules/Image/matrix.c b/src/modules/Image/matrix.c index b20b68e1ee5e529c89efaf27f358e5210be3fb2c..ebf377721e5aca2bf06d74ff97461a974865b88e 100644 --- a/src/modules/Image/matrix.c +++ b/src/modules/Image/matrix.c @@ -1193,7 +1193,7 @@ void img_translate(INT32 args,int expand) if (!xt) { - MEMCPY(img->img,THIS->img,sizeof(rgb_group)*THIS->xsize*THIS->ysize); + memcpy(img->img,THIS->img,sizeof(rgb_group)*THIS->xsize*THIS->ysize); } else { diff --git a/src/modules/Parser/html.c b/src/modules/Parser/html.c index beeebc67a9de5a5cc40c2321ac20b1604bcaa565..580b1be214ecab55fda2f01f3bb6b71cc3cf9e13 100644 --- a/src/modules/Parser/html.c +++ b/src/modules/Parser/html.c @@ -650,7 +650,7 @@ found_start: n_ws_or_endarg = (ptrdiff_t)(N_WS(this) + n); ws_or_endarg=alloca(sizeof(p_wchar2)*n_ws_or_endarg); if (!ws_or_endarg) Pike_error ("Out of stack.\n"); - MEMCPY(ws_or_endarg+n, WS (this), N_WS (this) * sizeof(p_wchar2)); + memcpy(ws_or_endarg+n, WS (this), N_WS (this) * sizeof(p_wchar2)); ws_or_endarg[0] = ARG_EQ (this); ws_or_endarg[1] = TAG_END (this); ws_or_endarg[2] = TAG_START (this); @@ -677,10 +677,10 @@ found_start: #endif #endif - MEMCPY(CC->arg_break_chars, ws_or_endarg, + memcpy(CC->arg_break_chars, ws_or_endarg, n_ws_or_endarg*sizeof(p_wchar2)); - MEMCPY(CC->arg_break_chars+n_ws_or_endarg, + memcpy(CC->arg_break_chars+n_ws_or_endarg, ARGQ_START (this), NARGQ (this) * sizeof(p_wchar2)); CC->arg_break_chars[CC->n_arg_break_chars-1] = ENTITY_START (this); @@ -749,8 +749,8 @@ static void init_html_struct(struct object *UNUSED(o)) THIS->entity_start=DEF_ENT_START; THIS->entity_end=DEF_ENT_END; THIS->nargq=NELEM(argq_start); - MEMCPY(THIS->argq_start,argq_start,sizeof(argq_start)); - MEMCPY(THIS->argq_stop,argq_stop,sizeof(argq_stop)); + memcpy(THIS->argq_start,argq_start,sizeof(argq_start)); + memcpy(THIS->argq_stop,argq_stop,sizeof(argq_stop)); THIS->arg_eq=DEF_EQ; /* allocated stuff */ @@ -777,11 +777,11 @@ static void init_html_struct(struct object *UNUSED(o)) #ifdef CONFIGURABLE_MARKUP THIS->lazy_entity_ends=(p_wchar2*)xalloc(sizeof(lazy_entity_ends)); - MEMCPY(THIS->lazy_entity_ends,lazy_entity_ends,sizeof(lazy_entity_ends)); + memcpy(THIS->lazy_entity_ends,lazy_entity_ends,sizeof(lazy_entity_ends)); THIS->n_lazy_entity_ends=NELEM(lazy_entity_ends); THIS->ws=(p_wchar2*)xalloc(sizeof(whitespace)); - MEMCPY(THIS->ws,whitespace,sizeof(whitespace)); + memcpy(THIS->ws,whitespace,sizeof(whitespace)); THIS->n_ws=NELEM(whitespace); #endif @@ -1167,7 +1167,7 @@ static void html_add_quote_tag(INT32 args) arr = val->u.array = resize_array (arr, arr->size+3); MEMMOVE (arr->item+i+3, arr->item+i, (arr->size-i-3) * sizeof(struct svalue)); - MEMCPY (arr->item+i, sp-=3, 3 * sizeof(struct svalue)); + memcpy (arr->item+i, sp-=3, 3 * sizeof(struct svalue)); goto done; } else free_string (cmp); @@ -1183,7 +1183,7 @@ static void html_add_quote_tag(INT32 args) } else arr = val->u.array = resize_array (arr, arr->size+3); - MEMCPY (arr->item+arr->size-3, sp-=3, 3 * sizeof(struct svalue)); + memcpy (arr->item+arr->size-3, sp-=3, 3 * sizeof(struct svalue)); } done: ; @@ -4861,13 +4861,13 @@ static void html_clone(INT32 args) p->n_lazy_entity_ends=THIS->n_lazy_entity_ends; newstr=(p_wchar2*)xalloc(sizeof(p_wchar2)*p->n_lazy_entity_ends); - MEMCPY(newstr,THIS->lazy_entity_ends,sizeof(p_wchar2)*p->n_lazy_entity_ends); + memcpy(newstr,THIS->lazy_entity_ends,sizeof(p_wchar2)*p->n_lazy_entity_ends); if (p->lazy_entity_ends) free(p->lazy_entity_ends); p->lazy_entity_ends=newstr; p->n_ws=THIS->n_ws; newstr=(p_wchar2*)xalloc(sizeof(p_wchar2)*p->n_ws); - MEMCPY(newstr,THIS->ws,sizeof(p_wchar2)*p->n_ws); + memcpy(newstr,THIS->ws,sizeof(p_wchar2)*p->n_ws); if (p->ws) free(p->ws); p->ws=newstr; #endif diff --git a/src/modules/Pipe/pipe.c b/src/modules/Pipe/pipe.c index 3c434ffeb67178fb9121600f6aa26418f9c84957..31c6bf163612b5f1eecf4c5416dfd1df516982f8 100644 --- a/src/modules/Pipe/pipe.c +++ b/src/modules/Pipe/pipe.c @@ -579,7 +579,7 @@ static INLINE struct pike_string* gimme_some_data(size_t pos) src = this->firstinput->u.mmap + pos - this->pos; /* This thread_allow/deny is at the cost of one extra memory copy */ THREADS_ALLOW(); - MEMCPY(tmp->str, src, len); + memcpy(tmp->str, src, len); THREADS_DISALLOW(); return end_shared_string(tmp); } diff --git a/src/modules/SANE/sane.c b/src/modules/SANE/sane.c index 66fde53199f00213d99921ed01e49facde135f76..9719b800a257bc808a8168fcfdb7f4dc4cc3f14f 100644 --- a/src/modules/SANE/sane.c +++ b/src/modules/SANE/sane.c @@ -651,7 +651,7 @@ static void nonblocking_row_scan_callback( int fd, void *_c ) } break; case SANE_FRAME_RGB: - MEMCPY( (char *)c->r, c->buffer, c->p.bytes_per_line ); + memcpy( (char *)c->r, c->buffer, c->p.bytes_per_line ); break; default:break; } diff --git a/src/modules/_Image_GIF/image_gif.c b/src/modules/_Image_GIF/image_gif.c index 62cfa7c43ba172e7f026b93d71f1e475f88bfeeb..7bb5ea269068fdcac75f0f7507af2c82a3ad070c 100644 --- a/src/modules/_Image_GIF/image_gif.c +++ b/src/modules/_Image_GIF/image_gif.c @@ -550,7 +550,7 @@ CHRONO("gif _render_block push of packed data begin"); { ps=begin_shared_string(256); *((unsigned char*)(ps->str))=255; - MEMCPY(ps->str+1,lzw.out+i,255); + memcpy(ps->str+1,lzw.out+i,255); push_string(end_shared_string(ps)); numstrings++; if (numstrings>32) /* shrink stack */ @@ -564,7 +564,7 @@ CHRONO("gif _render_block push of packed data begin"); { ps=begin_shared_string(lzw.outpos-i+2); ps->str[0] = DO_NOT_WARN((char)(lzw.outpos-i)); - MEMCPY(ps->str+1,lzw.out+i,lzw.outpos-i); + memcpy(ps->str+1,lzw.out+i,lzw.outpos-i); ps->str[lzw.outpos-i+1]=0; push_string(end_shared_string(ps)); numstrings++; @@ -1818,17 +1818,17 @@ static void gif_deinterlace(rgb_group *s, tmp=malloc(xsize*ysize*sizeof(rgb_group)); if (!tmp) return; - MEMCPY(tmp,s,xsize*ysize*sizeof(rgb_group)); + memcpy(tmp,s,xsize*ysize*sizeof(rgb_group)); n=0; for (y=0; y<ysize; y+=8) - MEMCPY(s+y*xsize,tmp+n++*xsize,xsize*sizeof(rgb_group)); + memcpy(s+y*xsize,tmp+n++*xsize,xsize*sizeof(rgb_group)); for (y=4; y<ysize; y+=8) - MEMCPY(s+y*xsize,tmp+n++*xsize,xsize*sizeof(rgb_group)); + memcpy(s+y*xsize,tmp+n++*xsize,xsize*sizeof(rgb_group)); for (y=2; y<ysize; y+=4) - MEMCPY(s+y*xsize,tmp+n++*xsize,xsize*sizeof(rgb_group)); + memcpy(s+y*xsize,tmp+n++*xsize,xsize*sizeof(rgb_group)); for (y=1; y<ysize; y+=2) - MEMCPY(s+y*xsize,tmp+n++*xsize,xsize*sizeof(rgb_group)); + memcpy(s+y*xsize,tmp+n++*xsize,xsize*sizeof(rgb_group)); free(tmp); } @@ -2386,7 +2386,7 @@ void image_gif__encode_extension(INT32 args) { d=begin_shared_string(256); *((unsigned char*)(d->str))=255; - MEMCPY(d->str+1,s->str+i,255); + memcpy(d->str+1,s->str+i,255); push_string(end_shared_string(d)); n++; if (n>32) /* shrink stack */ @@ -2400,7 +2400,7 @@ void image_gif__encode_extension(INT32 args) { d=begin_shared_string(s->len-i+2); d->str[0] = DO_NOT_WARN(s->len - i); - MEMCPY(d->str+1, s->str+i, d->len-i); + memcpy(d->str+1, s->str+i, d->len-i); d->str[d->len-i+1]=0; push_string(end_shared_string(d)); n++; diff --git a/src/modules/_Image_TIFF/image_tiff.c b/src/modules/_Image_TIFF/image_tiff.c index 1c5aff29e09893b598ff3aa4db3b91669c399e4e..c2c7b414dbf55959bbddf1fccffc69bbba855491 100644 --- a/src/modules/_Image_TIFF/image_tiff.c +++ b/src/modules/_Image_TIFF/image_tiff.c @@ -125,7 +125,7 @@ static tsize_t read_buffer( thandle_t bh, tdata_t d, tsize_t len ) buffer_handle->offset, buffer_handle->real_len, avail); if(!avail) return -1; len = MINIMUM(avail, len); - MEMCPY(data, buffer_handle->str+buffer_handle->offset, len); + memcpy(data, buffer_handle->str+buffer_handle->offset, len); buffer_handle->offset += len; return len; } @@ -145,7 +145,7 @@ static tsize_t write_buffer(thandle_t bh, tdata_t d, tsize_t len) len); increase_buffer_size( buffer_handle ); } - MEMCPY( buffer_handle->str+buffer_handle->offset, data, len ); + memcpy( buffer_handle->str+buffer_handle->offset, data, len ); buffer_handle->offset += len; if(buffer_handle->offset > buffer_handle->real_len) buffer_handle->real_len = buffer_handle->offset; diff --git a/src/modules/_Roxen/roxen.c b/src/modules/_Roxen/roxen.c index 6ae6653a742833eb99cb484559956bdfda98388b..9c77f08a902dc87b24d6978a7acae15155e5a128 100644 --- a/src/modules/_Roxen/roxen.c +++ b/src/modules/_Roxen/roxen.c @@ -126,7 +126,7 @@ static void f_hp_feed( INT32 args ) hp->pnt = (hp->headers + hp->hsize - hp->left); } - MEMCPY( hp->pnt, str->str, str_len ); + memcpy( hp->pnt, str->str, str_len ); pop_n_elems( args ); /* FIXME: The below does not support lines terminated with just \r. */ diff --git a/src/modules/_Stdio/efuns.c b/src/modules/_Stdio/efuns.c index e324978a880426fc99be7ad5989ee277d433f24c..83728d317b477cbaddcd4ac3dab7850f0a5d3124 100644 --- a/src/modules/_Stdio/efuns.c +++ b/src/modules/_Stdio/efuns.c @@ -1292,7 +1292,7 @@ void low_get_dir(DIR *dir, ptrdiff_t name_max) if(num_files >= FPR) break; lens[num_files]=NAMLEN(d); if(bufptr+lens[num_files] >= buffer+sizeof(buffer)) break; - MEMCPY(bufptr, d->d_name, lens[num_files]); + memcpy(bufptr, d->d_name, lens[num_files]); ptrs[num_files]=bufptr; bufptr+=lens[num_files]; num_files++; diff --git a/src/modules/_Stdio/file.c b/src/modules/_Stdio/file.c index 41094a37a28ff13ae0c1e0ce0e79b54d089f091e..894e1e40d0b04a7c04954609556eac41e822378d 100644 --- a/src/modules/_Stdio/file.c +++ b/src/modules/_Stdio/file.c @@ -1216,7 +1216,7 @@ static int writev_fds(int fd, struct iovec *iov, int iovcnt, cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_type = SCM_RIGHTS; - MEMCPY(CMSG_DATA(cmsg), fds, num_fds * sizeof(int)); + memcpy(CMSG_DATA(cmsg), fds, num_fds * sizeof(int)); msg.msg_flags = 0; #else diff --git a/src/modules/_WhiteFish/blob.c b/src/modules/_WhiteFish/blob.c index 43dd6747aecc6d8efee142b978e6887498dfff48..d2f702f23e069066f2417845a359326ac3fc4b98 100644 --- a/src/modules/_WhiteFish/blob.c +++ b/src/modules/_WhiteFish/blob.c @@ -530,9 +530,9 @@ static void f_blob__cast( INT32 args ) fsort( zipp[i].b->data+5, nh, 2, (void *)cmp_hit ); #else short *data = malloc( nh * 2 ); - MEMCPY( data, zipp[i].b->data+5, nh * 2 ); + memcpy( data, zipp[i].b->data+5, nh * 2 ); fsort( data, nh, 2, (void *)cmp_hit ); - MEMCPY( zipp[i].b->data+5, data, nh * 2 ); + memcpy( zipp[i].b->data+5, data, nh * 2 ); free( data ); #endif } diff --git a/src/modules/_WhiteFish/buffer.c b/src/modules/_WhiteFish/buffer.c index 9e93987023b16f2a3a53dad060cefaae954b136d..2980daae719e13cb50d659fccafc7d69dad9fdb0 100644 --- a/src/modules/_WhiteFish/buffer.c +++ b/src/modules/_WhiteFish/buffer.c @@ -71,7 +71,7 @@ void wf_buffer_wint( struct buffer *b, { s = htonl(s); wf_buffer_make_space( b, 4 ); - MEMCPY( b->data+b->size, &s, 4 ); + memcpy( b->data+b->size, &s, 4 ); b->size += 4; } @@ -119,7 +119,7 @@ int wf_buffer_memcpy( struct buffer *d, if( nelems <= 0 ) return 0; wf_buffer_make_space( d, nelems ); - MEMCPY( d->data+d->size, s->data+s->rpos, nelems ); + memcpy( d->data+d->size, s->data+s->rpos, nelems ); s->rpos += nelems; d->size += nelems; return nelems; @@ -195,7 +195,7 @@ void wf_buffer_set_pike_string( struct buffer *b, b->size = data->len; b->data = malloc( b->size ); b->allocated_size = b->size; - MEMCPY( b->data, data->str, b->size ); + memcpy( b->data, data->str, b->size ); } } @@ -209,6 +209,6 @@ void wf_buffer_append( struct buffer *b, int size ) { wf_buffer_make_space( b, size ); - MEMCPY( b->data+b->size, data, size ); + memcpy( b->data+b->size, data, size ); b->size+=size; } diff --git a/src/modules/_WhiteFish/resultset.c b/src/modules/_WhiteFish/resultset.c index 8b3ccf8c8e5149fe8f992b38976c158ae3737a4c..b1939a27c899eace265a21ab8f637ce818f0dab9 100644 --- a/src/modules/_WhiteFish/resultset.c +++ b/src/modules/_WhiteFish/resultset.c @@ -378,7 +378,7 @@ static void f_resultset_dup( INT32 args ) if(THIS->d) { ResultSet *d = malloc( THIS->d->num_docs * 8 + 4 ); - MEMCPY( d, THIS->d, THIS->d->num_docs * 8 + 4 ); + memcpy( d, THIS->d, THIS->d->num_docs * 8 + 4 ); T(o)->d = d; T(o)->allocated_size = T(o)->d->num_docs; } @@ -434,7 +434,7 @@ static void duplicate_resultset( struct object *dest, int size = 4+4*T(src)->allocated_size*2; T(dest)->allocated_size = T(src)->allocated_size; T(dest)->d = malloc( size ); - MEMCPY( (char *)T(dest)->d, (char *)T(src)->d, size ); + memcpy( (char *)T(dest)->d, (char *)T(src)->d, size ); } } diff --git a/src/modules/sybase/sybase.c b/src/modules/sybase/sybase.c index d26f2937c35109109613a8d6a8a454cec3a62e21..8c6cdb66fdb870bbdc3cf4105dcc5113a3f71640 100644 --- a/src/modules/sybase/sybase.c +++ b/src/modules/sybase/sybase.c @@ -260,7 +260,7 @@ static int handle_errors (pike_sybase_connection *this) { show_severity(severity); } - MEMCPY(this->error,message.sqlerrm.sqlerrmc, + memcpy(this->error,message.sqlerrm.sqlerrmc, message.sqlerrm.sqlerrml+1); this->had_error=1; diff --git a/src/modules/system/memory.c b/src/modules/system/memory.c index 603d5946d3188b96ab9f8ab9a08ca851c3a80f90..76cffc7fb34ac6940184ef9dcecb29e863779aa5 100644 --- a/src/modules/system/memory.c +++ b/src/modules/system/memory.c @@ -747,7 +747,7 @@ static void pwrite_n(INT32 args,int shift,int reverse,char *func) case 022: /* 2 -> 2 */ if (reverse) copy_reverse_string2(d, (unsigned char *)ps->str, ps->len); - else MEMCPY(d,ps->str,ps->len*4); + else memcpy(d,ps->str,ps->len*4); break; case 012: /* 1 -> 2 */ if (reverse) @@ -762,7 +762,7 @@ static void pwrite_n(INT32 args,int shift,int reverse,char *func) case 011: /* 1 -> 1 */ if (reverse) copy_reverse_string1(d, (unsigned char *)ps->str,ps->len); - else MEMCPY(d,ps->str,ps->len*2); + else memcpy(d,ps->str,ps->len*2); break; case 001: /* 0 -> 1 */ if (reverse) @@ -770,7 +770,7 @@ static void pwrite_n(INT32 args,int shift,int reverse,char *func) else convert_0_to_1((p_wchar1*)d, STR0(ps), ps->len); break; case 000: - MEMCPY(d,ps->str,ps->len); + memcpy(d,ps->str,ps->len); break; default: Pike_error("Illegal state %d -> %d\n",ps->size_shift,shift); @@ -900,7 +900,7 @@ static void memory_index_write(INT32 args) "not equally long (%ld v/s %ld; can't resize memory)\n", DO_NOT_WARN((long)ps->len), (long)pos2-(long)pos1); else - MEMCPY(THIS->p+pos1, ps->str, ps->len); + memcpy(THIS->p+pos1, ps->str, ps->len); ref_push_string(ps); } diff --git a/src/modules/system/nt.c b/src/modules/system/nt.c index 079d8670cca81e8ba059b29e0a29a61cc7576250..9622dfb81082526661db614d61c5fc366c056b20 100644 --- a/src/modules/system/nt.c +++ b/src/modules/system/nt.c @@ -1198,7 +1198,7 @@ static void low_encode_localgroup_members_info_0(LOCALGROUP_MEMBERS_INFO_0 *tmp) int lentmp=getlengthsid( (X) ); \ PSID psidtmp=xalloc(lentmp); \ struct object *o=low_clone(sid_program); \ - MEMCPY( psidtmp, (X), lentmp); \ + memcpy( psidtmp, (X), lentmp); \ (*(PSID *)(o->storage))=psidtmp; \ push_object(o); \ } else { \ @@ -2768,7 +2768,7 @@ static void f_normalize_path(INT32 args) * e.g. "c:\\". */ file = xalloc(str->len + 2); SET_ONERROR (file_uwp, free, file); - MEMCPY(file, str->str, str->len); + memcpy(file, str->str, str->len); file[str->len] = '.'; file[str->len + 1] = 0; } diff --git a/src/modules/system/system.c b/src/modules/system/system.c index d8350b94fe65be57e117f437ae55a5faf8884c8c..b388fdceede30b7759adb0f8a7d35b2460f50cd6 100644 --- a/src/modules/system/system.c +++ b/src/modules/system/system.c @@ -1984,7 +1984,7 @@ int get_inet_addr(PIKE_SOCKADDR *addr,char *name,char *service, INT_TYPE port, if(found) { /* fprintf(stderr, "Got %d bytes (family: %d (%d))\n", */ /* addr_len, found->ai_addr->sa_family, found->ai_family); */ - MEMCPY((char *)addr, (char *)found->ai_addr, addr_len); + memcpy((char *)addr, (char *)found->ai_addr, addr_len); } freeaddrinfo(res); if(addr_len) { @@ -2026,7 +2026,7 @@ int get_inet_addr(PIKE_SOCKADDR *addr,char *name,char *service, INT_TYPE port, ipv4.sin_addr.s_addr = inet_addr(name); addr->ipv6.sin6_addr.s6_addr[10] = 0xff; addr->ipv6.sin6_addr.s6_addr[11] = 0xff; - MEMCPY(addr->ipv6.sin6_addr.s6_addr + 12, &ipv4.sin_addr.s_addr, 4); + memcpy(addr->ipv6.sin6_addr.s6_addr + 12, &ipv4.sin_addr.s_addr, 4); } else #endif addr->ipv4.sin_addr.s_addr = inet_addr(name); @@ -2049,11 +2049,11 @@ int get_inet_addr(PIKE_SOCKADDR *addr,char *name,char *service, INT_TYPE port, SOCKADDR_FAMILY(*addr) = ret->h_addrtype; #ifdef HAVE_H_ADDR_LIST - MEMCPY((char *)SOCKADDR_IN_ADDR(*addr), + memcpy((char *)SOCKADDR_IN_ADDR(*addr), (char *)ret->h_addr_list[0], ret->h_length); #else - MEMCPY((char *)SOCKADDR_IN_ADDR(*addr), + memcpy((char *)SOCKADDR_IN_ADDR(*addr), (char *)ret->h_addr, ret->h_length); #endif @@ -2134,7 +2134,7 @@ static void describe_hostent(struct hostent *hp) #else struct in_addr in; - MEMCPY(&in.s_addr, *p, sizeof (in.s_addr)); + memcpy(&in.s_addr, *p, sizeof (in.s_addr)); push_text(inet_ntoa(in)); #endif nelem++; @@ -2157,7 +2157,7 @@ static void describe_hostent(struct hostent *hp) push_text(fd_inet_ntop(hp->h_addrtype, hp->h_addr, buffer, sizeof(buffer))); #else struct in_addr in; - MEMCPY(&in.s_addr, hp->h_addr, sizeof (in.s_addr)); + memcpy(&in.s_addr, hp->h_addr, sizeof (in.s_addr)); push_text(inet_ntoa(in)); #endif } diff --git a/src/object.c b/src/object.c index 0e2a515b44d4ec56d3ced9cc67c102d6fbe3c133..9994d09e4e7acb818aa18364eea0adb23fbef866 100644 --- a/src/object.c +++ b/src/object.c @@ -555,7 +555,7 @@ PMOD_EXPORT struct object *get_master(void) tmp=xalloc(strlen(master_file)+3); - MEMCPY(tmp, master_file, strlen(master_file)+1); + memcpy(tmp, master_file, strlen(master_file)+1); strcat(tmp,".o"); s = NULL; diff --git a/src/operators.c b/src/operators.c index aa3842e9f36eab7ddd39ed833a85a72de705dd55..a24c78a9385d61770beb57a19968e274a6112782 100644 --- a/src/operators.c +++ b/src/operators.c @@ -3631,20 +3631,20 @@ PMOD_EXPORT void o_multiply(void) pos = ret->str; if (len > delta) { - MEMCPY(pos, src->str, delta); + memcpy(pos, src->str, delta); pos += delta; len -= delta; while (len > delta) { - MEMCPY(pos, ret->str, delta); + memcpy(pos, ret->str, delta); pos += delta; len -= delta; delta <<= 1; } if (len) { - MEMCPY(pos, ret->str, len); + memcpy(pos, ret->str, len); } } else if (len) { - MEMCPY(pos, src->str, len); + memcpy(pos, src->str, len); } pop_n_elems(2); push_string(low_end_shared_string(ret)); @@ -3665,7 +3665,7 @@ PMOD_EXPORT void o_multiply(void) pos=ret->str; len=sp[-2].u.string->len << sp[-2].u.string->size_shift; for(e=0;e<sp[-1].u.integer;e++,pos+=len) - MEMCPY(pos,sp[-2].u.string->str,len); + memcpy(pos,sp[-2].u.string->str,len); pop_n_elems(2); push_string(low_end_shared_string(ret)); return; diff --git a/src/pike_memory.c b/src/pike_memory.c index 9a6ff483e26094f743d112aa383800f12e0d5c36..c1612da65b9a2f57041fadf432ab4fff9ae90d33 100644 --- a/src/pike_memory.c +++ b/src/pike_memory.c @@ -41,7 +41,7 @@ char *strdup(const char *str) int len = strlen(str)+1; res = xalloc(len); - MEMCPY(res, str, len); + memcpy(res, str, len); } return(res); } @@ -80,9 +80,9 @@ static void swap(char *a, char *b, size_t size) while(size) { tmp = MINIMUM((size_t)sizeof(tmpbuf), size); - MEMCPY(tmpbuf,a,tmp); - MEMCPY(a,b,tmp); - MEMCPY(b,tmpbuf,tmp); + memcpy(tmpbuf,a,tmp); + memcpy(a,b,tmp); + memcpy(b,tmpbuf,tmp); size-=tmp; a+=tmp; b+=tmp; @@ -180,10 +180,10 @@ void reorder(char *memory, INT32 nitems, INT32 size,INT32 *order) #endif default: - for(e=0;e<nitems;e++) MEMCPY(tmp+e*size, memory+order[e]*size, size); + for(e=0;e<nitems;e++) memcpy(tmp+e*size, memory+order[e]*size, size); } - MEMCPY(memory, tmp, size * nitems); + memcpy(memory, tmp, size * nitems); free(tmp); } @@ -439,7 +439,7 @@ PMOD_EXPORT char *debug_xstrdup(const char *src) if (src) { int len = strlen (src) + 1; dst = malloc (len); - MEMCPY (dst, src, len); + memcpy (dst, src, len); } return dst; } @@ -1287,7 +1287,7 @@ PMOD_EXPORT void *realloc(void *x,size_t y) if(old_size >= y) return x; ret=malloc(y); if(!ret) return 0; - MEMCPY(ret, x, old_size); + memcpy(ret, x, old_size); if(x) free(x); }else{ ret=debug_realloc(x, y, DMALLOC_LOCATION()); @@ -1314,7 +1314,7 @@ void *fake_realloc(void *x,size_t y) if(old_size >= y) return x; ret=malloc(y); if(!ret) return 0; - MEMCPY(ret, x, old_size); + memcpy(ret, x, old_size); if(x) free(x); }else{ ret=real_realloc(x,y); @@ -1531,8 +1531,8 @@ char *do_pad(char *mem, long size) /* fprintf(stderr,"Padding %p(%d) %ld\n",mem, size, q); */ #if 1 q%=RNDSIZE; - MEMCPY(mem - DEBUG_MALLOC_PAD, rndbuf+q, DEBUG_MALLOC_PAD); - MEMCPY(mem + size, rndbuf+q, DEBUG_MALLOC_PAD); + memcpy(mem - DEBUG_MALLOC_PAD, rndbuf+q, DEBUG_MALLOC_PAD); + memcpy(mem + size, rndbuf+q, DEBUG_MALLOC_PAD); #else for(e=0;e< DEBUG_MALLOC_PAD; e+=4) { @@ -1942,7 +1942,7 @@ static struct memhdr *low_make_memhdr(void *p, int s, LOCATION location mh->gc_generation=gc_generation * 1000 + Pike_in_gc; #ifdef DMALLOC_C_STACK_TRACE if (bt_len > 0) { - MEMCPY (mh->alloc_bt, bt, bt_len * sizeof (c_stack_frame)); + memcpy (mh->alloc_bt, bt, bt_len * sizeof (c_stack_frame)); mh->alloc_bt_len = bt_len; } else @@ -2306,7 +2306,7 @@ PMOD_EXPORT char *debug_strdup(const char *s, LOCATION location) long length; length=strlen(s); m=(char *)debug_malloc(length+1,location); - MEMCPY(m,s,length+1); + memcpy(m,s,length+1); if(verbose_debug_malloc) fprintf(stderr, "strdup(\"%s\") => %p (%s)\n", s, m, LOCATION_NAME(location)); @@ -2978,7 +2978,7 @@ static LOCATION low_dynamic_location(char type, const char *file, Pike_fatal ("Too long bin_data blob: %u\n", bin_data_len); ((unsigned char *) str->str)[l + 1] = ((unsigned char *) &bl)[0]; ((unsigned char *) str->str)[l + 2] = ((unsigned char *) &bl)[1]; - MEMCPY (str->str + l + 3, bin_data, bin_data_len); + memcpy (str->str + l + 3, bin_data, bin_data_len); } str->hval=hval; @@ -3099,7 +3099,7 @@ static void dump_location_bt (LOCATION location, int indent, const char *prefix) unsigned char *bin_base = (unsigned char *) location + strlen (location) + 1; unsigned int bin_len = EXTRACT_UWORD (bin_base); - MEMCPY ((unsigned char *) bt, bin_base + 2, bin_len); + memcpy ((unsigned char *) bt, bin_base + 2, bin_len); frames = bin_len / sizeof (c_stack_frame); for (i = 0; i < frames; i++) { diff --git a/src/pike_types.c b/src/pike_types.c index 42927ff2e2081506970781496ee56fe12fb99c86..55e3e047e718485366ae8304a1e590ea11b741ba 100644 --- a/src/pike_types.c +++ b/src/pike_types.c @@ -8423,7 +8423,7 @@ static void low_make_pike_type(unsigned char *type_string, break; } str = begin_wide_shared_string(bytes>>size_shift, size_shift); - MEMCPY(str->str, type_string+2, bytes); + memcpy(str->str, type_string+2, bytes); if (size_shift && #if (PIKE_BYTEORDER == 1234) /* Little endian */ diff --git a/src/port.c b/src/port.c index fff4c729fd8c460686710b4d697cea98e31ed1ca..d05c7498c60530c2c5ef690171b6206bd37b1f0a 100644 --- a/src/port.c +++ b/src/port.c @@ -262,18 +262,6 @@ PMOD_EXPORT int STRCASECMP(const char *a,const char *b) } #endif -#indef HAVE_MEMCPY -PMOD_EXPORT void MEMCPY(void *bb,const void *aa,size_t s) -{ - if(!s) return; - { - char *b=(char *)bb; - char *a=(char *)aa; - for(;s;s--) *(b++)=*(a++); - } -} -#endif - #ifndef HAVE_MEMMOVE PMOD_EXPORT void MEMMOVE(void *b,const void *aa,size_t s) { @@ -336,7 +324,7 @@ PMOD_EXPORT int VSPRINTF(char *buf,const char *fmt,va_list args) fmt2[0]='%'; for(;(s=STRCHR(fmt,'%'));fmt=s) { - MEMCPY(buf,fmt,s-fmt); + memcpy(buf,fmt,s-fmt); buf+=s-fmt; fmt=s; fmt2p=fmt2+1; @@ -388,7 +376,7 @@ PMOD_EXPORT int VSPRINTF(char *buf,const char *fmt,va_list args) } } tmpA=strlen(fmt); - MEMCPY(buf,fmt,tmpA); + memcpy(buf,fmt,tmpA); buf+=tmpA; *buf=0; return buf-b; @@ -430,21 +418,21 @@ PMOD_EXPORT int SNPRINTF(char *buf, size_t size, const char *fmt, ...) PMOD_EXPORT unsigned INT16 EXTRACT_UWORD_(unsigned char *p) { unsigned INT16 a; - MEMCPY((char *)&a,p,sizeof(a)); + memcpy((char *)&a,p,sizeof(a)); return a; } PMOD_EXPORT INT16 EXTRACT_WORD_(unsigned char *p) { INT16 a; - MEMCPY((char *)&a,p,sizeof(a)); + memcpy((char *)&a,p,sizeof(a)); return a; } PMOD_EXPORT INT32 EXTRACT_INT_(unsigned char *p) { INT32 a; - MEMCPY((char *)&a,p,sizeof(a)); + memcpy((char *)&a,p,sizeof(a)); return a; } #endif diff --git a/src/port.h b/src/port.h index ecfa659a957e3d6210da7034d5f3f49bf9e43d3c..96bfc70faf9c8b7d5da8cac4c3aa6f07b72387a8 100644 --- a/src/port.h +++ b/src/port.h @@ -173,12 +173,8 @@ PMOD_EXPORT int STRCASECMP(const char *a,const char *b); #define HAVE_MEMSET 1 #define MEMSET memset -#ifndef HAVE_MEMCPY -void MEMCPY(void *b,const void *a,size_t s); -# define __builtin_memcpy MEMCPY -#else -# define MEMCPY(X,Y,Z) memcpy((char*)(X),(char*)(Y),(Z)) -#endif +#define HAVE_MEMCPY 1 +#define MEMCPY(X,Y,Z) memcpy((char*)(X),(char*)(Y),(Z)) #ifndef HAVE_MEMMOVE PMOD_EXPORT void MEMMOVE(void *b,const void *a,size_t s); @@ -254,21 +250,21 @@ PMOD_EXPORT INT32 EXTRACT_INT_(unsigned char *p); /*@unused@*/ static INLINE unsigned EXTRACT_UWORD_(unsigned char *p) { unsigned INT16 a; - MEMCPY((char *)&a,p,sizeof(a)); + memcpy((char *)&a,p,sizeof(a)); return a; } /*@unused@*/ static INLINE int EXTRACT_WORD_(unsigned char *p) { INT16 a; - MEMCPY((char *)&a,p,sizeof(a)); + memcpy((char *)&a,p,sizeof(a)); return a; } /*@unused@*/ static INLINE INT32 EXTRACT_INT_(unsigned char *p) { INT32 a; - MEMCPY((char *)&a,p,sizeof(a)); + memcpy((char *)&a,p,sizeof(a)); return a; } #endif diff --git a/src/post_modules/Bz2/libbzip2mod.cmod b/src/post_modules/Bz2/libbzip2mod.cmod index 4cda09ca5baf32f2e031c29af5dbef1546663cf4..3353ae0e11b291eb20fe9927ed451ef54222aca5 100644 --- a/src/post_modules/Bz2/libbzip2mod.cmod +++ b/src/post_modules/Bz2/libbzip2mod.cmod @@ -654,7 +654,7 @@ PIKECLASS Inflate if(tmp_internbuf == NULL){ Pike_error("Failed to allocate memory in Bz2.Inflate->inflate().\n"); } - MEMCPY (tmp_internbuf, s->next_in, s->avail_in); + memcpy (tmp_internbuf, s->next_in, s->avail_in); } /* free buf space*/ if(THIS->internbuf != NULL){ diff --git a/src/post_modules/GSSAPI/gssapi.cmod b/src/post_modules/GSSAPI/gssapi.cmod index abe12cee4000625bc49d0a718584c602bd0b3f10..bca643451018e7e0daff842b328988a3260fcc22 100644 --- a/src/post_modules/GSSAPI/gssapi.cmod +++ b/src/post_modules/GSSAPI/gssapi.cmod @@ -267,7 +267,7 @@ static void cleanup_oid_set (gss_OID_set *oid_set) size_t l_ = src_->length; \ dst_->length = l_; \ dst_->elements = xalloc (l_); \ - MEMCPY (dst_->elements, src_->elements, l_); \ + memcpy (dst_->elements, src_->elements, l_); \ } while (0) /* Support code to map between gss_OID's and the dotted-decimal diff --git a/src/post_modules/GTK1/source/encode_truecolor.c b/src/post_modules/GTK1/source/encode_truecolor.c index 8129cc9cfad64a0322b7ed896d2b54cd2c2e171e..1e201fcd6f38c4b87804d746e709f7c6b62f3ed6 100644 --- a/src/post_modules/GTK1/source/encode_truecolor.c +++ b/src/post_modules/GTK1/source/encode_truecolor.c @@ -40,7 +40,7 @@ static void encode_truecolor_24_rgb( rgb_group *s, unsigned char *d, int q, int w ) { - MEMCPY(d,(unsigned char *)s,q); + memcpy(d,(unsigned char *)s,q); } static void encode_truecolor_24_rgb_al32_swapped( rgb_group *s, @@ -71,7 +71,7 @@ static void encode_truecolor_24_rgb_al32( rgb_group *s, { for(l=0; l<(q/w)/3; l++) { - MEMCPY(d,(unsigned char *)s,w*3); + memcpy(d,(unsigned char *)s,w*3); d += (w*3+3)&~3; } } diff --git a/src/post_modules/GTK1/source/support.c b/src/post_modules/GTK1/source/support.c index 649fec129677a8274a7f480c00a86425040cf410..11db3aea42b66cc59e0bed66af414bb1e4856ee6 100644 --- a/src/post_modules/GTK1/source/support.c +++ b/src/post_modules/GTK1/source/support.c @@ -251,7 +251,7 @@ GdkImage *gdkimage_from_pikeimage( struct object *img, int fast, GdkImage *i ) Pike_error("Failed to convert image\n"); } PFTIME("Converting image"); - MEMCPY(i->mem, Pike_sp[-1].u.string->str, Pike_sp[-1].u.string->len); + memcpy(i->mem, Pike_sp[-1].u.string->str, Pike_sp[-1].u.string->len); pop_stack(); /* string */ pop_stack(); /* function */ } @@ -357,24 +357,24 @@ void pgtk_get_mapping_arg( struct mapping *map, if(len != sizeof(char *)) Pike_fatal("oddities detected\n"); #endif - MEMCPY(((char **)dest), &s->u.string->str, sizeof(char *)); + memcpy(((char **)dest), &s->u.string->str, sizeof(char *)); break; case PIKE_T_INT: if(len == 2) { short i = (short)s->u.integer; - MEMCPY(((short *)dest), &i, 2); + memcpy(((short *)dest), &i, 2); } else if(len == 4) - MEMCPY(((int *)dest), &s->u.integer, len); + memcpy(((int *)dest), &s->u.integer, len); break; case PIKE_T_FLOAT: if(len == sizeof(FLOAT_TYPE)) - MEMCPY(((FLOAT_TYPE *)dest), &s->u.float_number,len); + memcpy(((FLOAT_TYPE *)dest), &s->u.float_number,len); else if(len == sizeof(double)) { double d = s->u.float_number; - MEMCPY(((double *)dest), &d,len); + memcpy(((double *)dest), &d,len); } break; } diff --git a/src/post_modules/GTK2/source/encode_truecolor.c b/src/post_modules/GTK2/source/encode_truecolor.c index 5e486d7d020a5e41097b7872703ddb92ce65a37c..a7c06bb9b11699bed5a8202166662ad114e18d99 100644 --- a/src/post_modules/GTK2/source/encode_truecolor.c +++ b/src/post_modules/GTK2/source/encode_truecolor.c @@ -40,7 +40,7 @@ static void encode_truecolor_24_rgb( rgb_group *s, unsigned char *d, int q, int w ) { - MEMCPY(d,(unsigned char *)s,q); + memcpy(d,(unsigned char *)s,q); } static void encode_truecolor_24_rgb_al32_swapped( rgb_group *s, @@ -71,7 +71,7 @@ static void encode_truecolor_24_rgb_al32( rgb_group *s, { for(l=0; l<(q/w)/3; l++) { - MEMCPY(d,(unsigned char *)s,w*3); + memcpy(d,(unsigned char *)s,w*3); d += (w*3+3)&~3; q--; } diff --git a/src/post_modules/GTK2/source/support.c b/src/post_modules/GTK2/source/support.c index 6400a9ca45dd2df6f8f7372c058851a565d53633..9e435aa02e8fb55e561c083995b9d138652b24bd 100644 --- a/src/post_modules/GTK2/source/support.c +++ b/src/post_modules/GTK2/source/support.c @@ -247,7 +247,7 @@ GdkImage *gdkimage_from_pikeimage(struct object *img, int fast, GObject **pi) { Pike_error("Failed to convert image\n"); } PFTIME("Converting image"); - MEMCPY(i->mem,Pike_sp[-1].u.string->str,Pike_sp[-1].u.string->len); + memcpy(i->mem,Pike_sp[-1].u.string->str,Pike_sp[-1].u.string->len); pop_stack(); /* string */ pop_stack(); /* function */ } @@ -348,21 +348,21 @@ void pgtk2_get_mapping_arg(struct mapping *map, if (len!=sizeof(char *)) Pike_fatal("oddities detected\n"); #endif - MEMCPY(((char **)dest),&s->u.string->str,sizeof(char *)); + memcpy(((char **)dest),&s->u.string->str,sizeof(char *)); break; case PIKE_T_INT: if (len==2) { short i=(short)s->u.integer; - MEMCPY(((short *)dest),&i,2); + memcpy(((short *)dest),&i,2); } else if (len==4) - MEMCPY(((int *)dest),&s->u.integer,len); + memcpy(((int *)dest),&s->u.integer,len); break; case PIKE_T_FLOAT: if (len==sizeof(FLOAT_TYPE)) - MEMCPY(((FLOAT_TYPE *)dest),&s->u.float_number,len); + memcpy(((FLOAT_TYPE *)dest),&s->u.float_number,len); else if (len==sizeof(double)) { double d=s->u.float_number; - MEMCPY(((double *)dest),&d,len); + memcpy(((double *)dest),&d,len); } break; } diff --git a/src/post_modules/Nettle/cipher.cmod b/src/post_modules/Nettle/cipher.cmod index 9f2dd72bfbdefacfb0cf2e0a18f84ad737c2b929..8c4802e282d528137123f8f5678f9302e1d7179c 100644 --- a/src/post_modules/Nettle/cipher.cmod +++ b/src/post_modules/Nettle/cipher.cmod @@ -75,7 +75,7 @@ static void pike_crypt_func(void *object, pike_nettle_size_t length, Pike_error("Bad string length %ld returned from crypt()\n", DO_NOT_WARN((long)str->len)); } - MEMCPY(dst, str->str, length); + memcpy(dst, str->str, length); pop_stack(); } @@ -728,7 +728,7 @@ PIKECLASS BufferedCipher if (THIS->backlog_len) { if (data->len >= (THIS->block_size - THIS->backlog_len)) { - MEMCPY(THIS->backlog + THIS->backlog_len, data->str, + memcpy(THIS->backlog + THIS->backlog_len, data->str, (THIS->block_size - THIS->backlog_len)); soffset += (THIS->block_size - THIS->backlog_len); THIS->backlog_len = 0; @@ -742,7 +742,7 @@ PIKECLASS BufferedCipher DO_NOT_WARN((long)Pike_sp[-1].u.string->len)); strings++; } else { - MEMCPY(THIS->backlog + THIS->backlog_len, + memcpy(THIS->backlog + THIS->backlog_len, data->str, data->len); THIS->backlog_len += data->len; pop_n_elems(args); @@ -770,7 +770,7 @@ PIKECLASS BufferedCipher } if (soffset < data->len) { - MEMCPY(THIS->backlog, data->str + soffset, data->len - soffset); + memcpy(THIS->backlog, data->str + soffset, data->len - soffset); THIS->backlog_len = data->len - soffset; } @@ -1315,7 +1315,7 @@ PIKECLASS BlockCipher NO_WIDE_STRING(iv); if(iv->len != THIS->block_size) Pike_error("Argument incompatible with cipher block size.\n"); - MEMCPY(STR0(THIS->iv), STR0(iv), THIS->block_size); + memcpy(STR0(THIS->iv), STR0(iv), THIS->block_size); RETURN this_object(); } @@ -1864,7 +1864,7 @@ PIKECLASS BlockCipher NO_WIDE_STRING(iv); if(iv->len != THIS->block_size) Pike_error("Argument incompatible with cipher block size.\n"); - MEMCPY(STR0(THIS->iv), STR0(iv), THIS->block_size); + memcpy(STR0(THIS->iv), STR0(iv), THIS->block_size); RETURN this_object(); } @@ -2375,7 +2375,7 @@ PIKECLASS BlockCipher NO_WIDE_STRING(iv); if(iv->len != THIS->block_size) Pike_error("Argument incompatible with cipher block size.\n"); - MEMCPY(STR0(THIS->iv), STR0(iv), THIS->block_size); + memcpy(STR0(THIS->iv), STR0(iv), THIS->block_size); RETURN this_object(); } @@ -2765,7 +2765,7 @@ PIKECLASS BlockCipher NO_WIDE_STRING(iv); if(iv->len != THIS->block_size) Pike_error("Argument incompatible with cipher block size.\n"); - MEMCPY(STR0(THIS->iv), STR0(iv), THIS->block_size); + memcpy(STR0(THIS->iv), STR0(iv), THIS->block_size); RETURN this_object(); } @@ -3177,7 +3177,7 @@ PIKECLASS BlockCipher16 *(ctr_iv++) = 14 - iv_len; - MEMCPY(ctr_iv, STR0(iv), iv_len); + memcpy(ctr_iv, STR0(iv), iv_len); memset(ctr_iv + iv_len, 0, 15 - iv_len); RETURN this_object(); @@ -3305,7 +3305,7 @@ PIKECLASS BlockCipher16 ptr[i] = psize & 0xff; } buf[0][0] = flags; - MEMCPY(buf[0]+1, STR0(nonce), nonce->len); + memcpy(buf[0]+1, STR0(nonce), nonce->len); func(ctx, 16, buf[1], buf[0]); bufno = 1; @@ -5187,7 +5187,7 @@ PIKECLASS DES buf[7] = (key->str[6]&127)<<1; } else - MEMCPY(buf, key->str, 8); + memcpy(buf, key->str, 8); des_fix_parity(8, buf, buf); RETURN make_shared_binary_string((char *)buf, 8); @@ -5296,7 +5296,7 @@ pike_des3_set_key(void *c, f_add(2); f_Nettle_DES3_fix_parity(1); - MEMCPY(nkotb, Pike_sp[-1].u.string->str, 8+8); + memcpy(nkotb, Pike_sp[-1].u.string->str, 8+8); pop_stack(); key = nkotb; @@ -5310,7 +5310,7 @@ pike_des3_set_key(void *c, o_range(); f_add(2); - MEMCPY(nkotb, Pike_sp[-1].u.string->str, 8+8+8); + memcpy(nkotb, Pike_sp[-1].u.string->str, 8+8+8); pop_stack(); key = nkotb; @@ -5320,7 +5320,7 @@ pike_des3_set_key(void *c, case 7+7+7: push_string(make_shared_binary_string(key, length)); f_Nettle_DES3_fix_parity(1); - MEMCPY(nkotb, Pike_sp[-1].u.string->str, 8+8+8); + memcpy(nkotb, Pike_sp[-1].u.string->str, 8+8+8); pop_stack(); key = nkotb; diff --git a/src/post_modules/Nettle/idea.c b/src/post_modules/Nettle/idea.c index 3ec081d33819f0d4fe7dbc5fe842e8e5428c3cb4..89053516e8fcda6ecbeb144eda60da950d839afd 100644 --- a/src/post_modules/Nettle/idea.c +++ b/src/post_modules/Nettle/idea.c @@ -170,7 +170,7 @@ idea_invert(unsigned INT16 *d, *--p = t2; *--p = t1; /* Copy and destroy temp copy */ - MEMCPY(d, temp, sizeof(temp)); + memcpy(d, temp, sizeof(temp)); memset(temp, 0, sizeof(temp)); } /* idea_invert */ diff --git a/src/post_modules/Nettle/nettle.cmod b/src/post_modules/Nettle/nettle.cmod index d255d05b1c0d404fece475944fef460d6c00c70f..70e2c9ac52e9456e26dcbe395b46c219921e8021 100644 --- a/src/post_modules/Nettle/nettle.cmod +++ b/src/post_modules/Nettle/nettle.cmod @@ -279,9 +279,9 @@ program_flags PROGRAM_CLEAR_STORAGE; static void fortuna_rekey(void) { fortuna_generate(); - MEMCPY(THIS->key, THIS->data, 16); + memcpy(THIS->key, THIS->data, 16); fortuna_generate(); - MEMCPY(THIS->key+16, THIS->data, 16); + memcpy(THIS->key+16, THIS->data, 16); aes_set_encrypt_key(&THIS->aes_ctx, AES256_KEY_SIZE, THIS->key); } diff --git a/src/post_modules/Nettle/nt.cmod b/src/post_modules/Nettle/nt.cmod index c6fe16228b84d9f6764bf5c4f81af8da716cf373..149ac3bff2e1b817a7150a7570650c54d7a21dcd 100644 --- a/src/post_modules/Nettle/nt.cmod +++ b/src/post_modules/Nettle/nt.cmod @@ -103,7 +103,7 @@ PIKECLASS CryptContext } res = begin_shared_string(size); if(init && size>0) - MEMCPY(res->str, init->str, MINIMUM(init->len,size)); + memcpy(res->str, init->str, MINIMUM(init->len,size)); if(CryptGenRandom(THIS->handle, size, (BYTE*)res->str)) { pop_n_elems(args); push_string(end_shared_string(res)); diff --git a/src/post_modules/Shuffler/c_source_stream.c b/src/post_modules/Shuffler/c_source_stream.c index e0359cd8647125489a05626464f7df7a5de6692e..6814b2098b41e0910fe888eedc9fa1be3daee98b 100644 --- a/src/post_modules/Shuffler/c_source_stream.c +++ b/src/post_modules/Shuffler/c_source_stream.c @@ -68,7 +68,7 @@ static struct data get_data( struct source *src, off_t UNUSED(len) ) if( s->available ) /* There is data in the buffer. Return it. */ { res.data = s->_buffer; - MEMCPY( res.data, s->_read_buffer, res.len ); + memcpy( res.data, s->_read_buffer, res.len ); s->available = 0; setup_callbacks( src ); } @@ -117,7 +117,7 @@ static void read_callback( int UNUSED(fd), struct fd_source *s ) s->skip -= l; return; } - MEMCPY( s->_read_buffer, s->_read_buffer+s->skip, l-s->skip ); + memcpy( s->_read_buffer, s->_read_buffer+s->skip, l-s->skip ); l-=s->skip; s->skip = 0; } diff --git a/src/post_modules/Shuffler/d_source_pikestream.c b/src/post_modules/Shuffler/d_source_pikestream.c index e5a666b8bacb5424dfb8e234d53a90bc2439d4c4..24309e2a18a3415b0d3577bd4190a023091ebb6d 100644 --- a/src/post_modules/Shuffler/d_source_pikestream.c +++ b/src/post_modules/Shuffler/d_source_pikestream.c @@ -87,7 +87,7 @@ static struct data get_data( struct source *src, off_t len ) } len -= s->skip; buffer = malloc( len ); - MEMCPY( buffer, s->str->str+s->skip, len); + memcpy( buffer, s->str->str+s->skip, len); } else { @@ -100,7 +100,7 @@ static struct data get_data( struct source *src, off_t len ) s->s.eof = 1; } buffer = malloc( len ); - MEMCPY( buffer, s->str->str, len ); + memcpy( buffer, s->str->str, len ); } res.data = buffer; res.len = len; diff --git a/src/program.c b/src/program.c index 69fb9c86a4291b02ae15a99eec802b13e24cb518..7243d469a13f9537a68fc1c0aa39909cc79dbff0 100644 --- a/src/program.c +++ b/src/program.c @@ -1574,7 +1574,7 @@ void PIKE_CONCAT(low_add_many_to_,NAME) (struct program_state *state, \ state->malloc_size_program->PIKE_CONCAT(num_,NAME)=m; \ state->new_program->NAME=tmp; \ } \ - MEMCPY(state->new_program->NAME + \ + memcpy(state->new_program->NAME + \ state->new_program->PIKE_CONCAT(num_,NAME), \ ARG, sizeof(TYPE) * cnt); \ state->new_program->PIKE_CONCAT(num_,NAME) += cnt; \ @@ -1606,7 +1606,7 @@ void PIKE_CONCAT(add_to_,NAME) (ARGTYPE ARG) { \ state->malloc_size_program->PIKE_CONCAT(num_,NAME)=m; \ state->new_program->NAME=tmp; \ } \ - MEMCPY(state->new_program->NAME + \ + memcpy(state->new_program->NAME + \ state->new_program->PIKE_CONCAT(num_,NAME), \ ARG, sizeof(TYPE) * cnt); \ state->new_program->PIKE_CONCAT(num_,NAME) += cnt; \ @@ -2375,7 +2375,7 @@ void optimize_program(struct program *p) #define FOO(NUMTYPE,TYPE,ARGTYPE,NAME) \ size=DO_ALIGN(size, ALIGNOF(TYPE)); \ if (p->PIKE_CONCAT (num_, NAME)) \ - MEMCPY(data+size,p->NAME,p->PIKE_CONCAT(num_,NAME)*sizeof(p->NAME[0])); \ + memcpy(data+size,p->NAME,p->PIKE_CONCAT(num_,NAME)*sizeof(p->NAME[0])); \ PIKE_CONCAT(RELOCATE_,NAME)(p, (TYPE *)(data+size)); \ dmfree(p->NAME); \ p->NAME=(TYPE *)(data+size); \ @@ -7702,7 +7702,7 @@ static char *make_plain_file (struct pike_string *filename, int malloced) if (len > NELEM (buf) - 1) len = NELEM (buf) - 1; } - MEMCPY (buffer, file, len); + memcpy (buffer, file, len); buffer[len] = 0; return buffer; } diff --git a/src/rbtree.c b/src/rbtree.c index 7d09b128c35d3724a305ea01111b928834b080b8..c54f80e04545ee2e0b141b34b55f3fda4b7da155 100644 --- a/src/rbtree.c +++ b/src/rbtree.c @@ -828,7 +828,7 @@ struct rb_node_hdr *low_rb_unlink_with_move (struct rb_node_hdr **root, } keep_flags (node, - MEMCPY ((char *) node + OFFSETOF (rb_node_hdr, flags), + memcpy ((char *) node + OFFSETOF (rb_node_hdr, flags), (char *) unlink + OFFSETOF (rb_node_hdr, flags), node_size - OFFSETOF (rb_node_hdr, flags))); diff --git a/src/sprintf.c b/src/sprintf.c index 853fa5c869496d3f1076a716ef6d6f22626481bf..9a3b3e96649994642c20d3cf3972e59e9435f509 100644 --- a/src/sprintf.c +++ b/src/sprintf.c @@ -1671,7 +1671,7 @@ cont_2: if ((f != 0.0) || (tf == 0.0)) { #endif #ifdef FLOAT_IS_IEEE_BIG - MEMCPY(x, &f, 4); + memcpy(x, &f, 4); #elif defined(FLOAT_IS_IEEE_LITTLE) x[0] = ((char *)&f)[3]; x[1] = ((char *)&f)[2]; @@ -1689,7 +1689,7 @@ cont_2: break; case 8: #ifdef DOUBLE_IS_IEEE_BIG - MEMCPY(x, &tf, 8); + memcpy(x, &tf, 8); #elif defined(DOUBLE_IS_IEEE_LITTLE) x[0] = ((char *)&tf)[7]; x[1] = ((char *)&tf)[6]; diff --git a/src/stralloc.c b/src/stralloc.c index e21e188b6e6e1c75eff3e880f290d8e4af041cc0..2c130ea3b7c54e156d0bfe9e294bab3f023441e3 100644 --- a/src/stralloc.c +++ b/src/stralloc.c @@ -943,7 +943,7 @@ PMOD_EXPORT struct pike_string * debug_make_shared_binary_string(const char *str if (!s) { s=begin_shared_string(len); - MEMCPY(s->str, str, len); + memcpy(s->str, str, len); link_pike_string(s, h); } else { add_ref(s); @@ -1000,7 +1000,7 @@ PMOD_EXPORT struct pike_string * debug_make_shared_binary_string1(const p_wchar1 if (!s) { s=begin_wide_shared_string(len,1); - MEMCPY(s->str, str, len<<1); + memcpy(s->str, str, len<<1); link_pike_string(s, h); } else { add_ref(s); @@ -1035,7 +1035,7 @@ PMOD_EXPORT struct pike_string * debug_make_shared_binary_string2(const p_wchar2 if (!s) { s=begin_wide_shared_string(len,2); - MEMCPY(s->str, str, len<<2); + memcpy(s->str, str, len<<2); link_pike_string(s, h); } else { add_ref(s); @@ -1698,9 +1698,9 @@ struct pike_string *realloc_unlinked_string(struct pike_string *a, r->min = a->min; r->max = a->max; if (a->len <= size) { - MEMCPY(r->str, a->str, a->len<<a->size_shift); + memcpy(r->str, a->str, a->len<<a->size_shift); } else { - MEMCPY(r->str, a->str, size<<a->size_shift); + memcpy(r->str, a->str, size<<a->size_shift); } free_string(a); } @@ -1721,7 +1721,7 @@ static struct pike_string *realloc_shared_string(struct pike_string *a, return realloc_unlinked_string(a, size); }else{ r=begin_wide_shared_string(size,a->size_shift); - MEMCPY(r->str, a->str, a->len<<a->size_shift); + memcpy(r->str, a->str, a->len<<a->size_shift); r->flags |= a->flags & ~15; r->min = a->min; r->max = a->max; @@ -1896,7 +1896,7 @@ struct pike_string *modify_shared_string(struct pike_string *a, }else{ struct pike_string *r; r=begin_wide_shared_string(a->len,a->size_shift); - MEMCPY(r->str, a->str, a->len << a->size_shift); + memcpy(r->str, a->str, a->len << a->size_shift); low_set_index(r,index,c); free_string(a); return end_shared_string(r); @@ -1970,7 +1970,7 @@ PMOD_EXPORT struct pike_string *add_and_free_shared_strings(struct pike_string * { a = realloc_shared_string(a, alen + b->len); update_flags_for_add( a, b ); - MEMCPY(a->str+(alen<<a->size_shift),b->str,b->len<<b->size_shift); + memcpy(a->str+(alen<<a->size_shift),b->str,b->len<<b->size_shift); free_string(b); a->flags |= STRING_NOT_HASHED; return end_shared_string(a); @@ -2359,7 +2359,7 @@ PMOD_EXPORT void init_string_builder_copy(struct string_builder *to, to->malloced = from->malloced; to->s = begin_wide_shared_string (from->malloced, from->s->size_shift); to->s->len = from->s->len; - MEMCPY (to->s->str, from->s->str, (from->s->len + 1) << from->s->size_shift); + memcpy (to->s->str, from->s->str, (from->s->len + 1) << from->s->size_shift); to->known_shift = from->known_shift; } @@ -2646,7 +2646,7 @@ PMOD_EXPORT void string_builder_fill(struct string_builder *s, while(howmany > 0) { tmp = MINIMUM(len, howmany); - MEMCPY(s->s->str + (s->s->len << s->s->size_shift), + memcpy(s->s->str + (s->s->len << s->s->size_shift), to.ptr, tmp << s->s->size_shift); len+=tmp; diff --git a/src/stralloc.h b/src/stralloc.h index a67a86b22003d687ff0c77ad230350bf46875824..09a353544d3f32d582e0491b98e7de74fb5b30e8 100644 --- a/src/stralloc.h +++ b/src/stralloc.h @@ -259,9 +259,9 @@ PMOD_EXPORT extern struct shared_string_location *all_shared_string_locations; #define MAKE_CONSTANT_SHARED_STRING(var, text) \ REF_MAKE_CONST_STRING(var, text) -#define convert_0_to_0(X,Y,Z) MEMCPY((char *)(X),(char *)(Y),(Z)) -#define convert_1_to_1(X,Y,Z) MEMCPY((char *)(X),(char *)(Y),(Z)<<1) -#define convert_2_to_2(X,Y,Z) MEMCPY((char *)(X),(char *)(Y),(Z)<<2) +#define convert_0_to_0(X,Y,Z) memcpy((char *)(X),(char *)(Y),(Z)) +#define convert_1_to_1(X,Y,Z) memcpy((char *)(X),(char *)(Y),(Z)<<1) +#define convert_2_to_2(X,Y,Z) memcpy((char *)(X),(char *)(Y),(Z)<<2) #define compare_0_to_0(X,Y,Z) MEMCMP((char *)(X),(char *)(Y),(Z)) #define compare_1_to_1(X,Y,Z) MEMCMP((char *)(X),(char *)(Y),(Z)<<1) diff --git a/src/svalue.c b/src/svalue.c index b7e91ac88ed6ad169f015d192cc60ba2d715d7b3..ee155af74829d885eed9aa816b6246d3dd8f3a1a 100644 --- a/src/svalue.c +++ b/src/svalue.c @@ -255,7 +255,7 @@ PMOD_EXPORT TYPE_FIELD assign_svalues_no_free(struct svalue *to, TYPE_FIELD masked_type; check_type_hint (from, num, type_hint); - MEMCPY((char *)to, (char *)from, sizeof(struct svalue) * num); + memcpy((char *)to, (char *)from, sizeof(struct svalue) * num); if (!(masked_type = (type_hint & BIT_REF_TYPES))) return type_hint;