From a56feb01e30d39830c13b1eb2f97947e57ca7199 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 23 Mar 2011 14:05:01 -0500 Subject: [PATCH] Some warning fixage. * glib/GType.cs: * glib/Makefile.am: * glib/Object.cs: * glib/ParamSpec.cs: * glib/PtrArray.cs: * glib/SignalClosure.cs: * glib/Value.cs: mark private struct fields public to avoid 0169, and remove the nowarn from the csc command. fixed one real warning, exposed a bunch of obsolete usage still to fix. --- glib/GType.cs | 16 ++++++++-------- glib/Makefile.am | 2 +- glib/Object.cs | 28 ++++++++++++++-------------- glib/ParamSpec.cs | 20 ++++++++++---------- glib/PtrArray.cs | 2 +- glib/SignalClosure.cs | 9 ++++----- glib/Value.cs | 18 +++++++++--------- 7 files changed, 47 insertions(+), 48 deletions(-) diff --git a/glib/GType.cs b/glib/GType.cs index e8e039fcf..b1981b035 100755 --- a/glib/GType.cs +++ b/glib/GType.cs @@ -38,15 +38,15 @@ namespace GLib { struct GTypeInfo { public ushort class_size; - IntPtr base_init; - IntPtr base_finalize; - IntPtr class_init; - IntPtr class_finalize; - IntPtr class_data; + public IntPtr base_init; + public IntPtr base_finalize; + public IntPtr class_init; + public IntPtr class_finalize; + public IntPtr class_data; public ushort instance_size; - ushort n_preallocs; - IntPtr instance_init; - IntPtr value_table; + public ushort n_preallocs; + public IntPtr instance_init; + public IntPtr value_table; } struct GTypeQuery { diff --git a/glib/Makefile.am b/glib/Makefile.am index c1bb01ad2..c591cb927 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -81,7 +81,7 @@ EXTRA_DIST = \ $(ASSEMBLY): $(build_sources) $(SNK) @rm -f $(ASSEMBLY).mdb - $(CSC) $(CSFLAGS) -keyfile:$(SNK) -unsafe -nowarn:0169,0612,0618 -out:$(ASSEMBLY) -target:library $(references) $(build_sources) + $(CSC) $(CSFLAGS) -keyfile:$(SNK) -unsafe -out:$(ASSEMBLY) -target:library $(references) $(build_sources) policy.%.config: $(top_builddir)/policy.config sed -e "s/@ASSEMBLY_NAME@/$(ASSEMBLY_NAME)/" -e "s/@POLICY@/$*/" $(top_builddir)/policy.config > $@ diff --git a/glib/Object.cs b/glib/Object.cs index d665d7197..0a9ed811d 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -180,23 +180,23 @@ namespace GLib { } struct GObjectClass { - GTypeClass type_class; - IntPtr construct_props; + public GTypeClass type_class; + public IntPtr construct_props; public ConstructorDelegate constructor_cb; public SetPropertyDelegate set_prop_cb; public GetPropertyDelegate get_prop_cb; - IntPtr dispose; - IntPtr finalize; - IntPtr dispatch_properties_changed; - IntPtr notify; - IntPtr constructed; - IntPtr dummy1; - IntPtr dummy2; - IntPtr dummy3; - IntPtr dummy4; - IntPtr dummy5; - IntPtr dummy6; - IntPtr dummy7; + public IntPtr dispose; + public IntPtr finalize; + public IntPtr dispatch_properties_changed; + public IntPtr notify; + public IntPtr constructed; + public IntPtr dummy1; + public IntPtr dummy2; + public IntPtr dummy3; + public IntPtr dummy4; + public IntPtr dummy5; + public IntPtr dummy6; + public IntPtr dummy7; } [UnmanagedFunctionPointer (CallingConvention.Cdecl)] diff --git a/glib/ParamSpec.cs b/glib/ParamSpec.cs index 3e40a813a..64a91ed3b 100644 --- a/glib/ParamSpec.cs +++ b/glib/ParamSpec.cs @@ -109,22 +109,22 @@ namespace GLib { } struct GTypeInstance { - IntPtr g_class; + public IntPtr g_class; } struct GParamSpec { - GTypeInstance g_type_instance; + public GTypeInstance g_type_instance; - IntPtr name; - ParamFlags flags; + public IntPtr name; + public ParamFlags flags; public IntPtr value_type; - IntPtr owner_type; + public IntPtr owner_type; - IntPtr _nick; - IntPtr _blurb; - IntPtr qdata; - uint ref_count; - uint param_id; + public IntPtr _nick; + public IntPtr _blurb; + public IntPtr qdata; + public uint ref_count; + public uint param_id; } [DllImport ("libgobject-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] diff --git a/glib/PtrArray.cs b/glib/PtrArray.cs index 3ad5d137a..63efac39b 100644 --- a/glib/PtrArray.cs +++ b/glib/PtrArray.cs @@ -145,7 +145,7 @@ namespace GLib { } struct GPtrArray { - IntPtr pdata; + public IntPtr pdata; public uint len; } diff --git a/glib/SignalClosure.cs b/glib/SignalClosure.cs index 8797bd7e7..1e0d218db 100644 --- a/glib/SignalClosure.cs +++ b/glib/SignalClosure.cs @@ -29,7 +29,6 @@ namespace GLib { EventArgs args; GLib.Object obj; - object result; public ClosureInvokedArgs (GLib.Object obj, EventArgs args) { @@ -51,10 +50,10 @@ namespace GLib { } struct GClosure { - long fields; - IntPtr marshaler; - IntPtr data; - IntPtr notifiers; + public long fields; + public IntPtr marshaler; + public IntPtr data; + public IntPtr notifiers; } internal delegate void ClosureInvokedHandler (object o, ClosureInvokedArgs args); diff --git a/glib/Value.cs b/glib/Value.cs index e7d8c192f..82d6e6372 100755 --- a/glib/Value.cs +++ b/glib/Value.cs @@ -32,15 +32,15 @@ namespace GLib { [StructLayout(LayoutKind.Explicit)] struct Padding { - [FieldOffset (0)] int v_int; - [FieldOffset (0)] uint v_uint; - [FieldOffset (0)] int v_long; - [FieldOffset (0)] uint v_ulong; - [FieldOffset (0)] long v_int64; - [FieldOffset (0)] ulong v_uint64; - [FieldOffset (0)] float v_float; - [FieldOffset (0)] double v_double; - [FieldOffset (0)] IntPtr v_pointer; + [FieldOffset (0)] public int v_int; + [FieldOffset (0)] public uint v_uint; + [FieldOffset (0)] public int v_long; + [FieldOffset (0)] public uint v_ulong; + [FieldOffset (0)] public long v_int64; + [FieldOffset (0)] public ulong v_uint64; + [FieldOffset (0)] public float v_float; + [FieldOffset (0)] public double v_double; + [FieldOffset (0)] public IntPtr v_pointer; } IntPtr type;