Formating comments and docs strings, fix clang Warnings

This commit is contained in:
Harshit-Dhanwalkar 2026-06-19 13:05:10 +05:30
parent af6841fcac
commit 7b39cd09c3
5 changed files with 23 additions and 66 deletions

View file

@ -33,7 +33,7 @@ typedef struct {
char ramp[CHARSET_RAMP_LEN];
} charset_entry_t;
// Registry of loaded charsets, hot-reloadable from a directory of .txt files.
// Registry of loaded charsets, hot-reloadable from directory of .txt files.
typedef struct {
charset_entry_t sets[MAX_CHARSETS];
int count;
@ -45,9 +45,9 @@ typedef struct {
int charset_registry_init(charset_registry_t *reg, const char *dir);
void charset_registry_scan(
charset_registry_t *reg); /* (re)loads all files in dir */
charset_registry_t *reg); // (re)loads all files in dir
void charset_registry_check_reload(
charset_registry_t *reg); /* inotify poll, call once per frame */
charset_registry_t *reg); // inotify poll, call once per frame
void charset_registry_cleanup(charset_registry_t *reg);
const char *charset_registry_active_ramp(const charset_registry_t *reg);

View file

@ -7,7 +7,7 @@
typedef struct webcam_impl webcam_impl_t;
typedef struct {
int fd; /* Linux: V4L2 fd. macOS: -1 (unused externally) */
int fd; // Linux: V4L2 fd. macOS: -1 (unused externally)
int width;
int height;
void *buffer;

View file

@ -4,23 +4,23 @@
#include <stdint.h>
typedef struct {
void (*process)(uint8_t *gray, int w, int h, void *ctx);
const char *name;
void (*process)(uint8_t *gray, int w, int h, void *ctx);
const char *name;
} filter_plugin_t;
typedef struct {
void *dl_handle; // handle from dlopen
filter_plugin_t *plugin; // resolved plugin vtable
char path[256]; // absolute path to .so
char tmp_path[280]; // temp copy path used for current dlopen // HACK:
char status_msg[128]; // last load/swap message
int inotify_fd; // inotify instance fd
int inotify_wd; // watch descriptor
void *dl_handle; // handle from dlopen
filter_plugin_t *plugin; // resolved plugin vtable
char path[256]; // absolute path to .so
char tmp_path[280]; // temp copy path used for current dlopen // HACK:
char status_msg[128]; // last load/swap message
int inotify_fd; // inotify instance fd
int inotify_wd; // watch descriptor
} plugin_loader_t;
int plugin_load (plugin_loader_t *pl, const char *path);
void plugin_watch_init (plugin_loader_t *pl, const char *path);
int plugin_load(plugin_loader_t *pl, const char *path);
void plugin_watch_init(plugin_loader_t *pl, const char *path);
void plugin_check_reload(plugin_loader_t *pl);
void plugin_cleanup (plugin_loader_t *pl);
void plugin_cleanup(plugin_loader_t *pl);
#endif

View file

@ -6,11 +6,11 @@
#include <stdint.h>
typedef struct {
uint8_t *buf[2]; // Double buffer, one slot per thread
int width, height; // capture dimensions
int ascii_w, ascii_h;
int ready_idx; // which slot has the freshest frame
int has_frame; // non-zero once producer has written once
uint8_t *buf[2]; // Double buffer, one slot per thread
int width, height; // capture dimensions
int ascii_w, ascii_h; // Ascii width and height
int ready_idx; // which slot has the freshest frame
int has_frame; // non-zero once producer has written once
pthread_mutex_t lock;
pthread_cond_t cond;
volatile int stop;