[llvm] r180847 - fix windows warning.

Aaron Ballman aaron at aaronballman.com
Wed May 1 07:26:50 PDT 2013


I noticed that this interface uses size_t and size_type both; should
we make it more consistent by using size_type in place of size_t?

~Aaron

On Wed, May 1, 2013 at 10:18 AM, Peng Cheng <gm4cheng at gmail.com> wrote:
> Author: chp
> Date: Wed May  1 09:18:06 2013
> New Revision: 180847
>
> URL: http://llvm.org/viewvc/llvm-project?rev=180847&view=rev
> Log:
> fix windows warning.
>
> warning C4244: 'argument' : conversion from 'uint64_t' to 'const unsigned int', possible loss of data
>
> Modified:
>     llvm/trunk/include/llvm/ADT/StringRef.h
>
> Modified: llvm/trunk/include/llvm/ADT/StringRef.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringRef.h?rev=180847&r1=180846&r2=180847&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/ADT/StringRef.h (original)
> +++ llvm/trunk/include/llvm/ADT/StringRef.h Wed May  1 09:18:06 2013
> @@ -390,14 +390,14 @@ namespace llvm {
>
>      /// Return a StringRef equal to 'this' but with the first \p N elements
>      /// dropped.
> -    StringRef drop_front(unsigned N = 1) const {
> +    StringRef drop_front(size_t N = 1) const {
>        assert(size() >= N && "Dropping more elements than exist");
>        return substr(N);
>      }
>
>      /// Return a StringRef equal to 'this' but with the last \p N elements
>      /// dropped.
> -    StringRef drop_back(unsigned N = 1) const {
> +    StringRef drop_back(size_t N = 1) const {
>        assert(size() >= N && "Dropping more elements than exist");
>        return substr(0, size()-N);
>      }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list