small code cleanups and deal with some warnings

This commit is contained in:
adelikat 2013-10-27 17:07:37 +00:00
parent 7e49c9457d
commit 3f410a771c
13 changed files with 52 additions and 13 deletions

View File

@ -18,13 +18,23 @@ namespace BizHawk.Client.Common
public class BinaryStateLoader : IDisposable
{
bool disposed = false;
private bool isDisposed = false;
public void Dispose()
{
if (!disposed)
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
disposed = true;
zip.Close();
isDisposed = true;
if (disposing)
{
zip.Close();
}
}
}
@ -95,8 +105,6 @@ namespace BizHawk.Client.Common
{
ZipOutputStream zip;
bool disposed = false;
/// <summary>
///
/// </summary>
@ -135,12 +143,23 @@ namespace BizHawk.Client.Common
PutFileByName(BinaryStateFileNames.input, callback);
}
private bool isDisposed = false;
public void Dispose()
{
if (!disposed)
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
disposed = true;
zip.Dispose();
isDisposed = true;
if (disposing)
{
zip.Close();
}
}
}

View File

@ -9,7 +9,7 @@ namespace BizHawk.Client.Common
//split into "bind" and "open (the bound thing)"
//scan archive to flatten interior directories down to a path (maintain our own archive item list)
public class HawkFile : IDisposable
public sealed class HawkFile : IDisposable
{
public static bool ExistsAt(string path)
{

View File

@ -436,7 +436,6 @@ namespace BizHawk.Client.Common
Header.Comments.Add(str);
}
}
sr.Close();
}
return true;

View File

@ -3,6 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
#pragma warning disable 649 //adelikat: Disable dumb warnings until this file is complete
#pragma warning disable 169 //adelikat: Disable dumb warnings until this file is complete
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
{
sealed public partial class Vic

View File

@ -3,6 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
#pragma warning disable 649 //adelikat: Disable dumb warnings until this file is complete
#pragma warning disable 169 //adelikat: Disable dumb warnings until this file is complete
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
{
sealed public partial class Vic

View File

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
#pragma warning disable 649 //adelikat: Disable dumb warnings until this file is complete
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
{
sealed public partial class Vic

View File

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
#pragma warning disable 649 //adelikat: Disable dumb warnings until this file is complete
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
{
sealed public partial class Vic

View File

@ -3,6 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
#pragma warning disable 649 //adelikat: Disable dumb warnings until this file is complete
#pragma warning disable 169 //adelikat: Disable dumb warnings until this file is complete
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
{
sealed public class VicColumnState

View File

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
#pragma warning disable 649 //adelikat: Disable dumb warnings until this file is complete
namespace BizHawk.Emulation.Computers.Commodore64.Experimental.Chips.Internals
{
sealed public partial class Vic : IVideoProvider

View File

@ -1,5 +1,9 @@
using System;
#pragma warning disable 649 //adelikat: Disable dumb warnings until this file is complete
#pragma warning disable 169 //adelikat: Disable dumb warnings until this file is complete
#pragma warning disable 219 //adelikat: Disable dumb warnings until this file is complete
namespace BizHawk.Emulation.Computers.Commodore64.MOS
{
sealed public partial class Sid

View File

@ -27,7 +27,7 @@ namespace BizHawk.Emulation.Consoles.GB
/// <summary>
/// RTC time when emulation begins.
/// </summary>
long zerotime;
long zerotime = 0;
LibGambatte.RTCCallback TimeCallback;

View File

@ -3,6 +3,8 @@ using System.Runtime.InteropServices;
using System.IO;
using System.Collections.Generic;
#pragma warning disable 649 //adelikat: Disable dumb warnings until this file is complete
namespace BizHawk.Emulation.Consoles.PSX
{
public unsafe class Octoshock : IEmulator, IVideoProvider, ISoundProvider

View File

@ -491,7 +491,7 @@ namespace BizHawk
/// File attributes are metadata values stored by the file system on disk and are used by the system and are available to developers via various file I/O APIs.
/// </summary>
[Flags]
[CLSCompliant(false)]
//[CLSCompliant(false)]
public enum FileAttributes : uint
{
/// <summary>