summaryrefslogtreecommitdiff
path: root/utils/sparse_vector.cc
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-05-27 15:34:44 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2012-05-27 15:34:44 -0400
commit71c4918f05a4b380dfaebfabcc1847c1c6d497dd (patch)
treecd2a0c9c9175ddf8100b1c64d689e540f50eeae9 /utils/sparse_vector.cc
parentab38dc57a6a64aa7ef60a845a4176e18e1ac7f27 (diff)
clean up
Diffstat (limited to 'utils/sparse_vector.cc')
-rw-r--r--utils/sparse_vector.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/sparse_vector.cc b/utils/sparse_vector.cc
index 27bb88dd..00e7bd60 100644
--- a/utils/sparse_vector.cc
+++ b/utils/sparse_vector.cc
@@ -32,7 +32,7 @@ void Encode(double objective, const SparseVector<double>& v, ostream* out) {
*reinterpret_cast<double*>(&data[off_objective]) = objective;
*reinterpret_cast<int*>(&data[off_num_feats]) = num_feats;
char* cur = &data[off_data];
- assert(cur - data == off_data);
+ assert(static_cast<size_t>(cur - data) == off_data);
for (const_iterator it = v.begin(); it != v.end(); ++it) {
const string& fname = FD::Convert(it->first);
*cur++ = static_cast<char>(fname.size()); // name len
@@ -41,10 +41,10 @@ void Encode(double objective, const SparseVector<double>& v, ostream* out) {
*reinterpret_cast<double*>(cur) = it->second;
cur += sizeof(double);
}
- assert(cur - data == off_magic);
+ assert(static_cast<size_t>(cur - data) == off_magic);
*reinterpret_cast<unsigned int*>(cur) = 0xBAABABBAu;
cur += sizeof(unsigned int);
- assert(cur - data == tot_size);
+ assert(static_cast<size_t>(cur - data) == tot_size);
b64encode(data, tot_size, out);
delete[] data;
}