[Crosstoolchain-logs] [device-tree-compiler] 263/357: dtc: Abolish asize field of struct data

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:06:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

zumbi pushed a commit to branch upstream/1.3.x
in repository device-tree-compiler.

commit 1a9468c9a0c0bd6e3ff1b9bff7547dd7e7aa9bb7
Author: David Gibson <david at gibson.dropbear.id.au>
Date:   Thu Mar 6 15:48:04 2008 +1100

    dtc: Abolish asize field of struct data
    
    The asize field in struct data is a hangover from the early days when
    a struct data was sometimes allowed to refer to a static chunk of
    memory rather than a malloc()ed block.
    
    That's long gone, since the lifetime issues were far more trouble than
    it was worth, so get rid of the asize field.
    
    Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
---
 data.c | 8 --------
 dtc.h  | 1 -
 2 files changed, 9 deletions(-)

diff --git a/data.c b/data.c
index a94718c..0ee1010 100644
--- a/data.c
+++ b/data.c
@@ -32,8 +32,6 @@ void data_free(struct data d)
 		m = nm;
 	}
 
-	assert(!d.val || d.asize);
-
 	if (d.val)
 		free(d.val);
 }
@@ -43,9 +41,6 @@ struct data data_grow_for(struct data d, int xlen)
 	struct data nd;
 	int newsize;
 
-	/* we must start with an allocated datum */
-	assert(!d.val || d.asize);
-
 	if (xlen == 0)
 		return d;
 
@@ -56,11 +51,8 @@ struct data data_grow_for(struct data d, int xlen)
 	while ((d.len + xlen) > newsize)
 		newsize *= 2;
 
-	nd.asize = newsize;
 	nd.val = xrealloc(d.val, newsize);
 
-	assert(nd.asize >= (d.len + xlen));
-
 	return nd;
 }
 
diff --git a/dtc.h b/dtc.h
index dbff5e8..d5be1a5 100644
--- a/dtc.h
+++ b/dtc.h
@@ -118,7 +118,6 @@ struct  marker {
 struct data {
 	int len;
 	char *val;
-	int asize;
 	struct marker *markers;
 };
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list