summaryrefslogtreecommitdiffstats
path: root/recipes-enea/bitcalc/bitcalc/0001-bitcalc-resolved-compilation-warnings.patch
blob: d1410cd56f2e02190698c5c1580e0025d9214940 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 00f03f600f29323cc6fd1c0f484a06d31acfd51d Mon Sep 17 00:00:00 2001
From: Dragos Motrea <Dragos.Motrea@enea.com>
Date: Thu, 13 Jul 2017 13:55:42 +0200
Subject: [rt-tools][LXCR-7892][PATCHv1 1/1] bitcalc: resolved compilation
 warnings

Two warnings resolved: functions which are candidates for 'pure' attribute and
an uninitialized variable.

Upstream-Status: Submitted

Signed-off-by: Dragos Motrea <Dragos.Motrea@enea.com>
---
 bitcalc/src/bitcalc.c | 2 +-
 bitcalc/src/bitmap.h  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bitcalc/src/bitcalc.c b/bitcalc/src/bitcalc.c
index bae4c06..8a51628 100644
--- a/bitcalc/src/bitcalc.c
+++ b/bitcalc/src/bitcalc.c
@@ -54,7 +54,7 @@ static size_t bitmap_stack_depth_max = 0;
 
 static char *bitmap_str(const struct bitmap_t *set)
 {
-	char *str;
+	char *str = NULL;
 
 	switch (display_format) {
 	case format_mask:
diff --git a/bitcalc/src/bitmap.h b/bitcalc/src/bitmap.h
index 17fee3a..5022dac 100644
--- a/bitcalc/src/bitmap.h
+++ b/bitcalc/src/bitmap.h
@@ -61,10 +61,10 @@ extern struct bitmap_t *bitmap_alloc_from_u32_list(const char *mlist);
  */
 
 /* Return 1 if bit is set in bit mask, 0 otherwise. */
-extern int bitmap_isset(size_t bit, const struct bitmap_t *set);
+extern int bitmap_isset(size_t bit, const struct bitmap_t *set) __attribute__((pure));
 
 /* Return the number of bits set in bit mask. */
-extern size_t bitmap_bit_count(const struct bitmap_t *set);
+extern size_t bitmap_bit_count(const struct bitmap_t *set) __attribute__((pure));
 
 /*
  * Modify bitmap
-- 
2.7.4