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
TS-4971: Change TSPluginRegistration to be const. #1110
Conversation
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1010/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/902/ for details. |
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.
How about removing all the const casts in plugins?
char *support_email; | ||
char const *plugin_name; | ||
char const *vendor_name; | ||
char const *support_email; |
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.
Everything else in this file uses const char *
. It would be better to keep a consistent style.
I'll fix the |
d36efa6
to
5274bb0
Compare
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1015/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/907/ for details. |
80fa076
to
69b815c
Compare
FreeBSD build failed! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1024/ for details. |
Linux build failed! See https://ci.trafficserver.apache.org/job/Github-Linux/916/ for details. |
Linux build failed! See https://ci.trafficserver.apache.org/job/Github-Linux/918/ for details. |
69b815c
to
7e8e2cc
Compare
Linux build failed! See https://ci.trafficserver.apache.org/job/Github-Linux/917/ for details. |
FreeBSD build failed! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1025/ for details. |
Linux build failed! See https://ci.trafficserver.apache.org/job/Github-Linux/919/ for details. |
FreeBSD build failed! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1026/ for details. |
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1027/ for details. |
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'd prefer that we focused this PR on the original problem and didn't add a lot of additional changes (at leas in the same commit). Some one these will break Solaris builds.
{"auth-host", required_argument, 0, 'h'}, | ||
{"auth-port", required_argument, 0, 'p'}, | ||
{"auth-transform", required_argument, 0, 't'}, | ||
{"force-cacheability", no_argument, 0, 'c'}, |
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 change will break Solaris.
{const_cast<char *>("config"), required_argument, NULL, 'c'}, | ||
{NULL, no_argument, NULL, '\0'}}; | ||
static const struct option longopt[] = { | ||
{"log", required_argument, NULL, 'l'}, {"config", required_argument, NULL, 'c'}, {NULL, no_argument, NULL, '\0'}}; |
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.
Solaris again :(
{NULL, 0, NULL, 0}, | ||
{"packed-node-support", no_argument, NULL, 'n'}, {"private-response", no_argument, NULL, 'p'}, | ||
{"disable-gzip-output", no_argument, NULL, 'z'}, {"first-byte-flush", no_argument, NULL, 'b'}, | ||
{"handler-filename", required_argument, NULL, 'f'}, {NULL, 0, NULL, 0}, |
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.
Solaris
@@ -80,7 +80,7 @@ HttpDataFetcherImpl::addFetchRequest(const string &url, FetchedDataProcessor *ca | |||
if (length < (int)sizeof(buff)) { | |||
http_req = buff; | |||
} else { | |||
http_req = (char *)malloc(length + 1); | |||
http_req = static_cast<char *>(malloc(length + 1)); |
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'm not convinced by static_cast
on malloc()
. It does nothing but look uglier. It would be better not to include so many different changes in this PR.
I think we should fix up the casts, or not. I think it's worse to say we'll fix some of the pointless casts but not others. If the goal is to show correct code, they should all be fixed. I also think if we're fixing this all C style casts should be removed. Those are strongly deprecated for C++ code. The point of the distinct casts is to make it clear what is being done. I'm fine with splitting this into a PR for each commit. That's why I left them separated. |
7e8e2cc
to
5274bb0
Compare
Commits to which the review referred have been removed from the pull request.
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/1029/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/921/ for details. |
No description provided.