Fix spelling mistakes in comments
authorCharles Giessen <charles@lunarg.com>
Thu, 7 Dec 2023 20:41:31 +0000 (13:41 -0700)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Tue, 19 Dec 2023 17:25:02 +0000 (10:25 -0700)
These creep in over time, and make the codebase harder to understand due to spelling
errors causing confusion when reading comments.

loader/cJSON.c
loader/cJSON.h
loader/loader.c
loader/loader_common.h
loader/loader_windows.c
loader/settings.c
loader/settings.h
loader/vk_loader_platform.h

index 24c8f2b96766c9f6eb1d940798a238fe78d77899..b07d9518a1909701393b33c597e55a84d011944f 100644 (file)
@@ -442,7 +442,7 @@ static char *print_string_ptr(const VkAllocationCallbacks *pAllocator, const cha
 /* Invoke print_string_ptr (which is useful) on an item. */
 static char *print_string(cJSON *item, printbuffer *p) { return print_string_ptr(item->pAllocator, item->valuestring, p); }
 
-/* Predeclare these prototypes. */
+/* Declare these prototypes. */
 static const char *parse_value(cJSON *item, const char *value, bool *out_of_memory);
 static char *print_value(cJSON *item, int depth, int fmt, printbuffer *p);
 static const char *parse_array(cJSON *item, const char *value, bool *out_of_memory);
@@ -1014,7 +1014,7 @@ VkResult loader_get_json(const struct loader_instance *inst, const char *filenam
     bool out_of_memory = false;
     *json = cJSON_Parse(inst ? &inst->alloc_callbacks : NULL, json_buf, &out_of_memory);
     if (out_of_memory) {
-        loader_log(inst, VULKAN_LOADER_ERROR_BIT, 0, "loader_get_json: Out of Memory error occured while parsing JSON file %s.",
+        loader_log(inst, VULKAN_LOADER_ERROR_BIT, 0, "loader_get_json: Out of Memory error occurred while parsing JSON file %s.",
                    filename);
         res = VK_ERROR_OUT_OF_HOST_MEMORY;
         goto out;
index 4878288f50ccb7411cb4785fd4039bf2410411d0..e02af8a71839e559e1e72cb6fc28a7a531124d36 100644 (file)
@@ -105,7 +105,7 @@ VkResult loader_parse_json_string_to_existing_str(const struct loader_instance *
 // It is the callers responsibility to free out_string.
 VkResult loader_parse_json_string(cJSON *object, const char *key, char **out_string);
 
-// Given a cJSON object, find the array of strings assocated with they key and writes the count into out_count and data into
+// Given a cJSON object, find the array of strings associated with they key and writes the count into out_count and data into
 // out_array_of_strings. It is the callers responsibility to free out_array_of_strings.
 VkResult loader_parse_json_array_of_strings(const struct loader_instance *inst, cJSON *object, const char *key,
                                             struct loader_string_list *string_list);
index 17a8e17f1f3a2e45a5f2a6331a32d067909999ce..a65b59704d50ebf8c2d6a11e17429c73951a9531 100644 (file)
@@ -1714,13 +1714,13 @@ VkResult loader_scanned_icd_add(const struct loader_instance *inst, struct loade
         fp_create_inst = loader_platform_get_proc_address(handle, "vkCreateInstance");
         if (NULL == fp_create_inst) {
             loader_log(inst, VULKAN_LOADER_ERROR_BIT, 0,
-                       "loader_scanned_icd_add:  Failed querying \'vkCreateInstance\' via dlsym/loadlibrary for ICD %s", filename);
+                       "loader_scanned_icd_add:  Failed querying \'vkCreateInstance\' via dlsym/LoadLibrary for ICD %s", filename);
             goto out;
         }
         fp_get_inst_ext_props = loader_platform_get_proc_address(handle, "vkEnumerateInstanceExtensionProperties");
         if (NULL == fp_get_inst_ext_props) {
             loader_log(inst, VULKAN_LOADER_ERROR_BIT, 0,
-                       "loader_scanned_icd_add: Could not get \'vkEnumerateInstanceExtensionProperties\' via dlsym/loadlibrary "
+                       "loader_scanned_icd_add: Could not get \'vkEnumerateInstanceExtensionProperties\' via dlsym/LoadLibrary "
                        "for ICD %s",
                        filename);
             goto out;
@@ -1918,7 +1918,7 @@ char *loader_get_next_path(char *path) {
 }
 
 /* Processes a json manifest's library_path and the location of the json manifest to create the path of the library
- * The output is stored in out_fullpath by allocating a string - so its the caller's repsonsibility to free it
+ * The output is stored in out_fullpath by allocating a string - so its the caller's responsibility to free it
  * The output is the combination of the base path of manifest_file_path concatenated with library path
  * If library_path is an absolute path, we do not prepend the base path of manifest_file_path
  *
@@ -1956,14 +1956,14 @@ VkResult combine_manifest_directory_and_library_path(const struct loader_instanc
         goto out;
     }
     size_t cur_loc_in_out_fullpath = 0;
-    // look for the last occurance of DIRECTORY_SYMBOL in manifest_file_path
+    // look for the last occurrence of DIRECTORY_SYMBOL in manifest_file_path
     size_t last_directory_symbol = 0;
     bool found_directory_symbol = false;
     for (size_t i = 0; i < manifest_file_path_str_len; i++) {
         if (manifest_file_path[i] == DIRECTORY_SYMBOL) {
             last_directory_symbol = i + 1;  // we want to include the symbol
             found_directory_symbol = true;
-            // dont break because we want to find the last occurance
+            // dont break because we want to find the last occurrence
         }
     }
     // Add manifest_file_path up to the last directory symbol
@@ -2120,7 +2120,7 @@ bool update_meta_layer_extensions_from_component_layers(const struct loader_inst
     return res;
 }
 
-// Verify that all meta-layers in a layer verify_meta_layer_component_layerslist are valid.
+// Verify that all meta-layers in a layer list are valid.
 VkResult verify_all_meta_layers(struct loader_instance *inst, const struct loader_envvar_all_filters *filters,
                                 struct loader_layer_list *instance_layers, bool *override_layer_present) {
     VkResult res = VK_SUCCESS;
@@ -2595,7 +2595,7 @@ VkResult loader_read_layer_json(const struct loader_instance *inst, struct loade
     if (loader_cJSON_GetObjectItem(layer_node, "app_keys")) {
         if (!props.is_override) {
             loader_log(inst, VULKAN_LOADER_WARN_BIT | VULKAN_LOADER_LAYER_BIT, 0,
-                       "Layer %s contains app_keys, but any app_keys can only be provided by the override metalayer. "
+                       "Layer %s contains app_keys, but any app_keys can only be provided by the override meta layer. "
                        "These will be ignored.",
                        props.info.layerName);
         }
@@ -3764,7 +3764,7 @@ VkResult loader_scan_for_layers(struct loader_instance *inst, struct loader_laye
         goto out;
     }
 
-    // If we should not look for layers using other mechanisms, assing settings_layers to instance_layers and jump to the
+    // If we should not look for layers using other mechanisms, assign settings_layers to instance_layers and jump to the
     // output
     if (!should_search_for_other_layers) {
         *instance_layers = settings_layers;
@@ -3845,7 +3845,7 @@ VkResult loader_scan_for_implicit_layers(struct loader_instance *inst, struct lo
         goto out;
     }
 
-    // If we should not look for layers using other mechanisms, assing settings_layers to instance_layers and jump to the
+    // If we should not look for layers using other mechanisms, assign settings_layers to instance_layers and jump to the
     // output
     if (!should_search_for_other_layers) {
         *instance_layers = settings_layers;
@@ -3962,11 +3962,11 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL loader_gpa_instance_terminator(VkInstan
         return (PFN_vkVoidFunction)terminator_CreateInstance;
     }
 
-    // While the spec is very clear that quering vkCreateDevice requires a valid VkInstance, because the loader allowed querying
+    // While the spec is very clear that querying vkCreateDevice requires a valid VkInstance, because the loader allowed querying
     // with a NULL VkInstance handle for a long enough time, it is impractical to fix this bug in the loader
 
     // As such, this is a bug to maintain compatibility for the RTSS layer (Riva Tuner Statistics Server) but may
-    // be dependend upon by other layers out in the wild.
+    // be depended upon by other layers out in the wild.
     if (!strcmp(pName, "vkCreateDevice")) {
         return (PFN_vkVoidFunction)terminator_CreateDevice;
     }
@@ -5041,7 +5041,7 @@ VkResult loader_validate_instance_extensions(struct loader_instance *inst, const
             goto out;
         }
     } else {
-        // Build the lists of active layers (including metalayers) and expanded layers (with metalayers resolved to their
+        // Build the lists of active layers (including meta layers) and expanded layers (with meta layers resolved to their
         // components)
         res = loader_add_implicit_layers(inst, layer_filters, &active_layers, &expanded_layers, instance_layers);
         if (res != VK_SUCCESS) {
index d94ea3b2bc72b0d9c3e7258a203fb896aa739f0e..953cbb4cd182f2587c242e1ea7cc8fb46dbfb017 100644 (file)
@@ -402,8 +402,8 @@ struct loader_physical_device_term {
 };
 
 #if defined(LOADER_ENABLE_LINUX_SORT)
-// Structure for storing the relevent device information for selecting a device.
-// NOTE: Needs to be defined here so we can store this content in the term structrue
+// Structure for storing the relevant device information for selecting a device.
+// NOTE: Needs to be defined here so we can store this content in the term structure
 //       for quicker sorting.
 struct LinuxSortedDeviceInfo {
     // Associated Vulkan Physical Device
index ad65f9e607528838b5b83a18a3fc74f811912a5c..5b0dfb0dab70fae51f5f87d1ccfaf2d8e5eb5ea4 100644 (file)
@@ -46,7 +46,7 @@
 #include <winternl.h>
 #include <strsafe.h>
 #if defined(__MINGW32__)
-#undef strcpy  // fix error with redfined strcpy when building with MinGW-w64
+#undef strcpy  // fix error with redefined strcpy when building with MinGW-w64
 #endif
 #include <dxgi1_6.h>
 #include "adapters.h"
@@ -688,7 +688,7 @@ VkResult windows_read_manifest_from_d3d_adapters(const struct loader_instance *i
                 goto out;
             }
 
-            // If this is a string and not a multi-string, we don't want to go throught the loop more than once
+            // If this is a string and not a multi-string, we don't want to go through the loop more than once
             if (full_info->value_type == REG_SZ) {
                 break;
             }
@@ -865,7 +865,7 @@ VkResult enumerate_adapter_physical_devices(struct loader_instance *inst, struct
     return VK_SUCCESS;
 }
 
-// Whenever there are multiple drivers for the same hardware and one of the drivers is an implementation layered ontop of another
+// Whenever there are multiple drivers for the same hardware and one of the drivers is an implementation layered on top of another
 // API (such as the Dozen driver which converts vulkan to Dx12), we want to make sure the layered driver appears after the 'native'
 // driver. This function iterates over all physical devices and make sure any with matching LUID's are sorted such that drivers with
 // a underlyingAPI of VK_LAYERED_DRIVER_UNDERLYING_API_D3D12_MSFT are ordered after drivers without it.
index 828937a0df7a0c64319a76635ffbf5be367f16c8..4e037bce71e85883a6f55407e349718d047c3639 100644 (file)
@@ -335,7 +335,7 @@ VkResult get_loader_settings(const struct loader_instance* inst, loader_settings
 
     // Corresponds to the settings object that has no app keys
     int global_settings_index = -1;
-    // Corresponds to the settings object which has a matchign app key
+    // Corresponds to the settings object which has a matching app key
     int index_to_use = -1;
 
     char current_process_path[1024];
@@ -551,7 +551,7 @@ VkResult get_settings_layers(const struct loader_instance* inst, struct loader_l
         }
 
         // The special layer location that indicates where unordered layers should go only should have the
-        // settings_control_value set - everythign else should be NULL
+        // settings_control_value set - everything else should be NULL
         if (layer_config->control == LOADER_SETTINGS_LAYER_UNORDERED_LAYER_LOCATION) {
             struct loader_layer_properties props = {0};
             props.settings_control_value = LOADER_SETTINGS_LAYER_UNORDERED_LAYER_LOCATION;
index d3cd8b7cc9bec25fb8aeb0c8e04ad3d098c2b85a..e0ffe3a6e28a041167dfef58d88034cce012f847 100644 (file)
@@ -48,7 +48,7 @@ typedef enum loader_settings_layer_control {
 } loader_settings_layer_control;
 
 // If a loader_settings_layer_configuration has a name of loader_settings_unknown_layers_location, then it specifies that the
-// layer configuation it was found in shall be the location all layers not listed in the settings file that are enabled.
+// layer configuration it was found in shall be the location all layers not listed in the settings file that are enabled.
 #define LOADER_SETTINGS_UNKNOWN_LAYERS_LOCATION "loader_settings_unknown_layers_location"
 
 #define LOADER_SETTINGS_MAX_NAME_SIZE 256U;
@@ -73,7 +73,7 @@ typedef struct loader_settings {
 } loader_settings;
 
 // Call this function to get the current settings that the loader should use.
-// It will open up the current loader settings file and return a loader_settigns in out_loader_settings if it.
+// It will open up the current loader settings file and return a loader_settings in out_loader_settings if it.
 // It should be called on every call to the global functions excluding vkGetInstanceProcAddr
 // Caller is responsible for cleaning up by calling free_loader_settings()
 VkResult get_loader_settings(const struct loader_instance* inst, loader_settings* out_loader_settings);
index 1a84a7dd228cf7f5e80c4e571195ce728284b7c5..afb0f5634ada90b778d28deb157fbc8079883c36 100644 (file)
@@ -348,7 +348,7 @@ static inline char *loader_platform_executable_path(char *buffer, size_t size) {
 }
 #endif  // defined (__QNX__)
 
-// Compatability with compilers that don't support __has_feature
+// Compatibility with compilers that don't support __has_feature
 #if !defined(__has_feature)
 #define __has_feature(x) 0
 #endif