[libcxx] r329665 - [libcxx] [test] Use the correct type from strlen. Include correct header.

Billy Robert O'Neal III via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 9 20:04:08 PDT 2018


Author: bion
Date: Mon Apr  9 20:04:07 2018
New Revision: 329665

URL: http://llvm.org/viewvc/llvm-project?rev=329665&view=rev
Log:
[libcxx] [test] Use the correct type from strlen. Include correct header.

Modified:
    libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp
    libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp
    libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp
    libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp

Modified: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp?rev=329665&r1=329664&r2=329665&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/cp_size_cp.pass.cpp Mon Apr  9 20:04:07 2018
@@ -15,6 +15,7 @@
 
 #include <strstream>
 #include <cassert>
+#include <cstring>
 
 int main()
 {
@@ -71,8 +72,8 @@ int main()
     }
     {
         char buf[10] = "abcd";
-        int s = std::strlen(buf);
-        std::strstreambuf sb(buf, sizeof(buf)-s, buf + s);
+        std::size_t s = std::strlen(buf);
+        std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
         assert(sb.sgetc() == 'a');
         assert(sb.snextc() == 'b');
         assert(sb.snextc() == 'c');

Modified: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp?rev=329665&r1=329664&r2=329665&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/scp_size_scp.pass.cpp Mon Apr  9 20:04:07 2018
@@ -15,6 +15,7 @@
 
 #include <strstream>
 #include <cassert>
+#include <cstring>
 
 int main()
 {
@@ -71,8 +72,8 @@ int main()
     }
     {
         signed char buf[10] = "abcd";
-        int s = std::strlen((char*)buf);
-        std::strstreambuf sb(buf, sizeof(buf)-s, buf + s);
+        std::size_t s = std::strlen((char*)buf);
+        std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
         assert(sb.sgetc() == 'a');
         assert(sb.snextc() == 'b');
         assert(sb.snextc() == 'c');

Modified: libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp?rev=329665&r1=329664&r2=329665&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.cons/ucp_size_ucp.pass.cpp Mon Apr  9 20:04:07 2018
@@ -15,6 +15,7 @@
 
 #include <strstream>
 #include <cassert>
+#include <cstring>
 
 int main()
 {
@@ -71,8 +72,8 @@ int main()
     }
     {
         unsigned char buf[10] = "abcd";
-        int s = std::strlen((char*)buf);
-        std::strstreambuf sb(buf, sizeof(buf)-s, buf + s);
+        std::size_t s = std::strlen((char*)buf);
+        std::strstreambuf sb(buf, sizeof(buf) - s, buf + s);
         assert(sb.sgetc() == 'a');
         assert(sb.snextc() == 'b');
         assert(sb.snextc() == 'c');

Modified: libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp?rev=329665&r1=329664&r2=329665&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp Mon Apr  9 20:04:07 2018
@@ -45,7 +45,7 @@ protected:
         {
             if (ch != base::traits_type::eof())
             {
-                int n = str_.size();
+                std::size_t n = str_.size();
                 str_.push_back(static_cast<CharT>(ch));
                 str_.resize(str_.capacity());
                 base::setp(const_cast<CharT*>(str_.data()),




More information about the cfe-commits mailing list