From 61f8a82d5e66c9b9d02d63b1bb0f422b774fe13a Mon Sep 17 00:00:00 2001 From: kevin Date: Wed, 7 Oct 2015 12:59:46 -0400 Subject: [PATCH] cmVectOps.h/c : Added use of _cmVOU_Abs() to eliminate warning regarding abs(unsigned). --- vop/cmVectOps.c | 1 + vop/cmVectOps.h | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/vop/cmVectOps.c b/vop/cmVectOps.c index e5d3b12..239efc4 100644 --- a/vop/cmVectOps.c +++ b/vop/cmVectOps.c @@ -26,6 +26,7 @@ #define cmVectOpsRICode_h #include "cmVectOpsTemplateMain.h" +unsigned _cmVOU_Abs( unsigned x ) { return x; } void cmVOU_VPrint( cmRpt_t* rpt, const char* fmt, ... ) { diff --git a/vop/cmVectOps.h b/vop/cmVectOps.h index 2b85053..27efe53 100644 --- a/vop/cmVectOps.h +++ b/vop/cmVectOps.h @@ -103,9 +103,12 @@ cmReal_t cmVOI_Variance(const int* sp, unsigned sn, const cmReal_t* mean); // Complex vector * matrix multiply // dbp[1,dn] = v[1,vn] * m[vn,dn] cmComplexR_t* cmVORC_MultVVM( cmComplexR_t* dbp, unsigned dn, const cmComplexR_t* vp, unsigned vn, const cmComplexR_t* m ); + + unsigned _cmVOU_Abs(unsigned x ); + +#define cmAbs(x) _Generic((x), double:fabs, float:fabsf, unsigned:_cmVOU_Abs, char:abs, int:abs, bool:_cmVOU_Abs )(x) +#define cmIsClose(x0,x1,eps) _Generic((x0), double:cmIsCloseD, float:cmIsCloseF, int:cmIsCloseI, unsigned:cmIsCloseU, default:cmIsCloseD)(x0,x1,eps) -#define cmAbs(x) _Generic((x), double:fabs, float:fabsf, int:abs, unsigned:abs, default:fabs )(x) -#define cmIsClose(x0,x1,eps) _Generic((x0), double:cmIsCloseD, float:cmIsCloseF, int:cmIsCloseI, unsigned:cmIsCloseU, default:cmIsCloseD)(x0,x1,eps) #ifdef __cplusplus }