Applied Barlog's "arrange this qualifier" patch.

This commit is contained in:
the_fiddler 2009-08-25 15:59:57 +00:00
parent beac0d41d1
commit 52744c1661
9 changed files with 49 additions and 49 deletions

View file

@ -76,7 +76,7 @@ namespace Bind.GL2
Function.Initialize(); Function.Initialize();
Delegate.Initialize(glSpec, glSpecExt); Delegate.Initialize(glSpec, glSpecExt);
this.WriteBindings( WriteBindings(
Delegate.Delegates, Delegate.Delegates,
Function.Wrappers, Function.Wrappers,
Enum.GLEnums); Enum.GLEnums);

View file

@ -60,7 +60,7 @@ namespace Bind.Glu
Trace.WriteLine("Processing specs, please wait..."); Trace.WriteLine("Processing specs, please wait...");
//this.Translate(); //this.Translate();
this.WriteBindings( WriteBindings(
Delegate.Delegates, Delegate.Delegates,
Function.Wrappers, Function.Wrappers,
Enum.GLEnums); Enum.GLEnums);

View file

@ -57,7 +57,7 @@ namespace Bind.Glx
Trace.WriteLine("Processing specs, please wait..."); Trace.WriteLine("Processing specs, please wait...");
//this.Translate(); //this.Translate();
this.WriteBindings( WriteBindings(
Delegate.Delegates, Delegate.Delegates,
Function.Wrappers, Function.Wrappers,
Enum.GLEnums); Enum.GLEnums);

View file

@ -72,11 +72,11 @@ namespace Bind.Structures
public Delegate(Delegate d) public Delegate(Delegate d)
{ {
this.Category = d.Category; Category = d.Category;
this.Name = d.Name; Name = d.Name;
this.Parameters = new ParameterCollection(d.Parameters); Parameters = new ParameterCollection(d.Parameters);
this.ReturnType = new Type(d.ReturnType); ReturnType = new Type(d.ReturnType);
this.Version = d.Version; Version = d.Version;
//this.Version = !String.IsNullOrEmpty(d.Version) ? new string(d.Version.ToCharArray()) : ""; //this.Version = !String.IsNullOrEmpty(d.Version) ? new string(d.Version.ToCharArray()) : "";
} }
@ -525,7 +525,7 @@ namespace Bind.Structures
} }
} }
ReturnType.Translate(overrides, this.Category); ReturnType.Translate(overrides, Category);
if (ReturnType.CurrentType.ToLower().Contains("void") && ReturnType.Pointer != 0) if (ReturnType.CurrentType.ToLower().Contains("void") && ReturnType.Pointer != 0)
{ {
@ -581,7 +581,7 @@ namespace Bind.Structures
} }
} }
Parameters[i].Translate(overrides, this.Category); Parameters[i].Translate(overrides, Category);
if (Parameters[i].CurrentType == "UInt16" && Name.Contains("LineStipple")) if (Parameters[i].CurrentType == "UInt16" && Name.Contains("LineStipple"))
Parameters[i].WrapperType = WrapperTypes.UncheckedParameter; Parameters[i].WrapperType = WrapperTypes.UncheckedParameter;
@ -627,9 +627,9 @@ namespace Bind.Structures
{ {
public void Add(Delegate d) public void Add(Delegate d)
{ {
if (!this.ContainsKey(d.Name)) if (!ContainsKey(d.Name))
{ {
this.Add(d.Name, d); Add(d.Name, d);
} }
else else
{ {

View file

@ -224,7 +224,7 @@ namespace Bind.Structures
// Translate enum names. // Translate enum names.
{ {
List<string> keys_to_update = new List<string>(); List<string> keys_to_update = new List<string>();
foreach (Enum e in this.Values) foreach (Enum e in Values)
{ {
string name = e.Name; string name = e.Name;
@ -249,14 +249,14 @@ namespace Bind.Structures
foreach (string name in keys_to_update) foreach (string name in keys_to_update)
{ {
Enum e = this[name]; Enum e = this[name];
this.Remove(name); Remove(name);
this.Add(e.Name, e); Add(e.Name, e);
} }
keys_to_update = null; keys_to_update = null;
} }
foreach (Enum e in this.Values) foreach (Enum e in Values)
{ {
XPathNavigator enum_override = overrides.CreateNavigator().SelectSingleNode(String.Format(path, e.Name)); XPathNavigator enum_override = overrides.CreateNavigator().SelectSingleNode(String.Format(path, e.Name));
foreach (Constant c in e.ConstantCollection.Values) foreach (Constant c in e.ConstantCollection.Values)
@ -283,7 +283,7 @@ namespace Bind.Structures
// In this case try searching all enums for the correct constant to alias (stupid opengl specs). // In this case try searching all enums for the correct constant to alias (stupid opengl specs).
if (String.IsNullOrEmpty(c.Reference) && !Char.IsDigit(c.Value[0])) if (String.IsNullOrEmpty(c.Reference) && !Char.IsDigit(c.Value[0]))
{ {
foreach (Enum @enum in this.Values) foreach (Enum @enum in Values)
{ {
// Skip generic GLenum // Skip generic GLenum
if (@enum.Name == "GLenum") if (@enum.Name == "GLenum")
@ -299,7 +299,7 @@ namespace Bind.Structures
} }
} }
foreach (Enum e in this.Values) foreach (Enum e in Values)
{ {
restart: restart:
foreach (Constant c in e.ConstantCollection.Values) foreach (Constant c in e.ConstantCollection.Values)
@ -320,7 +320,7 @@ namespace Bind.Structures
List<Constant> removed_tokens = new List<Constant>(); List<Constant> removed_tokens = new List<Constant>();
foreach (Enum e in this.Values) foreach (Enum e in Values)
{ {
if (e.Name == "All") if (e.Name == "All")
continue; continue;

View file

@ -54,7 +54,7 @@ namespace Bind.Structures
public Function(Function f) public Function(Function f)
: this((Delegate)f) : this((Delegate)f)
{ {
this.Body = new FunctionBody(f.Body); Body = new FunctionBody(f.Body);
} }
#endregion #endregion
@ -73,7 +73,7 @@ namespace Bind.Structures
public void TurnVoidPointersToIntPtr() public void TurnVoidPointersToIntPtr()
{ {
foreach (Parameter p in this.Parameters) foreach (Parameter p in Parameters)
{ {
if (p.Pointer != 0 && p.CurrentType == "void") if (p.Pointer != 0 && p.CurrentType == "void")
{ {
@ -230,9 +230,9 @@ namespace Bind.Structures
public bool Equals(Function other) public bool Equals(Function other)
{ {
return return
!String.IsNullOrEmpty(this.TrimmedName) && !String.IsNullOrEmpty(other.TrimmedName) && !String.IsNullOrEmpty(TrimmedName) && !String.IsNullOrEmpty(other.TrimmedName) &&
this.TrimmedName == other.TrimmedName && TrimmedName == other.TrimmedName &&
this.Parameters.ToString(true) == other.Parameters.ToString(true); Parameters.ToString(true) == other.Parameters.ToString(true);
} }
#endregion #endregion
@ -571,7 +571,7 @@ namespace Bind.Structures
} }
} }
this.Body = f.Body; Body = f.Body;
} }
#endregion #endregion
@ -603,7 +603,7 @@ namespace Bind.Structures
{ {
foreach (string s in fb) foreach (string s in fb)
{ {
this.Add(s); Add(s);
} }
} }
@ -629,16 +629,16 @@ namespace Bind.Structures
{ {
foreach (string t in collection) foreach (string t in collection)
{ {
this.Add(t); Add(t);
} }
} }
public override string ToString() public override string ToString()
{ {
if (this.Count == 0) if (Count == 0)
return String.Empty; return String.Empty;
StringBuilder sb = new StringBuilder(this.Count); StringBuilder sb = new StringBuilder(Count);
sb.AppendLine("{"); sb.AppendLine("{");
foreach (string s in this) foreach (string s in this)
@ -661,9 +661,9 @@ namespace Bind.Structures
public void Add(Function f) public void Add(Function f)
{ {
if (!this.ContainsKey(f.Extension)) if (!ContainsKey(f.Extension))
{ {
this.Add(f.Extension, new List<Function>()); Add(f.Extension, new List<Function>());
this[f.Extension].Add(f); this[f.Extension].Add(f);
} }
else else
@ -676,7 +676,7 @@ namespace Bind.Structures
{ {
foreach (Function f in functions) foreach (Function f in functions)
{ {
this.Add(f); Add(f);
} }
} }

View file

@ -41,12 +41,12 @@ namespace Bind.Structures
if (p == null) if (p == null)
return; return;
this.Name = p.Name; Name = p.Name;
this.Unchecked = p.Unchecked; Unchecked = p.Unchecked;
this.UnmanagedType = p.UnmanagedType; UnmanagedType = p.UnmanagedType;
this.Generic = p.Generic; Generic = p.Generic;
this.Flow = p.Flow; Flow = p.Flow;
this.cache = p.cache; cache = p.cache;
//this.rebuild = false; //this.rebuild = false;
} }
@ -381,7 +381,7 @@ namespace Bind.Structures
{ {
foreach (Parameter p in pc) foreach (Parameter p in pc)
{ {
this.Add(new Parameter(p)); Add(new Parameter(p));
} }
} }
@ -531,7 +531,7 @@ namespace Bind.Structures
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.Append("("); sb.Append("(");
if (this.Count > 0) if (Count > 0)
{ {
foreach (Parameter p in this) foreach (Parameter p in this)
{ {
@ -576,7 +576,7 @@ namespace Bind.Structures
sb.Append("("); sb.Append("(");
if (this.Count > 0) if (Count > 0)
{ {
foreach (Parameter p in this) foreach (Parameter p in this)
{ {

View file

@ -54,13 +54,13 @@ namespace Bind.Structures
{ {
if (t != null) if (t != null)
{ {
this.CurrentType = t.CurrentType; CurrentType = t.CurrentType;
this.PreviousType = t.PreviousType; PreviousType = t.PreviousType;
this.WrapperType = t.WrapperType; WrapperType = t.WrapperType;
this.Array = t.Array; Array = t.Array;
this.Pointer = t.Pointer; Pointer = t.Pointer;
this.Reference = t.Reference; Reference = t.Reference;
this.ElementCount = t.ElementCount; ElementCount = t.ElementCount;
} }
} }

View file

@ -56,7 +56,7 @@ namespace Bind.Wgl
Trace.WriteLine("Processing specs, please wait..."); Trace.WriteLine("Processing specs, please wait...");
//this.Translate(); //this.Translate();
this.WriteBindings( WriteBindings(
Delegate.Delegates, Delegate.Delegates,
Function.Wrappers, Function.Wrappers,
Enum.GLEnums); Enum.GLEnums);