summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools
diff options
context:
space:
mode:
authorGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-08-02 12:08:15 -0400
committerGravatarGravatar AJR <ajrhacker@users.noreply.github.com>2019-08-02 12:12:04 -0400
commit8013c43adf62485a9f9d95a45c525c97191c9398 (patch)
tree490dde363aeebcc50ad703a1136664152023065c /src/tools
parent478ec7352fec88d0506cc645a832677c6bc153d2 (diff)
Use canonical spelling of "canonical" (nw)
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/imgtool/imgtool.cpp106
-rw-r--r--src/tools/imgtool/imgtool.h4
-rw-r--r--src/tools/imgtool/modules.cpp4
-rw-r--r--src/tools/imgtool/modules.h2
-rw-r--r--src/tools/imgtool/modules/fat.cpp20
5 files changed, 68 insertions, 68 deletions
diff --git a/src/tools/imgtool/imgtool.cpp b/src/tools/imgtool/imgtool.cpp
index 67283ce8fa3..b51d7b4d478 100644
--- a/src/tools/imgtool/imgtool.cpp
+++ b/src/tools/imgtool/imgtool.cpp
@@ -151,7 +151,7 @@ static void internal_error(const imgtool_module *module, const char *message)
void imgtool_init(bool omit_untested, void (*warn)(const char *message))
{
imgtoolerr_t err;
- err = imgtool_create_cannonical_library(omit_untested, global_imgtool_library);
+ err = imgtool_create_canonical_library(omit_untested, global_imgtool_library);
assert(err == IMGTOOLERR_SUCCESS);
if (err == IMGTOOLERR_SUCCESS)
{
@@ -1165,11 +1165,11 @@ std::string imgtool::image::info()
#define PATH_CANBEBOOTBLOCK 0x00000004
//-------------------------------------------------
-// partition::cannonicalize_path - normalizes a path string
+// partition::canonicalize_path - normalizes a path string
// into a NUL delimited list
//-------------------------------------------------
-imgtoolerr_t imgtool::partition::cannonicalize_path(uint32_t flags, const char *path, std::string &result)
+imgtoolerr_t imgtool::partition::canonicalize_path(uint32_t flags, const char *path, std::string &result)
{
imgtoolerr_t err = (imgtoolerr_t)IMGTOOLERR_SUCCESS;
@@ -1216,7 +1216,7 @@ imgtoolerr_t imgtool::partition::cannonicalize_path(uint32_t flags, const char *
{
const char *s = path ? path : "";
- // allocate space for a new cannonical path
+ // allocate space for a new canonical path
std::ostringstream stream;
// copy the path
@@ -1245,10 +1245,10 @@ imgtoolerr_t imgtool::partition::cannonicalize_path(uint32_t flags, const char *
//-------------------------------------------------
-// partition::cannonicalize_fork
+// partition::canonicalize_fork
//-------------------------------------------------
-imgtoolerr_t imgtool::partition::cannonicalize_fork(const char **fork)
+imgtoolerr_t imgtool::partition::canonicalize_fork(const char **fork)
{
// does this module support forks?
if (m_list_forks)
@@ -1364,13 +1364,13 @@ imgtoolerr_t imgtool::partition::list_file_attributes(const char *path, uint32_t
if (!m_list_attrs)
return imgtoolerr_t(IMGTOOLERR_UNIMPLEMENTED | IMGTOOLERR_SRC_FUNCTIONALITY);
- // cannonicalize path
- std::string cannonical_path;
- err = cannonicalize_path(PATH_LEAVENULLALONE, path, cannonical_path);
+ // canonicalize path
+ std::string canonical_path;
+ err = canonicalize_path(PATH_LEAVENULLALONE, path, canonical_path);
if (err)
return err;
- err = m_list_attrs(*this, cannonical_path.c_str(), attrs, len);
+ err = m_list_attrs(*this, canonical_path.c_str(), attrs, len);
if (err)
return err;
@@ -1389,13 +1389,13 @@ imgtoolerr_t imgtool::partition::get_file_attributes(const char *path, const uin
if (!m_get_attrs)
return imgtoolerr_t(IMGTOOLERR_UNIMPLEMENTED | IMGTOOLERR_SRC_FUNCTIONALITY);
- // cannonicalize path
- std::string cannonical_path;
- err = cannonicalize_path(PATH_LEAVENULLALONE, path, cannonical_path);
+ // canonicalize path
+ std::string canonical_path;
+ err = canonicalize_path(PATH_LEAVENULLALONE, path, canonical_path);
if (err)
return err;
- err = m_get_attrs(*this, cannonical_path.c_str(), attrs, values);
+ err = m_get_attrs(*this, canonical_path.c_str(), attrs, values);
if (err)
return err;
@@ -1414,13 +1414,13 @@ imgtoolerr_t imgtool::partition::put_file_attributes(const char *path, const uin
if (!m_set_attrs)
return imgtoolerr_t(IMGTOOLERR_UNIMPLEMENTED | IMGTOOLERR_SRC_FUNCTIONALITY);
- // cannonicalize path
- std::string cannonical_path;
- err = cannonicalize_path(PATH_LEAVENULLALONE, path, cannonical_path);
+ // canonicalize path
+ std::string canonical_path;
+ err = canonicalize_path(PATH_LEAVENULLALONE, path, canonical_path);
if (err)
return err;
- err = m_set_attrs(*this, cannonical_path.c_str(), attrs, values);
+ err = m_set_attrs(*this, canonical_path.c_str(), attrs, values);
if (err)
return err;
@@ -1467,14 +1467,14 @@ imgtoolerr_t imgtool::partition::get_icon_info(const char *path, imgtool_iconinf
if (!m_get_iconinfo)
return imgtoolerr_t(IMGTOOLERR_UNIMPLEMENTED | IMGTOOLERR_SRC_FUNCTIONALITY);
- // cannonicalize path
- std::string cannonical_path;
- err = cannonicalize_path(0, path, cannonical_path);
+ // canonicalize path
+ std::string canonical_path;
+ err = canonicalize_path(0, path, canonical_path);
if (err)
return err;
memset(iconinfo, 0, sizeof(*iconinfo));
- err = m_get_iconinfo(*this, cannonical_path.c_str(), iconinfo);
+ err = m_get_iconinfo(*this, canonical_path.c_str(), iconinfo);
if (err)
return err;
@@ -1502,14 +1502,14 @@ imgtoolerr_t imgtool::partition::suggest_file_filters(const char *path,
if (!m_suggest_transfer)
return imgtoolerr_t(IMGTOOLERR_UNIMPLEMENTED | IMGTOOLERR_SRC_FUNCTIONALITY);
- // cannonicalize path
- std::string cannonical_path;
- err = cannonicalize_path(PATH_LEAVENULLALONE, path, cannonical_path);
+ // canonicalize path
+ std::string canonical_path;
+ err = canonicalize_path(PATH_LEAVENULLALONE, path, canonical_path);
if (err)
return err;
// invoke the module's suggest call
- err = m_suggest_transfer(*this, cannonical_path.c_str(), suggestions, suggestions_length);
+ err = m_suggest_transfer(*this, canonical_path.c_str(), suggestions, suggestions_length);
if (err)
return err;
@@ -1699,18 +1699,18 @@ imgtoolerr_t imgtool::partition::read_file(const char *filename, const char *for
}
else
{
- // cannonicalize path
- std::string cannonical_path;
- err = cannonicalize_path(PATH_CANBEBOOTBLOCK, filename, cannonical_path);
+ // canonicalize path
+ std::string canonical_path;
+ err = canonicalize_path(PATH_CANBEBOOTBLOCK, filename, canonical_path);
if (err)
return err;
- err = cannonicalize_fork(&fork);
+ err = canonicalize_fork(&fork);
if (err)
return err;
// invoke the actual module
- err = m_read_file(*this, cannonical_path.c_str(), fork, destf);
+ err = m_read_file(*this, canonical_path.c_str(), fork, destf);
if (err)
return markerrorsource(err);
}
@@ -1769,13 +1769,13 @@ imgtoolerr_t imgtool::partition::write_file(const char *filename, const char *fo
filename = ucase_str.c_str();
}
- // cannonicalize path
- std::string cannonical_path;
- err = cannonicalize_path(PATH_CANBEBOOTBLOCK, filename, cannonical_path);
+ // canonicalize path
+ std::string canonical_path;
+ err = canonicalize_path(PATH_CANBEBOOTBLOCK, filename, canonical_path);
if (err)
return err;
- err = cannonicalize_fork(&fork);
+ err = canonicalize_fork(&fork);
if (err)
return err;
@@ -1806,7 +1806,7 @@ imgtoolerr_t imgtool::partition::write_file(const char *filename, const char *fo
}
// actually invoke the write file handler
- err = m_write_file(*this, cannonical_path.c_str(), fork, sourcef, opts);
+ err = m_write_file(*this, canonical_path.c_str(), fork, sourcef, opts);
if (err)
return markerrorsource(err);
}
@@ -1924,13 +1924,13 @@ imgtoolerr_t imgtool::partition::delete_file(const char *fname)
if (!m_delete_file)
return imgtoolerr_t(IMGTOOLERR_UNIMPLEMENTED | IMGTOOLERR_SRC_FUNCTIONALITY);
- // cannonicalize path
- std::string cannonical_path;
- err = cannonicalize_path(0, fname, cannonical_path);
+ // canonicalize path
+ std::string canonical_path;
+ err = canonicalize_path(0, fname, canonical_path);
if (err)
return err;
- err = m_delete_file(*this, cannonical_path.c_str());
+ err = m_delete_file(*this, canonical_path.c_str());
if (err)
return markerrorsource(err);
@@ -1949,15 +1949,15 @@ imgtoolerr_t imgtool::partition::list_file_forks(const char *path, std::vector<i
if (!m_list_forks)
return imgtoolerr_t(IMGTOOLERR_UNIMPLEMENTED | IMGTOOLERR_SRC_FUNCTIONALITY);
- // cannonicalize path
- std::string cannonical_path;
- err = cannonicalize_path(0, path, cannonical_path);
+ // canonicalize path
+ std::string canonical_path;
+ err = canonicalize_path(0, path, canonical_path);
if (err)
return err;
// call the callback
forks.clear();
- err = m_list_forks(*this, cannonical_path.c_str(), forks);
+ err = m_list_forks(*this, canonical_path.c_str(), forks);
if (err)
return err;
@@ -1978,9 +1978,9 @@ imgtoolerr_t imgtool::partition::create_directory(const char *path)
if (!m_create_dir)
return imgtoolerr_t(IMGTOOLERR_UNIMPLEMENTED | IMGTOOLERR_SRC_FUNCTIONALITY);
- // cannonicalize path
- std::string cannonical_path;
- err = cannonicalize_path(PATH_MUSTBEDIR, path, cannonical_path);
+ // canonicalize path
+ std::string canonical_path;
+ err = canonicalize_path(PATH_MUSTBEDIR, path, canonical_path);
if (err)
return err;
@@ -2005,9 +2005,9 @@ imgtoolerr_t imgtool::partition::delete_directory(const char *path)
if (!m_delete_dir)
return imgtoolerr_t(IMGTOOLERR_UNIMPLEMENTED | IMGTOOLERR_SRC_FUNCTIONALITY);
- // cannonicalize path
- std::string cannonical_path;
- err = cannonicalize_path(PATH_MUSTBEDIR, path, cannonical_path);
+ // canonicalize path
+ std::string canonical_path;
+ err = canonicalize_path(PATH_MUSTBEDIR, path, canonical_path);
if (err)
return err;
@@ -2296,8 +2296,8 @@ imgtoolerr_t imgtool::directory::open(imgtool::partition &partition, const std::
if (!partition.m_next_enum)
return imgtoolerr_t(IMGTOOLERR_UNIMPLEMENTED | IMGTOOLERR_SRC_FUNCTIONALITY);
- std::string cannonical_path;
- err = partition.cannonicalize_path(PATH_MUSTBEDIR, path.c_str(), cannonical_path);
+ std::string canonical_path;
+ err = partition.canonicalize_path(PATH_MUSTBEDIR, path.c_str(), canonical_path);
if (err)
return err;
@@ -2309,7 +2309,7 @@ imgtoolerr_t imgtool::directory::open(imgtool::partition &partition, const std::
if (partition.m_begin_enum)
{
- err = partition.m_begin_enum(*enumeration, cannonical_path.c_str());
+ err = partition.m_begin_enum(*enumeration, canonical_path.c_str());
if (err)
return markerrorsource(err);
}
diff --git a/src/tools/imgtool/imgtool.h b/src/tools/imgtool/imgtool.h
index 1a63ccd2399..aa4ae79e29e 100644
--- a/src/tools/imgtool/imgtool.h
+++ b/src/tools/imgtool/imgtool.h
@@ -226,8 +226,8 @@ namespace imgtool
std::unique_ptr<uint8_t[]> m_extra_bytes;
// methods
- imgtoolerr_t cannonicalize_path(uint32_t flags, const char *path, std::string &result);
- imgtoolerr_t cannonicalize_fork(const char **fork);
+ imgtoolerr_t canonicalize_path(uint32_t flags, const char *path, std::string &result);
+ imgtoolerr_t canonicalize_fork(const char **fork);
imgtoolerr_t map_block_to_image_block(uint64_t partition_block, uint64_t &image_block) const;
};
diff --git a/src/tools/imgtool/modules.cpp b/src/tools/imgtool/modules.cpp
index 35b31a38be0..1c573e3bcc9 100644
--- a/src/tools/imgtool/modules.cpp
+++ b/src/tools/imgtool/modules.cpp
@@ -26,8 +26,8 @@ static void (*const modules[])(const imgtool_class *imgclass, uint32_t state, un
#include "modules.cpp"
};
-/* step 3: declare imgtool_create_cannonical_library() */
-imgtoolerr_t imgtool_create_cannonical_library(bool omit_untested, std::unique_ptr<imgtool::library> &library)
+/* step 3: declare imgtool_create_canonical_library() */
+imgtoolerr_t imgtool_create_canonical_library(bool omit_untested, std::unique_ptr<imgtool::library> &library)
{
size_t i;
diff --git a/src/tools/imgtool/modules.h b/src/tools/imgtool/modules.h
index 9950e39857a..d58b5af008c 100644
--- a/src/tools/imgtool/modules.h
+++ b/src/tools/imgtool/modules.h
@@ -13,6 +13,6 @@
#include "library.h"
-imgtoolerr_t imgtool_create_cannonical_library(bool omit_untested, std::unique_ptr<imgtool::library> &library);
+imgtoolerr_t imgtool_create_canonical_library(bool omit_untested, std::unique_ptr<imgtool::library> &library);
#endif /* MODULES_H */
diff --git a/src/tools/imgtool/modules/fat.cpp b/src/tools/imgtool/modules/fat.cpp
index 057a5c68770..029050d1e9c 100644
--- a/src/tools/imgtool/modules/fat.cpp
+++ b/src/tools/imgtool/modules/fat.cpp
@@ -1211,7 +1211,7 @@ static void fat_calc_dirent_lfnchecksum(uint8_t *entry, size_t entry_len)
-static char fat_cannonicalize_sfn_char(char ch)
+static char fat_canonicalize_sfn_char(char ch)
{
/* return the display version of this short file name character */
return tolower(ch);
@@ -1219,7 +1219,7 @@ static char fat_cannonicalize_sfn_char(char ch)
-static void fat_cannonicalize_sfn(char *sfn, const uint8_t *sfn_bytes)
+static void fat_canonicalize_sfn(char *sfn, const uint8_t *sfn_bytes)
{
/* return the display version of this short file name */
int i;
@@ -1236,7 +1236,7 @@ static void fat_cannonicalize_sfn(char *sfn, const uint8_t *sfn_bytes)
rtrim(sfn);
}
for (i = 0; sfn[i]; i++)
- sfn[i] = fat_cannonicalize_sfn_char(sfn[i]);
+ sfn[i] = fat_canonicalize_sfn_char(sfn[i]);
}
@@ -1360,7 +1360,7 @@ static imgtoolerr_t fat_read_dirent(imgtool::partition &partition, fat_file *fil
}
/* pick apart short filename */
- fat_cannonicalize_sfn(ent.short_filename, entry);
+ fat_canonicalize_sfn(ent.short_filename, entry);
/* and the long filename */
if (lfn_lastentry == 1)
@@ -1411,7 +1411,7 @@ static imgtoolerr_t fat_construct_dirent(const char *filename, creation_policy_t
char32_t ch;
char last_short_char = ' ';
char short_char = '\0';
- char cannonical_short_char;
+ char canonical_short_char;
char16_t buf[UTF16_CHAR_MAX];
int i, len;
int sfn_pos = 0;
@@ -1457,10 +1457,10 @@ static imgtoolerr_t fat_construct_dirent(const char *filename, creation_policy_t
short_char = (char) ch;
else
short_char = '\0'; /* illegal SFN char */
- cannonical_short_char = fat_cannonicalize_sfn_char((char) ch);
- if (!short_char || (short_char != cannonical_short_char))
+ canonical_short_char = fat_canonicalize_sfn_char((char) ch);
+ if (!short_char || (short_char != canonical_short_char))
{
- if (toupper(short_char) == toupper(cannonical_short_char))
+ if (toupper(short_char) == toupper(canonical_short_char))
sfn_disposition = std::max(sfn_disposition, SFN_DERIVATIVE);
else
sfn_disposition = SFN_MANGLED;
@@ -1732,7 +1732,7 @@ static imgtoolerr_t fat_lookup_path(imgtool::partition &partition, const char *p
goto done;
bumped_sfn = false;
- fat_cannonicalize_sfn(sfn, &created_entry[created_entry_len - FAT_DIRENT_SIZE]);
+ fat_canonicalize_sfn(sfn, &created_entry[created_entry_len - FAT_DIRENT_SIZE]);
do
{
@@ -1744,7 +1744,7 @@ static imgtoolerr_t fat_lookup_path(imgtool::partition &partition, const char *p
{
bumped_sfn = true;
fat_bump_dirent(partition, created_entry, created_entry_len);
- fat_cannonicalize_sfn(sfn, &created_entry[created_entry_len - FAT_DIRENT_SIZE]);
+ fat_canonicalize_sfn(sfn, &created_entry[created_entry_len - FAT_DIRENT_SIZE]);
}
}
while(!ent.eof);