Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: ui/base/range/range.h

Issue 11889017: some fixes and warning disables in ui/ for building on win x64 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove stupid code Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_win.cc ('k') | ui/base/range/range_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_RANGE_RANGE_H_ 5 #ifndef UI_BASE_RANGE_RANGE_H_
6 #define UI_BASE_RANGE_RANGE_H_ 6 #define UI_BASE_RANGE_RANGE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 // Getters and setters. 59 // Getters and setters.
60 size_t start() const { return start_; } 60 size_t start() const { return start_; }
61 void set_start(size_t start) { start_ = start; } 61 void set_start(size_t start) { start_ = start; }
62 62
63 size_t end() const { return end_; } 63 size_t end() const { return end_; }
64 void set_end(size_t end) { end_ = end; } 64 void set_end(size_t end) { end_ = end; }
65 65
66 // Returns the absolute value of the length. 66 // Returns the absolute value of the length.
67 size_t length() const { 67 size_t length() const {
68 int length = end() - start(); 68 ptrdiff_t length = end() - start();
69 return length >= 0 ? length : -length; 69 return length >= 0 ? length : -length;
70 } 70 }
71 71
72 bool is_reversed() const { return start() > end(); } 72 bool is_reversed() const { return start() > end(); }
73 bool is_empty() const { return start() == end(); } 73 bool is_empty() const { return start() == end(); }
74 74
75 // Returns the minimum and maximum values. 75 // Returns the minimum and maximum values.
76 size_t GetMin() const; 76 size_t GetMin() const;
77 size_t GetMax() const; 77 size_t GetMax() const;
78 78
(...skipping 26 matching lines...) Expand all
105 std::string ToString() const; 105 std::string ToString() const;
106 106
107 private: 107 private:
108 size_t start_; 108 size_t start_;
109 size_t end_; 109 size_t end_;
110 }; 110 };
111 111
112 } // namespace ui 112 } // namespace ui
113 113
114 #endif // UI_BASE_RANGE_RANGE_H_ 114 #endif // UI_BASE_RANGE_RANGE_H_
OLDNEW
« no previous file with comments | « ui/base/dragdrop/os_exchange_data_provider_win.cc ('k') | ui/base/range/range_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698