Commit c0df59665de91324eeab1808c6c4e41343f21789

Stefan Sperling 2021-12-31T09:33:01

wrap overlong lines

diff --git a/got/got.c b/got/got.c
index 0b61ca9..f551f71 100644
--- a/got/got.c
+++ b/got/got.c
@@ -8449,7 +8449,8 @@ done:
 }
 
 static const struct got_error *
-show_rebase_merge_conflict(struct got_object_id *id, struct got_repository *repo)
+show_rebase_merge_conflict(struct got_object_id *id,
+    struct got_repository *repo)
 {
 	const struct got_error *err;
 	struct got_commit_object *commit = NULL;
@@ -8833,7 +8834,8 @@ done:
 }
 
 static const struct got_error *
-process_backup_refs(const char *backup_ref_prefix, const char *wanted_branch_name,
+process_backup_refs(const char *backup_ref_prefix,
+    const char *wanted_branch_name,
     int delete, struct got_repository *repo)
 {
 	const struct got_error *err;
diff --git a/include/got_object.h b/include/got_object.h
index b6870a5..592e776 100644
--- a/include/got_object.h
+++ b/include/got_object.h
@@ -186,7 +186,8 @@ void got_object_tree_close(struct got_tree_object *);
 int got_object_tree_get_nentries(struct got_tree_object *);
 
 /* Get the first tree entry from a tree, or NULL if there is none. */
-struct got_tree_entry *got_object_tree_get_first_entry(struct got_tree_object *);
+struct got_tree_entry *got_object_tree_get_first_entry(
+    struct got_tree_object *);
 
 /* Get the last tree entry from a tree, or NULL if there is none. */
 struct got_tree_entry *got_object_tree_get_last_entry(struct got_tree_object *);
diff --git a/include/got_reference.h b/include/got_reference.h
index dedfb8f..9871489 100644
--- a/include/got_reference.h
+++ b/include/got_reference.h
@@ -137,8 +137,9 @@ void got_ref_list_free(struct got_reflist_head *);
  * elements by got_ref_list_free().
  */
 const struct got_error *
-got_reflist_insert(struct got_reflist_entry **newp, struct got_reflist_head *refs,
-    struct got_reference *ref, got_ref_cmp_cb cmp_cb, void *cmp_arg);
+got_reflist_insert(struct got_reflist_entry **newp,
+    struct got_reflist_head *refs, struct got_reference *ref,
+    got_ref_cmp_cb cmp_cb, void *cmp_arg);
 
 /* Sort a list of references with the provided comparison callback. */
 const struct got_error *
diff --git a/lib/diff3.c b/lib/diff3.c
index ec933af..aa2b7c6 100644
--- a/lib/diff3.c
+++ b/lib/diff3.c
@@ -170,7 +170,8 @@ static int ed_patch_lines(struct rcs_lines *, struct rcs_lines *);
 static const struct got_error *skip(size_t *, int, int, struct diff3_state *);
 static const struct got_error *edscript(int, struct diff3_state *);
 static const struct got_error *merge(size_t, size_t, struct diff3_state *);
-static const struct got_error *prange(struct line_range *, struct diff3_state *);
+static const struct got_error *prange(struct line_range *,
+    struct diff3_state *);
 static const struct got_error *repos(int, struct diff3_state *);
 static const struct got_error *increase(struct diff3_state *);
 static const struct got_error *diff3_internal(char *, char *, char *,
diff --git a/lib/fileindex.c b/lib/fileindex.c
index 60539f2..71a058b 100644
--- a/lib/fileindex.c
+++ b/lib/fileindex.c
@@ -220,7 +220,8 @@ got_fileindex_entry_filetype_set(struct got_fileindex_entry *ie, int type)
 }
 
 void
-got_fileindex_entry_staged_filetype_set(struct got_fileindex_entry *ie, int type)
+got_fileindex_entry_staged_filetype_set(struct got_fileindex_entry *ie,
+    int type)
 {
 	ie->mode &= ~GOT_FILEIDX_MODE_FILE_TYPE_STAGED;
 	ie->mode |= ((type << GOT_FILEIDX_MODE_FILE_TYPE_STAGED_SHIFT) &
diff --git a/lib/got_lib_gitconfig.h b/lib/got_lib_gitconfig.h
index 7bfbb24..69dcf37 100644
--- a/lib/got_lib_gitconfig.h
+++ b/lib/got_lib_gitconfig.h
@@ -55,4 +55,5 @@ int      got_gitconfig_match_num(struct got_gitconfig *, char *, char *, int);
 const struct got_error *got_gitconfig_reinit(struct got_gitconfig *, int);
 int      got_gitconfig_remove(struct got_gitconfig *, int, char *, char *);
 int      got_gitconfig_remove_section(struct got_gitconfig *, int, char *);
-int      got_gitconfig_set(struct got_gitconfig *, int, char *, char *, char *, int, int);
+int      got_gitconfig_set(struct got_gitconfig *, int, char *, char *, char *,
+    int, int);
diff --git a/lib/got_lib_object_idcache.h b/lib/got_lib_object_idcache.h
index 20d9f5c..237746f 100644
--- a/lib/got_lib_object_idcache.h
+++ b/lib/got_lib_object_idcache.h
@@ -21,7 +21,8 @@ void got_object_idcache_free(struct got_object_idcache *);
 
 const struct got_error *got_object_idcache_add(struct got_object_idcache *,
     struct got_object_id *, void *);
-void *got_object_idcache_get(struct got_object_idcache *, struct got_object_id *);
+void *got_object_idcache_get(struct got_object_idcache *,
+    struct got_object_id *);
 const struct got_error *got_object_idcache_remove_one(void **,
     struct got_object_idcache *, struct got_object_id *);
 int got_object_idcache_contains(struct got_object_idcache *,
diff --git a/lib/got_lib_object_parse.h b/lib/got_lib_object_parse.h
index 7592979..adbb8bb 100644
--- a/lib/got_lib_object_parse.h
+++ b/lib/got_lib_object_parse.h
@@ -44,5 +44,6 @@ struct got_pack;
 struct got_packidx;
 struct got_inflate_checksum;
 
-const struct got_error *got_object_parse_header(struct got_object **, char *, size_t);
+const struct got_error *got_object_parse_header(struct got_object **, char *,
+    size_t);
 const struct got_error *got_object_read_header(struct got_object **, int);
diff --git a/lib/got_lib_pack.h b/lib/got_lib_pack.h
index 5321690..dc97d61 100644
--- a/lib/got_lib_pack.h
+++ b/lib/got_lib_pack.h
@@ -193,4 +193,5 @@ const struct got_error *got_packfile_extract_object(struct got_pack *,
     struct got_object *, FILE *, FILE *, FILE *);
 const struct got_error *got_packfile_extract_object_to_mem(uint8_t **, size_t *,
     struct got_object *, struct got_pack *);
-struct got_pack *got_repo_get_cached_pack(struct got_repository *, const char *);
+struct got_pack *got_repo_get_cached_pack(struct got_repository *,
+    const char *);
diff --git a/lib/object_cache.c b/lib/object_cache.c
index f3cfb97..c684ffd 100644
--- a/lib/object_cache.c
+++ b/lib/object_cache.c
@@ -146,7 +146,8 @@ get_size_raw(struct got_raw_object *raw)
 }
 
 const struct got_error *
-got_object_cache_add(struct got_object_cache *cache, struct got_object_id *id, void *item)
+got_object_cache_add(struct got_object_cache *cache, struct got_object_id *id,
+    void *item)
 {
 	const struct got_error *err = NULL;
 	struct got_object_cache_entry *ce;
diff --git a/lib/pack.c b/lib/pack.c
index cda2a94..b23b137 100644
--- a/lib/pack.c
+++ b/lib/pack.c
@@ -485,7 +485,8 @@ got_packidx_get_object_offset(struct got_packidx *packidx, int idx)
 }
 
 int
-got_packidx_get_object_idx(struct got_packidx *packidx, struct got_object_id *id)
+got_packidx_get_object_idx(struct got_packidx *packidx,
+    struct got_object_id *id)
 {
 	u_int8_t id0 = id->sha1[0];
 	uint32_t totobj = be32toh(packidx->hdr.fanout_table[0xff]);
@@ -730,8 +731,8 @@ parse_negative_offset(int64_t *offset, size_t *len, struct got_pack *pack,
 }
 
 const struct got_error *
-got_pack_parse_offset_delta(off_t *base_offset, size_t *len, struct got_pack *pack,
-    off_t offset, int tslen)
+got_pack_parse_offset_delta(off_t *base_offset, size_t *len,
+    struct got_pack *pack, off_t offset, int tslen)
 {
 	const struct got_error *err;
 	int64_t negoffset;
@@ -1028,8 +1029,8 @@ got_packfile_open_object(struct got_object **obj, struct got_pack *pack,
 }
 
 const struct got_error *
-got_pack_get_delta_chain_max_size(uint64_t *max_size, struct got_delta_chain *deltas,
-    struct got_pack *pack)
+got_pack_get_delta_chain_max_size(uint64_t *max_size,
+    struct got_delta_chain *deltas, struct got_pack *pack)
 {
 	struct got_delta *delta;
 	uint64_t base_size = 0, result_size = 0;
diff --git a/lib/reference.c b/lib/reference.c
index b7336cf..ea1f566 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -845,8 +845,9 @@ got_ref_cmp_by_commit_timestamp_descending(void *arg, int *cmp,
 }
 
 const struct got_error *
-got_reflist_insert(struct got_reflist_entry **newp, struct got_reflist_head *refs,
-    struct got_reference *ref, got_ref_cmp_cb cmp_cb, void *cmp_arg)
+got_reflist_insert(struct got_reflist_entry **newp,
+    struct got_reflist_head *refs, struct got_reference *ref,
+    got_ref_cmp_cb cmp_cb, void *cmp_arg)
 {
 	const struct got_error *err;
 	struct got_reflist_entry *new, *re;
diff --git a/lib/repository.c b/lib/repository.c
index 41da7b1..40f5562 100644
--- a/lib/repository.c
+++ b/lib/repository.c
@@ -1410,8 +1410,10 @@ match_packed_object(struct got_object_id **unique_id,
 	packdir_fd = openat(got_repo_get_fd(repo),
 	    GOT_OBJECTS_PACK_DIR, O_DIRECTORY | O_CLOEXEC);
 	if (packdir_fd == -1) {
-		if (errno != ENOENT)
-			err = got_error_from_errno2("openat", GOT_OBJECTS_PACK_DIR);
+		if (errno != ENOENT) {
+			err = got_error_from_errno2("openat",
+			    GOT_OBJECTS_PACK_DIR);
+		}
 		goto done;
 	}
 
diff --git a/lib/worktree.c b/lib/worktree.c
index 87959af..dba36be 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -2816,7 +2816,8 @@ merge_file_cb(void *arg, struct got_blob_object *blob1,
 			if (err)
 				goto done;
 
-			fd = open(ondisk_path, O_RDONLY | O_NOFOLLOW | O_CLOEXEC);
+			fd = open(ondisk_path,
+			    O_RDONLY | O_NOFOLLOW | O_CLOEXEC);
 			if (fd == -1) {
 				err = got_error_from_errno2("open",
 				    ondisk_path);
@@ -4366,8 +4367,10 @@ create_patched_content(char **path_outfile, int reverse_patch,
 			}
 			link_len = readlinkat(dirfd2, de_name2,
 			    link_target, sizeof(link_target));
-			if (link_len == -1)
-				return got_error_from_errno2("readlinkat", path2);
+			if (link_len == -1) {
+				return got_error_from_errno2("readlinkat",
+				    path2);
+			}
 			sb2.st_mode = S_IFLNK;
 			sb2.st_size = link_len;
 		}
diff --git a/libexec/got-read-pack/got-read-pack.c b/libexec/got-read-pack/got-read-pack.c
index dc3aeaf..8bbfe87 100644
--- a/libexec/got-read-pack/got-read-pack.c
+++ b/libexec/got-read-pack/got-read-pack.c
@@ -773,8 +773,9 @@ done:
 }
 
 static const struct got_error *
-raw_object_request(struct imsg *imsg, struct imsgbuf *ibuf, struct got_pack *pack,
-    struct got_packidx *packidx, struct got_object_cache *objcache)
+raw_object_request(struct imsg *imsg, struct imsgbuf *ibuf,
+    struct got_pack *pack, struct got_packidx *packidx,
+    struct got_object_cache *objcache)
 {
 	const struct got_error *err = NULL;
 	uint8_t *buf = NULL;