Soaprman / FEFTwiddler

A save editor for Fire Emblem Fates
GNU General Public License v3.0
55 stars 17 forks source link

Fixed various variable warnings given by Visual Studio #20

Closed favna closed 8 years ago

favna commented 8 years ago

Title pretty much says it all. I was about to build it from source when Visual Studio gave some warnings about variables. The biggest change is still that I moved byte[] chunck from being declared every single method to a public class property so it is only declared once then referenced each time with each method.

I have somewhat tested this but not thoroughly - especially not with the unittests (i assume that's what is inside FEFTwiddlerTest).

To give some feedback on the change in Form1.cs: Using a Try Catch in which the Catch never prints anything anywhere is a waste of said Catch, albeit it being mandatory for TryCatch. Ideally ArgumentOutOfRangeException e would be converted to some form of to the end user sensible text and put into a popup box, but since that is beyond the scope of what is really necessary for a save editor like this I have now simply set it to write the error to the Console in case the programmer (you) is running a debug build.

Soaprman commented 8 years ago

You might wanna get latest and redo your change. I kinda just refactored Form1 into oblivion.

Soaprman commented 8 years ago

And yeah, exception handling as a whole is something I've mostly neglected.

Soaprman commented 8 years ago

Just looked at your changes.

That "var breakpoint = true;" in BaseDatabase.cs is fine as it is. That code shouldn't be called and is just something I keep around for fast XML editing if I need to fast XML edit.

I actually kind of want to keep chunk in function scope as well, since it has absolutely no meaning outside that scope. There are probably some declarations that can be dropped, though, yeah.

favna commented 8 years ago

You might wanna get latest and redo your change. I kinda just refactored Form1 into oblivion.

I did have the latest version at the time of checking :\ I use SoruceTree to fetch and pull and pulled just before making the changes xD

To put it exactly, I based the changes on commit 19c04950a720674ac7cf4bf305eb21932397b131