refactor(option): use void * for pointer to option value

Option related code uses `char *` for pointer to option value, which is not the best way of representing a type-agnostic pointer.

Solution: Make pointers to option value use `void *` instead.
This commit is contained in:
Famiu Haque
2023-06-20 13:09:06 +06:00
parent c07dceba33
commit 3681b7bb3b
4 changed files with 211 additions and 238 deletions

View File

@@ -108,7 +108,7 @@ local value_dumpers = {
}
local get_value = function(v)
return '(char *) ' .. value_dumpers[type(v)](v)
return '(void *) ' .. value_dumpers[type(v)](v)
end
local get_defaults = function(d,n)
@@ -131,7 +131,7 @@ local dump_option = function(i, o)
w(get_cond(o.enable_if))
end
if o.varname then
w(' .var=(char *)&' .. o.varname)
w(' .var=&' .. o.varname)
elseif #o.scope == 1 and o.scope[1] == 'window' then
w(' .var=VAR_WIN')
end