Re: Dscanner: intentionally unused variable

2018-01-07 Thread Ivan Trombley via Digitalmars-d
On Sunday, 7 January 2018 at 17:02:02 UTC, visitor wrote: It seems a simple underscore "_" as a variable name tells Dscanner exactly that. Any number of underscores but underscores only apparently. That works too. Thanks.

Re: Dscanner: intentionally unused variable

2018-01-07 Thread visitor via Digitalmars-d
On Sunday, 7 January 2018 at 16:29:42 UTC, visitor wrote: On Sunday, 7 January 2018 at 16:14:11 UTC, Jacob Carlborg wrote: On 2018-01-07 01:18, Ivan Trombley wrote: Is there a way tell dscanner that a variable is intentionally unused? I don't know about D-Scanner but I know that other

Re: Dscanner: intentionally unused variable

2018-01-07 Thread visitor via Digitalmars-d
On Sunday, 7 January 2018 at 16:14:11 UTC, Jacob Carlborg wrote: On 2018-01-07 01:18, Ivan Trombley wrote: Is there a way tell dscanner that a variable is intentionally unused? I don't know about D-Scanner but I know that other similar tools allow you to prefix the name of a variable with

Re: Dscanner: intentionally unused variable

2018-01-07 Thread Jacob Carlborg via Digitalmars-d
On 2018-01-07 01:18, Ivan Trombley wrote: While working with SDL, I found that I kept using the same pattern over and over: - Get the current clip rectangle. - Set a new clip rectangle. - restore the old clip rectangle on scope (exit). Instead of writing that code again and again, I wrote a

Re: Dscanner: intentionally unused variable

2018-01-07 Thread Ivan Trombley via Digitalmars-d
On Sunday, 7 January 2018 at 03:41:18 UTC, SimonN wrote: Another way would be to have the RAII wrapper in a with statement, but it produces extra indentation, which you might not like: with (MyStruct(100, 200)) { // code that uses the new clip rectangle } -- Simon This

Re: Dscanner: intentionally unused variable

2018-01-07 Thread Ivan Trombley via Digitalmars-d
On Sunday, 7 January 2018 at 08:46:40 UTC, Basile B. wrote: More simple is to understand D-Scanner limitations and accept that warnings are only warnings and that a message doesn't necessarily mean that there's something to do. If the output is clogged with warnings then it's more difficult

Re: Dscanner: intentionally unused variable

2018-01-07 Thread Basile B. via Digitalmars-d
On Sunday, 7 January 2018 at 00:18:27 UTC, Ivan Trombley wrote: While working with SDL, I found that I kept using the same pattern over and over: - Get the current clip rectangle. - Set a new clip rectangle. - restore the old clip rectangle on scope (exit). Instead of writing that code again

Re: Dscanner: intentionally unused variable

2018-01-07 Thread Basile B. via Digitalmars-d
On Sunday, 7 January 2018 at 00:22:15 UTC, H. S. Teoh wrote: On Sun, Jan 07, 2018 at 12:18:27AM +, Ivan Trombley via Digitalmars-d wrote: While working with SDL, I found that I kept using the same pattern over and over: - Get the current clip rectangle. - Set a new clip rectangle. -

Re: Dscanner: intentionally unused variable

2018-01-06 Thread SimonN via Digitalmars-d
On Sunday, 7 January 2018 at 00:18:27 UTC, Ivan Trombley wrote: While working with SDL, I found that I kept using the same pattern over and over: - Get the current clip rectangle. - Set a new clip rectangle. - restore the old clip rectangle on scope (exit). Instead of writing that code again

Re: Dscanner: intentionally unused variable

2018-01-06 Thread H. S. Teoh via Digitalmars-d
On Sun, Jan 07, 2018 at 12:18:27AM +, Ivan Trombley via Digitalmars-d wrote: > While working with SDL, I found that I kept using the same pattern over and > over: > - Get the current clip rectangle. > - Set a new clip rectangle. > - restore the old clip rectangle on scope (exit). > > Instead

Dscanner: intentionally unused variable

2018-01-06 Thread Ivan Trombley via Digitalmars-d
While working with SDL, I found that I kept using the same pattern over and over: - Get the current clip rectangle. - Set a new clip rectangle. - restore the old clip rectangle on scope (exit). Instead of writing that code again and again, I wrote a simple function that returns a struct which