Page MenuHomeFreeBSD

sound: Change PCMDIR_* numbering
ClosedPublic

Authored by christos on Sat, Oct 19, 5:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 5:53 PM
Unknown Object (File)
Wed, Oct 30, 8:36 AM
Unknown Object (File)
Thu, Oct 24, 11:38 AM
Unknown Object (File)
Wed, Oct 23, 8:31 AM
Unknown Object (File)
Tue, Oct 22, 2:58 PM
Unknown Object (File)
Tue, Oct 22, 1:00 PM
Unknown Object (File)
Mon, Oct 21, 11:04 PM
Unknown Object (File)
Sun, Oct 20, 3:25 PM
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.Mon, Oct 21, 8:55 PM
This revision was automatically updated to reflect the committed changes.