]> wimlib.net Git - wimlib/commitdiff
Constify some data
authorEric Biggers <ebiggers3@gmail.com>
Sun, 18 Dec 2016 09:19:26 +0000 (01:19 -0800)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 25 Dec 2016 19:42:17 +0000 (13:42 -0600)
programs/imagex.c
src/compress.c
src/decompress.c
src/mount_image.c
src/resource.c
src/win32_apply.c

index c1b064dc37c723a7d60da93901d3891fbeb0b772..d52b058d5facafa409058b33801d4b4a18624337 100644 (file)
@@ -490,7 +490,7 @@ verify_image_exists_and_is_single(int image, const tchar *image_name,
 static void
 print_available_compression_types(FILE *fp)
 {
-       static const tchar *s =
+       static const tchar * const s =
        T(
        "Available compression types:\n"
        "\n"
@@ -4378,7 +4378,7 @@ static const struct imagex_command imagex_commands[] = {
 
 #endif
 
-static const tchar *usage_strings[] = {
+static const tchar * const usage_strings[] = {
 [CMD_APPEND] =
 T(
 "    %"TS" " SOURCE_STR " WIMFILE [IMAGE_NAME [IMAGE_DESC]]\n"
@@ -4511,7 +4511,7 @@ static const tchar *get_cmd_string(int cmd, bool nospace)
 static void
 version(void)
 {
-       static const tchar *s =
+       static const tchar * const s =
        T(
 "wimlib-imagex (distributed with " PACKAGE " " PACKAGE_VERSION ")\n"
 "Copyright (C) 2012-2016 Eric Biggers\n"
@@ -4586,7 +4586,7 @@ usage_all(FILE *fp)
                print_usage_string(cmd, fp);
                tfprintf(fp, T("\n"));
        }
-       static const tchar *extra =
+       static const tchar * const extra =
        T(
 "    %"TS" --help\n"
 "    %"TS" --version\n"
index 259e7a4caca38aa3434d7f4ac3742346428144a0..1b0d2c9f9aff5d0f04b1537bda5f264b3c9efd89 100644 (file)
@@ -38,7 +38,7 @@ struct wimlib_compressor {
        size_t max_block_size;
 };
 
-static const struct compressor_ops *compressor_ops[] = {
+static const struct compressor_ops * const compressor_ops[] = {
        [WIMLIB_COMPRESSION_TYPE_XPRESS] = &xpress_compressor_ops,
        [WIMLIB_COMPRESSION_TYPE_LZX]    = &lzx_compressor_ops,
        [WIMLIB_COMPRESSION_TYPE_LZMS]   = &lzms_compressor_ops,
index d79865b898d19e9409f47569531aa0ef5f38454b..f255ea92fd503906cd8a6d73480cde25b8c3adeb 100644 (file)
@@ -36,7 +36,7 @@ struct wimlib_decompressor {
        void *private;
 };
 
-static const struct decompressor_ops *decompressor_ops[] = {
+static const struct decompressor_ops * const decompressor_ops[] = {
        [WIMLIB_COMPRESSION_TYPE_XPRESS] = &xpress_decompressor_ops,
        [WIMLIB_COMPRESSION_TYPE_LZX]    = &lzx_decompressor_ops,
        [WIMLIB_COMPRESSION_TYPE_LZMS]   = &lzms_decompressor_ops,
index 3641b204c3aec966d938b57d86517f181c5d9589..ed9001c0478ca1cf1daf3a391da14ff05ea9c184 100644 (file)
@@ -2036,7 +2036,7 @@ wimfs_write(const char *path, const char *buf, size_t size,
        return ret;
 }
 
-static struct fuse_operations wimfs_operations = {
+static const struct fuse_operations wimfs_operations = {
        .chmod       = wimfs_chmod,
        .chown       = wimfs_chown,
        .fgetattr    = wimfs_fgetattr,
index 9f119c47d7ff95e6d1a61aa0a3e18027ac0c0d9b..9054b55efaf46e058a145231cf79e4fd462c2e4d 100644 (file)
@@ -639,7 +639,7 @@ noop_cb(const void *chunk, size_t size, void *_ctx)
 int
 skip_wim_resource(const struct wim_resource_descriptor *rdesc)
 {
-       struct consume_chunk_callback cb = {
+       static const struct consume_chunk_callback cb = {
                .func = noop_cb,
        };
        return read_partial_wim_resource(rdesc, 0,
@@ -1333,7 +1333,7 @@ extract_blob_to_fd(struct blob_descriptor *blob, struct filedes *fd)
 int
 sha1_blob(struct blob_descriptor *blob)
 {
-       struct read_blob_callbacks cbs = {
+       static const struct read_blob_callbacks cbs = {
        };
        return read_blob_with_sha1(blob, &cbs);
 }
index ada5b919e64715f776a39d3dcb4e5e0b0b351a82..f971ca6f8bdeaf12c0f479832d36706edd1bd83c 100644 (file)
@@ -2482,7 +2482,7 @@ set_system_compression(HANDLE h, int format)
 
 /* Hard-coded list of files which the Windows bootloader may need to access
  * before the WOF driver has been loaded.  */
-static wchar_t *bootloader_pattern_strings[] = {
+static const wchar_t * const bootloader_pattern_strings[] = {
        L"*winload.*",
        L"*winresume.*",
        L"\\Windows\\AppPatch\\drvmain.sdb",
@@ -2514,7 +2514,7 @@ static wchar_t *bootloader_pattern_strings[] = {
 };
 
 static const struct string_list bootloader_patterns = {
-       .strings = bootloader_pattern_strings,
+       .strings = (wchar_t **)bootloader_pattern_strings,
        .num_strings = ARRAY_LEN(bootloader_pattern_strings),
 };