summaryrefslogtreecommitdiff
path: root/inputmethod/scim-python/patches/patch-ac
blob: 05e3c0554e8c4f035e98010bccfec5bf01d6157b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$NetBSD: patch-ac,v 1.2 2013/03/22 13:29:42 obache Exp $

* let to cast with appropriate type.

--- src/scim-python-factory.cpp.orig	2008-07-11 04:16:15.000000000 +0000
+++ src/scim-python-factory.cpp
@@ -130,18 +130,18 @@ PyIMEngineFactory::get_attr_unicode (cha
 	if (pValue) {
 		if (PyUnicode_Check (pValue)) {
 		#if Py_UNICODE_SIZE == 4
-			result = (wchar_t *)PyUnicode_AS_UNICODE (pValue);
+			result = (scim::ucs4_t *)PyUnicode_AS_UNICODE (pValue);
 		#else
 			gunichar *unistr = g_utf16_to_ucs4 (PyUnicode_AS_UNICODE (pValue),
 						PyUnicode_GET_SIZE (pValue), NULL, NULL, NULL);
-			result = (wchar_t *) unistr;
+			result = WideString((scim::ucs4_t *)unistr);
 			g_free (unistr);
 		#endif
 		}
 		else if (PyString_Check (pValue)) {
 			gunichar *unistr = g_utf8_to_ucs4 (PyString_AsString (pValue),
 						PyString_GET_SIZE (pValue), NULL, NULL, NULL);
-			result = (wchar_t *)unistr;
+			result = WideString((scim::ucs4_t *)unistr);
 			g_free (unistr);
 		}
 		Py_DECREF (pValue);