summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-11-15 10:09:11 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-11-15 10:09:11 (GMT)
commite5b1e20b49d4610ec84dc2da862b19d6119452d4 (patch)
tree132b4831c95ba4f1dce118cf44d2790feb4548e8 /generic
parentc28a047f8ac27cc47e0e47578bddc491c72bd9ae (diff)
parente00ef49560bb5bd4349d017887c7cd5a2d0ba38e (diff)
downloadtcl-e5b1e20b49d4610ec84dc2da862b19d6119452d4.zip
tcl-e5b1e20b49d4610ec84dc2da862b19d6119452d4.tar.gz
tcl-e5b1e20b49d4610ec84dc2da862b19d6119452d4.tar.bz2
Merge 8.6.
Also fix the use of WUR (warn unused result) in libtommath function signatures: this cannot be used in combination with "deprecated" or "nostub"
Diffstat (limited to 'generic')
-rw-r--r--generic/tclEncoding.c15
-rw-r--r--generic/tclTomMath.decls4
-rw-r--r--generic/tclTomMathDecls.h10
3 files changed, 11 insertions, 18 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 48e198b..e318d5b 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -2366,7 +2366,7 @@ UtfToUtfProc(
}
dstStart = dst;
- dstEnd = dst + dstLen - ((pureNullMode == 1) ? 4 : TCL_UTF_MAX);
+ dstEnd = dst + dstLen - TCL_UTF_MAX;
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
@@ -2412,21 +2412,14 @@ UtfToUtfProc(
if ((*chPtr & 0xFC00) == 0xD800) {
/* A high surrogate character is detected, handle especially */
Tcl_UniChar low = *chPtr;
- size_t len = Tcl_UtfToUniChar(src, &low);
+ if (src <= srcEnd-3) {
+ Tcl_UtfToUniChar(src, &low);
+ }
if ((low & 0xFC00) != 0xDC00) {
*dst++ = (char) (((*chPtr >> 12) | 0xE0) & 0xEF);
*dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF);
*dst++ = (char) ((*chPtr | 0x80) & 0xBF);
continue;
- } else if (pureNullMode == 1) {
- int full = (((*chPtr & 0x3FF) << 10) | (low & 0x3FF)) + 0x10000;
- *dst++ = (char) (((full >> 18) | 0xF0) & 0xF7);
- *dst++ = (char) (((full >> 12) | 0x80) & 0xBF);
- *dst++ = (char) (((full >> 6) | 0x80) & 0xBF);
- *dst++ = (char) ((full | 0x80) & 0xBF);
- *chPtr = 0;
- src += len;
- continue;
}
}
dst += Tcl_UniCharToUtf(*chPtr, dst);
diff --git a/generic/tclTomMath.decls b/generic/tclTomMath.decls
index 964b5a7..547604b 100644
--- a/generic/tclTomMath.decls
+++ b/generic/tclTomMath.decls
@@ -75,7 +75,7 @@ declare 16 {
mp_err MP_WUR TclBN_mp_div_2d(const mp_int *a, int b, mp_int *q, mp_int *r)
}
declare 17 {deprecated {is private function in libtommath}} {
- mp_err MP_WUR TclBN_mp_div_3(const mp_int *a, mp_int *q, unsigned int *r)
+ mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q, unsigned int *r)
}
declare 18 {
void TclBN_mp_exch(mp_int *a, mp_int *b)
@@ -144,7 +144,7 @@ declare 39 {
void TclBN_mp_set(mp_int *a, unsigned int b)
}
declare 40 {nostub {is private function in libtommath}} {
- mp_err MP_WUR TclBN_mp_sqr(const mp_int *a, mp_int *b)
+ mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b)
}
declare 41 {
mp_err MP_WUR TclBN_mp_sqrt(const mp_int *a, mp_int *b)
diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h
index 7588d96..056e2fe 100644
--- a/generic/tclTomMathDecls.h
+++ b/generic/tclTomMathDecls.h
@@ -210,8 +210,8 @@ EXTERN mp_err TclBN_mp_div_2d(const mp_int *a, int b, mp_int *q,
mp_int *r) MP_WUR;
/* 17 */
TCL_DEPRECATED("is private function in libtommath")
-mp_err MP_WUR TclBN_mp_div_3(const mp_int *a, mp_int *q,
- unsigned int *r) MP_WUR;
+mp_err TclBN_mp_div_3(const mp_int *a, mp_int *q,
+ unsigned int *r);
/* 18 */
EXTERN void TclBN_mp_exch(mp_int *a, mp_int *b);
/* 19 */
@@ -264,7 +264,7 @@ EXTERN mp_err TclBN_mp_shrink(mp_int *a) MP_WUR;
/* 39 */
EXTERN void TclBN_mp_set(mp_int *a, unsigned int b);
/* 40 */
-EXTERN mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b) MP_WUR;
+EXTERN mp_err TclBN_mp_sqr(const mp_int *a, mp_int *b);
/* 41 */
EXTERN mp_err TclBN_mp_sqrt(const mp_int *a, mp_int *b) MP_WUR;
/* 42 */
@@ -403,7 +403,7 @@ typedef struct TclTomMathStubs {
mp_err (*tclBN_mp_div_d) (const mp_int *a, unsigned int b, mp_int *q, unsigned int *r) MP_WUR; /* 14 */
mp_err (*tclBN_mp_div_2) (const mp_int *a, mp_int *q) MP_WUR; /* 15 */
mp_err (*tclBN_mp_div_2d) (const mp_int *a, int b, mp_int *q, mp_int *r) MP_WUR; /* 16 */
- TCL_DEPRECATED_API("is private function in libtommath") mp_err (*tclBN_mp_div_3) (const mp_int *a, mp_int *q, unsigned int *r) MP_WUR; /* 17 */
+ TCL_DEPRECATED_API("is private function in libtommath") mp_err (*tclBN_mp_div_3) (const mp_int *a, mp_int *q, unsigned int *r); /* 17 */
void (*tclBN_mp_exch) (mp_int *a, mp_int *b); /* 18 */
mp_err (*tclBN_mp_expt_u32) (const mp_int *a, unsigned int b, mp_int *c) MP_WUR; /* 19 */
mp_err (*tclBN_mp_grow) (mp_int *a, int size) MP_WUR; /* 20 */
@@ -426,7 +426,7 @@ typedef struct TclTomMathStubs {
void (*tclBN_mp_rshd) (mp_int *a, int shift); /* 37 */
mp_err (*tclBN_mp_shrink) (mp_int *a) MP_WUR; /* 38 */
void (*tclBN_mp_set) (mp_int *a, unsigned int b); /* 39 */
- TCL_DEPRECATED_API("is private function in libtommath") mp_err (*tclBN_mp_sqr) (const mp_int *a, mp_int *b) MP_WUR; /* 40 */
+ TCL_DEPRECATED_API("is private function in libtommath") mp_err (*tclBN_mp_sqr) (const mp_int *a, mp_int *b); /* 40 */
mp_err (*tclBN_mp_sqrt) (const mp_int *a, mp_int *b) MP_WUR; /* 41 */
mp_err (*tclBN_mp_sub) (const mp_int *a, const mp_int *b, mp_int *c) MP_WUR; /* 42 */
mp_err (*tclBN_mp_sub_d) (const mp_int *a, unsigned int b, mp_int *c) MP_WUR; /* 43 */