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

add sndio(7) support which is the only supported mixer backend on OpenBSD #470

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

rnagy
Copy link
Contributor

@rnagy rnagy commented Dec 6, 2021

This pull request adds sndio support to i3status. This is the only supported mixer backend
on OpenBSD so let's disable everything else.

@rnagy
Copy link
Contributor Author

rnagy commented Dec 15, 2021

@stapelberg

@@ -50,6 +50,10 @@ if get_option('pulseaudio')
cdata.set('HAS_PULSEAUDIO', 1)
endif

if get_option('sndio')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of making this feature optional, can you make it non-optional on OpenBSD please?

src/sndio.c Outdated
static void ondesc(void *unused, struct sioctl_desc *d, int val) {
struct control *i, **pi;

if (d == NULL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and elsewhere, please add braces:

if (d == NULL) {
  return;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

#include "i3status.h"

struct control {
struct control *next;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to use the include/queue.h macros for this list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't see the reason why for such simple code, but doable if you insist

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s not really about complexity, but rather uniformity and code re-use. No need to have multiple linked list implementations within the same project… :)

src/sndio.c Outdated
static void onval(void *unused, unsigned int addr, unsigned int value) {
struct control *c;

for (c = controls;; c = c->next) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not for (c = controls; c != NULL; c = c->next) instead of the explicit if (c == NULL) { return } below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

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