"Andrew de Quincey" adq_dvb@lidskialf.net wrote:
Hi, this patch optimises the SPI_GETNONCLIENTMETRICS and SPI_GETICONTITLELOGFONT SystemParameters. These are loaded *continually* by IDA Pro. As these properties weren't cached previously, this really slowed everything down as it hit the disk every time.
Is it possible to regenerate the patch avoiding the unnecessary changes in formatting and white space?
On Saturday 29 November 2003 15:18, Dmitry Timoshkov wrote:
"Andrew de Quincey" adq_dvb@lidskialf.net wrote:
Hi, this patch optimises the SPI_GETNONCLIENTMETRICS and SPI_GETICONTITLELOGFONT SystemParameters. These are loaded *continually* by IDA Pro. As these properties weren't cached previously, this really slowed everything down as it hit the disk every time.
Is it possible to regenerate the patch avoiding the unnecessary changes in formatting and white space?
Oops, sorry, didn't notice those had crept in. New version ASAP.
"Andrew de Quincey" adq_dvb@lidskialf.net wrote:
Oops, sorry, didn't notice those had crept in. New version ASAP.
I'm sorry, but I'm afarid the new patch is not enough.
Here are a couple of snippets:
1. the second '+' adds a non-epmty line (and this repeats over the whole patch):
- spi_idx = SPI_GETNONCLIENTMETRICS;
2. an unnecessary formatting change (new comment is OK):
if (lpnm->cbSize == sizeof(NONCLIENTMETRICSA)) {
- /* clear the struct, so we have 'sane' members */
- memset(
- (char *)pvParam + sizeof(lpnm->cbSize),
- /* clear the supplied struct, so we have 'sane' members */
- memset((char *)pvParam + sizeof(lpnm->cbSize),
3. the whole case for IconTitleFaceName might be replaced by
spi_idx = SPI_GETICONTITLELOGFONT; if (spi_loaded[spi_idx]) { memcpy(lpLogFont, &iconTitleLogFont, sizeof(LOGFONTA)); break; }
leaving the old code as is.
- the second '+' adds a non-epmty line (and this repeats
Done. BTW, there seem to be loads of such cases all over that file; I assume your intention is that no more should creep in?
- an unnecessary formatting change (new comment is OK):
Fixed.
- the whole case for IconTitleFaceName might be replaced by
spi_idx = SPI_GETICONTITLELOGFONT; if (spi_loaded[spi_idx]) { memcpy(lpLogFont, &iconTitleLogFont, sizeof(LOGFONTA)); break; }
Done. That was actually my preferred solution; I was trying to stick to the same coding style already in the file. If this is not a concern, I won't in future.
The rest of the code still had to change though; something has to write to the cached copy.