Page MenuHomeFreeBSD

sound: Change PCMDIR_* numbering
ClosedPublic

Authored by christos on Oct 19 2024, 5:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 5, 9:38 AM
Unknown Object (File)
Wed, Dec 4, 3:35 PM
Unknown Object (File)
Wed, Dec 4, 5:29 AM
Unknown Object (File)
Sun, Dec 1, 8:17 PM
Unknown Object (File)
Tue, Nov 19, 6:37 PM
Unknown Object (File)
Fri, Nov 15, 9:31 AM
Unknown Object (File)
Thu, Nov 14, 8:26 PM
Unknown Object (File)
Nov 7 2024, 3:38 AM
Subscribers

Details

Summary

Needed by a follow-up patch, so that channels can be sorted properly.
This change does not affect the behavior of any subsystem.

Sponsored by: The FreeBSD Foundation
MFC after: 2 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Could this be turned into an enum, to facilitate compiler checks in switch() statements? Or is there a policy on using enums in src? I see them far less often than I would expect.

Could this be turned into an enum, to facilitate compiler checks in switch() statements? Or is there a policy on using enums in src? I see them far less often than I would expect.

My plan was to convert more examples like this to enums in a follow up patch, but I've got no objection at all to making it an enum here.

sys/dev/sound/pcm/channel.h
339

I would consider giving this one a non-zero value, so that invalid values that arise from zero-initialization are more obvious.

christos marked an inline comment as done.

Start from 1.

Seems ok to me.

An anonymous enum type isn't terribly useful, you'd need to start defining variables using the new enum type in order to get checking in switch statements and so on. But, it doesn't hurt either.

This revision is now accepted and ready to land.Oct 21 2024, 8:55 PM
This revision was automatically updated to reflect the committed changes.