]> granicus.if.org Git - apache/commitdiff
Some cast magic for intentional float/int transformations.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 25 Jul 2001 21:12:45 +0000 (21:12 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 25 Jul 2001 21:12:45 +0000 (21:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89711 13f79535-47bb-0310-9956-ffa450edef68

modules/mappers/mod_rewrite.c

index cef06cef8fc6b888c21e10eff2b625c0f5297afd..c80181687b1c967f68791432ae49bdba5a78f224 100644 (file)
@@ -2479,7 +2479,7 @@ static void reduce_uri(request_rec *r)
     char host[LONG_STRING_LEN];
     char buf[MAX_STRING_LEN];
     char *olduri;
-    int l;
+    apr_size_t l;
 
     cp = (char *)ap_http_method(r);
     l  = strlen(cp);
@@ -3041,7 +3041,7 @@ static int rewrite_rand(int l, int h)
      * result. Doing an integer modulus would only use the lower-order bits
      * which may not be as uniformly random.
      */
-    return ((double)(rand() % RAND_MAX) / RAND_MAX) * (h - l + 1) + l;
+    return (int)((double)(rand() % RAND_MAX) / RAND_MAX) * (h - l + 1) + l;
 }
 
 static char *select_random_value_part(request_rec *r, char *value)