Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dont rollover in layersurface #7451

Merged
merged 1 commit into from
Aug 21, 2024
Merged

dont rollover in layersurface #7451

merged 1 commit into from
Aug 21, 2024

Conversation

gulafaran
Copy link
Contributor

@gulafaran gulafaran commented Aug 21, 2024

dont rollover in layersurface when assigning leader, a bit unnecessery.

unneded rollover on size_t if force equals -1
src/helpers/WLClasses.hpp Outdated Show resolved Hide resolved
src/helpers/WLClasses.hpp Outdated Show resolved Hide resolved
src/helpers/Format.hpp Outdated Show resolved Hide resolved
src/helpers/MiscFunctions.hpp Outdated Show resolved Hide resolved
src/helpers/Monitor.hpp Outdated Show resolved Hide resolved
src/helpers/WLClasses.hpp Outdated Show resolved Hide resolved
@gulafaran
Copy link
Contributor Author

gulafaran commented Aug 21, 2024

well its only default depending how these structs are being used or initialized.

struct Something
{
    int x;       // no default initialization value (bad)
    int y {};    // value-initialized by default
    int z { 2 }; // explicit default value
};

int main()
{
    Something s1;             // No initializer list: s1.x is uninitialized, s1.y and s1.z use defaults
    Something s2 { 5, 6, 7 }; // Explicit initializers: s2.x, s2.y, and s2.z use explicit values (no default values are used)
    Something s3 {};          // Missing initializers: s3.x is value initialized, s3.y and s3.z use defaults

    return 0;
}

and these structs are being used a bit all over the place with different types of initializing. hence why gcc warns about it

EDIT:

But when you turn on -Wmissing-field-initializers or -Wextra which includes -Wmissing-field-initializers, you get a compiler warning which hopefully is treated as an error. In this case, what the compiler just found is only about readability and therefore maintainability.

im just dropping the commits.

@gulafaran gulafaran changed the title enable pointer-arith and missing field initalizer warnings dont rollover in layersurface Aug 21, 2024
@vaxerski vaxerski merged commit cae937c into hyprwm:main Aug 21, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants