[PATCH 01/13] Match sizeof with pointer type

Anton Lundin glance at acc.umu.se
Tue Dec 10 15:53:25 UTC 2013


More to get clang-scan to quiet down that for the unlikely event that
unsigned int and int is different sizes.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 planner.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/planner.c b/planner.c
index 08e7f97..339801d 100644
--- a/planner.c
+++ b/planner.c
@@ -438,11 +438,11 @@ static unsigned int *sort_stops(unsigned int *dstops, int dnr, struct gaschanges
 {
 	int i, gi, di;
 	int total = dnr + gnr;
-	unsigned int *stoplevels = malloc(total * sizeof(int));
+	unsigned int *stoplevels = malloc(total * sizeof(unsigned int));
 
 	/* no gaschanges */
 	if (gnr == 0) {
-		memcpy(stoplevels, dstops, dnr * sizeof(int));
+		memcpy(stoplevels, dstops, dnr * sizeof(unsigned int));
 		return stoplevels;
 	}
 	i = total - 1;
-- 
1.8.3.2



More information about the subsurface mailing list