Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenfont/intern/blf_font.c35
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp2
2 files changed, 19 insertions, 18 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index bebc87cc5d4..7ec7e2357dd 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -122,36 +122,37 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
/* Note,
* blf_font_ensure_ascii_table(font); must be called before this macro */
-#define BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table) \
- if(((c)= (str)[i]) < 0x80) { \
- g= (glyph_ascii_table)[c]; \
- i++; \
+#define BLF_UTF8_NEXT_FAST(_font, _g, _str, _i, _c, _glyph_ascii_table) \
+ if(((_c)= (_str)[_i]) < 0x80) { \
+ _g= (_glyph_ascii_table)[_c]; \
+ _i++; \
} \
- else if ((c= BLI_str_utf8_as_unicode_step((str), &(i))) != BLI_UTF8_ERR) { \
- if ((g= blf_glyph_search((font)->glyph_cache, c)) == NULL) { \
- g= blf_glyph_add(font, FT_Get_Char_Index((font)->face, c), c); \
+ else if ((_c= BLI_str_utf8_as_unicode_step(_str, &(_i)))!=BLI_UTF8_ERR) { \
+ if ((_g= blf_glyph_search((_font)->glyph_cache, _c)) == NULL) { \
+ _g= blf_glyph_add(_font, \
+ FT_Get_Char_Index((_font)->face, _c), _c); \
} \
} \
#define BLF_KERNING_VARS(_font, _has_kerning, _kern_mode) \
- const short has_kerning= FT_HAS_KERNING((_font)->face); \
- const FT_UInt kern_mode= (has_kerning == 0) ? 0 : \
+ const short _has_kerning= FT_HAS_KERNING((_font)->face); \
+ const FT_UInt _kern_mode= (_has_kerning == 0) ? 0 : \
(((_font)->flags & BLF_KERNING_DEFAULT) ? \
ft_kerning_default : FT_KERNING_UNFITTED) \
-#define BLF_KERNING_STEP(_font, kern_mode, g_prev, g, delta, pen_x) \
+#define BLF_KERNING_STEP(_font, _kern_mode, _g_prev, _g, _delta, _pen_x) \
{ \
- if (g_prev) { \
- delta.x= delta.y= 0; \
+ if (_g_prev) { \
+ _delta.x= _delta.y= 0; \
if (FT_Get_Kerning((_font)->face, \
- (g_prev)->idx, \
- (g)->idx, \
- kern_mode, \
- &(delta)) == 0) \
+ (_g_prev)->idx, \
+ (_g)->idx, \
+ _kern_mode, \
+ &(_delta)) == 0) \
{ \
- pen_x += delta.x >> 6; \
+ _pen_x += delta.x >> 6; \
} \
} \
} \
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index b05b7be0877..87f776a726e 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -1042,8 +1042,8 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt
else if (val_len > attrdef->m_imax)
{
// trim the string
- *var = val;
var->SetLength(attrdef->m_imax);
+ memcpy(var->Ptr(), val, attrdef->m_imax - 1);
break;
}
} else if (val_len < attrdef->m_imin || val_len > attrdef->m_imax)