Bug 116244

Summary: compile error for superkaramba in kdeutils 3.5.0-rc1
Product: [Unmaintained] superkaramba Reporter: Roman I Khimov <rik>
Component: generalAssignee: Ryan Nickell <p0z3r>
Status: RESOLVED WORKSFORME    
Severity: normal CC: taurnil.oronar
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Roman I Khimov 2005-11-13 16:22:56 UTC
Version:            (using KDE KDE 3.5.0)
Installed from:    Compiled From Sources
Compiler:          gcc 3.3.3 
OS:                Linux

New KDE 3.5.0-rc1 stops compiling kdeutils with this error:

meter_python.cpp: In function `PyObject* QString2PyString(QString)':
meter_python.cpp:129: error: cannot convert `Py_UNICODE*' to `const wchar_t*'
   for argument `1' to `PyObject* PyUnicodeUCS2_FromWideChar(const wchar_t*,
   int)'
make[3]: *** [meter_python.o] Ошибка 1
make[3]: Leaving directory `/home/rik/build/kdeutils-3.5.0/superkaramba/src'
make[2]: *** [all-recursive] Ошибка 1
make[2]: Leaving directory `/home/rik/build/kdeutils-3.5.0/superkaramba'
make[1]: *** [all-recursive] Ошибка 1
make[1]: Leaving directory `/home/rik/build/kdeutils-3.5.0'
make: *** [all] Ошибка 2


I've made the following changes:
================================================
--- superkaramba/src/meter_python.cpp.old       2005-11-13 17:41:02.000000000 +0300
+++ superkaramba/src/meter_python.cpp   2005-11-13 18:10:01.000000000 +0300
@@ -119,18 +119,10 @@ PyObject* QString2PyString(QString strin
   PyObject *pyString;

   const unsigned short* tmp = string.ucs2();
-  Py_UNICODE *buf = new Py_UNICODE[string.length()];
-  for(unsigned int i = 0; i < string.length(); i++)
-  {
-    buf[i] = tmp[i];
-  }
-
   if(tmp)
-    pyString = PyUnicode_FromWideChar(buf, string.length());
+    pyString = PyUnicode_FromWideChar( (wchar_t *) tmp, string.length());
   else
     pyString = PyString_FromString("");
-
-  delete [] buf;

   return pyString;
 }
================================================

and compilation went fine. But I'm not sure it's a proper fix.
Comment 1 Thiago Macieira 2005-11-13 18:35:52 UTC
*** Bug 116243 has been marked as a duplicate of this bug. ***
Comment 2 Ryan Nickell 2005-11-13 20:12:23 UTC
This should already be fixed in SVN.  Please update to verify.
Comment 3 Roman I Khimov 2005-11-13 23:23:17 UTC
Yes, I've just built SVN version of kdeutils successfully (and saw a proper fix :)

Thanks!