From b9c58adae6f757018c5ec308cd7719409476128d Mon Sep 17 00:00:00 2001 From: Yeechan Lu Date: Tue, 18 Mar 2014 12:28:48 +0800 Subject: [PATCH] Remove compiler warnings --- Pythonnet.Runtime/runtime.cs | 8 ++++++++ Wox.Infrastructure/CommonStorage.cs | 2 +- Wox.Infrastructure/UserSettings/UserSelectedRecords.cs | 2 +- Wox.Plugin.System/BrowserBookmarks.cs | 2 +- Wox.Plugin.System/WindowsShellRun.cs | 2 -- Wox/Helper/DWMDropShadow.cs | 2 +- Wox/MainWindow.xaml.cs | 4 ++-- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Pythonnet.Runtime/runtime.cs b/Pythonnet.Runtime/runtime.cs index 49cf58b4be..e70835c574 100644 --- a/Pythonnet.Runtime/runtime.cs +++ b/Pythonnet.Runtime/runtime.cs @@ -632,6 +632,7 @@ namespace Python.Runtime { // This version avoids a managed <-> unmanaged transition. This one // does incref the returned type object. + [CLSCompliant(false)] public unsafe static IntPtr PyObject_Type(IntPtr op) { IntPtr tp = PyObject_TYPE(op); @@ -838,6 +839,7 @@ namespace Python.Runtime { public unsafe static extern IntPtr PyLong_FromLong(long value); + [CLSCompliant(false)] [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Ansi)] public unsafe static extern IntPtr @@ -853,6 +855,7 @@ namespace Python.Runtime { public unsafe static extern IntPtr PyLong_FromLongLong(long value); + [CLSCompliant(false)] [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Ansi)] public unsafe static extern IntPtr @@ -868,6 +871,7 @@ namespace Python.Runtime { public unsafe static extern int PyLong_AsLong(IntPtr value); + [CLSCompliant(false)] [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Ansi)] public unsafe static extern uint @@ -878,6 +882,7 @@ namespace Python.Runtime { public unsafe static extern long PyLong_AsLongLong(IntPtr value); + [CLSCompliant(false)] [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Ansi)] public unsafe static extern ulong @@ -1046,6 +1051,7 @@ namespace Python.Runtime { public unsafe static extern int PyUnicode_GetSize(IntPtr ob); + [CLSCompliant(false)] [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, EntryPoint="PyUnicodeUCS2_AsUnicode", ExactSpelling=true)] @@ -1455,6 +1461,7 @@ namespace Python.Runtime { public unsafe static extern int PyType_Ready(IntPtr type); + [CLSCompliant(false)] [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Ansi)] public unsafe static extern IntPtr @@ -1470,6 +1477,7 @@ namespace Python.Runtime { public unsafe static extern int PyObject_GenericSetAttr(IntPtr obj, IntPtr name, IntPtr value); + [CLSCompliant(false)] [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Ansi)] public unsafe static extern IntPtr diff --git a/Wox.Infrastructure/CommonStorage.cs b/Wox.Infrastructure/CommonStorage.cs index 3a9ed0a137..8d3930e7a6 100644 --- a/Wox.Infrastructure/CommonStorage.cs +++ b/Wox.Infrastructure/CommonStorage.cs @@ -46,7 +46,7 @@ namespace Wox.Infrastructure { storage = JsonConvert.DeserializeObject(json); } - catch (Exception e) + catch (Exception) { LoadDefaultUserSetting(); } diff --git a/Wox.Infrastructure/UserSettings/UserSelectedRecords.cs b/Wox.Infrastructure/UserSettings/UserSelectedRecords.cs index 214e0c3256..598d1fa704 100644 --- a/Wox.Infrastructure/UserSettings/UserSelectedRecords.cs +++ b/Wox.Infrastructure/UserSettings/UserSelectedRecords.cs @@ -7,7 +7,7 @@ namespace Wox.Infrastructure.UserSettings [Serializable] public class UserSelectedRecords { - private static int hasAddedCount = 0; + // private static int hasAddedCount = 0; public Dictionary Records = new Dictionary(); diff --git a/Wox.Plugin.System/BrowserBookmarks.cs b/Wox.Plugin.System/BrowserBookmarks.cs index 756ea3daad..42be68a777 100644 --- a/Wox.Plugin.System/BrowserBookmarks.cs +++ b/Wox.Plugin.System/BrowserBookmarks.cs @@ -35,7 +35,7 @@ namespace Wox.Plugin.System { Process.Start(c.Url); } - catch (Exception e) + catch (Exception) { MessageBox.Show("open url failed:" + c.Url); } diff --git a/Wox.Plugin.System/WindowsShellRun.cs b/Wox.Plugin.System/WindowsShellRun.cs index 9438a2f764..fbdaa6a504 100644 --- a/Wox.Plugin.System/WindowsShellRun.cs +++ b/Wox.Plugin.System/WindowsShellRun.cs @@ -165,8 +165,6 @@ namespace Wox.Plugin.System static bool CopyCommand(string pszCommand, string pszDir, out string pszOut) { - bool fRet = true; - pszOut = pszCommand; if (pszCommand[0] != '"') { diff --git a/Wox/Helper/DWMDropShadow.cs b/Wox/Helper/DWMDropShadow.cs index d727966d6a..30eba1aeeb 100644 --- a/Wox/Helper/DWMDropShadow.cs +++ b/Wox/Helper/DWMDropShadow.cs @@ -62,7 +62,7 @@ namespace Wox.Helper return false; } } - catch (Exception ex) + catch (Exception) { // Probably dwmapi.dll not found (incompatible OS) return false; diff --git a/Wox/MainWindow.xaml.cs b/Wox/MainWindow.xaml.cs index 36020f42de..7734100d02 100644 --- a/Wox/MainWindow.xaml.cs +++ b/Wox/MainWindow.xaml.cs @@ -31,7 +31,7 @@ namespace Wox public partial class MainWindow { private static readonly object locker = new object(); - public static bool Initialized = false; + public static bool initialized = false; private static readonly List waitShowResultList = new List(); private readonly GloablHotkey globalHotkey = new GloablHotkey(); @@ -44,7 +44,7 @@ namespace Wox public MainWindow() { InitializeComponent(); - Initialized = true; + initialized = true; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;