mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-07 19:40:38 +00:00
Resolved token conflicts in favor of tokens without reference.
This commit is contained in:
parent
93e224ff83
commit
c57853abb6
|
@ -175,11 +175,21 @@ namespace Bind.ES
|
||||||
e.ConstantCollection.Add(c.Name, c);
|
e.ConstantCollection.Add(c.Name, c);
|
||||||
}
|
}
|
||||||
else if (e.ConstantCollection[c.Name].Value != c.Value)
|
else if (e.ConstantCollection[c.Name].Value != c.Value)
|
||||||
|
{
|
||||||
|
var existing = e.ConstantCollection[c.Name];
|
||||||
|
if (existing.Reference != null && c.Reference == null)
|
||||||
|
{
|
||||||
|
e.ConstantCollection[c.Name] = c;
|
||||||
|
}
|
||||||
|
else if (existing.Reference == null && c.Reference != null)
|
||||||
|
{ } // Keep existing
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("[Warning] Conflicting token {0}.{1} with value {2} != {3}",
|
Console.WriteLine("[Warning] Conflicting token {0}.{1} with value {2} != {3}",
|
||||||
e.Name, c.Name, e.ConstantCollection[c.Name].Value, c.Value);
|
e.Name, c.Name, e.ConstantCollection[c.Name].Value, c.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (ArgumentException ex)
|
catch (ArgumentException ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine("[Warning] Failed to add constant {0} to enum {1}: {2}", c.Name, e.Name, ex.Message);
|
Console.WriteLine("[Warning] Failed to add constant {0} to enum {1}: {2}", c.Name, e.Name, ex.Message);
|
||||||
|
|
|
@ -302,8 +302,11 @@ namespace Bind
|
||||||
.Where(c => !Constant.TranslateConstantWithReference(c, enums, null))
|
.Where(c => !Constant.TranslateConstantWithReference(c, enums, null))
|
||||||
.Select(c => c).ToList();
|
.Select(c => c).ToList();
|
||||||
foreach (var c in broken_references)
|
foreach (var c in broken_references)
|
||||||
|
{
|
||||||
|
Console.WriteLine("[Warning] Reference {0} not found for token {1}.", c.Reference, c);
|
||||||
e.ConstantCollection.Remove(c.Name);
|
e.ConstantCollection.Remove(c.Name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static bool IsValue(string test)
|
static bool IsValue(string test)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue