aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/pcre/pcre_ord2utf8.c
diff options
context:
space:
mode:
authororivej <orivej@yandex-team.ru>2022-02-10 16:44:49 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:49 +0300
commit718c552901d703c502ccbefdfc3c9028d608b947 (patch)
tree46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/libs/pcre/pcre_ord2utf8.c
parente9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff)
downloadydb-718c552901d703c502ccbefdfc3c9028d608b947.tar.gz
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/pcre/pcre_ord2utf8.c')
-rw-r--r--contrib/libs/pcre/pcre_ord2utf8.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/contrib/libs/pcre/pcre_ord2utf8.c b/contrib/libs/pcre/pcre_ord2utf8.c
index e608a29a30..632fd9005c 100644
--- a/contrib/libs/pcre/pcre_ord2utf8.c
+++ b/contrib/libs/pcre/pcre_ord2utf8.c
@@ -6,7 +6,7 @@
and semantics are as close as possible to those of the Perl 5 language.
Written by Philip Hazel
- Copyright (c) 1997-2012 University of Cambridge
+ Copyright (c) 1997-2012 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -42,53 +42,53 @@ POSSIBILITY OF SUCH DAMAGE.
character value into a UTF8 string. */
#ifdef HAVE_CONFIG_H
-#include "pcre_config.h"
+#include "pcre_config.h"
#endif
-#define COMPILE_PCRE8
-
+#define COMPILE_PCRE8
+
#include "pcre_internal.h"
/*************************************************
* Convert character value to UTF-8 *
*************************************************/
-/* This function takes an integer value in the range 0 - 0x10ffff
-and encodes it as a UTF-8 character in 1 to 4 pcre_uchars.
+/* This function takes an integer value in the range 0 - 0x10ffff
+and encodes it as a UTF-8 character in 1 to 4 pcre_uchars.
Arguments:
cvalue the character value
- buffer pointer to buffer for result - at least 6 pcre_uchars long
+ buffer pointer to buffer for result - at least 6 pcre_uchars long
Returns: number of characters placed in the buffer
*/
-unsigned
+unsigned
int
-PRIV(ord2utf)(pcre_uint32 cvalue, pcre_uchar *buffer)
+PRIV(ord2utf)(pcre_uint32 cvalue, pcre_uchar *buffer)
{
-#ifdef SUPPORT_UTF
-
+#ifdef SUPPORT_UTF
+
register int i, j;
-
-for (i = 0; i < PRIV(utf8_table1_size); i++)
- if ((int)cvalue <= PRIV(utf8_table1)[i]) break;
+
+for (i = 0; i < PRIV(utf8_table1_size); i++)
+ if ((int)cvalue <= PRIV(utf8_table1)[i]) break;
buffer += i;
for (j = i; j > 0; j--)
{
*buffer-- = 0x80 | (cvalue & 0x3f);
cvalue >>= 6;
}
-*buffer = PRIV(utf8_table2)[i] | cvalue;
+*buffer = PRIV(utf8_table2)[i] | cvalue;
return i + 1;
-
+
#else
-
-(void)(cvalue); /* Keep compiler happy; this function won't ever be */
-(void)(buffer); /* called when SUPPORT_UTF is not defined. */
-return 0;
-
-#endif
+
+(void)(cvalue); /* Keep compiler happy; this function won't ever be */
+(void)(buffer); /* called when SUPPORT_UTF is not defined. */
+return 0;
+
+#endif
}
/* End of pcre_ord2utf8.c */