fix nlua build with analyzers

This commit is contained in:
Morilli 2025-07-07 18:11:06 +02:00
parent e4cf5d2955
commit b01ae4b757
2 changed files with 14 additions and 14 deletions

View File

@ -329,7 +329,7 @@ namespace NLua
}
/// <summary>
///
///
/// </summary>
/// <param name = "chunk"></param>
/// <param name = "name"></param>
@ -357,7 +357,7 @@ namespace NLua
}
/// <summary>
///
///
/// </summary>
/// <param name = "chunk"></param>
/// <param name = "name"></param>
@ -903,7 +903,7 @@ namespace NLua
}
/// <summary>
/// Gets a numeric field of the table or userdata corresponding the the provided reference
/// Gets a numeric field of the table or userdata corresponding to the provided reference
/// </summary>
internal object GetObject(int reference, object field)
{
@ -917,7 +917,7 @@ namespace NLua
}
/// <summary>
/// Sets a field of the table or userdata corresponding the the provided reference
/// Sets a field of the table or userdata corresponding to the provided reference
/// to the provided value
/// </summary>
internal void SetObject(int reference, string field, object val)
@ -929,7 +929,7 @@ namespace NLua
}
/// <summary>
/// Sets a numeric field of the table or userdata corresponding the the provided reference
/// Sets a numeric field of the table or userdata corresponding to the provided reference
/// to the provided value
/// </summary>
internal void SetObject(int reference, object field, object val)

View File

@ -45,13 +45,13 @@ namespace NLua
// local function index(obj, name)
// local meta = getmetatable(obj)
// local cached = meta.cache[name]
// if cached ~= nil then
// if cached == fakenil then
// return nil
// end
// return cached
// else
// local value, isCached = get_object_member(obj, name)
// if isCached then
@ -64,7 +64,7 @@ namespace NLua
// return value
// end
// end
// return index";
public MetaFunctions(ObjectTranslator translator)
@ -306,8 +306,8 @@ namespace NLua
var objType = obj.GetType();
var proxyType = new ProxyType(objType);
// Handle the most common case, looking up the method by name.
// CP: This will fail when using indexers and attempting to get a value with the same name as a property of the object,
// Handle the most common case, looking up the method by name.
// CP: This will fail when using indexers and attempting to get a value with the same name as a property of the object,
// ie: xmlelement['item'] <- item is a property of xmlelement
if (!string.IsNullOrEmpty(methodName) && IsMemberPresent(proxyType, methodName))
@ -990,7 +990,7 @@ namespace NLua
var args = setter.GetParameters();
var valueType = args[1].ParameterType;
// The new value the user specified
// The new value the user specified
var val = _translator.GetAsType(luaState, 3, valueType);
var indexType = args[0].ParameterType;
var index = _translator.GetAsType(luaState, 2, indexType);
@ -1028,7 +1028,7 @@ namespace NLua
{
detailMessage = null; // No error yet
// If not already a string just return - we don't want to call tostring - which has the side effect of
// If not already a string just return - we don't want to call tostring - which has the side effect of
// changing the lua typecode to string
// Note: We don't use isstring because the standard lua C isstring considers either strings or numbers to
// be true for isstring.
@ -1052,7 +1052,7 @@ namespace NLua
{
var members = targetType.GetMember(fieldName, bindingType | BindingFlags.Public);
if (members.Length <= 0)
if (members.Length is 0)
{
detailMessage = "field or property '" + fieldName + "' does not exist";
return false;
@ -1439,7 +1439,7 @@ namespace NLua
foreach (var currentNetParam in paramInfo)
{
if (!currentNetParam.IsIn && currentNetParam.IsOut) // Skips out params
if (!currentNetParam.IsIn && currentNetParam.IsOut) // Skips out params
{
paramList.Add(null);
outList.Add(paramList.Count - 1);