info-inventor
[Top] [All Lists]

Re: SoText2

To: Gildardo Sanchez-Ante <gildardo@xxxxxxxxxxxx>
Subject: Re: SoText2
From: "Joshua P. Dady" <jpd@xxxxxxxxxxxxxx>
Date: Mon, 18 Dec 2000 10:49:15 -0500
Cc: info-inventor@xxxxxxxxxxx
Organization: Mediascape Corporation
References: <Pine.GSO.4.21.0012161923290.10153-100000@xxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-inventor@xxxxxxxxxxx
The code in question tries to convert a 'char **' to a 'const char **',
which is an illegal conversion in C++ for const safety reasons (see the
C++ FAQ), and the compiler on Mandrake 7.2 caught the error:

   char* input = (char *)strings[i].getString();
   ...
   if ((iconv(conversionCode &input, &inbytes, ...

This generates the error:

   SoText2.c++:780: passing `char **' as argument 2 of `iconv(void *,
   const char **, size_t *, char **, size_t *)' adds cv-quals without
   intervening `const'

iconv() takes a "const char **" as its second argument.  The fix is to
change the declaration of 'input' to be 'const char *' (5 lines above
the error).  This adds the const qualifier to the 'char *' instead,
which is a valid conversion.  I haven't had the time to generate a patch
for this, but make this change in SoText2.c++ and SoText3.c++ to fix the
problem.

-- 
Joshua P. Dady                   Ph: (248) 945-1100  Fax: (248) 945-1166
Mediascape Corporation                        http://www.mediascape.com/

<Prev in Thread] Current Thread [Next in Thread>
  • SoText2, Gildardo Sanchez-Ante
    • Re: SoText2, Joshua P. Dady <=
    • Re: SoText2, Jonathan Lim