From 7be71b94a8ef4f8dd907990987d02db901b5efda Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 15 Jul 2016 19:33:01 +0000 Subject: To remove the const qualifier from a pointer to an object - either because we know it is actually mutable or because we are passing it to a function that doesn't accept a const object but won't actually attempt to modify it - simply casting from (const type *) to (type *) is legal C and clearly expresses the intent. So get rid of the obfuscating UNCONST macro. Basic idea discussed with guenther@. --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 49b97c2b..e7e70d04 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.271 2016/07/15 18:50:20 schwarze Exp $ */ +/* $Id: main.c,v 1.272 2016/07/15 19:33:01 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2012, 2014-2016 Ingo Schwarze @@ -980,7 +980,7 @@ woptions(struct curparse *curp, char *arg) while (*arg) { o = arg; - switch (getsubopt(&arg, UNCONST(toks), &v)) { + switch (getsubopt(&arg, (char * const *)toks, &v)) { case 0: curp->wstop = 1; break; -- cgit v1.2.3-56-ge451