Skip to content

Improve CLI --entryslot #17874

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

Merged
merged 1 commit into from
May 7, 2025
Merged

Improve CLI --entryslot #17874

merged 1 commit into from
May 7, 2025

Conversation

pstef
Copy link
Contributor

@pstef pstef commented May 6, 2025

Description

For the change introduced in 4cdcaa2 to make sense, the called strto function should be the variant that returns a signed type and that returned value should not be cast to unsigned.

Reviewers

@sonninnos

@sonninnos
Copy link
Collaborator

sonninnos commented May 6, 2025

It was never the intention to allow loading the auto state slot with -e -1, as the very next row shows.

@pstef pstef marked this pull request as draft May 6, 2025 18:57
@pstef pstef force-pushed the cli-entryslot branch from ba62435 to 5d0d680 Compare May 7, 2025 18:04
@pstef
Copy link
Contributor Author

pstef commented May 7, 2025

$ ./retroarch -e abc 2>&1 | fgrep entryslot
[WARN] [State]: --entryslot argument "abc" is not a valid entry state slot index. Ignoring.
$ ./retroarch -e -1 2>&1 | fgrep entryslot
[WARN] [State]: --entryslot argument "-1" is not a valid entry state slot index. Ignoring.
$ ./retroarch -e 0 2>&1 | fgrep entryslot
$ ./retroarch -e 1 2>&1 | fgrep entryslot
$ ./retroarch -e 999 2>&1 | fgrep entryslot
$ ./retroarch -e 1000 2>&1 | fgrep entryslot
[WARN] [State]: --entryslot argument "1000" is not a valid entry state slot index. Ignoring.
$ ./retroarch -e 1a 2>&1 | fgrep entryslot
[WARN] [State]: --entryslot argument "1a" is not a valid entry state slot index. Ignoring.

Accepted values are 0 to 999. Rewrite this part to use strtol and test
for values in that range.
@pstef pstef force-pushed the cli-entryslot branch from 5d0d680 to 740fdfe Compare May 7, 2025 18:06
@pstef pstef marked this pull request as ready for review May 7, 2025 18:07
@sonninnos sonninnos merged commit d3cf9aa into libretro:master May 7, 2025
31 checks passed
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