diff options
-rw-r--r-- | intern/cycles/render/sobol.cpp | 10 | ||||
-rw-r--r-- | source/blender/datatoc/datatoc.c | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/intern/cycles/render/sobol.cpp b/intern/cycles/render/sobol.cpp index 5fb3531b03b..c821249b239 100644 --- a/intern/cycles/render/sobol.cpp +++ b/intern/cycles/render/sobol.cpp @@ -62,7 +62,7 @@ typedef struct SobolDirectionNumbers { /* Keep simple alignment. */ /* clang-format off */ -static SobolDirectionNumbers SOBOL_NUMBERS[SOBOL_MAX_DIMENSIONS - 1] = { +static const SobolDirectionNumbers SOBOL_NUMBERS[SOBOL_MAX_DIMENSIONS - 1] = { {2, 1, 0, {1}}, {3, 2, 1, {1, 3}}, {4, 3, 1, {1, 3, 1}}, @@ -21279,10 +21279,10 @@ void sobol_generate_direction_vectors(uint vectors[][SOBOL_BITS], int dimensions v[i] = 1 << (31 - i); // all m's = 1 for (int dim = 1; dim < dimensions; dim++) { - SobolDirectionNumbers *numbers = &SOBOL_NUMBERS[dim - 1]; - uint s = numbers->s; - uint a = numbers->a; - uint *m = numbers->m; + const SobolDirectionNumbers *numbers = &SOBOL_NUMBERS[dim - 1]; + const uint s = numbers->s; + const uint a = numbers->a; + const uint *m = numbers->m; v = vectors[dim]; diff --git a/source/blender/datatoc/datatoc.c b/source/blender/datatoc/datatoc.c index 6fe2650d66c..cf8d17e5e7e 100644 --- a/source/blender/datatoc/datatoc.c +++ b/source/blender/datatoc/datatoc.c @@ -94,11 +94,11 @@ int main(int argc, char **argv) fprintf(fpout, "/* DataToC output of file <%s> */\n\n", argv[1]); /* Quiet 'missing-variable-declarations' warning. */ - fprintf(fpout, "extern int datatoc_%s_size;\n", argv[1]); - fprintf(fpout, "extern char datatoc_%s[];\n\n", argv[1]); + fprintf(fpout, "extern const int datatoc_%s_size;\n", argv[1]); + fprintf(fpout, "extern const char datatoc_%s[];\n\n", argv[1]); - fprintf(fpout, "int datatoc_%s_size = %d;\n", argv[1], (int)size); - fprintf(fpout, "char datatoc_%s[] = {\n", argv[1]); + fprintf(fpout, "const int datatoc_%s_size = %d;\n", argv[1], (int)size); + fprintf(fpout, "const char datatoc_%s[] = {\n", argv[1]); while (size--) { /* if we want to open in an editor * this is nicer to avoid very long lines */ |