Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit dbeb366

Browse files
William Douglasbryteise
authored andcommitted
Apply changes from clang-format
Running: clang-format -i -style=file src/*.[ch] src/lib/*.[ch] \ src/3rd_party/*.[ch] src/cmds/*.[ch] src/swupd_lib/*.[ch] \ src/verifytime/*.[ch] with clang v15 Signed-off-by: William Douglas <[email protected]>
1 parent a425393 commit dbeb366

34 files changed

+139
-143
lines changed

src/3rd_party/3rd_party.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
*
1818
*/
1919

20-
#include "swupd.h"
2120
#include "cmds/swupd_cmds.h"
21+
#include "swupd.h"
2222

2323
#ifdef THIRDPARTY
2424

src/3rd_party/3rd_party_add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#include <unistd.h>
2323

2424
#include "3rd_party_repos.h"
25-
#include "swupd_lib/signature.h"
2625
#include "swupd.h"
26+
#include "swupd_lib/signature.h"
2727

2828
#ifdef THIRDPARTY
2929

src/3rd_party/3rd_party_repos.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
*/
1919

2020
#include "3rd_party_repos.h"
21-
#include "swupd_lib/signature.h"
2221
#include "swupd.h"
22+
#include "swupd_lib/signature.h"
2323

2424
#include <errno.h>
2525
#include <fcntl.h>
@@ -260,7 +260,7 @@ int third_party_remove_repo_directory(const char *repo_name)
260260
int ret = 0;
261261
int ret_code = 0;
262262

263-
//TODO: use a global function to get this value
263+
// TODO: use a global function to get this value
264264
repo_dir = get_repo_content_path(repo_name);
265265
ret = sys_rm_recursive(repo_dir);
266266
if (ret < 0 && ret != -ENOENT) {

src/cmds/bundle_add.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
#include <sys/stat.h>
3131
#include <unistd.h>
3232

33-
#include "swupd_lib/alias.h"
3433
#include "swupd.h"
35-
#include "swupd_lib/target_root.h"
34+
#include "swupd_lib/alias.h"
3635
#include "swupd_lib/heuristics.h"
36+
#include "swupd_lib/target_root.h"
3737

3838
#define MODE_RW_O (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
3939
#define VERIFY_NOPICKY 0

src/cmds/bundle_list.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,10 @@ static enum swupd_code show_included_bundles(char *bundle_name, int version)
329329
}
330330

331331
/*
332-
* list_installable_bundles()
333-
* Parse the full manifest for the current version of the OS and print
334-
* all available bundles.
335-
*/
332+
* list_installable_bundles()
333+
* Parse the full manifest for the current version of the OS and print
334+
* all available bundles.
335+
*/
336336
static enum swupd_code list_installable_bundles(int version)
337337
{
338338
char *name;

src/cmds/check_update.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static void print_help(void)
3636
print("Checks whether an update is available and prints out the information if so\n\n");
3737
print("Usage:\n");
3838
print(" swupd check-update [OPTION...]\n\n");
39-
//TODO: Add documentation explaining this command
39+
// TODO: Add documentation explaining this command
4040

4141
global_print_help();
4242
}

src/cmds/clean.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ static int remove_irrelevant_file(const char *filename, const struct stat *st, i
468468
relevant_path = statedir_get_cache_url_dir();
469469
ret = str_starts_with(filename, relevant_path);
470470
FREE(relevant_path);
471-
if (ret == 0){
471+
if (ret == 0) {
472472
return 0;
473473
}
474474

@@ -482,7 +482,7 @@ static int remove_irrelevant_file(const char *filename, const struct stat *st, i
482482
}
483483
}
484484
stats.files_removed++;
485-
stats.bytes_removed+=long_to_ulong(st->st_size);
485+
stats.bytes_removed += long_to_ulong(st->st_size);
486486

487487
return 0;
488488
}
@@ -493,7 +493,7 @@ static int count_file(const char *filename, const struct stat *st, int type __at
493493
print("%s\n", filename);
494494
}
495495
stats.files_removed++;
496-
stats.bytes_removed+=long_to_ulong(st->st_size);
496+
stats.bytes_removed += long_to_ulong(st->st_size);
497497

498498
return 0;
499499
}
@@ -534,7 +534,7 @@ static enum swupd_code remove_cache_directory(const char *dir)
534534
enum swupd_code ret_code;
535535
int ret;
536536

537-
if (!sys_is_dir(dir)){
537+
if (!sys_is_dir(dir)) {
538538
return SWUPD_OK;
539539
}
540540

@@ -678,13 +678,13 @@ enum swupd_code clean_cachedir(void)
678678
}
679679
ret_code = clean_staged_manifests(dir, options.dry_run, false);
680680
FREE(dir);
681-
if(ret_code) {
681+
if (ret_code) {
682682
return ret_code;
683683
}
684684

685685
// remove all cache from other mirror URLs
686686
ret_code = clean_irrelevant_cache();
687-
if(ret_code) {
687+
if (ret_code) {
688688
return ret_code;
689689
}
690690
}

src/cmds/update.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
#include <unistd.h>
3333

3434
#include "swupd.h"
35+
#include "swupd_lib/heuristics.h"
3536
#include "swupd_lib/signature.h"
3637
#include "swupd_lib/target_root.h"
37-
#include "swupd_lib/heuristics.h"
3838

3939
#define FLAG_DOWNLOAD_ONLY 2000
4040
#define FLAG_UPDATE_SEARCH_FILE_INDEX 2001
@@ -80,7 +80,7 @@ bool update_get_option_download_only(void)
8080
static void save_swupd_binary_path()
8181
{
8282
/* we need to resolve the whole path to swupd first, proc/self/exe
83-
* is a symbolic link to the executable that is running the current process */
83+
* is a symbolic link to the executable that is running the current process */
8484
ssize_t path_length;
8585
path_length = readlink("/proc/self/exe", swupd_binary, sizeof(swupd_binary));
8686
if (path_length <= 0 || path_length >= LINE_MAX) {

src/cmds/verify.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
#include <unistd.h>
3434

3535
#include "swupd.h"
36+
#include "swupd_lib/heuristics.h"
3637
#include "swupd_lib/signature.h"
3738
#include "swupd_lib/target_root.h"
38-
#include "swupd_lib/heuristics.h"
3939

4040
#define FLAG_EXTRA_FILES_ONLY 2000
4141
#define FLAG_FILE 2001
@@ -299,7 +299,7 @@ static int get_required_files(struct manifest *official_manifest, struct list *r
299299
* Only called when a file has failed to be fixed during a verify or install.
300300
* If a low-space warning has been printed, don't check again,
301301
* but just warn the user and return.
302-
*/
302+
*/
303303
static void check_warn_freespace(struct file *file)
304304
{
305305
long fs_free;
@@ -611,7 +611,7 @@ static void remove_orphaned_files(struct list *files_to_verify, bool repair)
611611
if (errno != ENOTEMPTY) {
612612
print(" -> not deleted (%s)\n", strerror(errno));
613613
} else {
614-
//FIXME: Add force removal option?
614+
// FIXME: Add force removal option?
615615
print(" -> not deleted (not empty)\n");
616616
}
617617
} else {
@@ -922,7 +922,7 @@ enum swupd_code execute_verify_extra(extra_proc_fn_t post_verify_fn)
922922
bool invalid_bundle = false;
923923

924924
/* Unless we are installing a new bundle and the --skip-optional flag is not
925-
* set we shoudn't include optional bundles to the bundle list */
925+
* set we shoudn't include optional bundles to the bundle list */
926926
if (!cmdline_option_install || cmdline_option_skip_optional) {
927927
globals.skip_optional_bundles = true;
928928
}

src/lib/hashmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static struct list *hashmap_get_internal(struct hashmap *hashmap, const void *ke
121121
if (hashmap->equal(key, i->data)) {
122122
void *data = i->data;
123123
if (remove) {
124-
//If it's the first element of the list, update head
124+
// If it's the first element of the list, update head
125125
if (i == *items) {
126126
*items = i->next;
127127
}

0 commit comments

Comments
 (0)