mirror of
https://github.com/javalsai/lidm.git
synced 2025-07-03 06:15:03 +02:00
fix: language & format
This commit is contained in:
parent
e7ef64cd16
commit
6d30e889d5
@ -12,7 +12,8 @@ struct status {
|
||||
};
|
||||
|
||||
int read_desktop(FILE* NNULLABLE fd, void* UNULLABLE ctx,
|
||||
struct status (*NNULLABLE cb)(void* UNULLABLE ctx, char* NULLABLE table,
|
||||
struct status (*NNULLABLE cb)(void* UNULLABLE ctx,
|
||||
char* NULLABLE table,
|
||||
char* NNULLABLE key,
|
||||
char* NNULLABLE value));
|
||||
|
||||
|
@ -127,10 +127,10 @@ struct parser_error parse_key(enum introspection_type typ, union typ_ptr at,
|
||||
if (!aux_str) FAIL("allocation failure");
|
||||
aux_err = parse_str_inplace(aux_str);
|
||||
if (aux_err.msg != NULL) return aux_err;
|
||||
// FIXME: it be broken, prob the ptr arithmetic or smth, we mem leak instead 😎
|
||||
// If the ptr is not the default it means it was prev allocated, we should
|
||||
// free
|
||||
// if (*(char**)((uintptr_t)(&default_config) + offset) != *at.string) {
|
||||
// FIXME: it be broken, prob the ptr arithmetic or smth, we mem leak
|
||||
// instead 😎 If the ptr is not the default it means it was prev
|
||||
// allocated, we should free if (*(char**)((uintptr_t)(&default_config) +
|
||||
// offset) != *at.string) {
|
||||
// free(*at.string);
|
||||
// }
|
||||
*at.string = aux_str;
|
||||
|
@ -33,11 +33,12 @@ void ofield_kbd_type(struct opts_field* self, char* typed,
|
||||
}
|
||||
|
||||
bool ofield_opts_seek(struct opts_field* self, char seek) {
|
||||
// no options or (a single option but its selected isntead of on edit)
|
||||
// no options or (a single option but its selected instead of on edit)
|
||||
if (self->opts == 0 || (self->opts == 1 && self->current_opt != 0))
|
||||
return false;
|
||||
|
||||
self->current_opt = 1 + ((self->current_opt - 1 + seek + self->opts) % self->opts);
|
||||
self->current_opt =
|
||||
1 + ((self->current_opt - 1 + seek + self->opts) % self->opts);
|
||||
ui_update_ofield(self);
|
||||
return true;
|
||||
}
|
||||
|
@ -90,11 +90,13 @@ size_t utf8len_until(const char* str, const char* until) {
|
||||
}
|
||||
|
||||
const char* utf8back(const char* str) {
|
||||
while(utf8_iscont(*(--str))) {}
|
||||
while (utf8_iscont(*(--str))) {
|
||||
}
|
||||
return str;
|
||||
}
|
||||
const char* utf8seek(const char* str) {
|
||||
while(utf8_iscont(*(++str))) {}
|
||||
while (utf8_iscont(*(++str))) {
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user