Skip to content

Commit b62f38d

Browse files
committed
fixing some clang warnings
1 parent 19bd289 commit b62f38d

23 files changed

+47
-75
lines changed

CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ add_library(droidboot_gui STATIC
3030
common/droidboot_init.c
3131
common/droidboot_logging.c
3232
common/droidboot_main.c
33-
common/droidboot_screens.c
3433
common/droidboot_stdfunc.c
3534
common/droidboot_theme.c
3635
storage/droidboot_gpt.c
@@ -59,5 +58,5 @@ target_include_directories(droidboot_gui PUBLIC
5958
include
6059
.
6160
)
62-
target_compile_options(droidboot_gui PUBLIC -fsanitize=address -fsanitize-recover=address -fno-omit-frame-pointer)
63-
target_link_options(droidboot_gui PUBLIC -fsanitize=address -fsanitize-recover=address)
61+
target_compile_options(droidboot_gui PUBLIC -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer)
62+
target_link_options(droidboot_gui PUBLIC -fsanitize=address -fsanitize=undefined)

backend/droidboot_drivers.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ droidboot_ret droidboot_driver_init(){
8282
droidboot_log(DROIDBOOT_LOG_TRACE, "Ext4 mount returns: %d\n", r);
8383
}
8484
#ifdef DROIDBOOT_NO_SD_ENCRYPTED_SUPPORT
85-
else if(userdata_offset!=0 && metadata_offset!=0){
85+
else if(userdata_offset!=0 && metadata_offset!=0) {
8686
droidboot_metadata_dev.part_offset = metadata_offset * droidboot_sd_blklen();
8787
droidboot_metadata_dev.bdif->ph_bsize = droidboot_sd_blklen();
8888
droidboot_metadata_dev.bdif->ph_bcnt = metadata_blkcnt;
@@ -116,7 +116,7 @@ droidboot_ret droidboot_driver_init(){
116116
}
117117
#endif
118118
#ifdef DROIDBOOT_NO_SD_SUPPORT
119-
else if(userdata_offset!=0){
119+
else if(userdata_offset!=0) {
120120
droidboot_userdata_settings_dev.part_offset = userdata_offset * droidboot_sd_blklen();
121121
droidboot_userdata_settings_dev.bdif->ph_bsize = droidboot_sd_blklen();
122122
droidboot_userdata_settings_dev.bdif->ph_bcnt = userdata_blkcnt;

backend/droidboot_dualboot_backend.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <ext4.h>
77

88
#include <droidboot_drivers.h>
9-
#include <droidboot_screens.h>
109
#include <droidboot_config_parser.h>
1110
#include <droidboot_dtb.h>
1211

@@ -15,10 +14,10 @@
1514

1615
void droidboot_boot_linux_from_ext4(struct boot_entry *entry)
1716
{
18-
off_t kernel_raw_size = 0;
19-
off_t ramdisk_size = 0;
20-
off_t dtb_size = 0;
21-
off_t dtbo_size = 0;
17+
uint64_t kernel_raw_size = 0;
18+
uint64_t ramdisk_size = 0;
19+
uint64_t dtb_size = 0;
20+
uint64_t dtbo_size = 0;
2221
unsigned int dev_null;
2322
size_t rb;
2423
ext4_file fp;

common/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
obj-y += droidboot_init.o
55
obj-y += droidboot_logging.o
66
obj-y += droidboot_main.o
7-
obj-y += droidboot_screens.o
87
obj-y += droidboot_helpers.o
98
obj-y += droidboot_stdfunc.o
109
obj-y += droidboot_theme.o

common/common.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ OBJS += \
77
$(LOCAL_DIR)/droidboot_init.o \
88
$(LOCAL_DIR)/droidboot_logging.o \
99
$(LOCAL_DIR)/droidboot_main.o \
10-
$(LOCAL_DIR)/droidboot_screens.o \
1110
$(LOCAL_DIR)/droidboot_helpers.o \
1211
$(LOCAL_DIR)/droidboot_stdfunc.o \
1312
$(LOCAL_DIR)/droidboot_theme.o
@@ -16,7 +15,6 @@ MODULE_SRCS += \
1615
$(LOCAL_DIR)/droidboot_init.c \
1716
$(LOCAL_DIR)/droidboot_logging.c \
1817
$(LOCAL_DIR)/droidboot_main.c \
19-
$(LOCAL_DIR)/droidboot_screens.c \
2018
$(LOCAL_DIR)/droidboot_helpers.c \
2119
$(LOCAL_DIR)/droidboot_stdfunc.c \
2220
$(LOCAL_DIR)/droidboot_theme.c

common/droidboot_helpers.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ const void* droidboot_load_lvgl_image_from_ext4(char* path){
1313
}
1414

1515
ext4_fseek(&fp, 0, SEEK_END);
16-
off_t entry_file_size = ext4_ftell(&fp);
16+
uint64_t entry_file_size = ext4_ftell(&fp);
1717
ext4_fseek(&fp, 0, SEEK_SET); /* same as rewind(f); */
1818

19-
off_t header_len = sizeof(lv_img_header_t); // file header struct
20-
off_t buf_len = entry_file_size - header_len; // file size minus header size
19+
uint64_t header_len = sizeof(lv_img_header_t); // file header struct
20+
uint64_t buf_len = entry_file_size - header_len; // file size minus header size
2121
lv_img_dsc_t* img_dsc = (lv_img_dsc_t*)malloc(sizeof(lv_img_dsc_t)); // image descriptor struct
2222
unsigned char *buf = (unsigned char *)malloc(buf_len); // pixel data only
2323

common/droidboot_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void droidboot_show_dualboot_menu()
6666
droidboot_log(DROIDBOOT_LOG_INFO, "droidboot main: found %d entries\n", droidboot_num_of_boot_entries);
6767

6868
// Init styles
69-
droidboot_style_init(droidboot_global_config);
69+
//droidboot_style_init(droidboot_global_config);
7070

7171
// Show dualboot menu
7272
droidboot_draw_dualboot_menu(droidboot_entry_list, droidboot_global_config, droidboot_num_of_boot_entries);

common/droidboot_screens.c

Lines changed: 0 additions & 11 deletions
This file was deleted.

common/droidboot_stdfunc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ long droidboot_strtol(const char *restrict nptr, char **restrict endptr, int bas
3333
_Bool is_neg = 0, overflow = 0;
3434
/* Need unsigned so (-LONG_MIN) can fit in these: */
3535
unsigned long n = 0UL, cutoff;
36-
int cutlim;
36+
unsigned long cutlim;
3737
if (base < 0 || base == 1 || base > 36) {
3838
return 0L;
3939
}

common/droidboot_theme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ lv_style_t droidboot_list_style;
77
lv_style_t droidboot_win_style;
88
lv_style_t droidboot_list_button_style;
99
lv_style_t droidboot_list_button_selected_style;
10-
lv_style_t droidboot_list_timeout_style;
10+
//lv_style_t droidboot_list_timeout_style;
1111

1212
void droidboot_style_init(struct global_config *global_config){
1313
droidboot_log(DROIDBOOT_LOG_TRACE, "Current theme settings: radius: %d, bg_color: %llx, border_width: %d, border_color: %llx \n", global_config->radius, global_config->bg_color, global_config->border_width, global_config->border_color);

0 commit comments

Comments
 (0)