# HG changeset patch # User Mychaela Falconia # Date 1734734840 0 # Node ID 334d883b96baa551d44b2486d95bec73ea49f46c # Parent bda6b24385f74b1c5fbf207e3dfa750d369b3fb7 twrtp_jibuf_create: make config argument const While this config structure is not a constant in the mathematical sense of the term (it is expected that vty config changes may happen while twjit instance is alive), twjit functions never write to it, only read, hence it is 'const' in the not-quite-mathematical C-standard sense. diff -r bda6b24385f7 -r 334d883b96ba include/twjit.h --- a/include/twjit.h Fri Dec 20 22:13:01 2024 +0000 +++ b/include/twjit.h Fri Dec 20 22:47:20 2024 +0000 @@ -100,7 +100,7 @@ struct twrtp_jibuf_inst { /* pointer to config structure given to twrtp_jibuf_create(), * memory must remain valid, but content can change at any time. */ - struct twrtp_jibuf_config *ext_config; + const struct twrtp_jibuf_config *ext_config; /* count of RTP timestamp units per quantum */ uint32_t ts_quantum; /* quanta per second, used to scale max_future_sec */ @@ -130,7 +130,7 @@ /* twjit module API functions */ struct twrtp_jibuf_inst * -twrtp_jibuf_create(void *ctx, struct twrtp_jibuf_config *config); +twrtp_jibuf_create(void *ctx, const struct twrtp_jibuf_config *config); /* * The default timescale is 8 kHz (8000 samples per second), diff -r bda6b24385f7 -r 334d883b96ba src/twjit.c --- a/src/twjit.c Fri Dec 20 22:13:01 2024 +0000 +++ b/src/twjit.c Fri Dec 20 22:47:20 2024 +0000 @@ -78,7 +78,7 @@ /* create and destroy functions */ struct twrtp_jibuf_inst * -twrtp_jibuf_create(void *ctx, struct twrtp_jibuf_config *config) +twrtp_jibuf_create(void *ctx, const struct twrtp_jibuf_config *config) { struct twrtp_jibuf_inst *twjit;