[PyKDE] Compiling sip 4.1.1, PyQt 3.13, PyKDE 3.11.3 on Solaris 8micro-Howto

Giovanni Bajo rasky at develer.com
Sat Mar 5 12:09:19 GMT 2005


On Fri, March 4, 2005 14:01, Holger Joukl said:

> 2. Change sip-4.1.1/sipgen/gencode.c to use C-style casts instead of
> static
> casts:
> <gencode.c>
> ...
>  4002                                  else if (res -> atype == enum_type
> && isProtectedEnum(res -> u.ed))
>  4003                                  {
>  4004
> //prcode(fp,"static_cast<%E>(",res -> u.ed);
>  4005                                          // C-style cast
>  4006                                          prcode(fp,"(%E) (",res ->
> u.ed);
>  4007                                          incast = TRUE;
>  4008                                  }
> ...
> </gencode.c>

Your GCC compiler is almost 6 years old now. Isn't about time to update
it? It would probably solve this and other problems with C++ codebases.


> 3. Run configure.py
> 4. Manually change generated file
> PyKDE-3.11.3/kdecore/sipkdecorepart0.cpp.
> Line numbers might differ for you (?), but the relevant function is
> meth_KStartupInfoData_pids:
>
> <sipkdecorepart0.cpp>
> ...
> 48621  static PyObject *meth_KStartupInfoData_pids(PyObject
> *sipSelf,PyObject *sipArgs)
>  48622  {
>  48623          int sipArgsParsed = 0;
>  48624
>  48625          {
>  48626                  KStartupInfoData *sipCpp;
>  48627
>  48628                  if
> (sipParseArgs(&sipArgsParsed,sipArgs,"m",sipSelf,sipClass_KStartupInfoData,&sipCpp))
>  48629                  {
>  48630                          const QValueList<int> *sipRes;
>  48631
>  48632                          // sipRes = &sipCpp ->
> KStartupInfoData::pids();
>  48633                          sipRes = reinterpret_cast<const
> QValueList<int> *>( &sipCpp -> KStartupInfoData::pids() );
>  48634
>  48635                          PyObject *sipResObj
> sipConvertFrom_QValueList_1800(const_cast<QValueList<int> *>(sipRes));
>  48636
>  48637                          return sipResObj;
>  48638                  }
>  48639          }
> ...
> </sipkdecorepart0.cpp>

I'm not sure a reinterpret_cast is *ever* a solution. Probably the point
is where it is assumed that pid_t is int, rather than using pid_t
directly.

Giovanni Bajo




More information about the PyQt mailing list