All submissions to this site are governed by the Second Life Viewer Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.

Review Board 1.6.11

Welcome to the Second Life Viewer Code Review tool.
See the documentation on our wiki for how to use this site.

make PREHASH variables char const* const (fixes VWR-24487: llurlentry_stub.cpp:196: error: deprecated conversion from string constant to 'char*')

Review Request #100 - Created Jan. 18, 2011 and submitted

Boroondas Gupte Reviewers
viewer
VWR-24487 seth.productengine
None viewer-development
For the reason for this change, see https://jira.secondlife.com/browse/VWR-24487 and https://jira.secondlife.com/browse/VWR-24522

What I did:
In indra/llmessage/message_prehash.(h|cpp), I turned everything into constant pointers to constants by search/replace. Then I tried to compile and added const qualifiers in dependent code as needed to stop the compiler complaining.

Note that comments in indra/llmessage/message_prehash.(h|cpp) say these files have been generated from the message template. Because this generation might not have been a one-off thing, I changed the generating code, too, so it won't override this change here when the generation happens the next time. However, that part of the code is not called by Viewer, although the relevant function — dump_prehash_files() — ends up in the Viewer binary. That function probably gets called by the simulator, when one runs the latter with -prehash. (See https://bitbucket.org/lindenlab/viewer-development/src/fc7e5dcf3059/indra/llmessage/message.cpp#cl-2532 )
Compiled (standalone, 64bit Linux) with and without LL_TESTS.
Started the viewer, logged in, walked and flew around a bit. Everything seems to work.


Locally set _PREHASH_AgentData and _PREHASH_AgentID to (char const*)0x1 in indra/llui/tests/llurlentry_stub.cpp and indra/newview/tests/llremoteparcelrequest_test.cpp to verify they actually are never dereferenced, even when not NULL, so that using NULL pointers instead of place holder data won't change what code paths gets tested. Both tests binaries executed without crashes and all the contained tests passed.

Locally invoked start_messaging_system() with b_dump_prehash_file == true instead of FALSE, to see what would be generated after my change to dump_prehash_files().
The message_prehash.(h|cpp) generated by that had the correct type qualifiers and formatting, but some lines were removed or added compared to the modified files from the source tree. That probably means that the files aren't fully synchronized with the message template file in the source tree. Because the "added" constants are spread all over the file, while the "removed" ones were at the end, I'd wager that message_prehash.(h|cpp) in the viewer source tree are actually more up-to-date than the message template file in the source tree.
Review request changed
Updated (March 7, 2011, 3:51 p.m.)
  • changed from make PREHASH variables char const* const to make PREHASH variables char const* const (fixes VWR-24487: llurlentry_stub.cpp:196: error: deprecated conversion from string constant to 'char*')
(just mentioning the jira issue in the summary)
Ship it!
Posted (March 7, 2011, 6:15 p.m.)
Perfect.