summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync
diff options
context:
space:
mode:
authornick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 21:30:12 +0000
committernick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 21:30:12 +0000
commit92c3dc6b3fffbaf9fa2fa409120ca051bf317234 (patch)
treebd3635f12f049c215b6c33b83a64a78d9c1e2a45 /chrome/browser/sync
parent49000f228320e0071157928ec9054115d75c93e3 (diff)
downloadchromium_src-92c3dc6b3fffbaf9fa2fa409120ca051bf317234.zip
chromium_src-92c3dc6b3fffbaf9fa2fa409120ca051bf317234.tar.gz
chromium_src-92c3dc6b3fffbaf9fa2fa409120ca051bf317234.tar.bz2
Fix compiler warnings in chrome\browser\sync.
Warnings are treated as errors in the Chrome build. Most of these are just forcing the implicit conversion to maintain the previous behavior. TEST=sync unit tests BUG=none Review URL: http://codereview.chromium.org/193085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r--chrome/browser/sync/engine/all_status.cc2
-rw-r--r--chrome/browser/sync/engine/net/gaia_authenticator.cc2
-rw-r--r--chrome/browser/sync/engine/net/server_connection_manager.cc9
-rw-r--r--chrome/browser/sync/engine/syncapi.cc1
-rw-r--r--chrome/browser/sync/engine/syncapi.h3
-rw-r--r--chrome/browser/sync/notifier/communicator/auto_reconnect.cc3
-rw-r--r--chrome/browser/sync/notifier/listener/listen_task.cc9
-rw-r--r--chrome/browser/sync/syncable/directory_backing_store.cc2
-rw-r--r--chrome/browser/sync/syncable/directory_manager.cc2
-rw-r--r--chrome/browser/sync/util/path_helpers.cc2
-rw-r--r--chrome/browser/sync/util/pthread_helpers.cc6
11 files changed, 22 insertions, 19 deletions
diff --git a/chrome/browser/sync/engine/all_status.cc b/chrome/browser/sync/engine/all_status.cc
index e1bc5c7..1c8c5ed 100644
--- a/chrome/browser/sync/engine/all_status.cc
+++ b/chrome/browser/sync/engine/all_status.cc
@@ -91,7 +91,7 @@ AllStatus::Status AllStatus::CreateBlankStatus() const {
AllStatus::Status AllStatus::CalcSyncing(const SyncerEvent &event) const {
Status status = CreateBlankStatus();
SyncerStatus syncerStatus(event.last_session);
- status.unsynced_count += syncerStatus.unsynced_count();
+ status.unsynced_count += static_cast<int>(syncerStatus.unsynced_count());
status.conflicting_count += syncerStatus.conflicting_commits();
if (syncerStatus.current_sync_timestamp() ==
syncerStatus.servers_latest_timestamp()) {
diff --git a/chrome/browser/sync/engine/net/gaia_authenticator.cc b/chrome/browser/sync/engine/net/gaia_authenticator.cc
index 7276cec..435579f 100644
--- a/chrome/browser/sync/engine/net/gaia_authenticator.cc
+++ b/chrome/browser/sync/engine/net/gaia_authenticator.cc
@@ -72,7 +72,7 @@ bool SplitStringIntoKeyValuePairs(const string& line,
// values; just record that our split failed.
success = false;
}
- DCHECK_LE(value.size(), 1);
+ DCHECK_LE(value.size(), 1U);
kv_pairs->push_back(make_pair(key, value.empty()? "" : value[0]));
}
return success;
diff --git a/chrome/browser/sync/engine/net/server_connection_manager.cc b/chrome/browser/sync/engine/net/server_connection_manager.cc
index 42b380b..ab3f51f 100644
--- a/chrome/browser/sync/engine/net/server_connection_manager.cc
+++ b/chrome/browser/sync/engine/net/server_connection_manager.cc
@@ -56,7 +56,8 @@ bool ServerConnectionManager::Post::ReadBufferResponse(
if (require_response && (1 > response->content_length))
return false;
- const int64 bytes_read = ReadResponse(buffer_out, response->content_length);
+ const int64 bytes_read = ReadResponse(buffer_out,
+ static_cast<int>(response->content_length));
if (bytes_read != response->content_length) {
response->server_status = HttpResponse::IO_ERROR;
return false;
@@ -66,7 +67,8 @@ bool ServerConnectionManager::Post::ReadBufferResponse(
bool ServerConnectionManager::Post::ReadDownloadResponse(
HttpResponse* response, string* buffer_out) {
- const int64 bytes_read = ReadResponse(buffer_out, response->content_length);
+ const int64 bytes_read = ReadResponse(buffer_out,
+ static_cast<int>(response->content_length));
if (bytes_read != response->content_length) {
LOG(ERROR) << "Mismatched content lengths, server claimed " <<
@@ -237,7 +239,8 @@ bool ServerConnectionManager::CheckTime(int32* out_time) {
continue;
}
string time_response;
- time_response.resize(response.content_length);
+ time_response.resize(
+ static_cast<string::size_type>(response.content_length));
ok = post->ReadDownloadResponse(&response, &time_response);
if (!ok || string::npos !=
time_response.find_first_not_of("0123456789")) {
diff --git a/chrome/browser/sync/engine/syncapi.cc b/chrome/browser/sync/engine/syncapi.cc
index 3f6eb06..c30a5ea 100644
--- a/chrome/browser/sync/engine/syncapi.cc
+++ b/chrome/browser/sync/engine/syncapi.cc
@@ -1362,6 +1362,7 @@ SyncManager::Status SyncManager::SyncInternal::ComputeAggregatedStatus() {
allstatus()->status().updates_available,
allstatus()->status().updates_received,
allstatus()->status().disk_full,
+ false, // TODO(ncarter): invalid store?
allstatus()->status().max_consecutive_errors};
return return_status;
}
diff --git a/chrome/browser/sync/engine/syncapi.h b/chrome/browser/sync/engine/syncapi.h
index b922318..770581a9 100644
--- a/chrome/browser/sync/engine/syncapi.h
+++ b/chrome/browser/sync/engine/syncapi.h
@@ -409,8 +409,6 @@ class SYNC_EXPORT SyncManager {
SYNCING,
// Connected, no pending changes.
READY,
- // User has chosen to pause syncing.
- PAUSED,
// Internal sync error.
CONFLICT,
// Can't connect to server, and we haven't completed the initial
@@ -435,7 +433,6 @@ class SYNC_EXPORT SyncManager {
int unsynced_count;
int conflicting_count;
bool syncing;
- bool syncer_paused;
bool initial_sync_ended;
bool syncer_stuck;
int64 updates_available;
diff --git a/chrome/browser/sync/notifier/communicator/auto_reconnect.cc b/chrome/browser/sync/notifier/communicator/auto_reconnect.cc
index eadfe46..108fc1d 100644
--- a/chrome/browser/sync/notifier/communicator/auto_reconnect.cc
+++ b/chrome/browser/sync/notifier/communicator/auto_reconnect.cc
@@ -45,7 +45,8 @@ int AutoReconnect::seconds_until() const {
}
// Do a ceiling on the value (to avoid returning before its time)
- return (time_until_100ns + kSecsTo100ns - 1) / kSecsTo100ns;
+ int64 result = (time_until_100ns + kSecsTo100ns - 1) / kSecsTo100ns;
+ return static_cast<int>(result);
}
void AutoReconnect::StartReconnectTimer() {
diff --git a/chrome/browser/sync/notifier/listener/listen_task.cc b/chrome/browser/sync/notifier/listener/listen_task.cc
index ff43df1..79d0327 100644
--- a/chrome/browser/sync/notifier/listener/listen_task.cc
+++ b/chrome/browser/sync/notifier/listener/listen_task.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/sync/notifier/listener/listen_task.h"
#include "base/logging.h"
+#include "base/string_util.h"
#include "talk/base/task.h"
#include "talk/xmllite/qname.h"
#include "talk/xmllite/xmlelement.h"
@@ -60,10 +61,10 @@ bool ListenTask::IsValidNotification(const buzz::XmlElement* stanza) {
// </not:getAll>
// </cli:iq>
if (MatchRequestIq(stanza, buzz::STR_SET, kQnNotifierGetAll) &&
- !stricmp(stanza->Attr(buzz::QN_TO).c_str(),
- GetClient()->jid().Str().c_str()) &&
- !stricmp(stanza->Attr(buzz::QN_FROM).c_str(),
- GetClient()->jid().BareJid().Str().c_str())) {
+ !base::strcasecmp(stanza->Attr(buzz::QN_TO).c_str(),
+ GetClient()->jid().Str().c_str()) &&
+ !base::strcasecmp(stanza->Attr(buzz::QN_FROM).c_str(),
+ GetClient()->jid().BareJid().Str().c_str())) {
return true;
}
return false;
diff --git a/chrome/browser/sync/syncable/directory_backing_store.cc b/chrome/browser/sync/syncable/directory_backing_store.cc
index 2f13f93..59da679 100644
--- a/chrome/browser/sync/syncable/directory_backing_store.cc
+++ b/chrome/browser/sync/syncable/directory_backing_store.cc
@@ -410,7 +410,7 @@ void DirectoryBackingStore::LoadEntries(MetahandlesIndex* entry_bucket) {
}
select.append(" FROM metas ");
ScopedStatement statement(PrepareQuery(load_dbhandle_, select.c_str()));
- base::hash_set<int> handles;
+ base::hash_set<int64> handles;
while (EntryKernel* kernel = UnpackEntry(statement.get())) {
DCHECK(handles.insert(kernel->ref(META_HANDLE)).second); // Only in debug.
entry_bucket->insert(kernel);
diff --git a/chrome/browser/sync/syncable/directory_manager.cc b/chrome/browser/sync/syncable/directory_manager.cc
index b044d49..ce02117 100644
--- a/chrome/browser/sync/syncable/directory_manager.cc
+++ b/chrome/browser/sync/syncable/directory_manager.cc
@@ -148,7 +148,7 @@ ScopedDirLookup::ScopedDirLookup(DirectoryManager* dirman,
dir_ = dirman->managed_directory_ &&
(ComparePathNames(name, dirman->managed_directory_->name()) == 0) ?
dirman->managed_directory_ : NULL;
- good_ = dir_;
+ good_ = dir_ != NULL;
good_checked_ = false;
}
diff --git a/chrome/browser/sync/util/path_helpers.cc b/chrome/browser/sync/util/path_helpers.cc
index 1cf8d4e..cafcfca 100644
--- a/chrome/browser/sync/util/path_helpers.cc
+++ b/chrome/browser/sync/util/path_helpers.cc
@@ -71,7 +71,7 @@ PathString ExpandTilde(const PathString& path) {
// Returns a string with length or fewer elements, careful to
// not truncate a string mid-surrogate pair.
PathString TruncatePathString(const PathString& original, int length) {
- if (original.size() <= length)
+ if (original.size() <= static_cast<size_t>(length))
return original;
if (length <= 0)
return original;
diff --git a/chrome/browser/sync/util/pthread_helpers.cc b/chrome/browser/sync/util/pthread_helpers.cc
index 4dadc55..663fc66 100644
--- a/chrome/browser/sync/util/pthread_helpers.cc
+++ b/chrome/browser/sync/util/pthread_helpers.cc
@@ -115,9 +115,9 @@ struct timespec GetPThreadAbsoluteTime(uint32 ms) {
// The number of 100 nanosecond intervals from Jan 1, 1601 'til Jan 1, 1970.
const int64 kOffset = GG_LONGLONG(116444736000000000);
timespec result;
- result.tv_sec = (n.QuadPart - kOffset) / 10000000;
- result.tv_nsec = (n.QuadPart - kOffset -
- (result.tv_sec * GG_LONGLONG(10000000))) * 100;
+ result.tv_sec = static_cast<long>((n.QuadPart - kOffset) / 10000000);
+ result.tv_nsec = static_cast<long>((n.QuadPart - kOffset -
+ (result.tv_sec * GG_LONGLONG(10000000))) * 100);
return result;
#else
struct timeval now;