Fix warnings related to undefined defines and implicit casts
This commit is contained in:
14
.gitignore
vendored
14
.gitignore
vendored
@@ -77,3 +77,17 @@ x64/
|
||||
|
||||
# Coverage
|
||||
[Cc]overage
|
||||
|
||||
# Visual studio user-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
|
||||
# Visual Studio CMake
|
||||
out
|
||||
CMakeSettings.json
|
||||
@@ -12,7 +12,7 @@ typedef float bh_float32_t;
|
||||
typedef double bh_float64_t;
|
||||
|
||||
/* Platform specific type definition */
|
||||
#if __STDC_VERSION__ >= 199901L || defined(__GNUC__)
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int32_t bh_int32_t;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <bh/internal/buffer.h>
|
||||
#include <bh/internal/io.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ int bh_hashmap_reserve(bh_hashmap_t *hashmap,
|
||||
|
||||
/* Calculate hashmap max capacity and capacity threshold */
|
||||
capacity = hashmap->capacity;
|
||||
threshold = hashmap->capacity * hashmap->factor;
|
||||
threshold = (size_t)(hashmap->capacity * hashmap->factor);
|
||||
max_capacity = ((size_t)-1) / sizeof(bh_hashmap_node_t);
|
||||
|
||||
/* New capacity can't be smaller then current hashmap size */
|
||||
@@ -132,7 +132,7 @@ int bh_hashmap_reserve(bh_hashmap_t *hashmap,
|
||||
while (size > threshold)
|
||||
{
|
||||
capacity = (capacity) ? (capacity * 2) : (16);
|
||||
threshold = capacity * hashmap->factor;
|
||||
threshold = (size_t)(capacity * hashmap->factor);
|
||||
|
||||
/* Capacity can't be bigger than max capacity and overflow */
|
||||
if (capacity > max_capacity || capacity < 16)
|
||||
@@ -145,7 +145,7 @@ int bh_hashmap_reserve(bh_hashmap_t *hashmap,
|
||||
while (size <= threshold / 2 && capacity > 16)
|
||||
{
|
||||
capacity /= 2;
|
||||
threshold = capacity * hashmap->factor;
|
||||
threshold = (size_t)(capacity * hashmap->factor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ void bh_hashmap_set_factor(bh_hashmap_t *hashmap,
|
||||
|
||||
/* Calculate new threshold value */
|
||||
hashmap->factor = factor;
|
||||
hashmap->threshold = hashmap->capacity * factor;
|
||||
hashmap->threshold = (size_t)(hashmap->capacity * factor);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -220,9 +220,6 @@ void bh_cond_free(bh_cond_t *cond)
|
||||
int bh_thread_pool_add(bh_thread_pool_t *pool,
|
||||
bh_task_t *task)
|
||||
{
|
||||
void *iter;
|
||||
bh_task_t *item;
|
||||
|
||||
/* Queue task for execution */
|
||||
bh_mutex_lock(&pool->lock);
|
||||
if (bh_queue_insert(&pool->tasks, task))
|
||||
|
||||
Reference in New Issue
Block a user