The standard practice is to specify const first.
In the case of pointers, anything to the left of such a declaration represents what is being pointed to.
This means const cannot be used in this case unless the pointer is intending to point to a constant.
The const qualifier may instead be put after the pointer symbol '*' to designate that the pointer and not what is being pointed to is to be a constant.
It seems that I tend to forget this behavior.
This makes a pass at existing uses of such pointers, adding const in the appropriate way.
f_string_length_t failures_used = recurse.failures ? recurse.failures->used : 0;
{
- f_string_dynamics_t *list[] = {
+ f_string_dynamics_t * const list[] = {
&listing.block,
&listing.character,
&listing.regular,
f_string_length_t failures_used = recurse.failures ? recurse.failures->used : 0;
{
- f_string_dynamics_t *list[] = {
+ f_string_dynamics_t * const list[] = {
&listing.block,
&listing.character,
&listing.regular,
const f_string_length_t path_length = strnlen(path, f_path_max);
{
- f_string_dynamics_t *list[] = {
+ f_string_dynamics_t * const list[] = {
&listing.block,
&listing.character,
&listing.regular,
const f_string_length_t path_length = strnlen(path, f_path_max);
{
- f_string_dynamics_t *list[] = {
+ f_string_dynamics_t * const list[] = {
&listing.block,
&listing.character,
&listing.regular,
if (F_status_is_error_not(*status)) {
bool failed = F_false;
- f_string_static_t *settings[] = {
+ f_string_static_t * const settings[] = {
&setting->project_name,
};
f_string_dynamics_t version_minor = f_string_dynamics_t_initialize;
f_string_dynamics_t version_target = f_string_dynamics_t_initialize;
- f_string_dynamics_t *settings_value[] = {
+ f_string_dynamics_t * settings_value[] = {
&build_compiler,
&build_indexer,
&build_language,
&version_target,
};
- bool *settings_single_bool[] = {
+ bool * const settings_single_bool[] = {
0,
0,
0,
&setting->search_static,
};
- f_string_dynamic_t *settings_single_destination[] = {
+ f_string_dynamic_t * const settings_single_destination[] = {
&setting->build_compiler,
&setting->build_indexer,
0,
&setting->version_minor,
};
- uint8_t *settings_single_language[] = {
+ uint8_t * const settings_single_language[] = {
0,
0,
&setting->build_language,
};
- uint8_t *settings_single_version[] = {
+ uint8_t * const settings_single_version[] = {
0,
0,
0,
};
// 1 = "yes" or "no", 2 = path/, 3 = literal, 4 = "bash", "c", or "c++", 5 = "major", "minor", or "micro".
- uint8_t settings_single_type[] = {
+ const uint8_t settings_single_type[] = {
3,
3,
4,
}
{
- f_string_t sources[] = {
+ const f_string_t sources[] = {
fake_build_setting_default_version,
fake_build_setting_default_version,
fake_build_setting_default_version,
};
- f_string_length_t lengths[] = {
+ const f_string_length_t lengths[] = {
fake_build_setting_default_version_length,
fake_build_setting_default_version_length,
fake_build_setting_default_version_length,
};
- f_string_dynamic_t *destinations[] = {
+ f_string_dynamic_t * const destinations[] = {
&setting->version_major,
&setting->version_minor,
&setting->version_micro,
fake_build_stage_sources_settings_length,
};
- f_string_dynamic_t *values[] = {
+ f_string_dynamic_t * const values[] = {
&stage->file_libraries_script,
&stage->file_libraries_shared,
&stage->file_libraries_static,
&data->path_sources_script,
};
- f_string_dynamic_t **parameters_value[] = {
+ f_string_dynamic_t **const parameters_value[] = {
parameters_value_0,
parameters_value_1,
parameters_value_2,
fake_path_part_script_length,
};
- f_string_dynamic_t *parameters_value[] = {
+ f_string_dynamic_t * const parameters_value[] = {
&data->path_build_documents,
&data->path_build_includes,
&data->path_build_libraries,
&data->file_documents_readme,
};
- f_string_dynamic_t **parameters_value[] = {
+ f_string_dynamic_t **const parameters_value[] = {
parameters_value_0,
parameters_value_1,
parameters_value_2,
fake_file_readme_length,
};
- f_string_dynamic_t *parameters_value[] = {
+ f_string_dynamic_t * const parameters_value[] = {
&data->path_build_libraries_script,
&data->path_build_libraries_shared,
&data->path_build_libraries_static,
if (data->path_work.used > 0) {
{
- f_string_dynamic_t *parameters_value[] = {
+ f_string_dynamic_t * const parameters_value[] = {
&data->path_work_includes,
&data->path_work_libraries,
&data->path_work_programs,
fake_path_part_programs_length,
};
- f_string_dynamic_t *parameters_value[] = {
+ f_string_dynamic_t * const parameters_value[] = {
&data->path_work_includes,
&data->path_work_libraries,
&data->path_work_programs,
&data->path_work_programs_static,
};
- f_string_dynamic_t **parameters_value[] = {
+ f_string_dynamic_t **const parameters_value[] = {
parameters_value_0,
parameters_value_1,
};
fake_path_part_static_length,
};
- f_string_dynamic_t *parameters_value[] = {
+ f_string_dynamic_t * const parameters_value[] = {
&data->path_work_libraries_script,
&data->path_work_libraries_shared,
&data->path_work_libraries_static,
}
{
- f_string_dynamic_t *parameters_value[] = {
+ f_string_dynamic_t * const parameters_value[] = {
&data->path_build_documents,
&data->path_build_includes,
&data->path_build_libraries,
fake_default_settings_length,
};
- f_string_dynamic_t *parameters_value[] = {
+ f_string_dynamic_t * const parameters_value[] = {
&data->fakefile,
&data->process,
&data->settings,
fake_default_path_work_length,
};
- f_string_dynamic_t *parameters_value[] = {
+ f_string_dynamic_t * const parameters_value[] = {
&data->path_build,
&data->path_data,
&data->path_sources,
&data.mode,
};
- f_string_dynamics_t *destination[] = {
+ f_string_dynamics_t * const destination[] = {
&data_make->parameter.define,
&data_make->parameter.mode,
};
&data.settings,
};
- f_string_dynamics_t *destination[] = {
+ f_string_dynamics_t * const destination[] = {
&data_make->parameter.fakefile,
&data_make->parameter.build,
&data_make->parameter.data,
fake_make_parameter_variable_work_length,
};
- f_string_dynamics_t *reserved_value[] = {
+ f_string_dynamics_t * const reserved_value[] = {
&data_make->parameter.build,
&data_make->parameter.color,
&data_make->parameter.data,
init_string_verbosity_length,
};
- f_string_dynamic_t *parameter_value[] = {
+ f_string_dynamic_t * const parameter_value[] = {
&cache,
&cache,
&cache,
&cache,
};
- bool *parameter_value_bool[] = {
+ bool * const parameter_value_bool[] = {
0,
&setting_kernel->failsafe,
0,
0,
};
- uint8_t *parameter_value_uint8[] = {
+ uint8_t * const parameter_value_uint8[] = {
&setting_kernel->color,
0,
&setting_kernel->mode,
};
// @todo: create f_metric_t, such that it is an f_number_unsigned_t with an exponent type, such as: Y (yotta), Z (zetta), E (exa), P (peta), T (Tera), G (giga), M (mega), k (kilo), h (hecto), da (deca), (none), d (deci), c (centi), m (milli), μ (micro), n (nano), p (pico), f (femto), a (atto), z (zepto), and y (yocto).
- f_number_unsigned_t *parameter_value_number_unsigned[] = {
+ f_number_unsigned_t * const parameter_value_number_unsigned[] = {
0,
0,
0,