[llvm] r180847 - fix windows warning.

Peng Cheng gm4cheng at gmail.com
Wed May 1 11:36:14 PDT 2013


I agree with that, but did not make the change because not sure why there
are two such types.

On Wednesday, May 1, 2013, Aaron Ballman wrote:

> 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<javascript:;>>
> 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 <javascript:;>
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130501/f01f96f6/attachment.html>


More information about the llvm-commits mailing list