disallow pointer to pointer in api
This commit is contained in:
parent
8ec5a96333
commit
f4a3298906
@ -19,7 +19,7 @@ def default(parameter):
|
|||||||
return "NULL"
|
return "NULL"
|
||||||
else: return '"' + parameter["default"] + '"'
|
else: return '"' + parameter["default"] + '"'
|
||||||
elif basetype in api["types"]:
|
elif basetype in api["types"]:
|
||||||
if parameter["type"].endswith("*"):
|
if parameter["type"].endswith(" *"):
|
||||||
if parameter["default"] == {}:
|
if parameter["default"] == {}:
|
||||||
return "NULL"
|
return "NULL"
|
||||||
else:
|
else:
|
||||||
@ -103,7 +103,7 @@ for procedure, procedure_desc in api["procedures"].items():
|
|||||||
elif parameter["type"] == "char *":
|
elif parameter["type"] == "char *":
|
||||||
binding += " %s = lua_tostring(L, -1);\n" % (parameter["name"]);
|
binding += " %s = lua_tostring(L, -1);\n" % (parameter["name"]);
|
||||||
elif basetype in api["types"]:
|
elif basetype in api["types"]:
|
||||||
if parameter["type"].endswith("*"):
|
if parameter["type"].endswith(" *"):
|
||||||
binding += " { %s_value = to_%s(L, -1); %s = &%s_value; }\n" % (parameter["name"], basetype.lower(), parameter["name"], parameter["name"]);
|
binding += " { %s_value = to_%s(L, -1); %s = &%s_value; }\n" % (parameter["name"], basetype.lower(), parameter["name"], parameter["name"]);
|
||||||
else:
|
else:
|
||||||
binding += " %s = to_%s(L, -1);\n" % (parameter["name"], basetype.lower());
|
binding += " %s = to_%s(L, -1);\n" % (parameter["name"], basetype.lower());
|
||||||
|
@ -7,6 +7,7 @@ for that certain considerations are taken:
|
|||||||
with no expectation on new additions (see [/include/twn_types.h](../include/twn_types.h))
|
with no expectation on new additions (see [/include/twn_types.h](../include/twn_types.h))
|
||||||
* optionals can be expressed via pointer passage of value primitives, assumed immutable, with the NULL expressing default
|
* optionals can be expressed via pointer passage of value primitives, assumed immutable, with the NULL expressing default
|
||||||
* no opaque types, only keys
|
* no opaque types, only keys
|
||||||
|
* pointers to pointers aren't allowed
|
||||||
* when mutation on input is done, - it shouldn't be achieved from a mutable pointer, but the return value
|
* when mutation on input is done, - it shouldn't be achieved from a mutable pointer, but the return value
|
||||||
* return value could be a simple aggregate that is translatable to pure data dictionary
|
* return value could be a simple aggregate that is translatable to pure data dictionary
|
||||||
* module prefix is used for namespacing, actual symbols come after the prefix (`<module>_<symbol>`)
|
* module prefix is used for namespacing, actual symbols come after the prefix (`<module>_<symbol>`)
|
||||||
|
Loading…
Reference in New Issue
Block a user