Fix typos

This commit is contained in:
Olly Betts 2014-04-29 11:24:04 +12:00
commit 618868ce3d
17 changed files with 65 additions and 65 deletions

View file

@ -1,4 +1,4 @@
/* embed3.cpp A C++ embeded interpreter
/* embed3.cpp A C++ embedded interpreter
This will register a C++ class with Lua, and then call a Lua function
passing C++ objects to this function.
@ -33,12 +33,12 @@ extern "C" {
/* The SWIG external runtime is generated by using.
swig -lua -externalruntime swigluarun.h
It contains useful function used by SWIG in its wrappering
It contains useful function used by SWIG in its wrapper
SWIG_TypeQuery() SWIG_NewPointerObj()
*/
#include "swigluarun.h" // the SWIG external runtime
/* the SWIG wrappered library */
/* the SWIG wrapped library */
extern "C" int luaopen_example(lua_State*L);
// the code itself
@ -100,10 +100,10 @@ int main(int argc, char* argv[]) {
luaopen_example(L);
printf("[C++] all looks ok\n");
printf("\n");
printf("[C++] lets create an Engine and pass a pointer to Lua\n");
printf("[C++] let's create an Engine and pass a pointer to Lua\n");
Engine engine;
/* this code will pass a pointer into lua, but C++ still owns the object
this is a little tedious, to do, but lets do it
this is a little tedious, to do, but let's do it
we need to pass the pointer (obviously), the type name
and a flag which states if Lua should delete the pointer once its finished with it
The type name is a class name string which is registered with SWIG
@ -113,7 +113,7 @@ int main(int argc, char* argv[]) {
push_pointer(L,&engine,"Engine *",0);
lua_setglobal(L, "pEngine"); // set as global variable
printf("[C++] now lets load the file 'runme.lua'\n");
printf("[C++] now let's load the file 'runme.lua'\n");
printf("[C++] any lua code in this file will be executed\n");
if (luaL_loadfile(L, "runme.lua") || lua_pcall(L, 0, 0, 0)) {
printf("[C++] ERROR: cannot run lua file: %s", lua_tostring(L, -1));
@ -122,7 +122,7 @@ int main(int argc, char* argv[]) {
printf("[C++] We are now back in C++, all looks ok\n");
printf("\n");
printf("[C++] Lets call the Lua function onEvent(e)\n");
printf("[C++] Let's call the Lua function onEvent(e)\n");
printf("[C++] We will give it different events, as we wish\n");
printf("[C++] Starting with STARTUP\n");
Event ev;