Powertoys: Fix compiler warnings

Created on 8 Mar 2020  路  26Comments  路  Source: microsoft/PowerToys

Compiler warning should be fixed.

Area-Quality Priority-3 Resolution-Fix-Committed

All 26 comments

More to fix

image

@ivan100sic the __int64 to long are in your code, right?

Yes, those are mine. Do you want me to fix all of them (including those which are not mine)?

If you can/want, sure.

@ivan100sic, if you're working on this, can you assign it to yourself and put "in progress"?

Let's keep this open since there are other warnings we still have to fix it.

this is to keep us in a healthy state. If we need to move to 0.17, lets do it

@yuyoyuppe

image

when we fix them, it'd be nice to have an issue tracking TreatWarningsAsErrors setting for all projects.

Only one left:

image

it would be also nice to make sure that editandcontinue is enabled in Debug 馃檪

new ones:

1>GridZone.xaml.cs(156,1,156,13): warning SA1137: Elements should have the same indentation
1>Models\Settings.cs(340,36,340,37): warning SA1106: Code should not contain empty statements

Current warnings:

image

new ones:

3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\OpenWindows.cs(25,47,25,66): warning CS0067: The event 'OpenWindows.OnOpenWindowsUpdate' is never used
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\OpenWindows.cs(25,47,25,66): warning CS0067: The event 'OpenWindows.OnOpenWindowsUpdate' is never used
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(636,26,636,37): warning SA1310: Field 'GWL_EXSTYLE' should not contain an underscore
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(630,13,630,32): warning SA1413: Use trailing comma in multi-line initializers
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(766,13,766,41): warning SA1413: Use trailing comma in multi-line initializers
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(642,44,642,50): warning SA1121: Use built-in type alias
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\Window.cs(248,24,248,94): warning SA1119: Statement should not use unnecessary parenthesis
3>PowerToys\src\modules\windowwalker\app\Window Walker\ViewModels\WindowWalkerViewModel.cs(21,13,21,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(665,35,665,36): warning SA1028: Code should not contain trailing whitespace
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(718,114,718,115): warning SA1028: Code should not contain trailing whitespace
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(756,105,756,106): warning SA1028: Code should not contain trailing whitespace
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(606,13,606,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(610,13,610,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(614,13,614,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(618,13,618,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(622,13,622,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(627,13,627,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(649,13,649,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(654,13,654,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(659,13,659,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(663,13,663,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(668,13,668,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(672,13,672,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(678,13,678,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(682,13,682,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(686,13,686,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(690,13,690,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(695,13,695,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(699,13,699,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(704,13,704,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(708,13,708,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(713,13,713,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(717,13,717,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(723,13,723,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(728,13,728,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(732,13,732,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(736,13,736,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(740,13,740,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(745,13,745,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(749,13,749,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(754,13,754,15): warning SA1515: Single-line comment should be preceded by blank line
3>PowerToys\src\modules\windowwalker\app\Window Walker\Components\InteropAndHelpers.cs(761,13,761,15): warning SA1515: Single-line comment should be preceded by blank line

@betsegaw
I've assigned the issue to you for the Window Walker warnings.
Thanks.

@betsegaw, if you want, i can handle these, they should be pretty easy. if you haven't started yet

Thanks @crutkas! I haven't started yet so please be my guest!

I fixed the WW ones, PowerRename has one i'm unsure what to do about.

Severity    Code    Description Project File    Line    Suppression State
Warning LNK4075 ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification  PowerRenameUnitTests    C:\Users\crutkas\Source\Repos\PtMain\src\modules\powerrename\unittests\MockPowerRenameItem.obj  1   

@crutkas I'll take care of it.

another one:

Warning CS0067  The event 'OpenWindows.OnOpenWindowsUpdate' is never used Window Walker 
PowerToys\src\modules\windowwalker\app\Window Walker\Components\OpenWindows.cs  24  N/A

@yuyoyuppe That is actually used. unsure why it throws

yes, I've tried deleting it and got a compile error. perhaps we could use #pragma warning disable for it?

yes, I've tried deleting it and got a compile error. perhaps we could use #pragma warning disable for it?

Yup

New warning:
src\common\monitors.cpp(43,1): Warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data

@ivan100sic
thanks, assigned to @PrzemyslawTusinski .

image

Was this page helpful?
0 / 5 - 0 ratings