From 970745a5fc7c29de3e202988e5eb104fabca4fdc Mon Sep 17 00:00:00 2001 From: "Field G. Van Zee" Date: Wed, 19 Oct 2016 15:58:03 -0500 Subject: [PATCH] Reorganized typedefs to avoid compiler warnings. Details: - Relocated membrk_t definition from bli_membrk.h to bli_type_defs.h. - Moved #include of bli_malloc.h from blis.h to bli_type_defs.h. - Removed standalone mtx_t and mutex_t typedefs in bli_type_defs.h. - Moved #include of bli_mutex.h from bli_thread.h to bli_typedefs.h. - The redundant typedefs of membrk_t and mtx_t caused a warning on some C compilers. Thanks to Tyler Smith for reporting this issue. --- frame/base/bli_membrk.h | 10 ---------- frame/include/bli_type_defs.h | 13 ++++++------- frame/include/blis.h | 1 - frame/thread/bli_thread.h | 3 --- 4 files changed, 6 insertions(+), 21 deletions(-) diff --git a/frame/base/bli_membrk.h b/frame/base/bli_membrk.h index 5db956344..cce0f4c1a 100644 --- a/frame/base/bli_membrk.h +++ b/frame/base/bli_membrk.h @@ -36,16 +36,6 @@ #ifndef BLIS_MEMBRK_H #define BLIS_MEMBRK_H -// -- Memory broker object type -- - -typedef struct membrk_s -{ - pool_t pools[3]; - mtx_t mutex; - - malloc_ft malloc_fp; - free_ft free_fp; -} membrk_t; #define bli_membrk_pool( pool_index, membrk_p ) \ \ diff --git a/frame/include/bli_type_defs.h b/frame/include/bli_type_defs.h index 99b2c601d..d3548031c 100644 --- a/frame/include/bli_type_defs.h +++ b/frame/include/bli_type_defs.h @@ -715,10 +715,6 @@ typedef enum // -- BLIS misc. structure types ----------------------------------------------- // -// -- Mutex type -- - -typedef struct mtx_s mtx_t; - // -- Pool block type -- typedef struct @@ -741,10 +737,14 @@ typedef struct siz_t align_size; } pool_t; +// -- Mutex object type -- + +#include "bli_mutex.h" +#include "bli_malloc.h" + // -- Memory broker object type -- -typedef struct membrk_s membrk_t; -/* +typedef struct membrk_s { pool_t pools[3]; mtx_t mutex; @@ -752,7 +752,6 @@ typedef struct membrk_s membrk_t; malloc_ft malloc_fp; free_ft free_fp; } membrk_t; -*/ // -- Memory object type -- diff --git a/frame/include/blis.h b/frame/include/blis.h index 0eaaf413f..73f8fb20a 100644 --- a/frame/include/blis.h +++ b/frame/include/blis.h @@ -98,7 +98,6 @@ extern "C" { #include "bli_init.h" #include "bli_const.h" -#include "bli_malloc.h" #include "bli_obj.h" #include "bli_obj_scalar.h" #include "bli_cntx.h" diff --git a/frame/thread/bli_thread.h b/frame/thread/bli_thread.h index 5b9443587..78135e426 100644 --- a/frame/thread/bli_thread.h +++ b/frame/thread/bli_thread.h @@ -52,9 +52,6 @@ #define BLIS_ENABLE_MULTITHREADING #endif -// Include thread mutex (mtx_t) object definitions and prototypes. -#include "bli_mutex.h" - // Include thread communicator (thrcomm_t) object definitions and prototypes. #include "bli_thrcomm.h"