Skip to content

Store StrlenDevFd in n #1056

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
Jan 5, 2024
Merged

Store StrlenDevFd in n #1056

merged 1 commit into from
Jan 5, 2024

Conversation

mrdomino
Copy link
Collaborator

@mrdomino mrdomino commented Jan 5, 2024

No description provided.

Copy link
Collaborator

@pkulchenko pkulchenko left a comment

Choose a reason for hiding this comment

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

LGTM, although I was thinking if there is a way to avoid the duplication in StrlenDevFd. Maybe ((DevFd() ? sizeof(DevFd) : 0) -1)? BTW, wouldn't be better to have (DevFd() ? sizeof(DevFd)-1 : 0) or am I reading this incorrectly?

@mrdomino
Copy link
Collaborator Author

mrdomino commented Jan 5, 2024

You can't do sizeof of a runtime expression, which DevFd() generally is.

@mrdomino
Copy link
Collaborator Author

mrdomino commented Jan 5, 2024

Or well, you technically can, but I think it'll decay to sizeof(char *) or something, which is not what is wanted here.

@mrdomino mrdomino merged commit 3315b6e into jart:master Jan 5, 2024
@mrdomino mrdomino deleted the save-strlen branch January 5, 2024 04:17
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.

3 participants