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
more const in root #5409
more const in root #5409
Conversation
@@ -73,7 +73,7 @@ struct File | |||
size_t size; | |||
stat_t buf; | |||
ssize_t numread; | |||
char* name = this.name.toChars(); | |||
const(char)* name = this.name.toChars(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use auto
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that, and decided explicit was better when doing this conversion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will mean we're going to have to go back and change them all again when toChars
starts returning string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll all have to be scrutinized line by line anyway, because of 0 termination, rewrite to toString, etc. It's not encapsulated well at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh
f198888
to
f98d784
Compare
@@ -40,7 +40,7 @@ struct File | |||
_ref = 0; | |||
buffer = null; | |||
len = 0; | |||
name = cast(FileName*)n; | |||
name = n; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yebblies here's an example of as const use grows, the casts can be removed.
Auto-merge toggled on |
No description provided.