Commit 28ea8fad by Marcus Winter

fixed vc 2012 problems

parent 41af80bb
...@@ -297,7 +297,6 @@ extern "C" { ...@@ -297,7 +297,6 @@ extern "C" {
#ifdef EMBB_THREADING_ANALYSIS_MODE #ifdef EMBB_THREADING_ANALYSIS_MODE
#include <embb/base/c/internal/platform.h> #include <embb/base/c/internal/platform.h>
#include <assert.h>
int embb_mutex_init( int embb_mutex_init(
embb_mutex_t* mutex, embb_mutex_t* mutex,
...@@ -332,6 +331,8 @@ void embb_mutex_destroy( ...@@ -332,6 +331,8 @@ void embb_mutex_destroy(
#ifdef EMBB_DEBUG #ifdef EMBB_DEBUG
#include <assert.h>
#define EMBB_ATOMIC_INIT_CHECK(variable) assert(variable->marker == 0x12345678) #define EMBB_ATOMIC_INIT_CHECK(variable) assert(variable->marker == 0x12345678)
#define EMBB_ATOMIC_INIT_MARKER(variable) variable->marker = 0x12345678 #define EMBB_ATOMIC_INIT_MARKER(variable) variable->marker = 0x12345678
......
...@@ -49,8 +49,8 @@ void* embb_alloc(size_t bytes) { ...@@ -49,8 +49,8 @@ void* embb_alloc(size_t bytes) {
if (allocated == NULL) if (allocated == NULL)
return NULL; return NULL;
embb_internal__atomic_fetch_and_add_4( embb_internal__atomic_fetch_and_add_4(&embb_bytes_allocated,
&embb_bytes_allocated, (long)bytes_to_allocate); (EMBB_BASE_BASIC_TYPE_SIZE_4)bytes_to_allocate);
size_t* x_as_size_type = (size_t*)allocated; size_t* x_as_size_type = (size_t*)allocated;
...@@ -72,8 +72,8 @@ void embb_free(void * ptr) { ...@@ -72,8 +72,8 @@ void embb_free(void * ptr) {
(*alloc_type) = (size_t)INVALID_ALLOCATION; (*alloc_type) = (size_t)INVALID_ALLOCATION;
embb_internal__atomic_fetch_and_add_4( embb_internal__atomic_fetch_and_add_4(&embb_bytes_allocated,
&embb_bytes_allocated, (long)(0 - (size_t)(*bytes_allocated))); (EMBB_BASE_BASIC_TYPE_SIZE_4)(0 - (size_t)(*bytes_allocated)));
free((size_t*)ptr - 2); free((size_t*)ptr - 2);
} }
...@@ -127,8 +127,8 @@ void* embb_alloc_aligned(size_t alignment, size_t size) { ...@@ -127,8 +127,8 @@ void* embb_alloc_aligned(size_t alignment, size_t size) {
x_as_size_type[-2] = (size_t)allocated; x_as_size_type[-2] = (size_t)allocated;
x_as_size_type[-3] = bytes_to_allocate; x_as_size_type[-3] = bytes_to_allocate;
embb_internal__atomic_fetch_and_add_4( embb_internal__atomic_fetch_and_add_4(&embb_bytes_allocated,
&embb_bytes_allocated, (long)bytes_to_allocate); (EMBB_BASE_BASIC_TYPE_SIZE_4)bytes_to_allocate);
return x; return x;
} }
...@@ -138,14 +138,14 @@ void embb_free_aligned(void* ptr) { ...@@ -138,14 +138,14 @@ void embb_free_aligned(void* ptr) {
size_t* ptr_conv = (size_t*)ptr; size_t* ptr_conv = (size_t*)ptr;
// If embb_free_aligned is called, the memory block should have been allocated // If embb_free_aligned is called, the memory block should have been
// using embb_alloc_aligned. // allocated using embb_alloc_aligned.
assert(ptr_conv[-1] == ALIGNED_ALLOCATION); assert(ptr_conv[-1] == ALIGNED_ALLOCATION);
ptr_conv[-1] = (size_t)INVALID_ALLOCATION; ptr_conv[-1] = (size_t)INVALID_ALLOCATION;
embb_internal__atomic_fetch_and_add_4( embb_internal__atomic_fetch_and_add_4(&embb_bytes_allocated,
&embb_bytes_allocated, (long)((long)0 - ptr_conv[-3])); (EMBB_BASE_BASIC_TYPE_SIZE_4)((long)0 - ptr_conv[-3]));
free((void*)ptr_conv[-2]); free((void*)ptr_conv[-2]);
} }
......
...@@ -811,13 +811,13 @@ static void network_task_start( ...@@ -811,13 +811,13 @@ static void network_task_start(
int actual = 0; int actual = 0;
// expected counts bytes we intended to put into the buffer // expected counts bytes we intended to put into the buffer
int expected = int expected =
4 + // operation 4 + // operation
4 + // domain_id 4 + // domain_id
4 + // job_id 4 + // job_id
4 + // priority 4 + // priority
4 + 4 + // task handle 4 + 4 + // task handle
4 + // result_size 4 + // result_size
4 + local_task->arguments_size; // arguments buffer 4 + (int)local_task->arguments_size; // arguments buffer
// packet size // packet size
actual += embb_mtapi_network_buffer_push_back_int32( actual += embb_mtapi_network_buffer_push_back_int32(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment