diff options
author | Andreas Fritiofson <andreas.fritiofson@gmail.com> | 2013-09-30 23:16:20 +0200 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2013-10-31 20:42:34 +0000 |
commit | 517ba0690dcc9e859a05df2113ce32401a5ab254 (patch) | |
tree | 7f437e78a54eb7cb6af06ed589c8ceef0c5277bf /src/helper/fileio.c | |
parent | c044c601213ee800cffb21e1f53a89285b3346c9 (diff) |
Clean up const usage to avoid excessive casting
Don't use const on pointers that hold heap allocated data, because that
means functions that free them must cast away the const.
Do use const on pointer parameters or fields that needn't be modified.
Remove pointer casts that are no longer needed after fixing the constness.
Change-Id: I5d206f5019982fd1950bc6d6d07b6062dc24e886
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1668
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/helper/fileio.c')
-rw-r--r-- | src/helper/fileio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/helper/fileio.c b/src/helper/fileio.c index 04cfaf59..c6f45e6b 100644 --- a/src/helper/fileio.c +++ b/src/helper/fileio.c @@ -33,7 +33,7 @@ #include "fileio.h" struct fileio_internal { - const char *url; + char *url; ssize_t size; enum fileio_type type; enum fileio_access access; @@ -141,7 +141,7 @@ int fileio_close(struct fileio *fileio_p) retval = fileio_close_local(fileio); - free((void *)fileio->url); + free(fileio->url); fileio->url = NULL; free(fileio); |