Browse Source

Fix some small bugs in the documentation examples.

breakin 8 years ago
parent
commit
7d589eb444

+ 1 - 1
doc/source/reference/api/object_manipulation.rst

@@ -164,7 +164,7 @@ pops a key from the stack and delete the slot indexed by it from the table at po
     :param HSQUIRRELVM v: the target VM
     :param HSQUIRRELVM v: the target VM
     :param SQInteger idx: index of the target object in the stack
     :param SQInteger idx: index of the target object in the stack
     :returns: a SQRESULT
     :returns: a SQRESULT
-    :remarks: this call will invokes the delegation system like a normal dereference it only works on tables, arrays and userdata; if the function fails, nothing will be pushed in the stack.
+    :remarks: this call will invokes the delegation system like a normal dereference it only works on tables, arrays, classes, instances and userdata; if the function fails, nothing will be pushed in the stack.
 
 
 pops a key from the stack and performs a get operation on the object at the position idx in the stack; and pushes the result in the stack.
 pops a key from the stack and performs a get operation on the object at the position idx in the stack; and pushes the result in the stack.
 
 

+ 1 - 1
doc/source/reference/embedding/calling_a_function.rst

@@ -16,7 +16,7 @@ parameter is > 0. ::
     sq_pushinteger(v,1);
     sq_pushinteger(v,1);
     sq_pushfloat(v,2.0);
     sq_pushfloat(v,2.0);
     sq_pushstring(v,"three",-1);
     sq_pushstring(v,"three",-1);
-    sq_call(v,4,SQFalse);
+    sq_call(v,4,SQFalse,SQFalse);
     sq_pop(v,2); //pops the roottable and the function
     sq_pop(v,2); //pops the roottable and the function
 
 
 this is equivalent to the following Squirrel code::
 this is equivalent to the following Squirrel code::

+ 1 - 1
doc/source/reference/embedding/compiling_a_script.rst

@@ -8,7 +8,7 @@ You can compile a Squirrel script with the function *sq_compile*.::
 
 
     typedef SQInteger (*SQLEXREADFUNC)(SQUserPointer userdata);
     typedef SQInteger (*SQLEXREADFUNC)(SQUserPointer userdata);
 
 
-    SQRESULT sq_compile(HSQUIRRELVM v,SQREADFUNC read,SQUserPointer p,
+    SQRESULT sq_compile(HSQUIRRELVM v,SQLEXREADFUNC read,SQUserPointer p,
                 const SQChar *sourcename,SQBool raiseerror);
                 const SQChar *sourcename,SQBool raiseerror);
 
 
 In order to compile a script is necessary for the host application to implement a reader
 In order to compile a script is necessary for the host application to implement a reader

+ 2 - 1
doc/source/reference/embedding/creating_a_c_function.rst

@@ -99,7 +99,8 @@ Here an example of how to register a function::
     {
     {
         sq_pushroottable(v);
         sq_pushroottable(v);
         sq_pushstring(v,fname,-1);
         sq_pushstring(v,fname,-1);
-        sq_newclosure(v,f,0,0); //create a new function
+        sq_newclosure(v,f,0); //create a new function
         sq_newslot(v,-3,SQFalse);
         sq_newslot(v,-3,SQFalse);
         sq_pop(v,1); //pops the root table
         sq_pop(v,1); //pops the root table
+        return 0;
     }
     }

+ 1 - 1
doc/source/reference/embedding/references_from_c.rst

@@ -11,7 +11,7 @@ The object can be also re-pushed in the VM stack using sq_pushobject().::
 
 
     HSQOBJECT obj;
     HSQOBJECT obj;
 
 
-    sq_resetobject(&obj) //initialize the handle
+    sq_resetobject(&obj); //initialize the handle
     sq_getstackobj(v,-2,&obj); //retrieve an object handle from the pos -2
     sq_getstackobj(v,-2,&obj); //retrieve an object handle from the pos -2
     sq_addref(v,&obj); //adds a reference to the object
     sq_addref(v,&obj); //adds a reference to the object