Subject: Re: icewm broken in pkgsrc-2004Q4
To: None <netbsd-users@netbsd.org>
From: Milos Negovanovic <milosn@bonbon.net>
List: netbsd-users
Date: 12/23/2004 10:55:53
On Wed, Dec 22, 2004 at 08:13:59PM +0100, Florian Stoehr wrote:
> I got casting errors with this package.
> 
> Anybody else seeing this?
> 
> Attached is a patch, adding a const_cast<>. If this is not considered a 
> "hack", someone might please add this patch to icewm.
> 
> Haven't tried whether that also happens to -current pkgsrc.
> 
> Perhaps it's useful for others. Don't flame me if it causes any troubles.
> 
> -Florian
> 
> --- ylocale.cc  2004-08-16 06:58:31.000000000 +0200
> +++ ylocale.cc  2004-12-22 19:17:53.000000000 +0100
> @@ -152,7 +152,7 @@
>      char * inbuf((char *) lStr), * outbuf((char *) uStr);
>      size_t inlen(lLen), outlen(4 * lLen);
> 
> -    if (0 > (int) iconv(instance->toUnicode, &inbuf, &inlen, &outbuf, 
> &outlen))
> +    if (0 > (int) iconv(instance->toUnicode, const_cast<const 
> char**>(&inbuf), &inlen, &outbuf, &outlen))
>         warn(_("Invalid multibyte string \"%s\": %s"), lStr, 
> strerror(errno));
> 
>      *((YUChar *) outbuf) = 0;
> 

i've tested this on CURRENT with last night's pkgsrc and it works fine.
wm/icewm-imlib needs same patch to compile.

Regards
Milos