Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/include/BLI_endian_switch_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ BLI_INLINE void BLI_endian_switch_uint16(unsigned short *val)

BLI_INLINE void BLI_endian_switch_int32(int *val)
{
BLI_endian_switch_uint32((val));
BLI_endian_switch_uint32((unsigned int *)(val));
}
BLI_INLINE void BLI_endian_switch_uint32(unsigned int *val)
{
Expand Down
2 changes: 1 addition & 1 deletion core/intern/BLI_ghash_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ bool BLI_ghashutil_paircmp(const void *a, const void *b)

void BLI_ghashutil_pairfree(void *ptr)
{
MEM_freeN((const GHashPair *)(ptr));
MEM_freeN(ptr);
}

/** \} */
Expand Down
9 changes: 7 additions & 2 deletions core/intern/math_geom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,8 +1297,13 @@ int isect_seg_seg_v2_point_ex(const float v0[2],
if (equals_v2v2(v0, v1)) {
if (len_squared_v2v2(v2, v3) > square_f(eps)) {
/* use non-point segment as basis */
BUI_SWAP(v0, v2);
BUI_SWAP(v1, v3);
const float *v_tmp;
v_tmp = v0;
v0 = v2;
v2 = v_tmp;
v_tmp = v1;
v1 = v3;
v3 = v_tmp;

sub_v2_v2v2(s10, v1, v0);
sub_v2_v2v2(s30, v3, v0);
Expand Down
12 changes: 11 additions & 1 deletion core/intern/string_utf8.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,17 @@ size_t BLI_strncpy_wchar_from_utf8(wchar_t *__restrict dst_w,
const char *__restrict src_c,
const size_t dst_w_maxncpy)
{
/* WIN32 branch dropped with the utfconv C++ dependency; UTF-32 path below. */
if (dst_w_maxncpy == 0) {
return 0;
}
const size_t src_len = strlen(src_c);
size_t index = 0;
size_t len = 0;
while (index < src_len && len + 1 < dst_w_maxncpy) {
dst_w[len++] = (wchar_t)BLI_str_utf8_as_unicode_step_safe(src_c, src_len, &index);
}
dst_w[len] = 0;
return len;
}

/* End wchar_t / UTF8 functions. */
Expand Down