Browse Source

CPP: Changing int to size_t in one place, removing unnecessary friend class declaration.

pull/567/head
Philip Liard 15 years ago
committed by Mihaela Rosca
parent
commit
d0d252483b
3 changed files with 2 additions and 3 deletions
  1. +1
    -1
      cpp/src/phonenumberutil.cc
  2. +1
    -1
      cpp/src/phonenumberutil.h
  3. +0
    -1
      cpp/src/regexp_cache.h

+ 1
- 1
cpp/src/phonenumberutil.cc View File

@ -1925,7 +1925,7 @@ bool PhoneNumberUtil::MaybeStripExtension(string* number, string* extension)
// characters long. // characters long.
int PhoneNumberUtil::ExtractCountryCode(string* national_number) const { int PhoneNumberUtil::ExtractCountryCode(string* national_number) const {
int potential_country_code; int potential_country_code;
for (int i = 1; i <= kMaxLengthCountryCode; ++i) {
for (size_t i = 1; i <= kMaxLengthCountryCode; ++i) {
safe_strto32(national_number->substr(0, i), &potential_country_code); safe_strto32(national_number->substr(0, i), &potential_country_code);
string region_code; string region_code;
GetRegionCodeForCountryCode(potential_country_code, &region_code); GetRegionCodeForCountryCode(potential_country_code, &region_code);


+ 1
- 1
cpp/src/phonenumberutil.h View File

@ -517,7 +517,7 @@ class PhoneNumberUtil : public Singleton<PhoneNumberUtil> {
static const size_t kMinLengthForNsn = 3; static const size_t kMinLengthForNsn = 3;
static const size_t kMaxLengthForNsn = 15; static const size_t kMaxLengthForNsn = 15;
// The maximum length of the country calling code. // The maximum length of the country calling code.
static const int kMaxLengthCountryCode = 3;
static const size_t kMaxLengthCountryCode = 3;
static const char kPlusChars[]; static const char kPlusChars[];
// Regular expression of acceptable punctuation found in phone numbers. This // Regular expression of acceptable punctuation found in phone numbers. This


+ 0
- 1
cpp/src/regexp_cache.h View File

@ -70,7 +70,6 @@ class RegExpCache {
base::Lock lock_; // protects cache_impl_ base::Lock lock_; // protects cache_impl_
scoped_ptr<CacheImpl> cache_impl_; // protected by lock_ scoped_ptr<CacheImpl> cache_impl_; // protected by lock_
friend class RegExpCacheTest_CacheConstructor_Test; friend class RegExpCacheTest_CacheConstructor_Test;
friend class RegExpCacheTest_AccessConstructor_Test;
DISALLOW_COPY_AND_ASSIGN(RegExpCache); DISALLOW_COPY_AND_ASSIGN(RegExpCache);
}; };


Loading…
Cancel
Save