Re: Add const qualifiers to XLogRegister*() functions
| От | Aleksander Alekseev |
|---|---|
| Тема | Re: Add const qualifiers to XLogRegister*() functions |
| Дата | |
| Msg-id | CAJ7c6TN_dR=Js41SY98cTrifvWu_JY5++8yCez9DZ+B+2Nz06g@mail.gmail.com обсуждение исходный текст |
| Ответ на | Modernize const handling with readline (Peter Eisentraut <peter@eisentraut.org>) |
| Ответы |
Re: Add const qualifiers to XLogRegister*() functions
|
| Список | pgsql-hackers |
Hi, > On 04.10.23 16:37, Peter Eisentraut wrote: > > On 03.10.23 13:28, Aleksander Alekseev wrote: > >> While examining the code for similar places I noticed that the > >> following functions can also be const'ified: > > >> - XLogRegisterData (?) > > > > I don't think this would work, at least without further work elsewhere, > > because the data is stored in XLogRecData, which has no const handling. > > I got around to fixing this. Here is a patch. It allows removing a few > unconstify() calls, which is nice. LGTM. Note that this may affect third-party code. IMO this is not a big deal in this particular case. Also by randomly checking one of the affected non-static functions I found a bunch of calls like this: XLogRegisterData((char *) msgs, ...) ... where the first argument is going to become (const char *). It looks like the compilers are OK with implicitly casting (char*) to a more restrictive (const char*) though. -- Best regards, Aleksander Alekseev
В списке pgsql-hackers по дате отправления: