mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-10 19:06:33 +00:00
chore: eliminate compilation warnings under MSVC (#1170)
This commit is contained in:
1 parent
2cef4badb8
commit
b90b1ee9cf
30 files changed
+420
-461
No files matched your search
Vendored
+9
-9
@@ -845,7 +845,7 @@ inline void BitVector::build() {
|
||||
|
||||
num_ones_ = 0;
|
||||
for (std::size_t i = 0; i < units_.size(); ++i) {
|
||||
ranks_[i] = num_ones_;
|
||||
ranks_[i] = static_cast<id_type>(num_ones_);
|
||||
num_ones_ += pop_count(units_[i]);
|
||||
}
|
||||
}
|
||||
@@ -1769,7 +1769,7 @@ id_type DoubleArrayBuilder::arrange_from_keyset(const Keyset<T> &keyset,
|
||||
|
||||
inline id_type DoubleArrayBuilder::find_valid_offset(id_type id) const {
|
||||
if (extras_head_ >= units_.size()) {
|
||||
return units_.size() | (id & LOWER_MASK);
|
||||
return static_cast<id_type>(units_.size()) | (id & LOWER_MASK);
|
||||
}
|
||||
|
||||
id_type unfixed_id = extras_head_;
|
||||
@@ -1781,7 +1781,7 @@ inline id_type DoubleArrayBuilder::find_valid_offset(id_type id) const {
|
||||
unfixed_id = extras(unfixed_id).next();
|
||||
} while (unfixed_id != extras_head_);
|
||||
|
||||
return units_.size() | (id & LOWER_MASK);
|
||||
return static_cast<id_type>(units_.size()) | (id & LOWER_MASK);
|
||||
}
|
||||
|
||||
inline bool DoubleArrayBuilder::is_valid_offset(id_type id,
|
||||
@@ -1812,7 +1812,7 @@ inline void DoubleArrayBuilder::reserve_id(id_type id) {
|
||||
if (id == extras_head_) {
|
||||
extras_head_ = extras(id).next();
|
||||
if (extras_head_ == id) {
|
||||
extras_head_ = units_.size();
|
||||
extras_head_ = static_cast<id_type>(units_.size());
|
||||
}
|
||||
}
|
||||
extras(extras(id).prev()).set_next(extras(id).next());
|
||||
@@ -1821,8 +1821,8 @@ inline void DoubleArrayBuilder::reserve_id(id_type id) {
|
||||
}
|
||||
|
||||
inline void DoubleArrayBuilder::expand_units() {
|
||||
id_type src_num_units = units_.size();
|
||||
id_type src_num_blocks = num_blocks();
|
||||
id_type src_num_units = static_cast<id_type>(units_.size());
|
||||
id_type src_num_blocks = static_cast<id_type>(num_blocks());
|
||||
|
||||
id_type dest_num_units = src_num_units + BLOCK_SIZE;
|
||||
id_type dest_num_blocks = src_num_blocks + 1;
|
||||
@@ -1834,7 +1834,7 @@ inline void DoubleArrayBuilder::expand_units() {
|
||||
units_.resize(dest_num_units);
|
||||
|
||||
if (dest_num_blocks > NUM_EXTRA_BLOCKS) {
|
||||
for (std::size_t id = src_num_units; id < dest_num_units; ++id) {
|
||||
for (id_type id = src_num_units; id < dest_num_units; ++id) {
|
||||
extras(id).set_is_used(false);
|
||||
extras(id).set_is_fixed(false);
|
||||
}
|
||||
@@ -1858,9 +1858,9 @@ inline void DoubleArrayBuilder::expand_units() {
|
||||
inline void DoubleArrayBuilder::fix_all_blocks() {
|
||||
id_type begin = 0;
|
||||
if (num_blocks() > NUM_EXTRA_BLOCKS) {
|
||||
begin = num_blocks() - NUM_EXTRA_BLOCKS;
|
||||
begin = static_cast<id_type>(num_blocks() - NUM_EXTRA_BLOCKS);
|
||||
}
|
||||
id_type end = num_blocks();
|
||||
id_type end = static_cast<id_type>(num_blocks());
|
||||
|
||||
for (id_type block_id = begin; block_id != end; ++block_id) {
|
||||
fix_block(block_id);
|
||||
|
||||
Reference in new issue
Block a user