Skip to content

Revamp#1

Open
tricantivu wants to merge 7 commits intoHendrikto:masterfrom
tricantivu:master
Open

Revamp#1
tricantivu wants to merge 7 commits intoHendrikto:masterfrom
tricantivu:master

Conversation

@tricantivu
Copy link

@tricantivu tricantivu commented Jul 5, 2023

Previously (i.e commit 9a79e0d),
backlight_control would not validate the value argument and set unexpected brightness values.

For example:

backlight_control -100

Sets the current brigthness to 0.

Although Linux ensures the value set in /sys/class/backlight/<backlight>/brightness is between 0 and max_brightness, I think it would be nice to notify the user of invalid arguments.

Thanks for reading and I am open to feedback.

@Hendrikto
Copy link
Owner

Hi Alejandro,

Thanks for your interest and contribution :)

I agree with the technical changes (like ab68af5), but I don't want to change the coding style (e.g. 2b2725d). Are you fine with cherry-picking just some of the commits from your branch?

Best,
Hendrik

@tricantivu
Copy link
Author

tricantivu commented Jul 6, 2023

I am fine with that @Hendrikto

Edit 1:

What do you think about replacing the conditional expression ((value < 0 ? value *= -1 : value)) for labs function from stdlib header?

if (labs(value) >= 1 && labs(value) <= 100)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants