Browse Source

Convert spaces to tabs.

pull/1/head
Zoltan Varga 15 years ago committed by Andreia Gaita
parent
commit
c6c8291b41
  1. 11
      src/Mono.VisualC.Interop/ABI/CppAbi.cs
  2. 1
      src/Mono.VisualC.Interop/ABI/Impl/MsvcAbi.cs
  3. 2
      src/Mono.VisualC.Interop/ABI/VTable.cs
  4. 1
      src/Mono.VisualC.Interop/ABI/VTableManaged.cs
  5. 1
      src/Mono.VisualC.Interop/CppInstancePtr.cs
  6. 5
      src/Mono.VisualC.Interop/CppLibrary.cs
  7. 1
      src/Mono.VisualC.Interop/Util/DelegateTypeCache.cs
  8. 1
      src/Mono.VisualC.Interop/Util/MethodSignature.cs
  9. 1
      src/Mono.VisualC.Interop/Util/ReflectionHelper.cs

11
src/Mono.VisualC.Interop/ABI/CppAbi.cs

@ -22,7 +22,6 @@ namespace Mono.VisualC.Interop.ABI { @@ -22,7 +22,6 @@ namespace Mono.VisualC.Interop.ABI {
//FIXME: Exception handling, operator overloading etc.
//FIXME: Allow interface to override default calling convention
public abstract partial class CppAbi {
protected ModuleBuilder impl_module;
protected TypeBuilder impl_type;
@ -90,7 +89,6 @@ namespace Mono.VisualC.Interop.ABI { @@ -90,7 +89,6 @@ namespace Mono.VisualC.Interop.ABI {
var methods = GetMethods ();
CppTypeInfo typeInfo = MakeTypeInfo (methods.Where (m => IsVirtual (m)));
// Implement all methods
int vtableIndex = 0;
foreach (var method in methods)
@ -102,7 +100,6 @@ namespace Mono.VisualC.Interop.ABI { @@ -102,7 +100,6 @@ namespace Mono.VisualC.Interop.ABI {
ctor_il.Emit (OpCodes.Ret);
return (Iface)Activator.CreateInstance (impl_type.CreateType (), typeInfo);
}
@ -225,15 +222,12 @@ namespace Mono.VisualC.Interop.ABI { @@ -225,15 +222,12 @@ namespace Mono.VisualC.Interop.ABI {
case MethodType.NativeCtor:
EmitConstruct (il, nativeMethod, parameterTypes, nativePtr);
break;
case MethodType.NativeDtor:
EmitDestruct (il, nativeMethod, parameterTypes, cppInstancePtr, nativePtr);
break;
default:
EmitCallNative (il, nativeMethod, isStatic, parameterTypes, nativePtr);
break;
}
il.Emit (OpCodes.Ret);
@ -253,7 +247,6 @@ namespace Mono.VisualC.Interop.ABI { @@ -253,7 +247,6 @@ namespace Mono.VisualC.Interop.ABI {
// C++ interface properties are either to return the CppTypeInfo or to access C++ fields
if (retType.IsGenericType && retType.GetGenericTypeDefinition ().Equals (typeof (CppField<>))) {
// define a new field for the property
// fieldData = impl_type.DefineField ("__" + propName + "_Data", retType, FieldAttributes.InitOnly | FieldAttributes.Private);
@ -366,7 +359,6 @@ namespace Mono.VisualC.Interop.ABI { @@ -366,7 +359,6 @@ namespace Mono.VisualC.Interop.ABI {
*/
protected virtual MethodBuilder GetMethodBuilder (MethodInfo interfaceMethod)
{
Type [] parameterTypes = ReflectionHelper.GetMethodParameterTypes (interfaceMethod);
MethodBuilder methodBuilder = impl_type.DefineMethod (interfaceMethod.Name, MethodAttributes.Public | MethodAttributes.Virtual,
interfaceMethod.ReturnType, parameterTypes);
@ -643,9 +635,6 @@ namespace Mono.VisualC.Interop.ABI { @@ -643,9 +635,6 @@ namespace Mono.VisualC.Interop.ABI {
il.MarkLabel (validRef);
}
}
}
}

1
src/Mono.VisualC.Interop/ABI/Impl/MsvcAbi.cs

@ -190,7 +190,6 @@ namespace Mono.VisualC.Interop.ABI { @@ -190,7 +190,6 @@ namespace Mono.VisualC.Interop.ABI {
code.Append(mangleType.ElementTypeName);
code.Append ("@@");
break;
}
return code.ToString ();

2
src/Mono.VisualC.Interop/ABI/VTable.cs

@ -19,7 +19,6 @@ namespace Mono.VisualC.Interop.ABI { @@ -19,7 +19,6 @@ namespace Mono.VisualC.Interop.ABI {
// TODO: RTTI .. support virtual inheritance
public abstract class VTable : IDisposable {
public static MakeVTableDelegate DefaultImplementation = VTableManaged.Implementation;
protected CppTypeInfo typeInfo;
@ -69,7 +68,6 @@ namespace Mono.VisualC.Interop.ABI { @@ -69,7 +68,6 @@ namespace Mono.VisualC.Interop.ABI {
int currentOffset = typeInfo.VTableTopPadding;
for (int i = 0; i < EntryCount; i++) {
if (Marshal.ReadIntPtr (vtPtr, currentOffset) == IntPtr.Zero)
Marshal.WriteIntPtr (vtPtr, currentOffset, Marshal.ReadIntPtr (basePtr, currentOffset));

1
src/Mono.VisualC.Interop/ABI/VTableManaged.cs

@ -51,5 +51,4 @@ namespace Mono.VisualC.Interop.ABI { @@ -51,5 +51,4 @@ namespace Mono.VisualC.Interop.ABI {
return nativeLayoutType;
}
*/
}

1
src/Mono.VisualC.Interop/CppInstancePtr.cs

@ -129,7 +129,6 @@ namespace Mono.VisualC.Interop { @@ -129,7 +129,6 @@ namespace Mono.VisualC.Interop {
// if we do not KNOW that this instance is managed.
internal static T GetManaged<T> (IntPtr native, int nativeSize) where T : class
{
IntPtr handlePtr = Marshal.ReadIntPtr (native, nativeSize);
GCHandle handle = GCHandle.FromIntPtr (handlePtr);

5
src/Mono.VisualC.Interop/CppLibrary.cs

@ -37,7 +37,6 @@ namespace Mono.VisualC.Interop { @@ -37,7 +37,6 @@ namespace Mono.VisualC.Interop {
public CppLibrary (string name)
{
if (name == null)
throw new ArgumentNullException ("Name cannot be NULL.");
@ -49,7 +48,6 @@ namespace Mono.VisualC.Interop { @@ -49,7 +48,6 @@ namespace Mono.VisualC.Interop {
public CppLibrary (string name, CppAbi abi)
{
if (name == null)
throw new ArgumentNullException ("Name cannot be NULL.");
if (abi == null)
@ -70,7 +68,6 @@ namespace Mono.VisualC.Interop { @@ -70,7 +68,6 @@ namespace Mono.VisualC.Interop {
public Iface GetClass<Iface> (string className)
where Iface : ICppClass
{
return Abi.ImplementClass<Iface> (null, Name, className);
}
@ -80,7 +77,6 @@ namespace Mono.VisualC.Interop { @@ -80,7 +77,6 @@ namespace Mono.VisualC.Interop {
where Iface : ICppClassInstantiatable
where NativeLayout : struct
{
return Abi.ImplementClass<Iface, NativeLayout> (null, Name, className);
}
@ -94,7 +90,6 @@ namespace Mono.VisualC.Interop { @@ -94,7 +90,6 @@ namespace Mono.VisualC.Interop {
where NativeLayout : struct
where Managed : ICppObject
{
return Abi.ImplementClass<Iface, NativeLayout> (typeof (Managed), Name, className);
}

1
src/Mono.VisualC.Interop/Util/DelegateTypeCache.cs

@ -20,7 +20,6 @@ namespace Mono.VisualC.Interop.Util { @@ -20,7 +20,6 @@ namespace Mono.VisualC.Interop.Util {
private static Dictionary<DelegateSignature, Type> type_cache;
public static Type GetDelegateType (MethodInfo signature, CallingConvention? callingConvention)
{
return GetDelegateType (ReflectionHelper.GetMethodParameterTypes (signature), signature.ReturnType, callingConvention);

1
src/Mono.VisualC.Interop/Util/MethodSignature.cs

@ -59,7 +59,6 @@ namespace Mono.VisualC.Interop.Util { @@ -59,7 +59,6 @@ namespace Mono.VisualC.Interop.Util {
ReturnType.Equals (other.ReturnType);
}
public override int GetHashCode ()
{
unchecked {

1
src/Mono.VisualC.Interop/Util/ReflectionHelper.cs

@ -76,7 +76,6 @@ namespace Mono.VisualC.Interop.Util { @@ -76,7 +76,6 @@ namespace Mono.VisualC.Interop.Util {
marshalAsAttr = new CustomAttributeBuilder (ctor, args, fields, values);
attr = attr | ParameterAttributes.HasFieldMarshal;
} else */ if (forPInvoke && existingMarshalAs != null) {
// FIXME: This still doesn't feel like it's working right.. especially for virtual functions
ConstructorInfo ctor = typeof (MarshalAsAttribute).GetConstructor (new Type[] { typeof (UnmanagedType) });

Loading…
Cancel
Save