-
Notifications
You must be signed in to change notification settings - Fork 866
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
Eliminated ref_t. Some more convention fixes #1045
Conversation
Looks like it also depends on PR #1028. At least I see some function from that not yet merged PR in this one. |
Purged of any premature merges. Now the PR is completely independent. |
apps/srt-file-transmit.cpp
Outdated
tuple<string, string> ExtractPath(string path) | ||
{ |
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.
This looks like something from another PR.
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.
Looks good.
Ideally, this is better to be divided into two commits: one for changes to core, another for changes to the apps.
This can be easily done with two git commands:
git reset @~3
git add ./srtcore/*
git commit -m "[core] Eliminated ref_t from the core"
git add ./apps/*
git add ./testing/*
git commit -m "[apps] Eliminated ref_t from apps"
git push --force
I understand, but the trouble is that splitting makes sense if they can be independent - whereas as this involves deletion of |
Well, it is simple to solve. The first commit should remove ref_t from apps, the second - from the core. |
So like this then
|
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 must say these new prefixes do look silly. Also, experience tells me they are going to be hard to enforce or maintain. But no (serious) harm done and this is definitely better than 'Ref()' usage.
Other than that, please resolve the merge conflict with the master branch. Thanks!
Fixes #943, #945
The new convention for passing parameters by writable reference applied. The use of
ref_t
andRef
has been eliminated, as well as the definitions thereof.The new convention is:
w_
prefix and pointer parameters -pw_
prefix.(extra_parentheses)
around the whole expression. This applies to:The above rules don't embrace passing a non-writable object, usually preferred as const, but also when it's required to be passed by writable pointer or reference, but the function doesn't modify it.
Also the order of parameters is changed to the convention - writable reference parameters should be placed after value parameters.