You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2007/10/23 20:55:44 UTC

svn commit: r587608 - /apr/apr-util/branches/1.2.x/strmatch/apr_strmatch.c

Author: wrowe
Date: Tue Oct 23 11:55:43 2007
New Revision: 587608

URL: http://svn.apache.org/viewvc?rev=587608&view=rev
Log:
Correctly use size_t aligned numerics (which with all
of the casts gets especially tricky).

Backports: r587430

Modified:
    apr/apr-util/branches/1.2.x/strmatch/apr_strmatch.c

Modified: apr/apr-util/branches/1.2.x/strmatch/apr_strmatch.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.2.x/strmatch/apr_strmatch.c?rev=587608&r1=587607&r2=587608&view=diff
==============================================================================
--- apr/apr-util/branches/1.2.x/strmatch/apr_strmatch.c (original)
+++ apr/apr-util/branches/1.2.x/strmatch/apr_strmatch.c Tue Oct 23 11:55:43 2007
@@ -36,7 +36,7 @@
                                const char *s, apr_size_t slen)
 {
     const char *s_end = s + slen;
-    int *shift = (int *)(this_pattern->context);
+    apr_size_t *shift = (apr_size_t *)(this_pattern->context);
     const char *s_next = s + this_pattern->length - 1;
     const char *p_start = this_pattern->pattern;
     const char *p_end = p_start + this_pattern->length - 1;
@@ -60,7 +60,7 @@
                                const char *s, apr_size_t slen)
 {
     const char *s_end = s + slen;
-    int *shift = (int *)(this_pattern->context);
+    apr_size_t *shift = (apr_size_t *)(this_pattern->context);
     const char *s_next = s + this_pattern->length - 1;
     const char *p_start = this_pattern->pattern;
     const char *p_end = p_start + this_pattern->length - 1;
@@ -85,7 +85,7 @@
 {
     apr_strmatch_pattern *pattern;
     apr_size_t i;
-    int *shift;
+    apr_size_t *shift;
 
     pattern = apr_palloc(p, sizeof(*pattern));
     pattern->pattern = s;
@@ -96,7 +96,7 @@
         return pattern;
     }
 
-    shift = (int *)apr_palloc(p, sizeof(int) * NUM_CHARS);
+    shift = (apr_size_t *)apr_palloc(p, sizeof(apr_size_t) * NUM_CHARS);
     for (i = 0; i < NUM_CHARS; i++) {
         shift[i] = pattern->length;
     }