[Midnightbsd-cvs] src [9701] trunk/lib/libkiconv/xlat16_iconv.c: clang 3.4 patch
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sat Dec 16 14:42:25 EST 2017
Revision: 9701
http://svnweb.midnightbsd.org/src/?rev=9701
Author: laffer1
Date: 2017-12-16 14:42:25 -0500 (Sat, 16 Dec 2017)
Log Message:
-----------
clang 3.4 patch
Modified Paths:
--------------
trunk/lib/libkiconv/xlat16_iconv.c
Modified: trunk/lib/libkiconv/xlat16_iconv.c
===================================================================
--- trunk/lib/libkiconv/xlat16_iconv.c 2017-12-16 18:59:03 UTC (rev 9700)
+++ trunk/lib/libkiconv/xlat16_iconv.c 2017-12-16 19:42:25 UTC (rev 9701)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 2003, 2005 Ryuichiro Imura
* All rights reserved.
@@ -23,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $MidnightBSD$
+ * $FreeBSD: stable/10/lib/libkiconv/xlat16_iconv.c 282275 2015-04-30 16:08:47Z tijl $
*/
/*
@@ -49,8 +50,6 @@
#include "quirks.h"
-typedef void *iconv_t;
-
struct xlat16_table {
uint32_t * idx[0x200];
void * data;
@@ -61,9 +60,10 @@
static int chklocale(int, const char *);
#ifdef ICONV_DLOPEN
+typedef void *iconv_t;
static int my_iconv_init(void);
static iconv_t (*my_iconv_open)(const char *, const char *);
-static size_t (*my_iconv)(iconv_t, const char **, size_t *, char **, size_t *);
+static size_t (*my_iconv)(iconv_t, char **, size_t *, char **, size_t *);
static int (*my_iconv_close)(iconv_t);
#else
#include <iconv.h>
@@ -72,7 +72,7 @@
#define my_iconv iconv
#define my_iconv_close iconv_close
#endif
-static size_t my_iconv_char(iconv_t, const u_char **, size_t *, u_char **, size_t *);
+static size_t my_iconv_char(iconv_t, u_char **, size_t *, u_char **, size_t *);
int
kiconv_add_xlat16_cspair(const char *tocode, const char *fromcode, int flag)
@@ -222,8 +222,8 @@
src[0] = (u_char)(c >> 8);
src[1] = (u_char)c;
- ret = my_iconv_char(cd, (const u_char **)&srcp,
- &inbytesleft, &dstp, &outbytesleft);
+ ret = my_iconv_char(cd, &srcp, &inbytesleft,
+ &dstp, &outbytesleft);
if (ret == -1) {
table[us] = 0;
continue;
@@ -339,11 +339,10 @@
#endif
static size_t
-my_iconv_char(iconv_t cd, const u_char **ibuf, size_t * ilen, u_char **obuf,
+my_iconv_char(iconv_t cd, u_char **ibuf, size_t * ilen, u_char **obuf,
size_t * olen)
{
- const u_char *sp;
- u_char *dp, ilocal[3], olocal[3];
+ u_char *sp, *dp, ilocal[3], olocal[3];
u_char c1, c2;
int ret;
size_t ir, or;
@@ -353,7 +352,7 @@
ir = *ilen;
bzero(*obuf, *olen);
- ret = my_iconv(cd, (const char **)&sp, ilen, (char **)&dp, olen);
+ ret = my_iconv(cd, (char **)&sp, ilen, (char **)&dp, olen);
c1 = (*obuf)[0];
c2 = (*obuf)[1];
@@ -376,7 +375,7 @@
sp = ilocal;
dp = olocal;
- if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) {
+ if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) {
if (olocal[0] != c1)
return (ret);
@@ -430,7 +429,7 @@
sp = ilocal + 1;
dp = olocal;
- if ((my_iconv(cd,(const char **)&sp, &ir, (char **)&dp, &or)) != -1) {
+ if ((my_iconv(cd,(char **)&sp, &ir, (char **)&dp, &or)) != -1) {
if (olocal[0] == c2)
/*
* inbuf is a single byte char
More information about the Midnightbsd-cvs
mailing list