X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fscripting%2Fserialize.cpp;h=3455d2fc6f4ff81997c35eae1c3f671ea526d053;hb=714a30abd887def6331a193216387e66cbfbd1bb;hp=9ed5d23f009aca3e1686a28a01da56b7e5f6158b;hpb=fe138b9ec292ca9679b43cf5c4555f0193bab25d;p=supertux.git diff --git a/src/scripting/serialize.cpp b/src/scripting/serialize.cpp index 9ed5d23f0..3455d2fc6 100644 --- a/src/scripting/serialize.cpp +++ b/src/scripting/serialize.cpp @@ -16,6 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +#include #include "serialize.hpp" @@ -35,8 +36,8 @@ void load_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, const lisp::Lisp* using namespace lisp; if(table_idx < 0) - table_idx -= 2; - + table_idx -= 2; + lisp::ListIterator iter(lisp); while(iter.next() && iter.lisp() != NULL) { const std::string& token = iter.item(); @@ -74,12 +75,12 @@ void load_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, const lisp::Lisp* } } -void save_squirrel_table(HSQUIRRELVM vm, int table_idx, lisp::Writer& writer) +void save_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, lisp::Writer& writer) { // offset because of sq_pushnull if(table_idx < 0) table_idx -= 1; - + //iterator table sq_pushnull(vm); while(SQ_SUCCEEDED(sq_next(vm, table_idx))) { @@ -87,7 +88,7 @@ void save_squirrel_table(HSQUIRRELVM vm, int table_idx, lisp::Writer& writer) std::cerr << "Table contains non-string key\n"; continue; } - const char* key; + const SQChar* key; sq_getstring(vm, -2, &key); switch(sq_gettype(vm, -1)) { @@ -135,4 +136,3 @@ void save_squirrel_table(HSQUIRRELVM vm, int table_idx, lisp::Writer& writer) } } -