UI: Fixed warnings found by xbuild 14.0

This commit is contained in:
Sour 2018-06-11 19:27:35 -04:00
parent ebd6ff72ba
commit 718b671730
30 changed files with 5 additions and 53 deletions

View file

@ -52,7 +52,7 @@ namespace Mesen.GUI.Config
private static DebugWorkspace Deserialize(string path)
{
DebugWorkspace config = config = new DebugWorkspace();
DebugWorkspace config = new DebugWorkspace();
if(File.Exists(path)) {
try {

View file

@ -80,7 +80,6 @@ namespace Mesen.GUI.Controls
var item = this.Items[e.Item];
AfterEdit?.Invoke(this, new LabelEditEventArgs(item.Index, text));
} else if(_pressedEsc) {
string text = _originalText;
var originalItem = this.Items[e.Item];
var newItem = new ListViewItem(_originalText);
newItem.SubItems.Add(originalItem.SubItems[1].Text);

View file

@ -30,7 +30,6 @@
this.components = new System.ComponentModel.Container();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.ctrlDataViewer = new Mesen.GUI.Debugger.ctrlScrollableTextbox();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.tableLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
@ -75,6 +74,5 @@
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private ctrlScrollableTextbox ctrlDataViewer;
private System.Windows.Forms.ToolTip toolTip;
}
}

View file

@ -420,7 +420,6 @@ namespace Mesen.GUI.Debugger.Controls
private void ctxMenu_Opening(object sender, CancelEventArgs e)
{
int baseAddress = _bottomBank ? 0x1000 : 0x0000;
bool ppuMemory = this.cboChrSelection.SelectedIndex == 0;
if(this.cboChrSelection.SelectedIndex > 1) {
baseAddress += (this.cboChrSelection.SelectedIndex - 1) * 0x2000;
}

View file

@ -35,8 +35,6 @@ namespace Mesen.GUI.Debugger
public void InitializeGrid()
{
HashSet<string> keyCombinations = new HashSet<string>();
gridShortcuts.Rows.Clear();
foreach(FieldInfo shortcut in _shortcuts) {

View file

@ -28,7 +28,6 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.ctrlCodeViewer = new Mesen.GUI.Debugger.ctrlScrollableTextbox();
this.contextMenuMargin = new System.Windows.Forms.ContextMenuStrip(this.components);
this.mnuEditBreakpoint = new System.Windows.Forms.ToolStripMenuItem();
@ -151,7 +150,6 @@
#endregion
private System.Windows.Forms.ToolTip toolTip;
private Mesen.GUI.Debugger.ctrlScrollableTextbox ctrlCodeViewer;
private System.Windows.Forms.ContextMenuStrip contextMenuMargin;
private System.Windows.Forms.ToolStripMenuItem mnuRemoveBreakpoint;

View file

@ -36,7 +36,6 @@ namespace Mesen.GUI.Debugger
private UInt32? _currentActiveAddress { get; set; } = null;
private Point _previousLocation;
private DebugViewInfo _config;
private CodeTooltipManager _tooltipManager = null;
private CodeViewerActions _codeViewerActions;
@ -365,7 +364,6 @@ namespace Mesen.GUI.Debugger
this.ctrlCodeViewer.ContextMenuStrip = _codeViewerActions.contextMenu;
}
_previousLocation = e.Location;
_tooltipManager.ProcessMouseMove(e.Location);
}

View file

@ -183,7 +183,6 @@ namespace Mesen.GUI.Debugger.Controls
private void mnuAddBreakpoint_Click(object sender, EventArgs e)
{
if(lstFunctions.SelectedIndices.Count > 0) {
CodeLabel label = GetSelectedItem().Tag as CodeLabel;
int absoluteAddress = (int)GetSelectedItem().SubItems[2].Tag;
BreakpointManager.AddBreakpoint(new Breakpoint() {
MemoryType = DebugMemoryType.PrgRom,

View file

@ -43,7 +43,6 @@
this.chkTextSearch = new System.Windows.Forms.CheckBox();
this.chkMatchCase = new System.Windows.Forms.CheckBox();
this.ctrlHexBox = new Be.Windows.Forms.HexBox();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.statusStrip = new System.Windows.Forms.StatusStrip();
this.lblLocation = new System.Windows.Forms.ToolStripStatusLabel();
this.ctxMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
@ -495,7 +494,6 @@
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private System.Windows.Forms.Label lblNumberOfColumns;
private System.Windows.Forms.ComboBox cboNumberColumns;
private System.Windows.Forms.ToolTip toolTip;
private Be.Windows.Forms.HexBox ctrlHexBox;
private System.Windows.Forms.Panel panelSearch;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;

View file

@ -118,8 +118,6 @@ namespace Mesen.GUI.Debugger.Controls
float pixelsPerByte = (float)rect.Width / totalSize;
StringFormat verticalFormat = new StringFormat(StringFormatFlags.DirectionVertical);
float currentPosition = 1;
int byteOffset = 0;
foreach(MemoryRegionInfo region in _regions) {

View file

@ -422,7 +422,6 @@ namespace Mesen.GUI.Debugger.Controls
class ScrollbarColorProvider : IScrollbarColorProvider
{
private Color _nesRamColor = Color.FromArgb(163, 222, 171);
private Dictionary<int, Color> _breakpointColors = new Dictionary<int, Color>();
private ctrlSourceViewer _viewer;

View file

@ -260,8 +260,6 @@ namespace Mesen.GUI.Debugger.Controls
_selectedSprite = -1;
for(int i = 0x100 - 4; i >= 0; i-=4) {
int spriteY = _spriteRam[i];
int tileIndex = _spriteRam[i + 1];
int attributes = _spriteRam[i + 2];
int spriteX = _spriteRam[i + 3];
if(xPos >= spriteX && xPos < spriteX + 8 && yPos >= spriteY && yPos < spriteY + (_largeSprites ? 16 : 8)) {

View file

@ -58,7 +58,6 @@ namespace Mesen.GUI.Debugger
private string[] _contentNotes = new string[0];
private string[] _compareContents = null;
private int[] _lineNumbers = new int[0];
private int[] _lineMargins = new int[0];
private string[] _lineNumberNotes = new string[0];
private Dictionary<int, int> _lineNumberIndex = new Dictionary<int,int>();
private bool _showLineNumbers = false;
@ -889,7 +888,6 @@ namespace Mesen.GUI.Debugger
codeString = "--------" + codeString.Substring(2, codeString.Length - 4) + "--------";
}
string commentString = Comments?[i].Trim() ?? "";
int padding = Math.Max(CommentSpacingCharCount, codeString.Length);
if(codeString.Length == 0) {
padding = 0;

View file

@ -4831,7 +4831,6 @@ namespace FastColoredTextBoxNS
e.Graphics.FillRectangle(paddingBrush, LeftIndent - HorizontalScroll.Value - 2, 0,
Math.Max(0, Paddings.Left - 1), ClientSize.Height);
//
int leftTextIndent = Math.Max(LeftIndent, LeftIndent + Paddings.Left - HorizontalScroll.Value);
int textWidth = textAreaRect.Width;
//draw indent area
e.Graphics.FillRectangle(indentBrush, 0, 0, LeftIndentLine, ClientSize.Height);
@ -5083,7 +5082,6 @@ namespace FastColoredTextBoxNS
var state = graphics.Save();
graphics.SmoothingMode = SmoothingMode.HighQuality;
graphics.TranslateTransform(rect.Left + h/2, rect.Top + h/2);
var ts = new TimeSpan(DateTime.Now.Ticks);
graphics.RotateTransform(180 * (DateTime.Now.Millisecond/1000f));
using (var pen = new Pen(Color.Red, 2))
{
@ -6770,7 +6768,6 @@ namespace FastColoredTextBoxNS
/// </summary>
public virtual void InsertLinePrefix(string prefix)
{
Range old = Selection.Clone();
int from = Math.Min(Selection.Start.iLine, Selection.End.iLine);
int to = Math.Max(Selection.Start.iLine, Selection.End.iLine);
BeginUpdate();
@ -6798,7 +6795,6 @@ namespace FastColoredTextBoxNS
/// </summary>
public virtual void RemoveLinePrefix(string prefix)
{
Range old = Selection.Clone();
int from = Math.Min(Selection.Start.iLine, Selection.End.iLine);
int to = Math.Max(Selection.Start.iLine, Selection.End.iLine);
BeginUpdate();

View file

@ -54,7 +54,6 @@ namespace FastColoredTextBoxNS
private void UnloadUnusedLines()
{
const int margin = 2000;
var iStartVisibleLine = CurrentTB.VisibleRange.Start.iLine;
var iFinishVisibleLine = CurrentTB.VisibleRange.End.iLine;
int count = 0;

View file

@ -30,13 +30,11 @@ namespace FastColoredTextBoxNS
class FCTBTypeDescriptor : CustomTypeDescriptor
{
ICustomTypeDescriptor parent;
object instance;
public FCTBTypeDescriptor(ICustomTypeDescriptor parent, object instance)
: base(parent)
{
this.parent = parent;
this.instance = instance;
}

View file

@ -1885,7 +1885,6 @@ namespace Be.Windows.Forms
float x = ((float)(p.X - _recHex.X) / _charSize.Width);
float y = ((float)(p.Y - _recHex.Y) / _charSize.Height);
int iX = (int)x;
int iY = (int)y;
//Offset by half a character to make the selection more intuitive (e.g half the white space belongs to the left byte, the other to the right)
@ -2554,9 +2553,6 @@ namespace Be.Windows.Forms
int counter = -1;
long intern_endByte = Math.Min(_byteProvider.Length - 1, endByte + _iHexMaxHBytes);
bool isKeyInterpreterActive = _keyInterpreter == null || _keyInterpreter.GetType() == typeof(KeyInterpreter);
bool isStringKeyInterpreterActive = _keyInterpreter != null && _keyInterpreter.GetType() == typeof(StringKeyInterpreter);
int yPrevious = -1;
float xOffset = 0;
Color defaultForeColor = this.ForeColor;

View file

@ -40,7 +40,6 @@ namespace Mesen.GUI.Debugger
if(data[0].Length % 2 == 0 && Regex.IsMatch(data[0], "[0-9A-Fa-f]+")) {
TblKey key = new TblKey();
List<byte> bytes = new List<byte>();
for(int j = 0; j < data[0].Length; j+=2) {
byte result = byte.Parse(data[0].Substring(j, 2), System.Globalization.NumberStyles.HexNumber);
key.Key |= (UInt64)result << (8 * j / 2);

View file

@ -393,7 +393,7 @@ namespace Mesen.GUI.Debugger
private void UpdateWorkspace()
{
DebugWorkspaceManager.SaveWorkspace();
DebugWorkspace workspace = DebugWorkspaceManager.GetWorkspace();
DebugWorkspaceManager.GetWorkspace();
ctrlLabelList.UpdateLabelList();
ctrlFunctionList.UpdateFunctionList(true);

View file

@ -16,14 +16,12 @@ namespace Mesen.GUI.Debugger
{
private DateTime _lastUpdate = DateTime.MinValue;
private InteropEmu.NotificationListener _notifListener;
private TabPage _selectedTab;
private bool _refreshing = false;
public frmEventViewer()
{
InitializeComponent();
this._selectedTab = this.tpgPpuView;
this.mnuRefreshOnBreak.Checked = ConfigManager.Config.DebugInfo.EventViewerRefreshOnBreak;
this.chkShowPpuRegisterWrites.Checked = ConfigManager.Config.DebugInfo.EventViewerShowPpuRegisterWrites;
this.chkShowPpuRegisterReads.Checked = ConfigManager.Config.DebugInfo.EventViewerShowPpuRegisterReads;
@ -105,7 +103,6 @@ namespace Mesen.GUI.Debugger
private void tabMain_SelectedIndexChanged(object sender, EventArgs e)
{
this._selectedTab = this.tabMain.SelectedTab;
}
private void mnuRefreshOnBreak_Click(object sender, EventArgs e)

View file

@ -306,7 +306,6 @@ namespace Mesen.GUI.Debugger
List<int> indent = new List<int>(30000);
bool showByteCode = false;
char[] splitter = new char[] { ' ' };
while(readLine()) {
string[] parts = line.Split('\x1');
programCounter.Add(Int32.Parse(parts[0], System.Globalization.NumberStyles.HexNumber));

View file

@ -95,7 +95,6 @@ namespace Mesen.GUI.Forms.Cheats
if(string.IsNullOrWhiteSpace(_previousSearch)) {
lstGames.Items.AddRange(_gamesByCrc.Values.ToArray());
} else {
List<string> gamesToAdd = new List<string>();
lstGames.Items.AddRange(_gamesByCrc.Where(c => c.Value.Name.IndexOf(_previousSearch, StringComparison.InvariantCultureIgnoreCase) >= 0).Select(c => c.Value).ToArray());
}
}

View file

@ -124,7 +124,6 @@ namespace Mesen.GUI.Forms.Config
cboPlayer4.SelectedIndexChanged -= cboPlayerController_SelectedIndexChanged;
bool isNes = ((InputInfo)Entity).ConsoleType == ConsoleType.Nes;
bool p3and4visible = (isNes && chkFourScore.Checked) || (!isNes && ((InputInfo)Entity).ExpansionPortDevice == InteropEmu.ExpansionPortDevice.FourPlayerAdapter);
bool isOriginalFamicom = !isNes && !ConfigManager.Config.EmulationInfo.UseNes101Hvc101Behavior;
List<InteropEmu.ControllerType> controllerTypes = new List<InteropEmu.ControllerType>() { InteropEmu.ControllerType.None, InteropEmu.ControllerType.StandardController };

View file

@ -138,7 +138,6 @@ namespace Mesen.GUI.Forms.Config
protected override bool ValidateInput()
{
VideoFilterType orgFilter = ((VideoInfo)Entity).VideoFilter;
UpdateObject();
UpdateCustomRatioVisibility();
UpdatePalette();

View file

@ -18,8 +18,6 @@ namespace Mesen.GUI.Forms
{
public partial class frmConfigWizard : Form
{
private PrivateFontCollection _fonts = new PrivateFontCollection();
public frmConfigWizard()
{
InitializeComponent();

View file

@ -128,7 +128,7 @@ namespace Mesen.GUI.Forms
string filename = ofd.FileName;
Task.Run(() => {
int result = InteropEmu.RunAutomaticTest(filename);
InteropEmu.RunAutomaticTest(filename);
});
}
}

View file

@ -48,7 +48,6 @@ namespace Mesen.GUI.Forms
private object _loadRomLock = new object();
private int _romLoadCounter = 0;
private bool _showUpgradeMessage = false;
private float _xFactor = 1;
private float _yFactor = 1;
private bool _enableResize = false;
private bool _overrideWindowSize = false;
@ -345,7 +344,6 @@ namespace Mesen.GUI.Forms
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
{
_xFactor = factor.Width;
_yFactor = factor.Height;
base.ScaleControl(factor, specified);
}

View file

@ -82,7 +82,6 @@ namespace Mesen.GUI.GoogleDriveIntegration
private static bool UploadData()
{
using(MemoryStream stream = CloudSyncHelper.GetDataStream()) {
var gdAccessor = new GoogleDriveAccessor();
return _accessor.UploadFile(stream, "MesenData.zip");
}
}

View file

@ -24,7 +24,6 @@ namespace Mesen.GUI.GoogleDriveIntegration
{
private const string _contentType = @"application/zip";
private readonly string[] _scopes = new[] { DriveService.Scope.DriveAppdata };
private File _driveFile = null;
private UserCredential _credentials = null;
private DriveService _service = null;
private bool _connected = false;
@ -184,10 +183,8 @@ namespace Mesen.GUI.GoogleDriveIntegration
var request = _service.Files.Get(driveFile.Id);
var progress = await request.DownloadAsync(outStream).ConfigureAwait(false);
if(progress.Status == DownloadStatus.Completed) {
_driveFile = driveFile;
return FileDownloadResult.OK;
} else {
_driveFile = null;
return FileDownloadResult.Error;
}
}
@ -203,7 +200,6 @@ namespace Mesen.GUI.GoogleDriveIntegration
void Upload_ResponseReceived(File file)
{
_driveFile = file;
}
void IDisposable.Dispose()

View file

@ -64,8 +64,8 @@ namespace Mesen.GUI
try {
Task.Run(() => {
//Cache deserializers in another thread
XmlSerializer xmlSerializer = new XmlSerializer(typeof(Configuration));
xmlSerializer = new XmlSerializer(typeof(DebugWorkspace));
new XmlSerializer(typeof(Configuration));
new XmlSerializer(typeof(DebugWorkspace));
});
if(Type.GetType("Mono.Runtime") != null) {