code cleanup: style & warnings.

This commit is contained in:
2013-01-21 02:30:40 +00:00
parent add25e43ad
commit 38cee985bb
13 changed files with 82 additions and 78 deletions

View File

@@ -147,7 +147,7 @@ static void _build_translations_cache(PyObject *py_messages, const char *locale)
_translations_cache = BLI_ghash_new(_ghashutil_keyhash, _ghashutil_keycmp, __func__);
/* Iterate over all py dicts. */
while(PyDict_Next(py_messages, &pos, NULL, &uuid_dict)) {
while (PyDict_Next(py_messages, &pos, NULL, &uuid_dict)) {
PyObject *lang_dict;
#if 0
@@ -172,7 +172,7 @@ static void _build_translations_cache(PyObject *py_messages, const char *locale)
Py_ssize_t ppos = 0;
/* Iterate over all translations of the found language dict, and populate our ghash cache. */
while(PyDict_Next(lang_dict, &ppos, &pykey, &trans)) {
while (PyDict_Next(lang_dict, &ppos, &pykey, &trans)) {
GHashKey *key;
PyObject *tmp;
const char *msgctxt = NULL, *msgid = NULL;

View File

@@ -1626,8 +1626,6 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
/* Unicode String */
#ifdef WITH_INTERNATIONAL
bool do_translate = RNA_property_flag(prop) & PROP_STRING_PY_TRANSLATE;
#else
bool do_translate = false;
#endif /* WITH_INTERNATIONAL */
#ifdef USE_STRING_COERCE
@@ -1644,9 +1642,11 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
#endif /* USE_STRING_COERCE */
/* Any half-brained compiler should be able to optimize this out when WITH_INTERNATIONAL is off */
#ifdef WITH_INTERNATIONAL
if (do_translate) {
param = IFACE_(param);
}
#endif
if (param == NULL) {
if (PyUnicode_Check(value)) {