[PATCH] simple spelling changes

Stephen Hemminger stephen at networkplumber.org
Sun Nov 15 10:15:40 PST 2015


Fix obvious spelling mistakes in comments (and one error message).

Yes, this is trivial but I saw one while reviewing some of the code
and after that decided to run code through some tools.

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>


--- a/subsurface-core/datatrak.c	2015-11-14 10:09:43.967543480 -0800
+++ b/subsurface-core/datatrak.c	2015-11-15 10:04:54.504836973 -0800
@@ -37,7 +37,7 @@ static unsigned char *byte_to_bits(unsig
 
 /*
  * Datatrak stores the date in days since 01-01-1600, while Subsurface uses
- * time_t (seconds since 00:00 01-01-1970). Function substracts
+ * time_t (seconds since 00:00 01-01-1970). Function subtracts
  * (1970 - 1600) * 365,2425 = 135139,725  to our date variable, getting the
  * days since Epoch.
  */
@@ -123,7 +123,7 @@ static struct sample *dtrak_profile(stru
 		}
 		free(byte);
 
-		// In commit 5f44fdd setpoint replaced po2, so although this is not necesarily CCR dive ...
+		// In commit 5f44fdd setpoint replaced po2, so although this is not necessarily CCR dive ...
 		if (is_O2)
 			sample->setpoint.mbar = calculate_depth_to_mbar(sample->depth.mm, dt_dive->surface_pressure, 0) * o2percent / 100;
 		j++;
--- a/subsurface-core/device.c	2015-11-14 10:09:43.967543480 -0800
+++ b/subsurface-core/device.c	2015-11-15 10:12:23.738913397 -0800
@@ -85,7 +85,7 @@ static int fill_samples(struct sample *s
 }
 
 /* we have no average depth; instead of making up a random average depth
- * we should assume either a PADI recrangular profile (for short and/or
+ * we should assume either a PADI rectangular profile (for short and/or
  * shallow dives) or more reasonably a six point profile with a 3 minute
  * safety stop at 5m */
 static void fill_samples_no_avg(struct sample *s, int max_d, int max_t, double slope)
@@ -129,7 +129,7 @@ struct divecomputer *fake_dc(struct dive
 
 	/*
 	 * We want to fake the profile so that the average
-	 * depth ends up correct. However, in the absense of
+	 * depth ends up correct. However, in the absence of
 	 * a reasonable average, let's just make something
 	 * up. Note that 'avg_d == max_d' is _not_ a reasonable
 	 * average.
--- a/subsurface-core/dive.c	2015-11-14 10:09:43.967543480 -0800
+++ b/subsurface-core/dive.c	2015-11-15 10:11:50.554760014 -0800
@@ -1729,7 +1729,7 @@ int gasmix_distance(const struct gasmix
 }
 
 /* fill_pressures(): Compute partial gas pressures in bar from gasmix and ambient pressures, possibly for OC or CCR, to be
- * extended to PSCT. This function does the calculations of gass pressures applicable to a single point on the dive profile.
+ * extended to PSCT. This function does the calculations of gases pressures applicable to a single point on the dive profile.
  * The structure "pressures" is used to return calculated gas pressures to the calling software.
  * Call parameters:	po2 = po2 value applicable to the record in calling function
  *			amb_pressure = ambient pressure applicable to the record in calling function
@@ -2245,7 +2245,7 @@ static bool new_without_trip(struct dive
  *
  *  - dive computers with "relative datestamps" (ie the dive
  *    computer doesn't actually record an absolute date at all,
- *    but instead at download-time syncronizes its internal
+ *    but instead at download-time synchronizes its internal
  *    time with real-time on the downloading computer)
  *
  *  - using multiple dive computers with different real time on
@@ -2799,15 +2799,15 @@ int count_dives_with_suit(const char *su
  *     are merged into one longer dive, because the user asked for it
  *     in the divelist.
  *
- *     Because this case is with teh same dive computer, we *know* the
+ *     Because this case is with the same dive computer, we *know* the
  *     two must have a different start time, and "offset" is the relative
  *     time difference between the two.
  *
- * (a) two different dive computers that we migth want to merge into
+ * (a) two different dive computers that we might want to merge into
  *     one single dive with multiple dive computers.
  *
  *     This is the "try_to_merge()" case, which will have offset == 0,
- *     even if the dive times migth be different.
+ *     even if the dive times moth be different.
  */
 struct dive *merge_dives(struct dive *a, struct dive *b, int offset, bool prefer_downloaded)
 {
@@ -3054,7 +3054,7 @@ int split_dive(struct dive *dive)
 			continue;
 		}
 
-		// Goind down again? We want at least a minute from
+		// Going down again? We want at least a minute from
 		// the surface start.
 		if (!surface_start)
 			continue;
--- a/subsurface-core/ostctools.c	2015-11-14 10:09:43.967543480 -0800
+++ b/subsurface-core/ostctools.c	2015-11-15 10:05:46.801078696 -0800
@@ -59,7 +59,7 @@ static int ostc_prepare_data(int data_mo
 
 /*
  * OSTCTools stores the raw dive data in heavily padded files, one dive
- * each file. So it's not necesary to iterate once and again on a parsing
+ * each file. So it's not necessary to iterate once and again on a parsing
  * function. Actually there's only one kind of archive for every DC model.
  */
 void ostctools_import(const char *file, struct dive_table *divetable)
--- a/subsurface-core/uemis-downloader.c	2015-11-14 10:09:43.971543498 -0800
+++ b/subsurface-core/uemis-downloader.c	2015-11-15 10:09:39.986156509 -0800
@@ -289,7 +289,7 @@ static void str_append_with_delim(char *
 	snprintf(s + len, BUFLEN - len, "%s{", t);
 }
 
-/* The communication protocoll with the DC is truly funky.
+/* The communication protocol with the DC is truly funky.
  * After you write your request to the req.txt file you call this function.
  * It writes the number of the next ANS file at the beginning of the req.txt
  * file (prefixed by 'n' or 'r') and then again at the very end of it, after
@@ -330,7 +330,7 @@ static char *next_token(char **buf)
 	return q;
 }
 
-/* poor man's tokenizer that understands a quoted delimter ('{') */
+/* poor man's tokenizer that understands a quoted delimiter ('{') */
 static char *next_segment(char *buf, int *offset, int size)
 {
 	int i = *offset;
@@ -782,7 +782,7 @@ static bool uemis_delete_dive(device_dat
  * but the dive location API is even more crazy. We just get an id that is an
  * index into yet another data store that we read out later. In order to
  * correctly populate the location and gps data from that we need to remember
- * the adresses of those fields for every dive that references the divespot. */
+ * the addresses of those fields for every dive that references the divespot. */
 static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char *inbuf, char **max_divenr, bool keep_number, int *for_dive)
 {
 	char *buf = strdup(inbuf);
@@ -839,9 +839,9 @@ static bool process_raw_buffer(device_da
 			return false;
 		}
 		/* quickhack and workaround to capture the original dive_no
-		 * i am doing this so I dont have to change the original design
+		 * I am doing this so I don't have to change the original design
 		 * but when parsing a dive we never parse the dive number because
-		 * at the time it's being read the *dive varible is not set because
+		 * at the time it's being read the *dive variable is not set because
 		 * the dive_no tag comes before the object_id in the uemis ans file
 		 */
 		dive_no[0] = '\0';
@@ -1026,9 +1026,9 @@ static bool do_dump_buffer_to_file(char
  * filenr holds now the uemis filenr after having read several logs including the dive details,
  * fCapacity will five us the average number of files needed for all currently loaded data
  * remember the maximum file usage per dive
- * return : UEMIS_MEM_OK       if there is enough memeory for a full round
+ * return : UEMIS_MEM_OK       if there is enough memory for a full round
  *          UEMIS_MEM_CRITICAL if the memory is good for reading the dive logs
- *          UEMIS_MEM_FULL     if the memory is exhaused
+ *          UEMIS_MEM_FULL     if the memory is exhausted
  */
 static int get_memory(struct dive_table *td, int checkpoint)
 {
@@ -1101,14 +1101,14 @@ static void get_uemis_divespot(const cha
 			 */
 			(void)get_dive_site_uuid_by_name(nds->name, &ods);
 			if (ods) {
-				/* if the uuid's are the same, the new site is a duplicat and can be deleted */
+				/* if the uuid's are the same, the new site is a duplicate and can be deleted */
 				if (nds->uuid != ods->uuid) {
 					delete_dive_site(nds->uuid);
 					dive->dive_site_uuid = ods->uuid;
 				}
 			}
 		} else {
-			/* if we cant load the dive site details, delete the site we
+			/* if we can't load the dive site details, delete the site we
 			* created in process_raw_buffer
 			*/
 			delete_dive_site(dive->dive_site_uuid);
@@ -1150,7 +1150,7 @@ static bool get_matching_dive(int idx, c
 			if (mbuf) {
 				if (strstr(mbuf, log_file_no_to_find)) {
 					/* we found the logfilenr that matches our object_id from the divelog we were looking for
-					 * we mark the search sucessfull even if the dive has been deleted. */
+					 * we mark the search successful even if the dive has been deleted. */
 					found = true;
 					if (strstr(mbuf, "deleted{bool{true") == NULL) {
 						process_raw_buffer(data, deviceidnr, mbuf, &newmax, false, NULL);
@@ -1309,7 +1309,7 @@ const char *do_uemis_import(device_data_
 			 * As the object_id of the divelog entry and the object_id of the dive details are not necessarily the same, the match needs
 			 * to happen based on the logfilenr.
 			 * What the following part does is to optimize the mapping by using
-			 * dive_to_read = the dive deatils entry that need to be read using the object_id
+			 * dive_to_read = the dive details entry that need to be read using the object_id
 			 * logFileNoToFind = map the logfilenr of the dive details with the object_id = diveid from the get dive logs */
 			for (int i = match_dive_and_log; i < data->download_table->nr; i++) {
 				bool success = get_matching_dive(i, newmax, &uemis_mem_status, data, mountpath, deviceidnr);
@@ -1332,7 +1332,7 @@ const char *do_uemis_import(device_data_
 			/* if the user clicked cancel, exit gracefully */
 			if (import_thread_cancelled) {
 #if UEMIS_DEBUG & 4
-				fprintf(debugfile, "d_u_i thread cancelled, bailing\n");
+				fprintf(debugfile, "d_u_i thread canceled, bailing\n");
 #endif
 				break;
 			}
@@ -1352,7 +1352,7 @@ const char *do_uemis_import(device_data_
 #endif
 		} else {
 			/* some of the loading from the UEMIS failed at the divelog level
-			 * if the memory status = full, we cant even load the divespots and/or buddys.
+			 * if the memory status = full, we can't even load the divespots and/or buddies.
 			 * The loaded block of divelogs is useless and all new loaded divelogs need to
 			 * be deleted from the download_table.
 			 */


More information about the subsurface mailing list