aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/base64/ssse3/dec_tail.c
diff options
context:
space:
mode:
authoryazevnul <yazevnul@yandex-team.ru>2022-02-10 16:46:48 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:48 +0300
commit9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /contrib/libs/base64/ssse3/dec_tail.c
parent8cbc307de0221f84c80c42dcbe07d40727537e2c (diff)
downloadydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/base64/ssse3/dec_tail.c')
-rw-r--r--contrib/libs/base64/ssse3/dec_tail.c130
1 files changed, 65 insertions, 65 deletions
diff --git a/contrib/libs/base64/ssse3/dec_tail.c b/contrib/libs/base64/ssse3/dec_tail.c
index 69b6f2c9d3..69e0050710 100644
--- a/contrib/libs/base64/ssse3/dec_tail.c
+++ b/contrib/libs/base64/ssse3/dec_tail.c
@@ -1,65 +1,65 @@
- if (srclen-- == 0) {
- ret = 1;
- break;
- }
- if ((q = ssse3_base64_table_dec[*c++]) >= 254) {
- st.eof = 1;
- // Treat character '=' as invalid for byte 0:
- break;
- }
- st.carry = q << 2;
- st.bytes++;
-
- case 1: if (srclen-- == 0) {
- ret = 1;
- break;
- }
- if ((q = ssse3_base64_table_dec[*c++]) >= 254) {
- st.eof = 1;
- // Treat character '=' as invalid for byte 1:
- break;
- }
- *o++ = st.carry | (q >> 4);
- st.carry = q << 4;
- st.bytes++;
- outl++;
-
- case 2: if (srclen-- == 0) {
- ret = 1;
- break;
- }
- if ((q = ssse3_base64_table_dec[*c++]) >= 254) {
- st.eof = 1;
- // When q == 254, the input char is '='. Return 1 and EOF.
- // Technically, should check if next byte is also '=', but never mind.
- // When q == 255, the input char is invalid. Return 0 and EOF.
- ret = (q == 254) ? 1 : 0;
- break;
- }
- *o++ = st.carry | (q >> 2);
- st.carry = q << 6;
- st.bytes++;
- outl++;
-
- case 3: if (srclen-- == 0) {
- ret = 1;
- break;
- }
- if ((q = ssse3_base64_table_dec[*c++]) >= 254) {
- st.eof = 1;
- // When q == 254, the input char is '='. Return 1 and EOF.
- // When q == 255, the input char is invalid. Return 0 and EOF.
- ret = (q == 254) ? 1 : 0;
- break;
- }
- *o++ = st.carry | q;
- st.carry = 0;
- st.bytes = 0;
- outl++;
- }
-}
-state->eof = st.eof;
-state->bytes = st.bytes;
-state->carry = st.carry;
-*outlen = outl;
-return ret;
+ if (srclen-- == 0) {
+ ret = 1;
+ break;
+ }
+ if ((q = ssse3_base64_table_dec[*c++]) >= 254) {
+ st.eof = 1;
+ // Treat character '=' as invalid for byte 0:
+ break;
+ }
+ st.carry = q << 2;
+ st.bytes++;
+
+ case 1: if (srclen-- == 0) {
+ ret = 1;
+ break;
+ }
+ if ((q = ssse3_base64_table_dec[*c++]) >= 254) {
+ st.eof = 1;
+ // Treat character '=' as invalid for byte 1:
+ break;
+ }
+ *o++ = st.carry | (q >> 4);
+ st.carry = q << 4;
+ st.bytes++;
+ outl++;
+
+ case 2: if (srclen-- == 0) {
+ ret = 1;
+ break;
+ }
+ if ((q = ssse3_base64_table_dec[*c++]) >= 254) {
+ st.eof = 1;
+ // When q == 254, the input char is '='. Return 1 and EOF.
+ // Technically, should check if next byte is also '=', but never mind.
+ // When q == 255, the input char is invalid. Return 0 and EOF.
+ ret = (q == 254) ? 1 : 0;
+ break;
+ }
+ *o++ = st.carry | (q >> 2);
+ st.carry = q << 6;
+ st.bytes++;
+ outl++;
+
+ case 3: if (srclen-- == 0) {
+ ret = 1;
+ break;
+ }
+ if ((q = ssse3_base64_table_dec[*c++]) >= 254) {
+ st.eof = 1;
+ // When q == 254, the input char is '='. Return 1 and EOF.
+ // When q == 255, the input char is invalid. Return 0 and EOF.
+ ret = (q == 254) ? 1 : 0;
+ break;
+ }
+ *o++ = st.carry | q;
+ st.carry = 0;
+ st.bytes = 0;
+ outl++;
+ }
+}
+state->eof = st.eof;
+state->bytes = st.bytes;
+state->carry = st.carry;
+*outlen = outl;
+return ret;