Browse Source

Reduce build warnings by setting a few flags and not using deprecated overloads.

pull/1123/head
Jeremy Koritzinsky 9 years ago
parent
commit
58b3ff90ab
  1. 19
      build/UnitTests.NetCore.targets
  2. 1
      src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj
  3. 1
      src/Linux/Avalonia.LinuxFramebuffer/NativeUnsafeMethods.cs
  4. 1
      src/Windows/Avalonia.Designer/AppHost/HostedAppModel.cs
  5. 4
      src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs
  6. 2
      src/Windows/Avalonia.Win32/Win32Platform.cs
  7. 6
      src/Windows/Avalonia.Win32/WindowImpl.cs
  8. 32
      tests/Avalonia.Input.UnitTests/Avalonia.Input.UnitTests.csproj
  9. 1
      tests/Avalonia.Styling.UnitTests/Avalonia.Styling.UnitTests.csproj

19
build/UnitTests.NetCore.targets

@ -3,25 +3,6 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
</ItemGroup>

1
src/Avalonia.HtmlRenderer/Avalonia.HtmlRenderer.csproj

@ -4,6 +4,7 @@
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
<EnableDefaultItems>False</EnableDefaultItems>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<NoWarn>CS0436</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>

1
src/Linux/Avalonia.LinuxFramebuffer/NativeUnsafeMethods.cs

@ -72,6 +72,7 @@ namespace Avalonia.LinuxFramebuffer
FB_VBLANK_HAVE_VSYNC = 0x100 /* verical syncs can be detected */
}
[StructLayout(LayoutKind.Sequential)]
unsafe struct fb_vblank {
public VBlankFlags flags; /* FB_VBLANK flags */
__u32 count; /* counter of retraces since boot */

1
src/Windows/Avalonia.Designer/AppHost/HostedAppModel.cs

@ -86,7 +86,6 @@ namespace Avalonia.Designer.AppHost
}
double _currentScalingFactor = 1;
private string _color;
private string _background;
public event PropertyChangedEventHandler PropertyChanged;

4
src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs

@ -922,9 +922,7 @@ namespace Avalonia.Win32.Interop
[StructLayout(LayoutKind.Sequential)]
internal class MONITORINFO
{
#pragma warning disable CS0618 // Type or member is obsolete
public int cbSize = Marshal.SizeOf(typeof(MONITORINFO));
#pragma warning restore CS0618 // Type or member is obsolete
public int cbSize = Marshal.SizeOf<MONITORINFO>();
public RECT rcMonitor = new RECT();
public RECT rcWork = new RECT();
public int dwFlags = 0;

2
src/Windows/Avalonia.Win32/Win32Platform.cs

@ -167,7 +167,7 @@ namespace Avalonia.Win32
UnmanagedMethods.WNDCLASSEX wndClassEx = new UnmanagedMethods.WNDCLASSEX
{
cbSize = Marshal.SizeOf(typeof(UnmanagedMethods.WNDCLASSEX)),
cbSize = Marshal.SizeOf<UnmanagedMethods.WNDCLASSEX>(),
lpfnWndProc = _wndProcDelegate,
hInstance = UnmanagedMethods.GetModuleHandle(null),
lpszClassName = "AvaloniaMessageWindow " + Guid.NewGuid(),

6
src/Windows/Avalonia.Win32/WindowImpl.cs

@ -426,7 +426,7 @@ namespace Avalonia.Win32
case UnmanagedMethods.WindowsMessage.WM_DPICHANGED:
var dpi = ToInt32(wParam) & 0xffff;
var newDisplayRect = (UnmanagedMethods.RECT)Marshal.PtrToStructure(lParam, typeof(UnmanagedMethods.RECT));
var newDisplayRect = Marshal.PtrToStructure<UnmanagedMethods.RECT>(lParam);
Position = new Point(newDisplayRect.left, newDisplayRect.top);
_scaling = dpi / 96.0;
ScalingChanged?.Invoke(_scaling);
@ -494,7 +494,7 @@ namespace Avalonia.Win32
{
var tm = new UnmanagedMethods.TRACKMOUSEEVENT
{
cbSize = Marshal.SizeOf(typeof(UnmanagedMethods.TRACKMOUSEEVENT)),
cbSize = Marshal.SizeOf<UnmanagedMethods.TRACKMOUSEEVENT>(),
dwFlags = 2,
hwndTrack = _hwnd,
dwHoverTime = 0,
@ -619,7 +619,7 @@ namespace Avalonia.Win32
UnmanagedMethods.WNDCLASSEX wndClassEx = new UnmanagedMethods.WNDCLASSEX
{
cbSize = Marshal.SizeOf(typeof(UnmanagedMethods.WNDCLASSEX)),
cbSize = Marshal.SizeOf<UnmanagedMethods.WNDCLASSEX>(),
style = 0,
lpfnWndProc = _wndProcDelegate,
hInstance = UnmanagedMethods.GetModuleHandle(null),

32
tests/Avalonia.Input.UnitTests/Avalonia.Input.UnitTests.csproj

@ -3,35 +3,6 @@
<TargetFrameworks>net461;netcoreapp1.1</TargetFrameworks>
<OutputType>Library</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Avalonia.Input.UnitTests.XML</DocumentationFile>
<NoWarn>CS1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<Import Project="..\..\build\UnitTests.NetCore.targets" />
<Import Project="..\..\build\Moq.props" />
<Import Project="..\..\build\XUnit.props" />
@ -48,7 +19,4 @@
<ProjectReference Include="..\..\src\Avalonia.Styling\Avalonia.Styling.csproj" />
<ProjectReference Include="..\Avalonia.UnitTests\Avalonia.UnitTests.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
</Project>

1
tests/Avalonia.Styling.UnitTests/Avalonia.Styling.UnitTests.csproj

@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp1.1</TargetFrameworks>
<OutputType>Library</OutputType>
<NoWarn>CS0067</NoWarn>
</PropertyGroup>
<Import Project="..\..\build\UnitTests.NetCore.targets" />
<Import Project="..\..\build\Moq.props" />

Loading…
Cancel
Save