diff --git a/glib/FileUtils.cs b/glib/FileUtils.cs index 0a96a6e34..153ee8726 100644 --- a/glib/FileUtils.cs +++ b/glib/FileUtils.cs @@ -25,5 +25,7 @@ namespace GLib { return Marshal.PtrToStringAnsi (contents, length); } + + private FileUtils () {} } } diff --git a/glib/Log.cs b/glib/Log.cs index d7c253479..498889d2c 100644 --- a/glib/Log.cs +++ b/glib/Log.cs @@ -20,7 +20,7 @@ namespace GLib { public delegate void PrintFunc (string message); [Flags] - public enum LogLevelFlags : uint + public enum LogLevelFlags : int { /* log flags */ FlagRecursion = 1 << 0, @@ -40,7 +40,7 @@ namespace GLib { All = 255, FlagMask = 3, - LevelMask = (uint) 0xFFFFFFFC + LevelMask = unchecked ((int) 0xFFFFFFFC) } public class Log { diff --git a/glib/Markup.cs b/glib/Markup.cs index 5958e4a41..4bdd43aa0 100644 --- a/glib/Markup.cs +++ b/glib/Markup.cs @@ -13,6 +13,8 @@ namespace GLib { public class Markup { + private Markup () {} + [DllImport("libglib-2.0-0.dll")] static extern IntPtr g_markup_escape_text (string text, int len); diff --git a/glib/Marshaller.cs b/glib/Marshaller.cs index a563602f2..003255009 100644 --- a/glib/Marshaller.cs +++ b/glib/Marshaller.cs @@ -17,7 +17,12 @@ namespace GLibSharp { /// public class Marshaller { - + + // + // Do not allow instances of this + // + private Marshaller () {} + [DllImport("libglib-2.0-0.dll")] static extern void g_free (IntPtr mem); diff --git a/glib/Object.cs b/glib/Object.cs index af5b4eefe..6521bc67b 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -16,7 +16,7 @@ namespace GLib { using System.Runtime.InteropServices; [AttributeUsage(AttributeTargets.All)] - public class WrapperClassAttribute : Attribute { + public sealed class WrapperClassAttribute : Attribute { public WrapperClassAttribute () : base () {} } diff --git a/glib/SignalAttribute.cs b/glib/SignalAttribute.cs index d69fcb641..8d55bcb66 100644 --- a/glib/SignalAttribute.cs +++ b/glib/SignalAttribute.cs @@ -20,7 +20,7 @@ namespace GLib { /// and allows obtaining its original name. /// [Serializable] - public class SignalAttribute : Attribute + public sealed class SignalAttribute : Attribute { private string cname; diff --git a/glib/SignalCallback.cs b/glib/SignalCallback.cs index f267176bf..463bbe717 100644 --- a/glib/SignalCallback.cs +++ b/glib/SignalCallback.cs @@ -40,7 +40,7 @@ namespace GtkSharp { /// Initializes instance data. /// - public SignalCallback (GLib.Object obj, Delegate eh, System.Type argstype) + protected SignalCallback (GLib.Object obj, Delegate eh, System.Type argstype) { _key = _NextKey++; _obj = obj; diff --git a/glib/Source.cs b/glib/Source.cs index 9431cfea2..570493eb5 100644 --- a/glib/Source.cs +++ b/glib/Source.cs @@ -10,6 +10,7 @@ namespace GLib { using System.Runtime.InteropServices; public class Source { + private Source () {} [DllImport("libglib-2.0-0.dll")] static extern bool g_source_remove (uint tag); diff --git a/glib/Thread.cs b/glib/Thread.cs index 7ad7fd8d7..6f39c79bb 100644 --- a/glib/Thread.cs +++ b/glib/Thread.cs @@ -11,6 +11,8 @@ namespace GLib public class Thread { + private Thread () {} + [DllImport("libgthread-2.0-0.dll")] static extern void g_thread_init (IntPtr i); diff --git a/glib/Timeout.cs b/glib/Timeout.cs index 514740e6c..f28b7665e 100755 --- a/glib/Timeout.cs +++ b/glib/Timeout.cs @@ -32,6 +32,7 @@ namespace GLib { public class Timeout { + private Timeout () {} [DllImport("libglib-2.0-0.dll")] static extern uint g_timeout_add (uint interval, TimeoutHandler d, IntPtr data); diff --git a/glib/TypeConverter.cs b/glib/TypeConverter.cs index ad1f49ec5..603baa030 100644 --- a/glib/TypeConverter.cs +++ b/glib/TypeConverter.cs @@ -17,6 +17,9 @@ namespace GLibSharp { /// Utilities for converting between TypeFundamentals and System.Type /// public class TypeConverter { + + private TypeConverter () {} + public static TypeFundamentals LookupType (System.Type type) { if (type.Equals (typeof (string)))