浏览代码

cmVectOps.h/c : Added use of _cmVOU_Abs() to eliminate warning regarding abs(unsigned).

master
kevin 9 年前
父节点
当前提交
61f8a82d5e
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 1
    0
      vop/cmVectOps.c
  2. 5
    2
      vop/cmVectOps.h

+ 1
- 0
vop/cmVectOps.c 查看文件

@@ -26,6 +26,7 @@
26 26
 #define cmVectOpsRICode_h
27 27
 #include "cmVectOpsTemplateMain.h"
28 28
 
29
+unsigned _cmVOU_Abs( unsigned x ) { return x; }
29 30
 
30 31
 void cmVOU_VPrint( cmRpt_t* rpt, const char* fmt, ... )
31 32
 {

+ 5
- 2
vop/cmVectOps.h 查看文件

@@ -103,9 +103,12 @@ cmReal_t cmVOI_Variance(const int* sp, unsigned sn, const cmReal_t* mean);
103 103
 // Complex vector * matrix multiply
104 104
 // dbp[1,dn] = v[1,vn] * m[vn,dn]
105 105
 cmComplexR_t* cmVORC_MultVVM( cmComplexR_t* dbp, unsigned dn, const cmComplexR_t* vp, unsigned vn, const cmComplexR_t* m );
106
+  
107
+  unsigned _cmVOU_Abs(unsigned x );
108
+
109
+#define cmAbs(x)                 _Generic((x),  double:fabs,       float:fabsf, unsigned:_cmVOU_Abs, char:abs, int:abs,  bool:_cmVOU_Abs )(x)  
110
+#define cmIsClose(x0,x1,eps)     _Generic((x0), double:cmIsCloseD, float:cmIsCloseF, int:cmIsCloseI, unsigned:cmIsCloseU, default:cmIsCloseD)(x0,x1,eps)
106 111
 
107
-#define cmAbs(x)              _Generic((x),  double:fabs,       float:fabsf,      int:abs,        unsigned:abs,        default:fabs )(x)  
108
-#define cmIsClose(x0,x1,eps)  _Generic((x0), double:cmIsCloseD, float:cmIsCloseF, int:cmIsCloseI, unsigned:cmIsCloseU, default:cmIsCloseD)(x0,x1,eps)
109 112
   
110 113
 #ifdef __cplusplus
111 114
 }

正在加载...
取消
保存