Set chromium_code for rlz.
This does two things:
1.) It enables filename rules. Use this to simplify rlz.gyp.
2.) It enables more warnings. Fix them.
BUG=none
TEST=none
Review URL: https://codereview.appspot.com/5902045
git-svn-id: http://rlz.googlecode.com/svn/trunk@122 10bc0f33-e4bf-9a86-80cf-af638054f0c4
diff --git a/lib/crc8_unittest.cc b/lib/crc8_unittest.cc
index 1ebac34..85646d1 100644
--- a/lib/crc8_unittest.cc
+++ b/lib/crc8_unittest.cc
@@ -31,7 +31,7 @@
unsigned char crc;
bool matches;
int length;
- for (int i = 0; i < sizeof(data) / sizeof(data[0]); ++i) {
+ for (size_t i = 0; i < sizeof(data) / sizeof(data[0]); ++i) {
bytes = reinterpret_cast<unsigned char*>(data[i].string);
crc = 0;
matches = false;
diff --git a/lib/financial_ping_test.cc b/lib/financial_ping_test.cc
index e797881..dc43eda 100644
--- a/lib/financial_ping_test.cc
+++ b/lib/financial_ping_test.cc
@@ -134,7 +134,6 @@
// Clear all RLZs.
char rlz[rlz_lib::kMaxRlzLength + 1];
- int idx = 0;
for (int ap = rlz_lib::NO_ACCESS_POINT + 1;
ap < rlz_lib::LAST_ACCESS_POINT; ap++) {
rlz[0] = 0;
diff --git a/lib/machine_id.cc b/lib/machine_id.cc
index bfae4b2..48d05b9 100644
--- a/lib/machine_id.cc
+++ b/lib/machine_id.cc
@@ -59,7 +59,7 @@
}
// Convert from int to binary (makes big-endian).
- for (int i = 0; i < sizeof(int); i++) {
+ for (size_t i = 0; i < sizeof(int); i++) {
int shift_bits = 8 * (sizeof(int) - i - 1);
id_binary[base::kSHA1Length + i] = static_cast<unsigned char>(
(volume_id >> shift_bits) & 0xFF);
diff --git a/lib/rlz_lib.cc b/lib/rlz_lib.cc
index 34d074d..2b990a9 100644
--- a/lib/rlz_lib.cc
+++ b/lib/rlz_lib.cc
@@ -182,7 +182,6 @@
return false;
// Append the events to the buffer.
- size_t buffer_size = cgi_size - cgi_arg.size();
size_t num_values = 0;
for (num_values = 0; num_values < events.size(); ++num_values) {
diff --git a/lib/string_utils_unittest.cc b/lib/string_utils_unittest.cc
index 4a12bf0..6f93053 100644
--- a/lib/string_utils_unittest.cc
+++ b/lib/string_utils_unittest.cc
@@ -17,11 +17,11 @@
rlz_lib::SetExpectedAssertion("");
char bad_letters[] = {'\x80', '\xA0', '\xFF'};
- for (int i = 0; i < arraysize(bad_letters); ++i)
+ for (size_t i = 0; i < arraysize(bad_letters); ++i)
EXPECT_FALSE(rlz_lib::IsAscii(bad_letters[i]));
char good_letters[] = {'A', '~', '\n', 0x7F, 0x00};
- for (int i = 0; i < arraysize(good_letters); ++i)
+ for (size_t i = 0; i < arraysize(good_letters); ++i)
EXPECT_TRUE(rlz_lib::IsAscii(good_letters[i]));
}
diff --git a/mac/lib/rlz_value_store_mac.mm b/mac/lib/rlz_value_store_mac.mm
index 610f8b8..403c5f2 100644
--- a/mac/lib/rlz_value_store_mac.mm
+++ b/mac/lib/rlz_value_store_mac.mm
@@ -409,7 +409,6 @@
if (store_.get()) {
g_store_object = NULL;
- NSString* folder = CreateRlzDirectory();
NSDictionary* dict =
static_cast<RlzValueStoreMac*>(store_.get())->dictionary();
VERIFY([dict writeToFile:RlzPlistFilename() atomically:YES]);
diff --git a/rlz.gyp b/rlz.gyp
index ad0daf6..b03f8cb 100644
--- a/rlz.gyp
+++ b/rlz.gyp
@@ -4,6 +4,7 @@
{
'variables': {
+ 'chromium_code': 1,
'variables': {
# Set force_rlz_use_chrome_net to 1 to use chrome's network stack instead
# of win inet.
@@ -51,33 +52,25 @@
'lib/rlz_value_store.h',
'lib/string_utils.cc',
'lib/string_utils.h',
+ 'mac/lib/machine_id_mac.cc',
+ 'mac/lib/rlz_value_store_mac.mm',
+ 'mac/lib/rlz_value_store_mac.h',
+ 'win/lib/lib_mutex.cc',
+ 'win/lib/lib_mutex.h',
+ 'win/lib/machine_deal.cc',
+ 'win/lib/machine_deal.h',
+ 'win/lib/machine_id_win.cc',
+ 'win/lib/process_info.cc',
+ 'win/lib/process_info.h',
+ 'win/lib/rlz_lib.h',
+ 'win/lib/rlz_lib_win.cc',
+ 'win/lib/rlz_value_store_registry.cc',
+ 'win/lib/rlz_value_store_registry.h',
+ 'win/lib/user_key.cc',
+ 'win/lib/user_key.h',
+ 'win/lib/vista_winnt.h',
],
'conditions': [
- ['OS=="win"', {
- 'sources': [
- 'win/lib/lib_mutex.cc',
- 'win/lib/lib_mutex.h',
- 'win/lib/machine_deal.cc',
- 'win/lib/machine_deal.h',
- 'win/lib/machine_id_win.cc',
- 'win/lib/process_info.cc',
- 'win/lib/process_info.h',
- 'win/lib/rlz_lib.h',
- 'win/lib/rlz_lib_win.cc',
- 'win/lib/rlz_value_store_registry.cc',
- 'win/lib/rlz_value_store_registry.h',
- 'win/lib/user_key.cc',
- 'win/lib/user_key.h',
- 'win/lib/vista_winnt.h',
- ],
- }],
- ['OS=="mac"', {
- 'sources': [
- 'mac/lib/machine_id_mac.cc',
- 'mac/lib/rlz_value_store_mac.mm',
- 'mac/lib/rlz_value_store_mac.h',
- ],
- }],
['rlz_use_chrome_net==1', {
'defines': [
'RLZ_NETWORK_IMPLEMENTATION_CHROME_NET',
@@ -127,13 +120,9 @@
'test/rlz_test_helpers.cc',
'test/rlz_test_helpers.h',
'test/rlz_unittest_main.cc',
+ 'win/lib/machine_deal_test.cc',
],
'conditions': [
- ['OS=="win"', {
- 'sources': [
- 'win/lib/machine_deal_test.cc',
- ],
- }],
['rlz_use_chrome_net==1', {
'dependencies': [
'../net/net.gyp:net_test_support',