Skip to content
Snippets Groups Projects

configure: Enable -Wshadow.

Merged Elizabeth Figura requested to merge zfigura/vkd3d:mr2 into master
2 unresolved threads

This may be a matter of taste. I personally prefer to give variables a restricted scope, as I find this aids clarity, and -Wshadow can help prevent mistakes from this.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
20090 20090 check_copyable_footprints(&resource_desc, 0, sub_resource_count, base_offsets[k],
20091 20091 NULL, NULL, NULL, &total_size);
20092 20092
20093 for (l = 0; l < sub_resource_count; ++l)
20093 for (unsigned int l = 0; l < sub_resource_count; ++l)
  • I always thought we don't like to declare variables in the for header, and while I don't necessarily agree with that rule I think that there is some rule in keeping things consistent.

    I like the MR overall.

  • Please register or sign in to reply
    • Author Developer

      I always thought we don't like to declare variables in the for header, and while I don't necessarily agree with that rule I think that there is some rule in keeping things consistent.

      I think it was only ever forbidden because compilers choked on it, but I think compilers only ever choked on it because we had bugs in Wine preventing -std=c99 from working correctly, which have since been fixed.

      I personally prefer it, myself, and in general I prefer limiting variable scopes to the blocks where they're used. I believe Henri tends to have an opposite preference, but so far I don't think he's rejected patches on those grounds.

    • Ok, I wasn't aware of that. Well, I like restricting the scope of variables as much as possible too, and actually I prefer to declare variables in code, so that the typing information is as close as possible to the usage point. I was just puzzled by what came to me as a change.

    • Please register or sign in to reply
  • Giovanni Mascellani approved this merge request

    approved this merge request

  • I personally prefer it, myself, and in general I prefer limiting variable scopes to the blocks where they're used. I believe Henri tends to have an opposite preference, but so far I don't think he's rejected patches on those grounds.

    I'm not sure I'd call it the opposite, but I do like to keep declarations together instead of spreading them around, yes. I also tend to think that for reasonably sized functions it doesn't make much of a difference though...

  • Henri Verbeet approved this merge request

    approved this merge request

  • Alexandre Julliard approved this merge request

    approved this merge request

  • Please register or sign in to reply
    Loading