summaryrefslogtreecommitdiff
path: root/cvt.c
diff options
context:
space:
mode:
Diffstat (limited to 'cvt.c')
-rw-r--r--cvt.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/cvt.c b/cvt.c
index 0c0b08be56002..dc20b9c7b22a8 100644
--- a/cvt.c
+++ b/cvt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2015 Mark Nudelman
+ * Copyright (C) 1984-2016 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -20,7 +20,9 @@ extern int utf_mode;
* Get the length of a buffer needed to convert a string.
*/
public int
-cvt_length(int len, int ops)
+cvt_length(len, ops)
+ int len;
+ int ops;
{
if (utf_mode)
/*
@@ -36,7 +38,8 @@ cvt_length(int len, int ops)
* Allocate a chpos array for use by cvt_text.
*/
public int *
-cvt_alloc_chpos(int len)
+cvt_alloc_chpos(len)
+ int len;
{
int i;
int *chpos = (int *) ecalloc(sizeof(int), len);
@@ -52,12 +55,17 @@ cvt_alloc_chpos(int len)
* odst character (when it was in osrc) is returned in the chpos array.
*/
public void
-cvt_text(char *odst, char *osrc, int *chpos, int *lenp, int ops)
+cvt_text(odst, osrc, chpos, lenp, ops)
+ char *odst;
+ char *osrc;
+ int *chpos;
+ int *lenp;
+ int ops;
{
char *dst;
char *edst = odst;
char *src;
- char *src_end;
+ register char *src_end;
LWCHAR ch;
if (lenp != NULL)
@@ -69,7 +77,7 @@ cvt_text(char *odst, char *osrc, int *chpos, int *lenp, int ops)
{
int src_pos = (int) (src - osrc);
int dst_pos = (int) (dst - odst);
- ch = step_char((constant char **)&src, +1, src_end);
+ ch = step_char(&src, +1, src_end);
if ((ops & CVT_BS) && ch == '\b' && dst > odst)
{
/* Delete backspace and preceding char. */