From 92cb9a25b1a9117f4dacb0bce8c16b90b73b8698 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 4 Dec 2007 14:26:15 +1100 Subject: dtc: Add many const qualifications This adds 'const' qualifiers to many variables and functions. In particular it's now used for passing names to the tree accesor functions. Signed-off-by: David Gibson --- dtc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'dtc.c') diff --git a/dtc.c b/dtc.c index 179c303..01131d7 100644 --- a/dtc.c +++ b/dtc.c @@ -31,7 +31,7 @@ int reservenum; /* Number of memory reservation slots */ int minsize; /* Minimum blob size */ int padsize; /* Additional padding to blob */ -char *join_path(char *path, char *name) +char *join_path(const char *path, const char *name) { int lenp = strlen(path); int lenn = strlen(name); @@ -55,10 +55,10 @@ char *join_path(char *path, char *name) return str; } -void fill_fullpaths(struct node *tree, char *prefix) +void fill_fullpaths(struct node *tree, const char *prefix) { struct node *child; - char *unit; + const char *unit; tree->fullpath = join_path(prefix, tree->name); @@ -112,11 +112,11 @@ static void __attribute__ ((noreturn)) usage(void) int main(int argc, char *argv[]) { struct boot_info *bi; - char *inform = "dts"; - char *outform = "dts"; - char *outname = "-"; + const char *inform = "dts"; + const char *outform = "dts"; + const char *outname = "-"; int force = 0, check = 0; - char *arg; + const char *arg; int opt; FILE *inf = NULL; FILE *outf = NULL; -- cgit v1.2.3