From 760448365d293930989ed2afce4e2886bd556706 Mon Sep 17 00:00:00 2001 From: dam Date: Fri, 11 Nov 2022 01:17:14 +0000 Subject: Tweaked function to print time and function to parse input options. --- readme.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'readme.md') diff --git a/readme.md b/readme.md index 9ac479c..0d70120 100644 --- a/readme.md +++ b/readme.md @@ -59,9 +59,18 @@ Task Time Tracker - [x] Check if string_buffer needs to be cleared. We may be leaking info on the string_buffer. - [x] Replaced `sprintf` by `snprintf`; - [x] Make sure that string_buffer bounds are respected; -- [ ] Move database actions into functions: - - [ ] select_by_id/delta/task - - [ ] set_active(db, task) -- [ ] Re-check if draw_tui may be simplified. +- [ ] Compress code: + - [x] Re-do sprint_time5_utf8: -12 LOC; + - [ ] Re-do truncate_string_utf8: 1761 - XXXX = LOC; + - [ ] Get input using `get_input(char *input, size_t size, int row, int column)` (what does it returns???): + - [ ] wrap malloc (and maybe others) in a function with error checking + ```c + static inline void *MallocOrDie(size_t MemSize) { void *AllocMem = malloc(MemSize); /* Some implementations return null on a 0 length alloc, * we may as well allow this as it increases compatibility * with very few side effects */ if(!AllocMem && MemSize) { printf("Could not allocate memory!"); exit(-1); } return AllocMem; } + ``` + - [ ] Move database actions into functions: + - `select_task_by_delta(database_st *db, ptrdiff???)` + - `select_task_by_index(database_st *db, size_t???)` + - `sect_active(database_st *db, task_st *task)` + - [ ] Check if draw_tui may be simplified by drawing entire lines of tasks at once and draw columns separators after; - [ ] Review all code for bugs related to auto-cast on ptrdiff_t/size_t (signed/unsigned); - [ ] Go over all `TODO` items; -- cgit v1.2.3