Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
NLua
Commits
5cceea06
"Core/LuaInterface/Metatables.cs" did not exist on "b4943c8d57cdabf6674f6524be176ef6b3a41da0"
Commit
5cceea06
authored
Mar 19, 2013
by
Vinicius Jarina
Browse files
Removed warnings.
parent
083518a9
Changes
37
Show whitespace changes
Inline
Side-by-side
KeraLua
@
c4fbc038
Compare
82933e4c
...
c4fbc038
Subproject commit
82933e4c7544174e7a4ded2846bc18f28fad60c5
Subproject commit
c4fbc0380573499338679cc014e74f3762fa43e3
KopiLua
@
5a21e63c
Compare
00cbb47c
...
5a21e63c
Subproject commit
00cbb47c80beeb55069094cd606c923bf33fbaa5
Subproject commit
5a21e63c1948ba4a452c27812c1abe289f0d23fb
Core/NLua/CheckType.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
@@ -121,8 +122,6 @@ namespace NLua
...
@@ -121,8 +122,6 @@ namespace NLua
return
extractValues
[
typeof
(
LuaFunction
).
TypeHandle
.
Value
.
ToInt64
()];
return
extractValues
[
typeof
(
LuaFunction
).
TypeHandle
.
Value
.
ToInt64
()];
else
if
(
luatype
==
LuaTypes
.
Number
)
else
if
(
luatype
==
LuaTypes
.
Number
)
return
extractValues
[
typeof
(
double
).
TypeHandle
.
Value
.
ToInt64
()];
return
extractValues
[
typeof
(
double
).
TypeHandle
.
Value
.
ToInt64
()];
//else
//;//an unsupported type was encountered
}
}
if
(
LuaLib
.
lua_isnumber
(
luaState
,
stackPos
))
if
(
LuaLib
.
lua_isnumber
(
luaState
,
stackPos
))
...
...
Core/NLua/Config/NLuaConfig.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
...
@@ -35,7 +36,7 @@ namespace NLua.Config
...
@@ -35,7 +36,7 @@ namespace NLua.Config
#endif
#endif
public
const
string
NLuaCompany
=
"NLua Productions"
;
public
const
string
NLuaCompany
=
"NLua Productions"
;
public
const
string
NLuaProduct
=
"NLua"
;
public
const
string
NLuaProduct
=
"NLua"
;
public
const
string
NLuaCopyright
=
"Copyright 2003-2008 Fabio Mascarenhas, Kevin Hesterm
and 2012 Megax
"
;
public
const
string
NLuaCopyright
=
"Copyright 2003-2008 Fabio Mascarenhas, Kevin Hesterm
,Megax and Vinicius Jarina
"
;
public
const
string
NLuaTrademark
=
"MIT license"
;
public
const
string
NLuaTrademark
=
"MIT license"
;
public
const
string
NLuaVersion
=
"2.0.4"
;
public
const
string
NLuaVersion
=
"2.0.4"
;
public
const
string
NLuaFileVersion
=
"2.0.4.0"
;
public
const
string
NLuaFileVersion
=
"2.0.4.0"
;
...
...
Core/NLua/Event/DebugHookEventArgs.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Core/NLua/Event/EventCodes.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Core/NLua/Event/EventMasks.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Core/NLua/Event/HookExceptionEventArgs.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Core/NLua/Exceptions/LuaException.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Core/NLua/Exceptions/LuaScriptException.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Core/NLua/Extensions/GeneralExtensions.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* Permission is hereby granted, free of charge, to any person obtaining a copy
...
...
Core/NLua/GenerateEventAssembly/ClassGenerator.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Core/NLua/GenerateEventAssembly/CodeGeneration.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
@@ -373,10 +374,10 @@ namespace NLua
...
@@ -373,10 +374,10 @@ namespace NLua
}
}
}
}
// Generates an implementation of the
__
luaInterface
_g
etLuaTable method
// Generates an implementation of the luaInterface
G
etLuaTable method
var
returnTableMethod
=
myType
.
DefineMethod
(
"
__l
uaInterface
_g
etLuaTable"
,
var
returnTableMethod
=
myType
.
DefineMethod
(
"
L
uaInterface
G
etLuaTable"
,
MethodAttributes
.
Public
|
MethodAttributes
.
HideBySig
|
MethodAttributes
.
Virtual
,
typeof
(
LuaTable
),
new
Type
[
0
]);
MethodAttributes
.
Public
|
MethodAttributes
.
HideBySig
|
MethodAttributes
.
Virtual
,
typeof
(
LuaTable
),
new
Type
[
0
]);
myType
.
DefineMethodOverride
(
returnTableMethod
,
typeof
(
ILuaGeneratedType
).
GetMethod
(
"
__l
uaInterface
_g
etLuaTable"
));
myType
.
DefineMethodOverride
(
returnTableMethod
,
typeof
(
ILuaGeneratedType
).
GetMethod
(
"
L
uaInterface
G
etLuaTable"
));
generator
=
returnTableMethod
.
GetILGenerator
();
generator
=
returnTableMethod
.
GetILGenerator
();
generator
.
Emit
(
OpCodes
.
Ldfld
,
luaTableField
);
generator
.
Emit
(
OpCodes
.
Ldfld
,
luaTableField
);
generator
.
Emit
(
OpCodes
.
Ret
);
generator
.
Emit
(
OpCodes
.
Ret
);
...
...
Core/NLua/GenerateEventAssembly/DelegateGenerator.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Core/NLua/GenerateEventAssembly/ILuaGeneratedType.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
@@ -32,6 +33,6 @@ namespace NLua
...
@@ -32,6 +33,6 @@ namespace NLua
*/
*/
public
interface
ILuaGeneratedType
public
interface
ILuaGeneratedType
{
{
LuaTable
__l
uaInterface
_g
etLuaTable
();
LuaTable
L
uaInterface
G
etLuaTable
();
}
}
}
}
\ No newline at end of file
Core/NLua/GenerateEventAssembly/LuaClassType.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Core/NLua/Lua.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
@@ -155,7 +156,6 @@ namespace NLua
...
@@ -155,7 +156,6 @@ namespace NLua
public
Lua
()
public
Lua
()
{
{
luaState
=
LuaLib
.
luaL_newstate
();
// steffenj: Lua 5.1.1 API change (lua_open is gone)
luaState
=
LuaLib
.
luaL_newstate
();
// steffenj: Lua 5.1.1 API change (lua_open is gone)
//LuaLib.luaopen_base(luaState); // steffenj: luaopen_* no longer used
LuaLib
.
luaL_openlibs
(
luaState
);
// steffenj: Lua 5.1.1 API change (luaopen_base is gone, just open all libs right here)
LuaLib
.
luaL_openlibs
(
luaState
);
// steffenj: Lua 5.1.1 API change (luaopen_base is gone, just open all libs right here)
LuaLib
.
lua_pushstring
(
luaState
,
"LUAINTERFACE LOADED"
);
LuaLib
.
lua_pushstring
(
luaState
,
"LUAINTERFACE LOADED"
);
LuaLib
.
lua_pushboolean
(
luaState
,
true
);
LuaLib
.
lua_pushboolean
(
luaState
,
true
);
...
@@ -176,9 +176,6 @@ namespace NLua
...
@@ -176,9 +176,6 @@ namespace NLua
// We need to keep this in a managed reference so the delegate doesn't get garbage collected
// We need to keep this in a managed reference so the delegate doesn't get garbage collected
panicCallback
=
new
LuaCore
.
lua_CFunction
(
PanicCallback
);
panicCallback
=
new
LuaCore
.
lua_CFunction
(
PanicCallback
);
LuaLib
.
lua_atpanic
(
luaState
,
panicCallback
);
LuaLib
.
lua_atpanic
(
luaState
,
panicCallback
);
//LuaLib.lua_atlock(luaState, lockCallback = new LuaCore.lua_CFunction(LockCallback));
//LuaLib.lua_atunlock(luaState, unlockCallback = new LuaCore.lua_CFunction(UnlockCallback));
}
}
/*
/*
...
@@ -213,34 +210,11 @@ namespace NLua
...
@@ -213,34 +210,11 @@ namespace NLua
_StatePassed
=
true
;
_StatePassed
=
true
;
}
}
/// <summary>
/// Called for each lua_lock call
/// </summary>
/// <param name = "luaState"></param>
/// Not yet used
/*int LockCallback(LuaCore.lua_State luaState)
{
// Monitor.Enter(luaLock);
return 0;
}*/
/// <summary>
/// Called for each lua_unlock call
/// </summary>
/// <param name = "luaState"></param>
/// Not yet used
/*int UnlockCallback(LuaCore.lua_State luaState)
{
// Monitor.Exit(luaLock);
return 0;
}*/
public
void
Close
()
public
void
Close
()
{
{
if
(
_StatePassed
)
if
(
_StatePassed
)
return
;
return
;
////// if(luaState != LuaCore.lua_State.Zero)
if
(!
luaState
.
IsNull
())
{
if
(!
luaState
.
IsNull
())
{
LuaCore
.
lua_close
(
luaState
);
LuaCore
.
lua_close
(
luaState
);
ObjectTranslatorPool
.
Instance
.
Remove
(
luaState
);
ObjectTranslatorPool
.
Instance
.
Remove
(
luaState
);
...
@@ -254,9 +228,7 @@ namespace NLua
...
@@ -254,9 +228,7 @@ namespace NLua
[
System
.
Runtime
.
InteropServices
.
AllowReversePInvokeCalls
]
[
System
.
Runtime
.
InteropServices
.
AllowReversePInvokeCalls
]
static
int
PanicCallback
(
LuaCore
.
lua_State
luaState
)
static
int
PanicCallback
(
LuaCore
.
lua_State
luaState
)
{
{
// string desc = LuaLib.lua_tostring(luaState, 1);
string
reason
=
string
.
Format
(
"unprotected error in call to Lua API ({0})"
,
LuaLib
.
lua_tostring
(
luaState
,
-
1
));
string
reason
=
string
.
Format
(
"unprotected error in call to Lua API ({0})"
,
LuaLib
.
lua_tostring
(
luaState
,
-
1
));
// lua_tostring(L, -1);
throw
new
LuaException
(
reason
);
throw
new
LuaException
(
reason
);
}
}
...
@@ -601,7 +573,7 @@ namespace NLua
...
@@ -601,7 +573,7 @@ namespace NLua
}
}
/*
/*
* Register a delegate type to be used to convert Lua func
i
tions to C# delegates (useful for iOS where there is no dynamic code generation)
* Register a delegate type to be used to convert Lua functions to C# delegates (useful for iOS where there is no dynamic code generation)
* type delegateType
* type delegateType
*/
*/
public
void
RegisterLuaDelegateType
(
Type
delegateType
,
Type
luaDelegateType
)
public
void
RegisterLuaDelegateType
(
Type
delegateType
,
Type
luaDelegateType
)
...
...
Core/NLua/LuaBase.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Core/NLua/LuaFunction.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Core/NLua/LuaGlobalAttribute.cs
View file @
5cceea06
/*
/*
* This file is part of NLua.
* This file is part of NLua.
*
*
* Copyright (c) 2013 Vinicius Jarina (viniciusjarina@gmail.com)
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2003-2005 Fabio Mascarenhas de Queiroz.
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
* Copyright (C) 2012 Megax <http://megax.yeahunter.hu/>
*
*
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment