subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1349269 - in /subversion/trunk/subversion: libsvn_fs_fs/key-gen.c libsvn_subr/quoprint.c tests/libsvn_delta/random-test.c tests/libsvn_subr/skel-test.c tests/libsvn_subr/utf-test.c
Date Tue, 12 Jun 2012 11:39:41 GMT
Author: stefan2
Date: Tue Jun 12 11:39:40 2012
New Revision: 1349269

URL: http://svn.apache.org/viewvc?rev=1349269&view=rev
Log:
Silence int -> char conversion warnings.

* libsvn_fs_fs/key-gen.c
  (svn_fs_fs__add_keys): explicitly cast to char before assigning it to char
* libsvn_subr/quoprint.c
  (decode_bytes): ditto
* tests/libsvn_delta/random-test.c
  (generate_random_file): same here ...
* tests/libsvn_subr/skel-test.c
  (gen_implicit_length_all_chars, parse_explicit_length, parse_list, 
   unparse_list): ... here ...
* tests/libsvn_subr/utf-test.c
  (utf_validate2): ... and here

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/key-gen.c
    subversion/trunk/subversion/libsvn_subr/quoprint.c
    subversion/trunk/subversion/tests/libsvn_delta/random-test.c
    subversion/trunk/subversion/tests/libsvn_subr/skel-test.c
    subversion/trunk/subversion/tests/libsvn_subr/utf-test.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/key-gen.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/key-gen.c?rev=1349269&r1=1349268&r2=1349269&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/key-gen.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/key-gen.c Tue Jun 12 11:39:40 2012
@@ -60,7 +60,7 @@ svn_fs_fs__add_keys(const char *key1, co
       carry = val / 36;
       val = val % 36;
 
-      buf[i3++] = (val <= 9) ? (val + '0') : (val - 10 + 'a');
+      buf[i3++] = (char)((val <= 9) ? (val + '0') : (val - 10 + 'a'));
 
       if (i1>=0)
         i1--;

Modified: subversion/trunk/subversion/libsvn_subr/quoprint.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/quoprint.c?rev=1349269&r1=1349268&r2=1349269&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/quoprint.c (original)
+++ subversion/trunk/subversion/libsvn_subr/quoprint.c Tue Jun 12 11:39:40 2012
@@ -233,7 +233,7 @@ decode_bytes(svn_stringbuf_t *str, const
           find2 = strchr(hextab, inbuf[2]);
           if (find1 != NULL && find2 != NULL)
             {
-              c = ((find1 - hextab) << 4) | (find2 - hextab);
+              c = (char)(((find1 - hextab) << 4) | (find2 - hextab));
               svn_stringbuf_appendbyte(str, c);
             }
           *inbuflen = 0;

Modified: subversion/trunk/subversion/tests/libsvn_delta/random-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_delta/random-test.c?rev=1349269&r1=1349268&r2=1349269&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_delta/random-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_delta/random-test.c Tue Jun 12 11:39:40 2012
@@ -198,7 +198,7 @@ generate_random_file(apr_uint32_t maxlen
               buf = file_buffer;
             }
 
-          *buf++ = ch;
+          *buf++ = (char)ch;
           r = r * 1103515245 + 12345;
         }
     }

Modified: subversion/trunk/subversion/tests/libsvn_subr/skel-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/skel-test.c?rev=1349269&r1=1349268&r2=1349269&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/skel-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/skel-test.c Tue Jun 12 11:39:40 2012
@@ -216,7 +216,7 @@ gen_implicit_length_all_chars(apr_size_t
   for (i = 0; i < 256; i++)
     if (! skel_is_space( (apr_byte_t)i)
         && ! skel_is_paren( (apr_byte_t)i))
-      name[pos++] = i;
+      name[pos++] = (char)i;
 
   *len_p = pos;
   return name;
@@ -375,7 +375,7 @@ parse_explicit_length(apr_pool_t *pool)
       {
         char buf[1];
 
-        buf[0] = i;
+        buf[0] = (char)i;
         SVN_ERR(try_explicit_length(buf, 1, 1, pool));
       }
   }
@@ -386,7 +386,7 @@ parse_explicit_length(apr_pool_t *pool)
     char data[256];
 
     for (i = 0; i < 256; i++)
-      data[i] = i;
+      data[i] = (char)i;
 
     SVN_ERR(try_explicit_length(data, 256, 256, pool));
   }
@@ -592,7 +592,7 @@ parse_list(apr_pool_t *pool)
                       svn_skel_t *child;
                       char buf[1];
 
-                      buf[0] = atom_byte;
+                      buf[0] = (char)atom_byte;
 
                       put_list_start(str,  (apr_byte_t)sep, sep_count);
                       for (i = 0; i < list_len; i++)
@@ -619,7 +619,7 @@ parse_list(apr_pool_t *pool)
                     char data[256];
 
                     for (i = 0; i < 256; i++)
-                      data[i] = i;
+                      data[i] = (char)i;
 
                     put_list_start(str,  (apr_byte_t)sep, sep_count);
                     for (i = 0; i < list_len; i++)
@@ -797,7 +797,7 @@ unparse_list(apr_pool_t *pool)
     for (byte = 0; byte < 256; byte++)
       if (skel_is_name( (apr_byte_t)byte))
         {
-          char buf = byte;
+          char buf = (char)byte;
           add(build_atom(1, &buf, pool), list);
         }
 
@@ -858,7 +858,7 @@ unparse_list(apr_pool_t *pool)
             val = i * 10 + j;
             for (k = 0; k < sizeof(buf); k++)
               {
-                buf[k] = val;
+                buf[k] = (char)val;
                 val += j;
               }
 

Modified: subversion/trunk/subversion/tests/libsvn_subr/utf-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/utf-test.c?rev=1349269&r1=1349268&r2=1349269&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/utf-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/utf-test.c Tue Jun 12 11:39:40 2012
@@ -197,7 +197,7 @@ utf_validate2(apr_pool_t *pool)
       /* A random string; experiment shows that it's occasionally (less
          than 1%) valid but usually invalid. */
       for (j = 0; j < sizeof(str) - 1; ++j)
-        str[j] = range_rand(0, 255);
+        str[j] = (char)range_rand(0, 255);
       str[sizeof(str) - 1] = 0;
       len = strlen(str);
 



Mime
View raw message