diff options
| author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-03-26 02:51:44 -0300 |
|---|---|---|
| committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-03-26 16:28:13 -0300 |
| commit | 07dad7acf3d49b3136c5aad2c9fe05abb9aaf032 (patch) | |
| tree | 97ab0057d5c3cf17d2a2e90862c22432dd11c674 /src | |
| parent | dbc904956a17e6bec1ddeba9330b639167dbb882 (diff) | |
| download | rneovim-07dad7acf3d49b3136c5aad2c9fe05abb9aaf032.tar.gz rneovim-07dad7acf3d49b3136c5aad2c9fe05abb9aaf032.tar.bz2 rneovim-07dad7acf3d49b3136c5aad2c9fe05abb9aaf032.zip | |
Use memmove instead of mch_memmove
Diffstat (limited to 'src')
| -rw-r--r-- | src/blowfish.c | 14 | ||||
| -rw-r--r-- | src/buffer.c | 8 | ||||
| -rw-r--r-- | src/charset.c | 8 | ||||
| -rw-r--r-- | src/edit.c | 6 | ||||
| -rw-r--r-- | src/eval.c | 18 | ||||
| -rw-r--r-- | src/ex_cmds.c | 16 | ||||
| -rw-r--r-- | src/ex_cmds2.c | 10 | ||||
| -rw-r--r-- | src/ex_docmd.c | 14 | ||||
| -rw-r--r-- | src/ex_getln.c | 24 | ||||
| -rw-r--r-- | src/fileio.c | 44 | ||||
| -rw-r--r-- | src/fold.c | 12 | ||||
| -rw-r--r-- | src/garray.c | 2 | ||||
| -rw-r--r-- | src/getchar.c | 24 | ||||
| -rw-r--r-- | src/hashtab.c | 2 | ||||
| -rw-r--r-- | src/indent.c | 4 | ||||
| -rw-r--r-- | src/mark.c | 4 | ||||
| -rw-r--r-- | src/mbyte.c | 10 | ||||
| -rw-r--r-- | src/memline.c | 48 | ||||
| -rw-r--r-- | src/menu.c | 4 | ||||
| -rw-r--r-- | src/message.c | 16 | ||||
| -rw-r--r-- | src/misc1.c | 42 | ||||
| -rw-r--r-- | src/misc2.c | 40 | ||||
| -rw-r--r-- | src/normal.c | 2 | ||||
| -rw-r--r-- | src/ops.c | 40 | ||||
| -rw-r--r-- | src/option.c | 12 | ||||
| -rw-r--r-- | src/os_unix.c | 8 | ||||
| -rw-r--r-- | src/os_unix_defs.h | 18 | ||||
| -rw-r--r-- | src/regexp.c | 6 | ||||
| -rw-r--r-- | src/regexp_nfa.c | 20 | ||||
| -rw-r--r-- | src/screen.c | 46 | ||||
| -rw-r--r-- | src/search.c | 4 | ||||
| -rw-r--r-- | src/spell.c | 36 | ||||
| -rw-r--r-- | src/syntax.c | 8 | ||||
| -rw-r--r-- | src/tag.c | 8 | ||||
| -rw-r--r-- | src/term.c | 10 | ||||
| -rw-r--r-- | src/ui.c | 22 | ||||
| -rw-r--r-- | src/undo.c | 6 | ||||
| -rw-r--r-- | src/vim.h | 13 |
38 files changed, 300 insertions, 329 deletions
diff --git a/src/blowfish.c b/src/blowfish.c index 55c702cf31..6a48bec6b4 100644 --- a/src/blowfish.c +++ b/src/blowfish.c @@ -387,7 +387,7 @@ void bf_key_init(char_u *password, char_u *salt, int salt_len) key[i] = u; } - mch_memmove(sbx, sbi, 4 * 4 * 256); + memmove(sbx, sbi, 4 * 4 * 256); int keypos = 0; for (i = 0; i < 18; i++) { @@ -585,9 +585,9 @@ void bf_crypt_save(void) { save_randbyte_offset = randbyte_offset; save_update_offset = update_offset; - mch_memmove(save_ofb_buffer, ofb_buffer, BF_OFB_LEN); - mch_memmove(save_pax, pax, 4 * 18); - mch_memmove(save_sbx, sbx, 4 * 4 * 256); + memmove(save_ofb_buffer, ofb_buffer, BF_OFB_LEN); + memmove(save_pax, pax, 4 * 18); + memmove(save_sbx, sbx, 4 * 4 * 256); } /* @@ -598,9 +598,9 @@ void bf_crypt_restore(void) { randbyte_offset = save_randbyte_offset; update_offset = save_update_offset; - mch_memmove(ofb_buffer, save_ofb_buffer, BF_OFB_LEN); - mch_memmove(pax, save_pax, 4 * 18); - mch_memmove(sbx, save_sbx, 4 * 4 * 256); + memmove(ofb_buffer, save_ofb_buffer, BF_OFB_LEN); + memmove(pax, save_pax, 4 * 18); + memmove(sbx, save_sbx, 4 * 4 * 256); } /* diff --git a/src/buffer.c b/src/buffer.c index f175276a72..d0d0b033df 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -25,6 +25,8 @@ * The current implementation remembers all file names ever used. */ +#include <string.h> + #include "vim.h" #include "buffer.h" #include "charset.h" @@ -2933,7 +2935,7 @@ build_stl_str_hl ( /* There are too many items. Add the error code to the statusline * to give the user a hint about what went wrong. */ if (p + 6 < out + outlen) { - mch_memmove(p, " E541", (size_t)5); + memmove(p, " E541", (size_t)5); p += 5; } break; @@ -3010,7 +3012,7 @@ build_stl_str_hl ( n = (long)(p - t) - item[groupitem[groupdepth]].maxwid + 1; *t = '<'; - mch_memmove(t + 1, t + n, (size_t)(p - (t + n))); + memmove(t + 1, t + n, (size_t)(p - (t + n))); p = p - n + 1; /* Fill up space left over by half a double-wide char. */ while (++l < item[groupitem[groupdepth]].minwid) @@ -3032,7 +3034,7 @@ build_stl_str_hl ( *p++ = fillchar; } else { /* fill by inserting characters */ - mch_memmove(t + n - l, t, (size_t)(p - t)); + memmove(t + n - l, t, (size_t)(p - t)); l = n - l; if (p + l >= out + outlen) l = (long)((out + outlen) - p - 1); diff --git a/src/charset.c b/src/charset.c index 034aebc30f..a0514cf5b0 100644 --- a/src/charset.c +++ b/src/charset.c @@ -311,9 +311,9 @@ void trans_characters(char_u *buf, int bufsize) if (room <= 0) { return; } - mch_memmove(buf + trs_len, buf + 1, (size_t)len); + memmove(buf + trs_len, buf + 1, (size_t)len); } - mch_memmove(buf, trs, (size_t)trs_len); + memmove(buf, trs, (size_t)trs_len); --len; } buf += trs_len; @@ -427,14 +427,14 @@ char_u* str_foldcase(char_u *str, int orglen, char_u *buf, int buflen) if (ga_grow(&ga, len + 1) == FAIL) { return NULL; } - mch_memmove(ga.ga_data, str, (size_t)len); + memmove(ga.ga_data, str, (size_t)len); ga.ga_len = len; } else { if (len >= buflen) { // Ugly! len = buflen - 1; } - mch_memmove(buf, str, (size_t)len); + memmove(buf, str, (size_t)len); } if (buf == NULL) { diff --git a/src/edit.c b/src/edit.c index f081f9a219..85abda38b0 100644 --- a/src/edit.c +++ b/src/edit.c @@ -6298,7 +6298,7 @@ replace_push ( return; } if (replace_stack != NULL) { - mch_memmove(p, replace_stack, + memmove(p, replace_stack, (size_t)(replace_stack_nr * sizeof(char_u))); vim_free(replace_stack); } @@ -6306,7 +6306,7 @@ replace_push ( } p = replace_stack + replace_stack_nr - replace_offset; if (replace_offset) - mch_memmove(p + 1, p, (size_t)(replace_offset * sizeof(char_u))); + memmove(p + 1, p, (size_t)(replace_offset * sizeof(char_u))); *p = c; ++replace_stack_nr; } @@ -6352,7 +6352,7 @@ replace_join ( for (i = replace_stack_nr; --i >= 0; ) if (replace_stack[i] == NUL && off-- <= 0) { --replace_stack_nr; - mch_memmove(replace_stack + i, replace_stack + i + 1, + memmove(replace_stack + i, replace_stack + i + 1, (size_t)(replace_stack_nr - i)); return; } diff --git a/src/eval.c b/src/eval.c index fdf1032484..793ff30727 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1105,7 +1105,7 @@ void var_redir_str(char_u *value, int value_len) len = value_len; /* Append only "value_len" characters */ if (ga_grow(&redir_ga, len) == OK) { - mch_memmove((char *)redir_ga.ga_data + redir_ga.ga_len, value, len); + memmove((char *)redir_ga.ga_data + redir_ga.ga_len, value, len); redir_ga.ga_len += len; } else var_redir_stop(); @@ -7321,7 +7321,7 @@ call_func ( if (fname == NULL) error = ERROR_OTHER; else { - mch_memmove(fname, fname_buf, (size_t)i); + memmove(fname, fname_buf, (size_t)i); STRCPY(fname + i, name + llen); } } @@ -12016,7 +12016,7 @@ static void f_readfile(typval_T *argvars, typval_T *rettv) * the bytes are only copied once, and very long lines are * allocated only once. */ if ((s = vim_realloc(prev, prevlen + len + 1)) != NULL) { - mch_memmove(s + prevlen, start, len); + memmove(s + prevlen, start, len); s[prevlen + len] = NUL; prev = NULL; /* the list will own the string */ prevlen = prevsize = 0; @@ -12071,7 +12071,7 @@ static void f_readfile(typval_T *argvars, typval_T *rettv) dest = buf; } if (readlen > p - buf + 1) - mch_memmove(dest, p + 1, readlen - (p - buf) - 1); + memmove(dest, p + 1, readlen - (p - buf) - 1); readlen -= 3 - adjust_prevlen; prevlen -= adjust_prevlen; p = dest - 1; @@ -12109,7 +12109,7 @@ static void f_readfile(typval_T *argvars, typval_T *rettv) prev = newprev; } /* Add the line part to end of "prev". */ - mch_memmove(prev + prevlen, start, p - start); + memmove(prev + prevlen, start, p - start); prevlen += (long)(p - start); } } /* while */ @@ -12372,7 +12372,7 @@ static void f_repeat(typval_T *argvars, typval_T *rettv) r = alloc(len + 1); if (r != NULL) { for (i = 0; i < n; i++) - mch_memmove(r + i * slen, p, (size_t)slen); + memmove(r + i * slen, p, (size_t)slen); r[len] = NUL; } @@ -14905,7 +14905,7 @@ error: } ga_grow(&ga, cplen); - mch_memmove((char *)ga.ga_data + ga.ga_len, cpstr, (size_t)cplen); + memmove((char *)ga.ga_data + ga.ga_len, cpstr, (size_t)cplen); ga.ga_len += cplen; in_str += inlen; @@ -17829,7 +17829,7 @@ trans_function_name ( if (lead > 3) /* If it's "<SID>" */ STRCPY(name + 3, sid_buf); } - mch_memmove(name + lead, lv.ll_name, (size_t)len); + memmove(name + lead, lv.ll_name, (size_t)len); name[len + lead] = NUL; } *pp = end; @@ -19587,7 +19587,7 @@ char_u *do_string_sub(char_u *str, char_u *pat, char_u *sub, char_u *flags) /* copy the text up to where the match is */ i = (int)(regmatch.startp[0] - tail); - mch_memmove((char_u *)ga.ga_data + ga.ga_len, tail, (size_t)i); + memmove((char_u *)ga.ga_data + ga.ga_len, tail, (size_t)i); /* add the substituted text */ (void)vim_regsub(®match, sub, (char_u *)ga.ga_data + ga.ga_len + i, TRUE, TRUE, FALSE); diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 51e55b1300..b0919f3b30 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -11,6 +11,8 @@ * ex_cmds.c: some functions for command line commands */ +#include <string.h> + #include "vim.h" #include "version_defs.h" #include "ex_cmds.h" @@ -625,8 +627,8 @@ void ex_retab(exarg_T *eap) if (new_line == NULL) break; if (start_col > 0) - mch_memmove(new_line, ptr, (size_t)start_col); - mch_memmove(new_line + start_col + len, + memmove(new_line, ptr, (size_t)start_col); + memmove(new_line + start_col + len, ptr + col, (size_t)(old_len - col + 1)); ptr = new_line + start_col; for (col = 0; col < len; col++) @@ -4150,7 +4152,7 @@ void do_sub(exarg_T *eap) vim_free(new_start); goto outofmem; } - mch_memmove(p1, new_start, (size_t)(len + 1)); + memmove(p1, new_start, (size_t)(len + 1)); vim_free(new_start); new_start = p1; } @@ -4160,7 +4162,7 @@ void do_sub(exarg_T *eap) /* * copy the text up to the part that matched */ - mch_memmove(new_end, sub_firstline + copycol, (size_t)copy_len); + memmove(new_end, sub_firstline + copycol, (size_t)copy_len); new_end += copy_len; (void)vim_regsub_multi(®match, @@ -5088,16 +5090,16 @@ int find_help_tags(char_u *arg, int *num_matches, char_u ***matches, int keep_la if (*IObuff == '`') { if (d > IObuff + 2 && d[-1] == '`') { /* remove the backticks from `command` */ - mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff)); + memmove(IObuff, IObuff + 1, STRLEN(IObuff)); d[-2] = NUL; } else if (d > IObuff + 3 && d[-2] == '`' && d[-1] == ',') { /* remove the backticks and comma from `command`, */ - mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff)); + memmove(IObuff, IObuff + 1, STRLEN(IObuff)); d[-3] = NUL; } else if (d > IObuff + 4 && d[-3] == '`' && d[-2] == '\\' && d[-1] == '.') { /* remove the backticks and dot from `command`\. */ - mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff)); + memmove(IObuff, IObuff + 1, STRLEN(IObuff)); d[-4] = NUL; } } diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 90fbdb9c12..b461f8392a 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -11,6 +11,8 @@ * ex_cmds2.c: some more functions for command line commands */ +#include <string.h> + #include "vim.h" #include "version_defs.h" #include "ex_cmds2.h" @@ -582,7 +584,7 @@ void ex_breakdel(exarg_T *eap) vim_regfree(DEBUGGY(gap, todel).dbg_prog); --gap->ga_len; if (todel < gap->ga_len) - mch_memmove(&DEBUGGY(gap, todel), &DEBUGGY(gap, todel + 1), + memmove(&DEBUGGY(gap, todel), &DEBUGGY(gap, todel + 1), (gap->ga_len - todel) * sizeof(struct debuggy)); if (eap->cmdidx == CMD_breakdel) ++debug_tick; @@ -1629,7 +1631,7 @@ do_arglist ( (colnr_T)0)) { didone = TRUE; vim_free(ARGLIST[match].ae_fname); - mch_memmove(ARGLIST + match, ARGLIST + match + 1, + memmove(ARGLIST + match, ARGLIST + match + 1, (ARGCOUNT - match - 1) * sizeof(aentry_T)); --ALIST(curwin)->al_ga.ga_len; if (curwin->w_arg_idx > match) @@ -1973,7 +1975,7 @@ void ex_argdelete(exarg_T *eap) else { for (i = eap->line1; i <= eap->line2; ++i) vim_free(ARGLIST[i - 1].ae_fname); - mch_memmove(ARGLIST + eap->line1 - 1, ARGLIST + eap->line2, + memmove(ARGLIST + eap->line1 - 1, ARGLIST + eap->line2, (size_t)((ARGCOUNT - eap->line2) * sizeof(aentry_T))); ALIST(curwin)->al_ga.ga_len -= n; if (curwin->w_arg_idx >= eap->line2) @@ -2134,7 +2136,7 @@ alist_add_list ( if (after > ARGCOUNT) after = ARGCOUNT; if (after < ARGCOUNT) - mch_memmove(&(ARGLIST[after + count]), &(ARGLIST[after]), + memmove(&(ARGLIST[after + count]), &(ARGLIST[after]), (ARGCOUNT - after) * sizeof(aentry_T)); for (i = 0; i < count; ++i) { ARGLIST[after + i].ae_fname = files[i]; diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 87019dc749..d16458fe2d 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -3872,9 +3872,9 @@ static char_u *repl_cmdline(exarg_T *eap, char_u *src, int srclen, char_u *repl, * Copy the next commands, if there are any. */ i = (int)(src - *cmdlinep); /* length of part before match */ - mch_memmove(new_cmdline, *cmdlinep, (size_t)i); + memmove(new_cmdline, *cmdlinep, (size_t)i); - mch_memmove(new_cmdline + i, repl, (size_t)len); + memmove(new_cmdline + i, repl, (size_t)len); i += len; /* remember the end of the string */ STRCPY(new_cmdline + i, src + srclen); src = new_cmdline + i; /* remember where to continue */ @@ -4399,7 +4399,7 @@ static int uc_add_command(char_u *name, size_t name_len, char_u *rep, long argt, goto fail; cmd = USER_CMD_GA(gap, i); - mch_memmove(cmd + 1, cmd, (gap->ga_len - i) * sizeof(ucmd_T)); + memmove(cmd + 1, cmd, (gap->ga_len - i) * sizeof(ucmd_T)); ++gap->ga_len; @@ -4817,7 +4817,7 @@ static void ex_delcommand(exarg_T *eap) --gap->ga_len; if (i < gap->ga_len) - mch_memmove(cmd, cmd + 1, (gap->ga_len - i) * sizeof(ucmd_T)); + memmove(cmd, cmd + 1, (gap->ga_len - i) * sizeof(ucmd_T)); } /* @@ -5131,7 +5131,7 @@ static void do_ucmd(exarg_T *eap) * Also change K_SPECIAL KS_EXTRA KE_CSI into CSI. */ len = ksp - p; if (len > 0) { - mch_memmove(q, p, len); + memmove(q, p, len); q += len; } *q++ = ksp[1] == KS_SPECIAL ? K_SPECIAL : CSI; @@ -5152,7 +5152,7 @@ static void do_ucmd(exarg_T *eap) if (buf == NULL) totlen += len; else { - mch_memmove(q, p, len); + memmove(q, p, len); q += len; } @@ -8180,7 +8180,7 @@ char_u *expand_sfile(char_u *arg) vim_free(result); return NULL; } - mch_memmove(newres, result, (size_t)(p - result)); + memmove(newres, result, (size_t)(p - result)); STRCPY(newres + (p - result), repl); len = (int)STRLEN(newres); STRCAT(newres, p + srclen); diff --git a/src/ex_getln.c b/src/ex_getln.c index 03631eaabc..e0fc7ec28f 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1851,7 +1851,7 @@ add_indent: char_u *s = skipwhite(p); ga_grow(&line_ga, 1); - mch_memmove(s + 1, s, line_ga.ga_len - (s - p) + 1); + memmove(s + 1, s, line_ga.ga_len - (s - p) + 1); *s = ' '; ++line_ga.ga_len; } @@ -1892,7 +1892,7 @@ redraw: while (get_indent_str(p, 8) > indent) { char_u *s = skipwhite(p); - mch_memmove(s - 1, s, line_ga.ga_len - (s - p) + 1); + memmove(s - 1, s, line_ga.ga_len - (s - p) + 1); --line_ga.ga_len; } goto add_indent; @@ -2024,7 +2024,7 @@ static int realloc_cmdbuff(int len) } /* There isn't always a NUL after the command, but it may need to be * there, thus copy up to the NUL and add a NUL. */ - mch_memmove(ccline.cmdbuff, p, (size_t)ccline.cmdlen); + memmove(ccline.cmdbuff, p, (size_t)ccline.cmdlen); ccline.cmdbuff[ccline.cmdlen] = NUL; vim_free(p); @@ -2141,7 +2141,7 @@ static void draw_cmdline(int start, int len) } } else { prev_c = u8c; - mch_memmove(arshape_buf + newlen, p, mb_l); + memmove(arshape_buf + newlen, p, mb_l); newlen += mb_l; } } @@ -2212,7 +2212,7 @@ int put_on_cmdline(char_u *str, int len, int redraw) retval = OK; if (retval == OK) { if (!ccline.overstrike) { - mch_memmove(ccline.cmdbuff + ccline.cmdpos + len, + memmove(ccline.cmdbuff + ccline.cmdpos + len, ccline.cmdbuff + ccline.cmdpos, (size_t)(ccline.cmdlen - ccline.cmdpos)); ccline.cmdlen += len; @@ -2228,7 +2228,7 @@ int put_on_cmdline(char_u *str, int len, int redraw) i += (*mb_ptr2len)(ccline.cmdbuff + i)) --m; if (i < ccline.cmdlen) { - mch_memmove(ccline.cmdbuff + ccline.cmdpos + len, + memmove(ccline.cmdbuff + ccline.cmdpos + len, ccline.cmdbuff + i, (size_t)(ccline.cmdlen - i)); ccline.cmdlen += ccline.cmdpos + len - i; } else @@ -2236,7 +2236,7 @@ int put_on_cmdline(char_u *str, int len, int redraw) } else if (ccline.cmdpos + len > ccline.cmdlen) ccline.cmdlen = ccline.cmdpos + len; } - mch_memmove(ccline.cmdbuff + ccline.cmdpos, str, (size_t)len); + memmove(ccline.cmdbuff + ccline.cmdpos, str, (size_t)len); ccline.cmdbuff[ccline.cmdlen] = NUL; if (enc_utf8) { @@ -2497,7 +2497,7 @@ void cmdline_paste_str(char_u *s, int literally) */ static void cmdline_del(int from) { - mch_memmove(ccline.cmdbuff + from, ccline.cmdbuff + ccline.cmdpos, + memmove(ccline.cmdbuff + from, ccline.cmdbuff + ccline.cmdpos, (size_t)(ccline.cmdlen - ccline.cmdpos + 1)); ccline.cmdlen -= ccline.cmdpos - from; ccline.cmdpos = from; @@ -2724,10 +2724,10 @@ nextwild ( } else v = OK; if (v == OK) { - mch_memmove(&ccline.cmdbuff[ccline.cmdpos + difflen], + memmove(&ccline.cmdbuff[ccline.cmdpos + difflen], &ccline.cmdbuff[ccline.cmdpos], (size_t)(ccline.cmdlen - ccline.cmdpos + 1)); - mch_memmove(&ccline.cmdbuff[i], p2, STRLEN(p2)); + memmove(&ccline.cmdbuff[i], p2, STRLEN(p2)); ccline.cmdlen += difflen; ccline.cmdpos += difflen; } @@ -5037,12 +5037,12 @@ int read_viminfo_history(vir_T *virp, int writing) if (type == HIST_SEARCH) { /* Search entry: Move the separator from the first * column to after the NUL. */ - mch_memmove(p, val + 1, (size_t)len); + memmove(p, val + 1, (size_t)len); p[len] = sep; } else { /* Not a search entry: No separator in the viminfo * file, add a NUL separator. */ - mch_memmove(p, val, (size_t)len + 1); + memmove(p, val, (size_t)len + 1); p[len + 1] = NUL; } viminfo_history[type][viminfo_hisidx[type]++] = p; diff --git a/src/fileio.c b/src/fileio.c index a8aef2466b..2cf4e15aeb 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -11,6 +11,8 @@ * fileio.c: read from and write to a file */ +#include <string.h> + #include "vim.h" #include "fileio.h" #include "blowfish.h" @@ -1026,7 +1028,7 @@ retry: break; } if (linerest) /* copy characters from the previous buffer */ - mch_memmove(new_buffer, ptr - linerest, (size_t)linerest); + memmove(new_buffer, ptr - linerest, (size_t)linerest); vim_free(buffer); buffer = new_buffer; ptr = buffer + linerest; @@ -1059,7 +1061,7 @@ retry: if (conv_restlen > 0) { /* Insert unconverted bytes from previous line. */ - mch_memmove(ptr, conv_rest, conv_restlen); + memmove(ptr, conv_rest, conv_restlen); ptr += conv_restlen; size -= conv_restlen; } @@ -1219,7 +1221,7 @@ retry: /* Remove BOM from the text */ filesize += blen; size -= blen; - mch_memmove(ptr, ptr + blen, (size_t)size); + memmove(ptr, ptr + blen, (size_t)size); if (set_options) { curbuf->b_p_bomb = TRUE; curbuf->b_start_bomb = TRUE; @@ -1301,13 +1303,13 @@ retry: if (from_size > 0) { /* Some remaining characters, keep them for the next * round. */ - mch_memmove(conv_rest, (char_u *)fromp, from_size); + memmove(conv_rest, (char_u *)fromp, from_size); conv_restlen = (int)from_size; } /* move the linerest to before the converted characters */ line_start = ptr - linerest; - mch_memmove(line_start, buffer, (size_t)linerest); + memmove(line_start, buffer, (size_t)linerest); size = (long)((char_u *)top - ptr); } # endif @@ -1378,7 +1380,7 @@ retry: * conv_rest[]. */ if (tail != NULL) { conv_restlen = (int)((ptr + size) - tail); - mch_memmove(conv_rest, (char_u *)tail, conv_restlen); + memmove(conv_rest, (char_u *)tail, conv_restlen); size -= conv_restlen; } @@ -1499,7 +1501,7 @@ retry: /* move the linerest to before the converted characters */ line_start = dest - linerest; - mch_memmove(line_start, buffer, (size_t)linerest); + memmove(line_start, buffer, (size_t)linerest); size = (long)((ptr + real_size) - dest); ptr = dest; } else if (enc_utf8 && !curbuf->b_p_bin) { @@ -1530,7 +1532,7 @@ retry: * already done so. */ if (p > ptr) { conv_restlen = todo; - mch_memmove(conv_rest, p, conv_restlen); + memmove(conv_rest, p, conv_restlen); size -= conv_restlen; break; } @@ -1552,7 +1554,7 @@ retry: /* Drop, keep or replace the bad byte. */ if (bad_char_behavior == BAD_DROP) { - mch_memmove(p, p + 1, todo - 1); + memmove(p, p + 1, todo - 1); --p; --size; } else if (bad_char_behavior != BAD_KEEP) @@ -2338,7 +2340,7 @@ check_for_cryptkey ( /* Remove magic number from the text */ *filesizep += CRYPT_MAGIC_LEN + salt_len + seed_len; *sizep -= CRYPT_MAGIC_LEN + salt_len + seed_len; - mch_memmove(ptr, ptr + CRYPT_MAGIC_LEN + salt_len + seed_len, + memmove(ptr, ptr + CRYPT_MAGIC_LEN + salt_len + seed_len, (size_t)*sizep); /* Restore the read-only flag. */ curbuf->b_p_ro = b_p_ro; @@ -4050,7 +4052,7 @@ nofail: * front of the file name. */ if (errnum != NULL) { STRMOVE(IObuff + numlen, IObuff); - mch_memmove(IObuff, errnum, (size_t)numlen); + memmove(IObuff, errnum, (size_t)numlen); } STRCAT(IObuff, errmsg); emsg(IObuff); @@ -4332,7 +4334,7 @@ static int buf_write_bytes(struct bw_info *ip) l = CONV_RESTLEN - ip->bw_restlen; if (l > len) l = len; - mch_memmove(ip->bw_rest + ip->bw_restlen, buf, (size_t)l); + memmove(ip->bw_rest + ip->bw_restlen, buf, (size_t)l); n = utf_ptr2len_len(ip->bw_rest, ip->bw_restlen + l); if (n > ip->bw_restlen + len) { /* We have an incomplete byte sequence at the end to @@ -4352,7 +4354,7 @@ static int buf_write_bytes(struct bw_info *ip) ip->bw_restlen = 0; } else { ip->bw_restlen -= n; - mch_memmove(ip->bw_rest, ip->bw_rest + n, + memmove(ip->bw_rest, ip->bw_rest + n, (size_t)ip->bw_restlen); n = 0; } @@ -4365,7 +4367,7 @@ static int buf_write_bytes(struct bw_info *ip) if (len - wlen > CONV_RESTLEN) return FAIL; ip->bw_restlen = len - wlen; - mch_memmove(ip->bw_rest, buf + wlen, + memmove(ip->bw_rest, buf + wlen, (size_t)ip->bw_restlen); break; } @@ -4405,8 +4407,8 @@ static int buf_write_bytes(struct bw_info *ip) * conversion buffer for this. */ fromlen = len + ip->bw_restlen; from = ip->bw_conv_buf + ip->bw_conv_buflen - fromlen; - mch_memmove(from, ip->bw_rest, (size_t)ip->bw_restlen); - mch_memmove(from + ip->bw_restlen, buf, (size_t)len); + memmove(from, ip->bw_rest, (size_t)ip->bw_restlen); + memmove(from + ip->bw_restlen, buf, (size_t)len); } else { from = buf; fromlen = len; @@ -4438,8 +4440,8 @@ static int buf_write_bytes(struct bw_info *ip) * conversion buffer for this. */ fromlen = len + ip->bw_restlen; fp = (char *)ip->bw_conv_buf + ip->bw_conv_buflen - fromlen; - mch_memmove(fp, ip->bw_rest, (size_t)ip->bw_restlen); - mch_memmove(fp + ip->bw_restlen, buf, (size_t)len); + memmove(fp, ip->bw_rest, (size_t)ip->bw_restlen); + memmove(fp + ip->bw_restlen, buf, (size_t)len); from = fp; tolen = ip->bw_conv_buflen - fromlen; } else { @@ -4477,7 +4479,7 @@ static int buf_write_bytes(struct bw_info *ip) /* copy remainder to ip->bw_rest[] to be used for the next call. */ if (fromlen > 0) - mch_memmove(ip->bw_rest, (void *)from, fromlen); + memmove(ip->bw_rest, (void *)from, fromlen); ip->bw_restlen = (int)fromlen; buf = ip->bw_conv_buf; @@ -8248,7 +8250,7 @@ file_pat_to_reg_pat ( /* The 'pattern' is a filetype check ONLY */ reg_pat = (char_u *)alloc(check_length + 1); if (reg_pat != NULL) { - mch_memmove(reg_pat, pat, (size_t)check_length); + memmove(reg_pat, pat, (size_t)check_length); reg_pat[check_length] = NUL; } return reg_pat; @@ -8295,7 +8297,7 @@ file_pat_to_reg_pat ( #ifdef FEAT_OSFILETYPE /* Copy the type check in to the start. */ if (check_length) - mch_memmove(reg_pat, pat - check_length, (size_t)check_length); + memmove(reg_pat, pat - check_length, (size_t)check_length); i = check_length; #else i = 0; diff --git a/src/fold.c b/src/fold.c index e48085791d..89efa47176 100644 --- a/src/fold.c +++ b/src/fold.c @@ -624,7 +624,7 @@ void foldCreate(linenr_T start, linenr_T end) if (end_rel < fp[cont - 1].fd_top + fp[cont - 1].fd_len - 1) end_rel = fp[cont - 1].fd_top + fp[cont - 1].fd_len - 1; /* Move contained folds to inside new fold. */ - mch_memmove(fold_ga.ga_data, fp, sizeof(fold_T) * cont); + memmove(fold_ga.ga_data, fp, sizeof(fold_T) * cont); fold_ga.ga_len += cont; i += cont; @@ -635,7 +635,7 @@ void |