Code review comment for lp:~vjsamuel/drizzle/fix-casts-drizzle-client

Revision history for this message
Monty Taylor (mordred) wrote :

 - if (!(histfile_tmp= (char*) malloc(static_cast<uint32_t>(strlen(histfile) + 5))))

The internal one (static_cast<uint32_t> is not needed. strlen returns size_t which is the type malloc takes. However, (char *) can certainly be changed to use a c++ cast. (and don't even get me started on this needing to be a std::string instead of a malloc'd char *...

The other two are not - you do not need to const cast to _add_ const qualifiers, only to take them away.

« Back to merge proposal