From owner-freebsd-gnome@FreeBSD.ORG Tue Feb 6 03:42:47 2007 Return-Path: X-Original-To: freebsd-gnome@FreeBSD.org Delivered-To: freebsd-gnome@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09E8D16A400 for ; Tue, 6 Feb 2007 03:42:47 +0000 (UTC) (envelope-from bland@FreeBSD.org) Received: from smtp1.jp.viruscheck.net (smtp1.jp.viruscheck.net [154.33.69.52]) by mx1.freebsd.org (Postfix) with ESMTP id C328D13C467 for ; Tue, 6 Feb 2007 03:42:46 +0000 (UTC) (envelope-from bland@FreeBSD.org) Received: from (mail5.jp.viruscheck.net) [154.33.69.36]:43607 by smtp1.jp.viruscheck.net with esmtp id 1HEGuK-0004lw-Ld ; Tue, 06 Feb 2007 12:22:12 +0900 Received: from (noc.orchid.orchidtechnology.com) [125.206.34.113]:44453 by mail5.jp.viruscheck.net with esmtp id 1HEGuJ-0004M7-U6 ; Tue, 06 Feb 2007 12:22:12 +0900 Received: from [89.60.200.25] ([89.60.200.25]) by noc.orchid.orchidtechnology.com (8.13.4/8.13.4) with ESMTP id l163MAp4028140; Tue, 6 Feb 2007 12:22:10 +0900 (JST) (envelope-from bland@FreeBSD.org) Message-ID: <45C7F45D.4020407@FreeBSD.org> Date: Tue, 06 Feb 2007 12:22:05 +0900 From: Alexander Nedotsukov User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Jeremy Messenger References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-gnome@FreeBSD.org Subject: Re: Need a suggest the best way to fix iconv.. X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Feb 2007 03:42:47 -0000 Jeremy Messenger wrote: > Hello folks, > > I am not sure what is the best way to fix iconv. I get following build > error: > > =================================== > client/Text.cpp: In static member function `static std::string& > Text::convert(const std::string&, std::string&, const std::string&, > const std::string&)': > client/Text.cpp:312: error: invalid conversion from `char**' to `const > char**' > client/Text.cpp:312: error: initializing argument 2 of `size_t > libiconv(void*, const char**, size_t*, char**, size_t*)' > =================================== > > The code looks like (last line is 312 line): > > =================================== > size_t rv; > size_t len = str.length() * 2; // optimization > size_t inleft = str.length(); > size_t outleft = len; > tmp.resize(len); > const char *inbuf = str.data(); > char *outbuf = (char *)tmp.data(); > > while(inleft > 0) { > rv = iconv(cd, (char **)&inbuf, &inleft, &outbuf, &outleft); > =================================== > > Which should I change it to? > > rv = iconv(cd, (const char **)&inbuf, &inleft, &outbuf, &outleft); > > or > > rv = iconv(cd, &inbuf, &inleft, &outbuf, &outleft); This one. And if you have a plan to send your patch back to the authors it is better to declare inbuf as ICONV_CONST char* as well (though not sure if their configure smart enough to define that macro. check produced config.h to be sure). > > Both of them build fine. If I remember it correct about that AbiWord > has ICONV_CONST stuff, so I have chosen add 'const'. But, I am still > not sure so I rather ask in here to see if I am right or wrong. Thanks. > > Cheers, > Mezz > > > --mezz7@cox.net - mezz@FreeBSD.org > FreeBSD GNOME Team - FreeBSD Multimedia Hat (ports, not src) > http://www.FreeBSD.org/gnome/ - gnome@FreeBSD.org > http://wiki.freebsd.org/multimedia - multimedia@FreeBSD.org > _______________________________________________ > freebsd-gnome@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-gnome > To unsubscribe, send any mail to "freebsd-gnome-unsubscribe@freebsd.org"