40 # pragma GCC diagnostic error "-Wsign-conversion"
49 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
50 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
51 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
52 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
53 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
54 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
55 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
56 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1,
75 const unsigned char *p, *perr, *pend = (
const unsigned char *)
str +
length;
79 for (p = (
const unsigned char *)
str; p < pend; p++,
length--) {
82 if (
ELEM(
c, 0xfe, 0xff, 0x00)) {
89 if ((
c & 0xc0) != 0xc0) {
104 if ((*p & 0xc0) != 0x80) {
112 if ((
c & 0x3e) == 0) {
119 if (
c == 0xe0 && (*p & 0x20) == 0) {
126 if (*p == 0xa0 && *(p + 1) == 0x80) {
129 if (*p == 0xad && *(p + 1) == 0xbf) {
132 if (*p == 0xae && *(p + 1) == 0x80) {
135 if (*p == 0xaf && *(p + 1) == 0xbf) {
138 if (*p == 0xb0 && *(p + 1) == 0x80) {
141 if (*p == 0xbe && *(p + 1) == 0x80) {
144 if (*p == 0xbf && *(p + 1) == 0xbf) {
150 if (*p == 0xbf && *(p + 1) == 0xbe) {
153 if (*p == 0xbf && *(p + 1) == 0xbf) {
161 if (
c == 0xf0 && (*p & 0x30) == 0) {
168 if (
c == 0xf8 && (*p & 0x38) == 0) {
175 if (
c == 0xfc && (*p & 0x3c) == 0) {
185 if ((*p & 0xc0) != 0x80) {
195 return ((
const char *)perr - (
const char *)
str);
212 length -= (size_t)(bad_char + 1);
229 #define BLI_STR_UTF8_CPY(dst, src, maxncpy) \
232 while (*src != '\0' && (utf8_size = utf8_skip_data[*src]) < maxncpy) { \
233 maxncpy -= utf8_size; \
234 switch (utf8_size) { \
265 memset(dst, 0xff,
sizeof(*dst) * maxncpy);
281 memset(dst, 0xff,
sizeof(*dst) * maxncpy);
287 return (
size_t)(dst - r_dst);
290 #undef BLI_STR_UTF8_CPY
296 const wchar_t *__restrict src,
297 const size_t maxncpy)
299 const size_t maxlen = maxncpy - 1;
307 memset(dst, 0xff,
sizeof(*dst) * maxncpy);
310 while (*src &&
len <= maxlen_secured) {
320 if (
len +
l > maxlen) {
323 memcpy(dst +
len,
t,
l);
347 const char *strc_orig = strc;
349 for (
len = 0; *strc;
len++) {
353 *r_len_bytes = (size_t)(strc - strc_orig);
366 const char *strc_orig = strc;
367 const char *strc_end = strc + maxlen;
371 if (!*strc || strc + step > strc_end) {
378 *r_len_bytes = (size_t)(strc - strc_orig);
394 const char *__restrict src_c,
395 const size_t maxncpy)
411 return mk_wcwidth(ucs);
416 return mk_wcswidth(pwcs, n);
440 return (columns < 0) ? 1 : columns;
450 #define UTF8_COMPUTE(Char, Mask, Len, Err) \
455 else if ((Char & 0xe0) == 0xc0) { \
459 else if ((Char & 0xf0) == 0xe0) { \
463 else if ((Char & 0xf8) == 0xf0) { \
467 else if ((Char & 0xfc) == 0xf8) { \
471 else if ((Char & 0xfe) == 0xfc) { \
481 #define UTF8_GET(Result, Chars, Count, Mask, Len, Err) \
482 (Result) = (Chars)[0] & (Mask); \
483 for ((Count) = 1; (Count) < (Len); ++(Count)) { \
484 if (((Chars)[(Count)] & 0xc0) != 0x80) { \
489 (Result) |= ((Chars)[(Count)] & 0x3f); \
498 const unsigned char c = (
unsigned char)*p;
511 const unsigned char c = (
unsigned char)*p;
538 const unsigned char c = (
unsigned char)*p;
555 const unsigned char c = (
unsigned char)*p;
562 *index += (size_t)
len;
571 const unsigned char c = (
unsigned char)*p;
579 *index += (size_t)
len;
593 c = (
unsigned char)*p;
602 *index += (size_t)(p_next - p);
625 *index += (size_t)
len;
652 else if (
c < 0x800) {
656 else if (
c < 0x10000) {
660 else if (
c < 0x200000) {
664 else if (
c < 0x4000000) {
674 for (i =
len - 1; i > 0; i--) {
675 outbuf[i] = (
c & 0x3f) | 0x80;
678 outbuf[0] =
c | first;
685 const char *__restrict src_c,
686 const size_t maxncpy)
688 const size_t maxlen = maxncpy - 1;
694 memset(dst_w, 0xff,
sizeof(*dst_w) * maxncpy);
697 while (*src_c &&
len != maxlen) {
718 const char32_t *__restrict src,
719 const size_t maxncpy)
721 const size_t maxlen = maxncpy - 1;
729 memset(dst, 0xff,
sizeof(*dst) * maxncpy);
732 while (*src &&
len <= maxlen_secured) {
742 if (
len +
l > maxlen) {
745 memcpy(dst +
len,
t,
l);
784 for (--p; p >=
str; p--) {
785 if ((*p & 0xc0) != 0x80) {
811 for (++p; p < end && (*p & 0xc0) == 0x80; p++) {
816 for (++p; (*p & 0xc0) == 0x80; p++) {
821 return (p == end) ?
NULL : (
char *)p;
842 if ((*p & 0xc0) != 0x80) {
870 const bool from_right)
873 const size_t str_len = end ? (size_t)(end -
str) : strlen(
str);
879 *suf = (
char *)(
str + str_len);
883 *sep >=
str && (!end || *sep < end) && **sep !=
'\0';
892 for (d = delim; *d !=
'\0'; d++) {
896 *suf = (
char *)(
str + index);
898 return (
size_t)(*sep -
str);
915 int index = 0,
pos = 0;
916 while (
pos != offset) {
925 int offset = 0,
pos = 0;
926 while (
pos != index) {
935 int column = 0,
pos = 0;
936 while (
pos < offset) {
945 int offset = 0,
pos = 0,
col;
946 while (*(
str + offset) &&
pos < column) {
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
ATTR_WARN_UNUSED_RESULT const BMLoop * l
SIMD_FORCE_INLINE btScalar length(const btQuaternion &q)
Return the length of a quaternion.
#define UTF8_COMPUTE(Char, Mask, Len, Err)
int BLI_wcwidth(char32_t ucs)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy)
size_t BLI_strncpy_utf8_rlen(char *__restrict dst, const char *__restrict src, size_t maxncpy)
size_t BLI_strlen_utf8_ex(const char *strc, size_t *r_len_bytes)
size_t BLI_strnlen_utf8_ex(const char *strc, const size_t maxlen, size_t *r_len_bytes)
size_t BLI_str_partition_ex_utf8(const char *str, const char *end, const uint delim[], const char **sep, const char **suf, const bool from_right)
size_t BLI_strnlen_utf8(const char *strc, const size_t maxlen)
ptrdiff_t BLI_utf8_invalid_byte(const char *str, size_t length)
size_t BLI_str_utf32_as_utf8(char *__restrict dst, const char32_t *__restrict src, const size_t maxncpy)
int BLI_str_utf8_offset_from_column(const char *str, int column)
size_t BLI_strlen_utf8(const char *strc)
size_t BLI_str_utf32_as_utf8_len(const char32_t *src)
#define BLI_STR_UTF8_CPY(dst, src, maxncpy)
size_t BLI_str_utf8_from_unicode(uint c, char *outbuf)
static const size_t utf8_skip_data[256]
size_t BLI_strncpy_wchar_as_utf8(char *__restrict dst, const wchar_t *__restrict src, const size_t maxncpy)
int BLI_str_utf8_offset_to_index(const char *str, int offset)
size_t BLI_str_partition_utf8(const char *str, const uint delim[], const char **sep, const char **suf)
size_t BLI_wstrlen_utf8(const wchar_t *src)
int BLI_str_utf8_char_width(const char *p)
size_t BLI_str_rpartition_utf8(const char *str, const uint delim[], const char **sep, const char **suf)
uint BLI_str_utf8_as_unicode_and_size_safe(const char *__restrict p, size_t *__restrict index)
int BLI_utf8_invalid_strip(char *str, size_t length)
#define UTF8_GET(Result, Chars, Count, Mask, Len, Err)
uint BLI_str_utf8_as_unicode_step(const char *__restrict p, size_t *__restrict index)
int BLI_wcswidth(const char32_t *pwcs, size_t n)
int BLI_str_utf8_size(const char *p)
uint BLI_str_utf8_as_unicode(const char *p)
int BLI_str_utf8_size_safe(const char *p)
char * BLI_str_find_next_char_utf8(const char *p, const char *end)
int BLI_str_utf8_offset_to_column(const char *str, int offset)
uint BLI_str_utf8_as_unicode_and_size(const char *__restrict p, size_t *__restrict index)
int BLI_str_utf8_char_width_safe(const char *p)
size_t BLI_str_utf8_as_utf32(char32_t *__restrict dst_w, const char *__restrict src_c, const size_t maxncpy)
char * BLI_str_find_prev_char_utf8(const char *str, const char *p)
size_t BLI_strncpy_wchar_from_utf8(wchar_t *__restrict dst_w, const char *__restrict src_c, const size_t maxncpy)
char * BLI_str_prev_char_utf8(const char *p)
int BLI_str_utf8_offset_from_index(const char *str, int index)
int conv_utf_8_to_16(const char *in8, wchar_t *out16, size_t size16)
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)