Cleanup: use const pointers where possible

This commit is contained in:
Campbell Barton
2024-04-16 12:27:47 +10:00
parent 90f1d1cc61
commit 20b0805213
5 changed files with 6 additions and 6 deletions

View File

@@ -233,7 +233,7 @@ size_t memory_usage_block_num()
/* Count the number of active blocks. */
int64_t blocks_num = global.blocks_num_outside_locals;
for (Local *local : global.locals) {
for (const Local *local : global.locals) {
blocks_num += local->blocks_num;
}
return size_t(blocks_num);
@@ -246,7 +246,7 @@ size_t memory_usage_current()
/* Count the memory that's currently in use. */
int64_t mem_in_use = global.mem_in_use_outside_locals;
for (Local *local : global.locals) {
for (const Local *local : global.locals) {
mem_in_use += local->mem_in_use;
}
return size_t(mem_in_use);

View File

@@ -4617,7 +4617,7 @@ static FileData *read_library_file_data(FileData *basefd,
if (mainptr->curlib->packedfile) {
/* Read packed file. */
PackedFile *pf = mainptr->curlib->packedfile;
const PackedFile *pf = mainptr->curlib->packedfile;
BLO_reportf_wrap(basefd->reports,
RPT_INFO,

View File

@@ -225,7 +225,7 @@ static char *generate(GHash *messages, size_t *r_output_size)
BLI_assert(h == ik);
for (int i = 0; i < num_keys; i++) {
Offset *off = &offsets[i];
const Offset *off = &offsets[i];
/* The index table first has the list of keys, then the list of values.
* Each entry has first the size of the string, then the file offset. */

View File

@@ -495,7 +495,7 @@ bTheme *UI_GetTheme();
* For the rare case we need to temp swap in a different theme (off-screen render).
*/
void UI_Theme_Store(bThemeState *theme_state);
void UI_Theme_Restore(bThemeState *theme_state);
void UI_Theme_Restore(const bThemeState *theme_state);
/**
* Return shadow width outside menus and popups.

View File

@@ -1129,7 +1129,7 @@ void UI_Theme_Store(bThemeState *theme_state)
{
*theme_state = g_theme_state;
}
void UI_Theme_Restore(bThemeState *theme_state)
void UI_Theme_Restore(const bThemeState *theme_state)
{
g_theme_state = *theme_state;
}