libtiff: Merge branch 'typo_fixes' into 'master'

From c95c77350820e19c8e273925bc97259727d19695 Mon Sep 17 00:00:00 2001
From: Even Rouault <[EMAIL REDACTED]>
Date: Tue, 2 Apr 2024 02:21:50 +0200
Subject: [PATCH] Various typo fixes

---
 ChangeLog                        | 46 ++++++++++++++++----------------
 configure.ac                     |  2 +-
 libtiff/mkg3states.c             |  4 +--
 libtiff/tif_dir.h                |  6 ++---
 libtiff/tif_dirread.c            |  2 +-
 libtiff/tif_dirwrite.c           |  2 +-
 test/custom_dir_EXIF_231.c       |  2 +-
 test/rational_precision2double.c | 14 +++++-----
 test/test_IFD_enlargement.c      | 12 ++++-----
 test/test_directory.c            |  6 ++---
 test/test_open_options.c         |  2 +-
 test/test_write_read_tags.c      | 10 +++----
 tools/CMakeLists.txt             | 12 ++++-----
 tools/unsupported/CMakeLists.txt |  6 ++---
 14 files changed, 63 insertions(+), 63 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 87b5f126..a538cc1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -299,7 +299,7 @@
 	Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59751
 
 	In 738e0409 (refs #575), we disabled DNG / EP tags, but there was a
-	special proessing for TIFFTAG_EP_BATTERYLEVEL that must be disabled
+	special processing for TIFFTAG_EP_BATTERYLEVEL that must be disabled
 	since the tag is no longer defined.
 
 2023-06-09  Su_Laus  <sulau@freenet.de>
@@ -395,8 +395,8 @@
 	tif_dirinfo.c: disable DNG 1.2->1.6 tags.
 	They were added per b90b20d36d7833f54a1f3014c324f6c21b988006 but it has
 	been found in https://gitlab.com/libtiff/libtiff/-/issues/575 that it
-	could cause compatibity issues with libtiff users, so this addition
-	should be defered for a feature release (likely 4.6.0) and not a patch one.
+	could cause compatibility issues with libtiff users, so this addition
+	should be deferred for a feature release (likely 4.6.0) and not a patch one.
 
 	Fixes #575
 
@@ -576,7 +576,7 @@
 2023-05-06  Even Rouault  <even.rouault@spatialys.com>
 
 	Merge branch 'fix_548' into 'master'
-	LZWDecode(): avoid crash when trying to read again from a strip whith a...
+	LZWDecode(): avoid crash when trying to read again from a strip with a...
 
 	Closes #548
 
@@ -610,7 +610,7 @@
 
 2023-04-29  Even Rouault  <even.rouault@spatialys.com>
 
-	LZWDecode(): avoid crash when trying to read again from a strip whith a missing end-of-information marker (fixes #548)
+	LZWDecode(): avoid crash when trying to read again from a strip with a missing end-of-information marker (fixes #548)
 
 2023-04-25  Su_Laus  <sulau@freenet.de>
 
@@ -1339,7 +1339,7 @@
 
 	Use structures that can be extended as extra argument.
 
-	Leverages and ammends https://gitlab.com/libtiff/libtiff/-/merge_requests/409
+	Leverages and amends https://gitlab.com/libtiff/libtiff/-/merge_requests/409
 
 2022-11-21  Even Rouault  <even.rouault@spatialys.com>
 
@@ -2077,7 +2077,7 @@
 	to
 	{ TIFFTAG_INTEROPERABILITYIFD, 1, 1, TIFF_IFD8, 0, TIFF_SETGET_IFD8, TIFF_SETGET_UNDEFINED, FIELD_CUSTOM, 0, 0, "InteroperabilityIFDOffset", NULL },
 
-	However, if those tags schould not be handled by LibTiff because they are deamed as abandoned or unwanted tags, those tags need to be defined with FIELD_IGNORE instead of FIELD_CUSTOM and keeping set_field_type  = TIFF_SETGET_UNDEFINED
+	However, if those tags should not be handled by LibTiff because they are deamed as abandoned or unwanted tags, those tags need to be defined with FIELD_IGNORE instead of FIELD_CUSTOM and keeping set_field_type  = TIFF_SETGET_UNDEFINED
 
 2022-07-01  Su_Laus  <sulau@freenet.de>
 
@@ -2185,7 +2185,7 @@
 	tif_predict.c: make horAcc8() work with icc (ICC) 2021.6.0 20220226 -O2.
 	For a reason I don't understand, recent ICC generates wrong code in -O2
 	mode for the stride = 3 and 4 cases. The modified code is more
-	straightfoward, so go for it.
+	straightforward, so go for it.
 
 2022-06-19  Roger Leigh  <rleigh@codelibre.net>
 
@@ -2442,7 +2442,7 @@
 	Include stdlib.h in tif_lzw.c.
 	In `tif_lzw.c`, a call is made to `_byteswap_uint64`. This is declared in `stdlib.h`. `stdlib.h` is not included in `tib_lzw.c`, so a name error may occur.
 
-	This change adds `#include stdlib.h` to `tif_lzw.c`, to prevent a name error from occuring when `stdlib.h` is not included.
+	This change adds `#include stdlib.h` to `tif_lzw.c`, to prevent a name error from occurring when `stdlib.h` is not included.
 
 2022-05-29  Roger Leigh  <rleigh@codelibre.net>
 
@@ -2662,7 +2662,7 @@
 
 2022-04-22  Even Rouault  <even.rouault@spatialys.com>
 
-	tif_lzw.c: fix potential out-of-bounds error when trying to read in the same tile/strip after an error has occured (fixes #410)
+	tif_lzw.c: fix potential out-of-bounds error when trying to read in the same tile/strip after an error has occurred (fixes #410)
 
 2022-04-06  Su_Laus  <sulau@freenet.de>
 
@@ -3035,7 +3035,7 @@
 2022-02-11  Even Rouault  <even.rouault@spatialys.com>
 
 	Merge branch 'predictor_2_64bit' into 'master'
-	Predictor 2 (horizontal differenciation): support 64-bit
+	Predictor 2 (horizontal differentiation): support 64-bit
 
 	See merge request libtiff/libtiff!296
 
@@ -3054,7 +3054,7 @@
 
 2022-02-09  Even Rouault  <even.rouault@spatialys.com>
 
-	Predictor 2 (horizontal differenciation): support 64-bit.
+	Predictor 2 (horizontal differentiation): support 64-bit.
 	There's no reason not to support 64-bit. The TIFF 6 specification
 	doesn't say anything about that (and even mention 4-bit, which we don't
 	support)
@@ -3237,8 +3237,8 @@
 2021-12-13  Even Rouault  <even.rouault@spatialys.com>
 
 	OJPEG: avoid assertion when using TIFFReadScanline() (fixes #337)
-	Note: my analyis of the issue would be that the use of the scanline API
-	is currently propably broken with OJPEG.
+	Note: my analysis of the issue would be that the use of the scanline API
+	is currently probably broken with OJPEG.
 
 2021-12-10  Even Rouault  <even.rouault@spatialys.com>
 
@@ -3492,7 +3492,7 @@
 2021-09-23  Even Rouault  <even.rouault@spatialys.com>
 
 	TIFFAppendToStrip(): fix rewrite-in-place logic.
-	reproducable in particular with packbits compression.
+	reproducible in particular with packbits compression.
 
 	Fixes https://github.com/OSGeo/gdal/issues/4538
 
@@ -3960,7 +3960,7 @@
 2021-03-07  Antonio Valentino  <Antonio.Valentino@esa.int>
 
 	Add LERC plugin.
-	The lerc plugin code has been copyed form GDAL.
+	The lerc plugin code has been copied:* form GDAL.
 
 2021-03-06  Roger Leigh  <rleigh@codelibre.net>
 
@@ -4160,7 +4160,7 @@
 
 	Correct include order.
 
-	Eliminate implict fallthrough usage.
+	Eliminate implicit fallthrough usage.
 	Use simple loops in place of manual loop unrolling.  Rely on
 	the compiler optimiser to unroll loops when appropriate.
 
@@ -4422,7 +4422,7 @@
 2021-01-18  Even Rouault  <even.rouault@spatialys.com>
 
 	Merge branch 'tiffcmp' into 'master'
-	tiffcmp: fix comparaison with pixels that are fractional number of bytes
+	tiffcmp: fix comparison with pixels that are fractional number of bytes
 
 	Closes #53
 
@@ -4438,8 +4438,8 @@
 
 2021-01-15  Thomas Bernard  <miniupnp@free.fr>
 
-	tiffcmp: fix comparaison with pixels that are fractional number of bytes
-	For exemple : 4bits per sample + 3 samples per pixel => 1.5 bytes per pixel
+	tiffcmp: fix comparison with pixels that are fractional number of bytes
+	For example : 4bits per sample + 3 samples per pixel => 1.5 bytes per pixel
 
 	tiff2ps: exit the loop in case of error.
 	fixes #232
@@ -4634,7 +4634,7 @@
 2020-12-31  Kurt Schwehr  <schwehr@google.com>
 
 	custom_dir_EXIF_231.c: dos2unix and codespell.
-	additonal, Varable, greather, alwasy
+	additional, Varable, greather, alwasy
 
 2020-12-31  Kurt Schwehr  <schwehr@google.com>
 
@@ -6208,7 +6208,7 @@
 
 2019-10-03  Even Rouault  <even.rouault@spatialys.com>
 
-	tif_read: align code of TIFFReadRawStrip() and TIFFReadRawTile() that differed for non good reason. Non-functional change normally. (fixes GitLab #162)
+	tif_read: align code of TIFFReadRawStrip() and TIFFReadRawTile() that deferred for non good reason. Non-functional change normally. (fixes GitLab #162)
 
 2019-10-01  Even Rouault  <even.rouault@spatialys.com>
 
@@ -7740,7 +7740,7 @@
 
 2017-11-23  Roger Leigh  <rleigh@codelibre.net>
 
-	appveyor: Correct path for git clone and skip artefact archival.
+	appveyor: Correct path for git clone and skip artifact archival.
 
 2017-11-22  Roger Leigh  <rleigh@codelibre.net>
 
diff --git a/configure.ac b/configure.ac
index e86208d9..d4e65c69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -198,7 +198,7 @@ dnl Check if optarg (and presumably related externs) already declared in headers
 AC_CHECK_DECLS([optarg])
 
 dnl ---------------------------------------------------------------------------
-dnl Deprecated features and backward compatibilty
+dnl Deprecated features and backward compatibility
 dnl ---------------------------------------------------------------------------
 
 AC_ARG_ENABLE([deprecated],
diff --git a/libtiff/mkg3states.c b/libtiff/mkg3states.c
index f32113a3..3f60a282 100644
--- a/libtiff/mkg3states.c
+++ b/libtiff/mkg3states.c
@@ -22,7 +22,7 @@
  * OF THIS SOFTWARE.
  */
 
-/* Initialise fax decoder tables
+/* Initialize fax decoder tables
  * Decoder support is derived, with permission, from the code
  * in Frank Cringle's viewfax program;
  *      Copyright (C) 1990, 1995  Frank D. Cringle.
@@ -194,7 +194,7 @@ void WriteTable(FILE *fd, const TIFFFaxTabEnt *T, int Size, const char *name)
     fprintf(fd, "\n};\n");
 }
 
-/* initialise the huffman code tables */
+/* initialize the huffman code tables */
 int main(int argc, char *argv[])
 {
     FILE *fd;
diff --git a/libtiff/tif_dir.h b/libtiff/tif_dir.h
index 4afb1491..f9558b62 100644
--- a/libtiff/tif_dir.h
+++ b/libtiff/tif_dir.h
@@ -146,9 +146,9 @@ typedef struct
         td_deferstrilearraywriting; /* see TIFFDeferStrileArrayWriting() */
 
     /* LibTIFF writes all data that does not fit into the IFD entries directly
-     * after the IFD tag enty part. When reading, only the IFD data directly and
-     * continuously behind the IFD tags is taken into account for the IFD data
-     * size.*/
+     * after the IFD tag entry part. When reading, only the IFD data directly
+     * and continuously behind the IFD tags is taken into account for the IFD
+     * data size.*/
     uint64_t td_dirdatasize_write; /* auxiliary for evaluating size of IFD data
                                        to be written */
     uint64_t td_dirdatasize_read;  /* auxiliary for evaluating size of IFD data
diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
index 6fe436f6..8f57e1b9 100644
--- a/libtiff/tif_dirread.c
+++ b/libtiff/tif_dirread.c
@@ -4182,7 +4182,7 @@ static void CalcFinalIFDdatasizeReading(TIFF *tif, uint16_t dircount)
         }
         else
         {
-            /* Further data is no more continously after IFD */
+            /* Further data is no more continuously after IFD */
             break;
         }
     }
diff --git a/libtiff/tif_dirwrite.c b/libtiff/tif_dirwrite.c
index 499211aa..d7781fc8 100644
--- a/libtiff/tif_dirwrite.c
+++ b/libtiff/tif_dirwrite.c
@@ -2017,7 +2017,7 @@ static void EvaluateIFDdatasizeWrite(TIFF *tif, uint32_t count,
     uint64_t datalength = (uint64_t)count * typesize;
     if (datalength > ((tif->tif_flags & TIFF_BIGTIFF) ? 0x8U : 0x4U))
     {
-        /* LibTIFF increments write adress to an even offset, thus datalenght
+        /* LibTIFF increments write address to an even offset, thus datalenght
          * written is also incremented. */
         if (datalength & 1)
             datalength++;
diff --git a/test/custom_dir_EXIF_231.c b/test/custom_dir_EXIF_231.c
index eef88375..18ee91e5 100644
--- a/test/custom_dir_EXIF_231.c
+++ b/test/custom_dir_EXIF_231.c
@@ -409,7 +409,7 @@ int write_test_tiff(TIFF *tif, const char *filenameRead)
        Rational2Double or still uses the old definitions. For that,
        TIFF_RATIONAL tags with FIELD_CUSTOM are changed from TIFF_SETGET_DOUBLE
        to TIFF_SETGET_FLOAT for the new interface in order to prevent the old
-       reading behaviour. Tags to check: TIFFTAG_BESTQUALITYSCALE,
+       reading behavior. Tags to check: TIFFTAG_BESTQUALITYSCALE,
        TIFFTAG_BASELINENOISE, TIFFTAG_BASELINESHARPNESS
      */
     fip = TIFFFindField(tif, TIFFTAG_BESTQUALITYSCALE, TIFF_ANY);
diff --git a/test/rational_precision2double.c b/test/rational_precision2double.c
index 1683cb9a..7edb04c9 100644
--- a/test/rational_precision2double.c
+++ b/test/rational_precision2double.c
@@ -31,7 +31,7 @@
  * Extended and amended version for testing the TIFFSetField() / and
  *TIFFGetField()- interface for custom fields of type RATIONAL when the TIFFLib
  *internal precision is updated from FLOAT to DOUBLE! The external interface of
- *already defined tags schould be kept. This is verified for some of those tags
+ *already defined tags should be kept. This is verified for some of those tags
  *with this test.
  *
  */
@@ -131,7 +131,7 @@ static const TIFFField tifFieldInfo[] = {
 
 #define N(a) (sizeof(a) / sizeof(a[0]))
 
-/*--- Add aditional Rational-Double Tags to TIFF
+/*--- Add additional Rational-Double Tags to TIFF
           ref: html\addingtags.html but with new function _TIFFMergeFields().
 ---*/
 
@@ -203,7 +203,7 @@ int main()
     int ret;
     int errorNo;
 
-    /*-- Initialize TIFF-Extender to add additonal TIFF-Tags --*/
+    /*-- Initialize TIFF-Extender to add additional TIFF-Tags --*/
     _XTIFFInitialize();
 
     fprintf(stderr, "==== Test if Set()/Get() interface for some custom "
@@ -557,7 +557,7 @@ int write_test_tiff(TIFF *tif, const char *filenameRead, int blnAllCustomTags)
             goto failure;
         }
 
-        /*- Varable Array:  TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT */
+        /*- Variable Array:  TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT */
         if (!TIFFSetField(tif, TIFFTAG_BLACKLEVEL, 3, auxFloatArrayN1))
         { /* for TIFF_SETGET_C16_FLOAT */
             fprintf(stderr, "Can't set TIFFTAG_BLACKLEVEL tag.\n");
@@ -669,7 +669,7 @@ int write_test_tiff(TIFF *tif, const char *filenameRead, int blnAllCustomTags)
                         {
                             fprintf(stderr,
                                     "WriteCount for .set_field_type %d should "
-                                    "be -1 or greather than 1!  %s\n",
+                                    "be -1 or greater than 1!  %s\n",
                                     tSetFieldType,
                                     tFieldArray->fields[i].field_name);
                         }
@@ -1151,7 +1151,7 @@ int write_test_tiff(TIFF *tif, const char *filenameRead, int blnAllCustomTags)
                             else
                             {
                                 /* Old interface reads TIFF_RATIONAL defined as
-                                 * TIFF_SETGET_DOUBLE alwasy as FLOAT */
+                                 * TIFF_SETGET_DOUBLE always as FLOAT */
                                 auxDouble = (double)auxDblUnion.flt1;
                             }
                         }
@@ -1197,7 +1197,7 @@ int write_test_tiff(TIFF *tif, const char *filenameRead, int blnAllCustomTags)
                         {
                             fprintf(stderr,
                                     "Reading: WriteCount for .set_field_type "
-                                    "%d should be -1 or greather than 1!  %s\n",
+                                    "%d should be -1 or greater than 1!  %s\n",
                                     tSetFieldType,
                                     tFieldArray->fields[i].field_name);
                             GOTOFAILURE
diff --git a/test/test_IFD_enlargement.c b/test/test_IFD_enlargement.c
index 212c08e1..8f590d50 100644
--- a/test/test_IFD_enlargement.c
+++ b/test/test_IFD_enlargement.c
@@ -134,7 +134,7 @@ int write_image_data(TIFF *tif, uint16_t width, uint16_t length, bool tiled,
     return 0;
 } /*-- write_image_data() --*/
 
-/* Fills the acitve IFD with some default values and writes
+/* Fills the active IFD with some default values and writes
  *  an image with given number of lines as strips (scanlines) or tiles to file.
  */
 int write_data_to_current_directory(TIFF *tif, uint16_t width, uint16_t length,
@@ -226,7 +226,7 @@ int write_data_to_current_directory(TIFF *tif, uint16_t width, uint16_t length,
     return 0;
 } /*-- write_data_to_current_directory() --*/
 
-/* Adds an EXIF IFD with some default values to the acitve IFD.
+/* Adds an EXIF IFD with some default values to the active IFD.
  */
 int write_EXIF_data_to_current_directory(TIFF *tif, int i,
                                          uint64_t *dir_offset_EXIF)
@@ -370,7 +370,7 @@ int test_IFD_enlargement(const char *filename, unsigned int openMode,
         }
         if (is_strile_array_writing)
         {
-            /* Set flag for defered strile-array writing. */
+            /* Set flag for deferred strile-array writing. */
             if (!TIFFDeferStrileArrayWriting(tif))
             {
                 fprintf(
@@ -573,7 +573,7 @@ int test_IFD_enlargement(const char *filename, unsigned int openMode,
     }
 
     /* Check IFD 0 offset, which should have been changed.
-     * (Because of unsused bytes before EOF generated by downsizing of XMLPACKET
+     * (Because of unused bytes before EOF generated by downsizing of XMLPACKET
      * before enlarging IFD will be re-written even for numIFDs==1) */
     if (!TIFFSetDirectory(tif, 0))
     {
@@ -1459,7 +1459,7 @@ int test_CheckpointDirectory(const char *filename, bool is_big_tiff)
         }
         /* Check IFD offsets:
          * First IFD shall be overwritten (same offset) and second IFD shall be
-         * re-written (differen offset). */
+         * re-written (different offset). */
         if (!TIFFSetDirectory(tif, i))
         {
             fprintf(stderr, "Can't set directory %d of %s. Testline %d\n", i,
@@ -1602,7 +1602,7 @@ int test_CheckpointDirectory(const char *filename, bool is_big_tiff)
     return 1;
 } /*-- test_CheckpointDirectory --*/
 
-/* LibTIFF increments IFD write-pointer allways to even adresses, thus leaving 1
+/* LibTIFF increments IFD write-pointer always to even addresses, thus leaving 1
  * byte gaps in the data space for data outside IFD entries. This routine
  * checks correct handling for that.
  */
diff --git a/test/test_directory.c b/test/test_directory.c
index 02f06bf2..9dc589ec 100644
--- a/test/test_directory.c
+++ b/test/test_directory.c
@@ -444,7 +444,7 @@ int test_arbitrary_directrory_loading(unsigned int openMode)
     if (TIFFSetDirectory(tif, N_DIRECTORIES))
     {
         fprintf(stderr,
-                "No expected fail for accessing not existant directory number "
+                "No expected fail for accessing not existent directory number "
                 "%d in file %s\n",
                 N_DIRECTORIES, filename);
         goto failure;
@@ -530,7 +530,7 @@ int test_arbitrary_directrory_loading(unsigned int openMode)
     }
 
     /* Second UnlinkDirectory -> two IFDs are missing in the main-IFD chain
-     * then, orignal dirnum 2 and 3 */
+     * then, original dirnum 2 and 3 */
     if (!TIFFUnlinkDirectory(tif, 3))
     {
         fprintf(stderr, "Can't unlink directory %d within %s\n", 3, filename);
@@ -649,7 +649,7 @@ int test_arbitrary_directrory_loading(unsigned int openMode)
     }
 
     /* Third UnlinkDirectory -> three IFDs are missing in the main-IFD chain
-     * then, orignal dirnum 0, 2 and 3
+     * then, original dirnum 0, 2 and 3
      * Furthermore, this test checks that TIFFUnlinkDirectory() can unlink
      * the first directory dirnum = 0 and a following TIFFSetDirectory(0)
      * does not load the unlinked directory. */
diff --git a/test/test_open_options.c b/test/test_open_options.c
index f0a8332d..570f3945 100644
--- a/test/test_open_options.c
+++ b/test/test_open_options.c
@@ -357,7 +357,7 @@ int open_file_and_write(const char *filename, char *openModeString,
  * 'tiff_offsetsize' are swapped or not, depending how the file was opened: They
  * were not swapped when opening with "w" or opening an not existent file with
  * "a". They were swapped when opening an existent file with "r" or "a". This
- * behaviour shall be harmonized so that the internal parameters are allways in
+ * behaviour shall be harmonized so that the internal parameters are always in
  * host byte-order.
  */
 int test_TIFFheader_swapping(void)
diff --git a/test/test_write_read_tags.c b/test/test_write_read_tags.c
index 0bd5cca5..a583a02b 100644
--- a/test/test_write_read_tags.c
+++ b/test/test_write_read_tags.c
@@ -103,7 +103,7 @@ char inkNamesW[] = {"Ink1\0Ink2\0Ink3"};
 #define NUM_ELEMENTS(x) (sizeof(x) / sizeof(x[0]))
 
 /* -- List of tags, which must not be written with arbitrary values because they
- *    are written explicitely by the test program (like the basic TIFF tags),
+ *    are written explicitly by the test program (like the basic TIFF tags),
  *    are automatically written by LibTIFF (e.g.TIFFTAG_NUMBEROFINKS),
  *    have some special characteristics, or write procedure is not supported
  * yet.
@@ -519,7 +519,7 @@ int write_test_tiff(TIFF *tif, const char *filenameRead)
     /*-- Write dummy pixel data at the end of all directories. --*/
     if (TIFFWriteScanline(tif, buf, 0, 0) < 0)
     {
-        fprintf(stderr, "Can't write image data after all direcories.\n");
+        fprintf(stderr, "Can't write image data after all directories.\n");
         goto failure;
     }
 #endif
@@ -946,7 +946,7 @@ int write_all_tags(TIFF *tif, const TIFFFieldArray *tFieldArray,
     for (uint32_t t = 0; t < nTags; i++, t++)
     {
         bool deferredSetField = false;
-        /* Allways reset variableArrayCount to default value here. */
+        /* Always reset variableArrayCount to default value here. */
         uint32_t variableArrayCount = VARIABLE_ARRAY_SIZE;
 
         uint32_t tTag = tFieldArray->fields[t].field_tag;
@@ -1103,7 +1103,7 @@ int write_all_tags(TIFF *tif, const TIFFFieldArray *tFieldArray,
                             tSetFieldType, tFieldArray->fields[t].field_name);
                 }
                 break;
-                /* _Cxx_ just defines the precense and size of the count
+                /* _Cxx_ just defines the presence and size of the count
                  * parameter for the array:
                  * - C0=no count parameter (fixed array where,
                  *      positive readcount/writecount gives array count)
@@ -1613,7 +1613,7 @@ int read_all_tags(TIFF *tif, const TIFFFieldArray *tFieldArray,
             case TIFF_SETGET_C32_UINT32:
             case TIFF_SETGET_C32_SINT32:
             {
-                /* _Cxx_ just defines the precense and size of the count
+                /* _Cxx_ just defines the presence and size of the count
                  * parameter for the array:
                  * - C0=no count parameter (fixed array where,
                  *      positive readcount/writecount gives array count)
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 08b25bd2..dab13a58 100755
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -25,29 +25,29 @@
 # Windows specific resource preparation
 if (WIN32)
   message(STATUS "Include resource version information for TOOLS")
-  set(MSVC_RESSOURCE_FILE tif_tools_versioninfo.rc)
+  set(MSVC_RESOURCE_FILE tif_tools_versioninfo.rc)
   source_group("Resource Files" FILES tif_tools_versioninfo.rc)
 endif ()
 
 
 add_executable(tiffcp ../placeholder.h)
-target_sources(tiffcp PRIVATE tiffcp.c ${MSVC_RESSOURCE_FILE})
+target_sources(tiffcp PRIVATE tiffcp.c ${MSVC_RESOURCE_FILE})
 target_link_libraries(tiffcp PRIVATE tiff tiff_port)
 
 add_executable(tiffdump ../placeholder.h)
-target_sources(tiffdump PRIVATE tiffdump.c ${MSVC_RESSOURCE_FILE})
+target_sources(tiffdump PRIVATE tiffdump.c ${MSVC_RESOURCE_FILE})
 target_link_libraries(tiffdump PRIVATE tiff tiff_port)
 
 add_executable(tiffinfo ../placeholder.h)
-target_sources(tiffinfo PRIVATE tiffinfo.c ${MSVC_RESSOURCE_FILE})
+target_sources(tiffinfo PRIVATE tiffinfo.c ${MSVC_RESOURCE_FILE})
 target_link_libraries(tiffinfo PRIVATE tiff tiff_port)
 
 add_executable(tiffset ../placeholder.h)
-target_sources(tiffset PRIVATE tiffset.c ${MSVC_RESSOURCE_FILE})
+target_sources(tiffset PRIVATE tiffset.c ${MSVC_RESOURCE_FILE})
 target_link_libraries(tiffset PRIVATE tiff tiff_port)
 
 add_executable(tiffsplit ../placeholder.h)
-target_sources(tiffsplit PRIVATE tiffsplit.c ${MSVC_RESSOURCE_FILE})
+target_sources(tiffsplit PRIVATE tiffsplit.c ${MSVC_RESOURCE_FILE})
 target_link_libraries(tiffsplit PRIVATE tiff tiff_port)
 
 # rgb2ycbcr and thumbnail are intended to *NOT* be installed. They are for
diff --git a/tools/unsupported/CMakeLists.txt b/tools/unsupported/CMakeLists.txt
index 69283949..8a2843ff 100644
--- a/tools/unsupported/CMakeLists.txt
+++ b/tools/unsupported/CMakeLists.txt
@@ -27,17 +27,17 @@ message(STATUS "====  Tools - Unsupported =========")
 # Windows specific resource preparation
 if (WIN32)
   message(STATUS "Include resource version information for TOOLS-UNSUPPORTED")
-  set(MSVC_RESSOURCE_FILE tif_tools-unsupported_versioninfo.rc)
+  set(MSVC_RESOURCE_FILE tif_tools-unsupported_versioninfo.rc)
   source_group("Resource Files" FILES tif_tools-unsupported_versioninfo.rc)
 endif ()
 
 
 add_executable(tiff2pdf ../../placeholder.h)
-target_sources(tiff2pdf PRIVATE tiff2pdf.c ${MSVC_RESSOURCE_FILE})
+target_sources(tiff2pdf PRIVATE tiff2pdf.c ${MSVC_RESOURCE_FILE})
 target_link_libraries(tiff2pdf PRIVATE tiff tiff_port)
 
 add_executable(tiff2ps ../../placeholder.h)
-target_sources(tiff2ps PRIVATE tiff2ps.c ${MSVC_RESSOURCE_FILE})
+target_sources(tiff2ps PRIVATE tiff2ps.c ${MSVC_RESOURCE_FILE})
 target_link_libraries(tiff2ps PRIVATE tiff tiff_port CMath::CMath)
 
 # rgb2ycbcr and thumbnail are intended to *NOT* be installed. They are for