From 623679f5b3360a6fafc4fed45ccbc873eaa64e9e Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 19 Sep 2015 01:26:36 +0300 Subject: [PATCH] Fix 'value truncated' compiler warning in CORD_cat (MS VC) * cord/cordbscs.c (CORD_cat_char_star, CORD_cat): Cast "lenx" to unsigned char (to workaround false compiler warning about value truncation). --- cord/cordbscs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cord/cordbscs.c b/cord/cordbscs.c index 5653672..e8246d2 100644 --- a/cord/cordbscs.c +++ b/cord/cordbscs.c @@ -221,7 +221,8 @@ CORD CORD_cat_char_star(CORD x, const char * y, size_t leny) if (result == 0) OUT_OF_MEMORY; result->header = CONCAT_HDR; result->depth = depth; - if (lenx <= MAX_LEFT_LEN) result->left_len = lenx; + if (lenx <= MAX_LEFT_LEN) + result->left_len = (unsigned char)lenx; result->len = result_len; result->left = x; result->right = y; @@ -262,7 +263,8 @@ CORD CORD_cat(CORD x, CORD y) if (result == 0) OUT_OF_MEMORY; result->header = CONCAT_HDR; result->depth = depth; - if (lenx <= MAX_LEFT_LEN) result->left_len = lenx; + if (lenx <= MAX_LEFT_LEN) + result->left_len = (unsigned char)lenx; result->len = result_len; result->left = x; result->right = y; -- 2.7.4