[Pcre-svn] [559] code/trunk/src: Insert missing casts to red…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [559] code/trunk/src: Insert missing casts to reduce compiler warnings.
Revision: 559
          http://www.exim.org/viewvc/pcre2?view=rev&revision=559
Author:   ph10
Date:     2016-10-06 17:47:56 +0100 (Thu, 06 Oct 2016)
Log Message:
-----------
Insert missing casts to reduce compiler warnings.


Modified Paths:
--------------
    code/trunk/src/pcre2_intmodedep.h
    code/trunk/src/pcre2_match.c


Modified: code/trunk/src/pcre2_intmodedep.h
===================================================================
--- code/trunk/src/pcre2_intmodedep.h    2016-10-05 17:03:52 UTC (rev 558)
+++ code/trunk/src/pcre2_intmodedep.h    2016-10-06 16:47:56 UTC (rev 559)
@@ -140,7 +140,7 @@
 #undef LINK_SIZE
 #define LINK_SIZE 1
 #define PUT(a,n,d)   \
-  (a[n] = (d))
+  (a[n] = (PCRE2_UCHAR)(d))
 #define GET(a,n) \
   (a[n])
 #define MAX_PATTERN_SIZE (1 << 16)


Modified: code/trunk/src/pcre2_match.c
===================================================================
--- code/trunk/src/pcre2_match.c    2016-10-05 17:03:52 UTC (rev 558)
+++ code/trunk/src/pcre2_match.c    2016-10-06 16:47:56 UTC (rev 559)
@@ -1319,7 +1319,7 @@
         {
         pcre2_callout_block cb;
         cb.version          = 1;
-        cb.capture_top      = offset_top/2;
+        cb.capture_top      = (uint32_t)offset_top/2;
         cb.capture_last     = mb->capture_last & CAPLMASK;
         cb.offset_vector    = mb->ovector;
         cb.mark             = mb->nomatch_mark;
@@ -1746,7 +1746,7 @@
         pcre2_callout_block cb;
         cb.version          = 1;
         cb.callout_number   = ecode[LINK_SIZE + 1];
-        cb.capture_top      = offset_top/2;
+        cb.capture_top      = (uint32_t)offset_top/2;
         cb.capture_last     = mb->capture_last & CAPLMASK;
         cb.offset_vector    = mb->ovector;
         cb.mark             = mb->nomatch_mark;
@@ -7162,7 +7162,7 @@
   too many to fit into the ovector. */


   match_data->rc = ((mb->capture_last & OVFLBIT) != 0)?
-    0 : mb->end_offset_top/2;
+    0 : (int)mb->end_offset_top/2;


/* If there is space in the offset vector, set any pairs that follow the
highest-numbered captured string but are less than the number of capturing