clion suggestions for macro expansions
Costa Tsaousis (ktsaou) committed
Sep 9, 2017 at 22:08 UTC
c461c68d624646ff3961b1579b0f0d7e7329859f
1 file changed
+6
-6
src/storage_number.h
+6
-6
@@ -32,7 +32,7 @@ typedef uint32_t storage_number;
32
#define SN_FLAGS_MASK (~(0x6 << 24))
33
34
// extract the flags
35
-#define get_storage_number_flags(value) ((((storage_number)value) & (1 << 24)) | (((storage_number)value) & (2 << 24)) | (((storage_number)value) & (4 << 24)))
35
+#define get_storage_number_flags(value) ((((storage_number)(value)) & (1 << 24)) | (((storage_number)(value)) & (2 << 24)) | (((storage_number)(value)) & (4 << 24)))
36
#define SN_EMPTY_SLOT 0x00000000
37
38
// checks
@@ -44,13 +44,13 @@ calculated_number unpack_storage_number(storage_number value);
44
45
int print_calculated_number(char *str, calculated_number value);
46
47
-#define STORAGE_NUMBER_POSITIVE_MAX 167772150000000.0
48
-#define STORAGE_NUMBER_POSITIVE_MIN 0.0000001
49
-#define STORAGE_NUMBER_NEGATIVE_MAX -0.0000001
50
-#define STORAGE_NUMBER_NEGATIVE_MIN -167772150000000.0
47
+#define STORAGE_NUMBER_POSITIVE_MAX (167772150000000.0)
48
+#define STORAGE_NUMBER_POSITIVE_MIN (0.0000001)
49
+#define STORAGE_NUMBER_NEGATIVE_MAX (-0.0000001)
50
+#define STORAGE_NUMBER_NEGATIVE_MIN (-167772150000000.0)
51
52
// accepted accuracy loss
53
#define ACCURACY_LOSS 0.0001
54
-#define accuracy_loss(t1, t2) ((t1 == t2 || t1 == 0.0 || t2 == 0.0) ? 0.0 : (100.0 - ((t1 > t2) ? (t2 * 100.0 / t1 ) : (t1 * 100.0 / t2))))
54
+#define accuracy_loss(t1, t2) (((t1) == (t2) || (t1) == 0.0 || (t2) == 0.0) ? 0.0 : (100.0 - (((t1) > (t2)) ? ((t2) * 100.0 / (t1) ) : ((t1) * 100.0 / (t2)))))
55
56
#endif /* NETDATA_STORAGE_NUMBER_H */