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 missing enum value. #64

Closed
wants to merge 1 commit into from
Closed

Add missing enum value. #64

wants to merge 1 commit into from

Conversation

madpilot78
Copy link
Contributor

New versions of the clang compiler have strict checks for enum values.

The value "-1" is returned as a last resort from to_vfs_seek_type() as a VFSSeekType.

I added the value with a name that makes sense for such usage.

For context:

This is necessary to make audacious compile on latest FreeBSD head (future FreeBSD 14.0) which includes clang version 16.

I already added thsi as a local patch to the FreeBSD ports tree: freebsd/freebsd-ports@72610ec

@radioactiveman
Copy link
Member

@jlindgren90: How would you name the enum value?

  • VFS_SEEK_UNK
  • VFS_SEEK_INV
  • VFS_SEEK_UNKNOWN
  • VFS_SEEK_INVALID

@madpilot78: I think we should use this new enum value instead of -1 in to_vfs_seek_type().

@madpilot78
Copy link
Contributor Author

@jlindgren90: How would you name the enum value?

* `VFS_SEEK_UNK`

* `VFS_SEEK_INV`

* `VFS_SEEK_UNKNOWN`

* `VFS_SEEK_INVALID`

@madpilot78: I think we should use this new enum value instead of -1 in to_vfs_seek_type().

You're definitely right.

I'll wait for a decision on what it should be called and then update the review accordingly.

@jlindgren90
Copy link
Member

I vote for VFS_SEEK_INVALID.

@madpilot78
Copy link
Contributor Author

Updated according to suggestions.

src/libaudcore/vfs.h Outdated Show resolved Hide resolved
New versions of the clang compiler have strict checks for enum values.

The value "-1" is returned as a last resort from to_vfs_seek_type() as a VFSSeekType.

Replace usage of `-1` with the new enum name.
@jlindgren90
Copy link
Member

Merged with slight changes. Thanks!

@madpilot78 madpilot78 deleted the clang_16_fix branch June 30, 2023 16:02
x7upLime pushed a commit to x7upLime/gentoo that referenced this pull request Jul 20, 2023
backported from:
audacious-media-player/audacious#64

Closes: https://bugs.gentoo.org/896412
Signed-off-by: x7upLime <andrew@andrewdomain.com>
x7upLime pushed a commit to x7upLime/gentoo that referenced this pull request Jul 21, 2023
backported from:
audacious-media-player/audacious#64

Closes: https://bugs.gentoo.org/896412
Signed-off-by: Andrei Corduneanu <andrew@andrewdomain.com>
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Jul 22, 2023
backported from:
audacious-media-player/audacious#64

Closes: https://bugs.gentoo.org/896412
Signed-off-by: Andrei Corduneanu <andrew@andrewdomain.com>
Closes: #31980
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
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.

None yet

3 participants