*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/*
* This file contains functions that aid users to debug their lua scripts; for instance,
* tables can be easily output and values are represented in a human-readable way. (For instance,
/*
* This file contains functions that aid users to debug their lua scripts; for instance,
* tables can be easily output and values are represented in a human-readable way. (For instance,
snprintf(buff, 64, "%.3f", lua_tonumber(L, index));
break;
snprintf(buff, 64, "%.3f", lua_tonumber(L, index));
break;
//gets the next pair from the table
while (lua_next(L, -1)) { /* table key val */
// we need to copy here, as a cast from "Number" to "String"
//gets the next pair from the table
while (lua_next(L, -1)) { /* table key val */
// we need to copy here, as a cast from "Number" to "String"
- * \param L a lua state
- * \param ud index of the userdata to check in the stack
- * \param tname key of the metatable of this userdata in the registry
+ * @param L a lua state
+ * @param ud index of the userdata to check in the stack
+ * @param tname key of the metatable of this userdata in the registry
-int sglua_memory_writer(lua_State* L, const void* source, size_t size,
- void* userdata) {
-
- sglua_buffer_t buffer = (sglua_buffer_t) userdata;
+int sglua_memory_writer(lua_State* L, const void* source, size_t size, void* userdata)
+{
+ sglua_buffer_t buffer = static_cast<sglua_buffer_t>(userdata);