ср, 18 июл. 2018 г. в 20:10, Alexander Turenko <
alexander.turenko@xxxxxxxxxxxxx>:
Two minor comments are below.Both should be fine, I guess. But ok, changed it.
WBR, Alexander Turenko.
On Wed, Jul 18, 2018 at 06:57:39PM +0300, Nikita Tatunov wrote:
ср, 18 июл. 2018 г. в 18:53, Alex KhatskevichUtf8Read()
<[1]avkhatskevich@xxxxxxxxxxxxx>:
Once you have fixed comments, please apply a new full diff at the end
of email, to
continue review process.
Answer with a full diff to this email please (just paste as a plain
text output of `git diff` command)
On 18.07.2018 18:24, Nikita Tatunov wrote:
-/*
- * For LIKE and GLOB matching on EBCDIC machines, assume that every
- * character is exactly one byte in size. Also, provde the
- * macro for fast reading of the next character in the common case
where
- * the next character is ASCII.
+/**
+ * Providing there are symbols in string s this macro returns
+ * UTF-8 code of character and pushes pointer to the next symbol
+ * in the string. Otherwise return code is SQL_END_OF_STRING.
Nitpicking: pushes -> promotes?
*/&status)
-#define Utf8Read(s, e) ucnv_getNextUChar(pUtf8conv, &s, e,
+#define Utf8Read(s, e) (s < e ?\
+ ucnv_getNextUChar(pUtf8conv, &s, e, &status) : 0)
+
+#define SQL_END_OF_STRING 0
Always wrap argument usages of a function-like macro within its body
with parenthesis (consider example I give in the previous email). It is
usual way to handle the fact that a macros works as text replacement,
so, say
#define SUB(x, y) x - y
will give the wrong result for the expression SUB(10, 5 - 3), while
#define SUB(x, y) ((x) - (y))
will produce the correct result.