I don't think hardcoded sizes like that are better, because you'll always need to double check with actual string.
On Tue, Feb 5, 2019 at 1:26 PM Nikolay Sivov nsivov@codeweavers.com wrote:
I don't think hardcoded sizes like that are better, because you'll always need to double check with actual string.
What is there to double check, though? It seems to be fairly straight
forward.
On 2/5/19 9:02 AM, Isira Seneviratne wrote:
On Tue, Feb 5, 2019 at 1:26 PM Nikolay Sivov <nsivov@codeweavers.com mailto:nsivov@codeweavers.com> wrote:
I don't think hardcoded sizes like that are better, because you'll always need to double check with actual string.
What is there to double check, though? It seems to be fairly straight forward.
Magic constants are bad, one has to follow the code flow to figure it out. Afair we even had a janitorial task to remove magic constants.
If you still want to get rid of the strlen do it like Alex Henri did and use: ARRAY_SIZE(wstr) - 1.
bye michael
Michael Stefaniuc mstefani@winehq.org writes:
On 2/5/19 9:02 AM, Isira Seneviratne wrote:
On Tue, Feb 5, 2019 at 1:26 PM Nikolay Sivov <nsivov@codeweavers.com mailto:nsivov@codeweavers.com> wrote:
I don't think hardcoded sizes like that are better, because you'll always need to double check with actual string.
What is there to double check, though? It seems to be fairly straight forward.
Magic constants are bad, one has to follow the code flow to figure it out. Afair we even had a janitorial task to remove magic constants.
If you still want to get rid of the strlen do it like Alex Henri did and use: ARRAY_SIZE(wstr) - 1.
Frankly, keeping strlen() is fine. At least it's not worth doing a large scale search & replace job for this (much to your dismay I'm sure...)
On Tue, Feb 5, 2019 at 11:56 PM Alexandre Julliard julliard@winehq.org wrote:
Michael Stefaniuc mstefani@winehq.org writes:
On 2/5/19 9:02 AM, Isira Seneviratne wrote:
On Tue, Feb 5, 2019 at 1:26 PM Nikolay Sivov <nsivov@codeweavers.com mailto:nsivov@codeweavers.com> wrote:
I don't think hardcoded sizes like that are better, because you'll always need to double check with actual string.
What is there to double check, though? It seems to be fairly straight forward.
Magic constants are bad, one has to follow the code flow to figure it out. Afair we even had a janitorial task to remove magic constants.
If you still want to get rid of the strlen do it like Alex Henri did and use: ARRAY_SIZE(wstr) - 1.
Frankly, keeping strlen() is fine. At least it's not worth doing a large scale search & replace job for this (much to your dismay I'm sure...)
Oh, okay. Thank you for the information. It's not a big deal for me :)
-- Alexandre Julliard julliard@winehq.org