mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
s3:lib/charcnv: rename a parameter for clarity in next_codepoint_ext()
This commit is contained in:
parent
18104ef1be
commit
5b6a88b9bf
@ -481,7 +481,7 @@ size_t pull_string_talloc_fn(const char *function,
|
|||||||
int flags);
|
int flags);
|
||||||
size_t align_string(const void *base_ptr, const char *p, int flags);
|
size_t align_string(const void *base_ptr, const char *p, int flags);
|
||||||
codepoint_t next_codepoint_ext(const char *str, charset_t src_charset,
|
codepoint_t next_codepoint_ext(const char *str, charset_t src_charset,
|
||||||
size_t *size);
|
size_t *bytes_consumed);
|
||||||
codepoint_t next_codepoint(const char *str, size_t *size);
|
codepoint_t next_codepoint(const char *str, size_t *size);
|
||||||
|
|
||||||
/* The following definitions come from lib/clobber.c */
|
/* The following definitions come from lib/clobber.c */
|
||||||
|
@ -1809,7 +1809,7 @@ size_t align_string(const void *base_ptr, const char *p, int flags)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
codepoint_t next_codepoint_ext(const char *str, charset_t src_charset,
|
codepoint_t next_codepoint_ext(const char *str, charset_t src_charset,
|
||||||
size_t *size)
|
size_t *bytes_consumed)
|
||||||
{
|
{
|
||||||
/* It cannot occupy more than 4 bytes in UTF16 format */
|
/* It cannot occupy more than 4 bytes in UTF16 format */
|
||||||
uint8_t buf[4];
|
uint8_t buf[4];
|
||||||
@ -1821,7 +1821,7 @@ codepoint_t next_codepoint_ext(const char *str, charset_t src_charset,
|
|||||||
|
|
||||||
/* fastpath if the character is ASCII */
|
/* fastpath if the character is ASCII */
|
||||||
if ((str[0] & 0x80) == 0) {
|
if ((str[0] & 0x80) == 0) {
|
||||||
*size = 1;
|
*bytes_consumed = 1;
|
||||||
return (codepoint_t)str[0];
|
return (codepoint_t)str[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1837,7 +1837,7 @@ codepoint_t next_codepoint_ext(const char *str, charset_t src_charset,
|
|||||||
|
|
||||||
descriptor = conv_handles[src_charset][CH_UTF16LE];
|
descriptor = conv_handles[src_charset][CH_UTF16LE];
|
||||||
if (descriptor == (smb_iconv_t)-1 || descriptor == (smb_iconv_t)0) {
|
if (descriptor == (smb_iconv_t)-1 || descriptor == (smb_iconv_t)0) {
|
||||||
*size = 1;
|
*bytes_consumed = 1;
|
||||||
return INVALID_CODEPOINT;
|
return INVALID_CODEPOINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1858,7 +1858,7 @@ codepoint_t next_codepoint_ext(const char *str, charset_t src_charset,
|
|||||||
smb_iconv(descriptor, &str, &ilen, &outbuf, &olen);
|
smb_iconv(descriptor, &str, &ilen, &outbuf, &olen);
|
||||||
if (olen == 4) {
|
if (olen == 4) {
|
||||||
/* We didn't convert any bytes */
|
/* We didn't convert any bytes */
|
||||||
*size = 1;
|
*bytes_consumed = 1;
|
||||||
return INVALID_CODEPOINT;
|
return INVALID_CODEPOINT;
|
||||||
}
|
}
|
||||||
olen = 4 - olen;
|
olen = 4 - olen;
|
||||||
@ -1866,7 +1866,7 @@ codepoint_t next_codepoint_ext(const char *str, charset_t src_charset,
|
|||||||
olen = 2 - olen;
|
olen = 2 - olen;
|
||||||
}
|
}
|
||||||
|
|
||||||
*size = ilen_orig - ilen;
|
*bytes_consumed = ilen_orig - ilen;
|
||||||
|
|
||||||
if (olen == 2) {
|
if (olen == 2) {
|
||||||
/* 2 byte, UTF16-LE encoded value. */
|
/* 2 byte, UTF16-LE encoded value. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user