Fix a few GCC compile warnings

This commit is contained in:
rdb 2018-08-26 14:02:33 +02:00
parent 5147674980
commit c9372c3699
2 changed files with 4 additions and 1 deletions

View File

@ -169,7 +169,7 @@ add_hash(size_t hash, const Key &key) {
#ifdef _DEBUG
// We assume that the sequence is laid out sequentially in memory.
if (key.size() > 0) {
assert(&key[key.size() - 1] - &key[0] == key.size() - 1);
assert(&key[key.size() - 1] - &key[0] == (ptrdiff_t)key.size() - 1);
}
#endif
size_t num_bytes = (key.size() * sizeof(key[0]));

View File

@ -403,6 +403,9 @@ unlock_and_do_task() {
Thread *current_thread = Thread::get_current_thread();
nassertr(current_thread->_current_task == nullptr, DS_interrupt);
#ifdef __GNUC__
__attribute__((unused))
#endif
void *ptr = AtomicAdjust::compare_and_exchange_ptr
(current_thread->_current_task, nullptr, (TypedReferenceCount *)this);