fix: Fix compiler warnings

This commit is contained in:
Joel Spadin 2024-04-05 21:45:54 -05:00
parent 7d5aa0c0bf
commit a0f5ec6a3f
4 changed files with 7 additions and 6 deletions

View file

@ -24,13 +24,13 @@ struct layer_status_state {
static void set_layer_symbol(lv_obj_t *label, struct layer_status_state state) {
if (state.label == NULL) {
char text[7] = {};
char text[16] = {};
sprintf(text, LV_SYMBOL_KEYBOARD " %i", state.index);
snprintf(text, sizeof(text), LV_SYMBOL_KEYBOARD " %i", state.index);
lv_label_set_text(label, text);
} else {
char text[13] = {};
char text[16] = {};
snprintf(text, sizeof(text), LV_SYMBOL_KEYBOARD " %s", state.label);

View file

@ -35,7 +35,7 @@ static struct output_status_state get_state(const zmk_event_t *_eh) {
}
static void set_status_symbol(lv_obj_t *label, struct output_status_state state) {
char text[10] = {};
char text[24] = {};
switch (state.selected_endpoint.transport) {
case ZMK_TRANSPORT_USB:

View file

@ -93,7 +93,6 @@ void ksbb_inner_kscan_callback(const struct device *dev, uint32_t row, uint32_t
}
static int ksbb_configure(const struct device *dev, kscan_callback_t callback) {
const struct ksbb_config *cfg = dev->config;
struct ksbb_data *data = dev->data;
data->callback = callback;

View file

@ -82,7 +82,9 @@ static struct zmk_led_hsb hsb_scale_zero_max(struct zmk_led_hsb hsb) {
}
static struct led_rgb hsb_to_rgb(struct zmk_led_hsb hsb) {
float r, g, b;
float r = 0;
float g = 0;
float b = 0;
uint8_t i = hsb.h / 60;
float v = hsb.b / ((float)BRT_MAX);