* [FFmpeg-devel] [PATCH 1/2] avfilter/textutils, vf_drawtext, qrencode: Constify function pointers
@ 2024-06-20 21:51 Andreas Rheinhardt
2024-06-20 21:52 ` [FFmpeg-devel] [PATCH 2/2] avfilter/textutils: Constify ff_expand_text() Andreas Rheinhardt
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Rheinhardt @ 2024-06-20 21:51 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavfilter/qrencode.c | 2 +-
libavfilter/textutils.c | 2 +-
libavfilter/textutils.h | 2 +-
libavfilter/vf_drawtext.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavfilter/qrencode.c b/libavfilter/qrencode.c
index 0b1f7bb50a..1c7ce23e6e 100644
--- a/libavfilter/qrencode.c
+++ b/libavfilter/qrencode.c
@@ -284,7 +284,7 @@ static int func_eval_expr_formatted(void *ctx, AVBPrint *bp, const char *functio
argv[1][0], positions);
}
-static FFExpandTextFunction expand_text_functions[] = {
+static const FFExpandTextFunction expand_text_functions[] = {
{ "expr", 1, 1, func_eval_expr },
{ "e", 1, 1, func_eval_expr },
{ "expr_formatted", 2, 3, func_eval_expr_formatted },
diff --git a/libavfilter/textutils.c b/libavfilter/textutils.c
index 45967794bc..0b132fd153 100644
--- a/libavfilter/textutils.c
+++ b/libavfilter/textutils.c
@@ -36,7 +36,7 @@ static int ff_expand_text_function_internal(FFExpandTextContext *expand_text, AV
char *name, unsigned argc, char **argv)
{
void *log_ctx = expand_text->log_ctx;
- FFExpandTextFunction *functions = expand_text->functions;
+ const FFExpandTextFunction *functions = expand_text->functions;
unsigned i;
for (i = 0; i < expand_text->functions_nb; i++) {
diff --git a/libavfilter/textutils.h b/libavfilter/textutils.h
index 7fa856c681..d89956bfcc 100644
--- a/libavfilter/textutils.h
+++ b/libavfilter/textutils.h
@@ -74,7 +74,7 @@ typedef struct FFExpandTextContext {
* list of functions to use to expand sequences in the format
* FUNCTION_NAME{PARAMS}
*/
- FFExpandTextFunction *functions;
+ const FFExpandTextFunction *functions;
/**
* number of functions
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 2b6a0d0839..0ac0a0721c 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -950,7 +950,7 @@ static int func_eval_expr_int_format(void *ctx, AVBPrint *bp, const char *functi
argv[1][0], positions);
}
-static FFExpandTextFunction expand_text_functions[] = {
+static const FFExpandTextFunction expand_text_functions[] = {
{ "e", 1, 1, func_eval_expr },
{ "eif", 2, 3, func_eval_expr_int_format },
{ "expr", 1, 1, func_eval_expr },
--
2.40.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 3+ messages in thread
* [FFmpeg-devel] [PATCH 2/2] avfilter/textutils: Constify ff_expand_text()
2024-06-20 21:51 [FFmpeg-devel] [PATCH 1/2] avfilter/textutils, vf_drawtext, qrencode: Constify function pointers Andreas Rheinhardt
@ 2024-06-20 21:52 ` Andreas Rheinhardt
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Rheinhardt @ 2024-06-20 21:52 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavfilter/textutils.c | 6 +++---
libavfilter/textutils.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavfilter/textutils.c b/libavfilter/textutils.c
index 0b132fd153..e6b5239b20 100644
--- a/libavfilter/textutils.c
+++ b/libavfilter/textutils.c
@@ -79,7 +79,7 @@ static int ff_expand_text_function_internal(FFExpandTextContext *expand_text, AV
* @return negative value corresponding to an AVERROR error code in case of
* errors, a non-negative value otherwise
*/
-static int ff_expand_text_function(FFExpandTextContext *expand_text, AVBPrint *bp, char **rtext)
+static int ff_expand_text_function(FFExpandTextContext *expand_text, AVBPrint *bp, const char **rtext)
{
void *log_ctx = expand_text->log_ctx;
const char *text = *rtext;
@@ -112,7 +112,7 @@ static int ff_expand_text_function(FFExpandTextContext *expand_text, AVBPrint *b
if ((ret = ff_expand_text_function_internal(expand_text, bp, argv[0], argc - 1, argv + 1)) < 0)
goto end;
ret = 0;
- *rtext = (char *)text + 1;
+ *rtext = text + 1;
end:
for (i = 0; i < argc; i++)
@@ -120,7 +120,7 @@ end:
return ret;
}
-int ff_expand_text(FFExpandTextContext *expand_text, char *text, AVBPrint *bp)
+int ff_expand_text(FFExpandTextContext *expand_text, const char *text, AVBPrint *bp)
{
int ret;
diff --git a/libavfilter/textutils.h b/libavfilter/textutils.h
index d89956bfcc..8c2399d153 100644
--- a/libavfilter/textutils.h
+++ b/libavfilter/textutils.h
@@ -94,7 +94,7 @@ typedef struct FFExpandTextContext {
* @return negative value corresponding to an AVERROR error code in case of
* errors, a non-negative value otherwise
*/
-int ff_expand_text(FFExpandTextContext *expand_text, char *text, AVBPrint *bp);
+int ff_expand_text(FFExpandTextContext *expand_text, const char *text, AVBPrint *bp);
/**
* Print PTS representation to an AVBPrint object.
--
2.40.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 3+ messages in thread
* [FFmpeg-devel] [PATCH 1/2] avfilter/textutils, vf_drawtext, qrencode: Constify function pointers
@ 2024-06-20 19:52 Andreas Rheinhardt
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Rheinhardt @ 2024-06-20 19:52 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavfilter/qrencode.c | 2 +-
libavfilter/textutils.c | 2 +-
libavfilter/textutils.h | 2 +-
libavfilter/vf_drawtext.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavfilter/qrencode.c b/libavfilter/qrencode.c
index 0b1f7bb50a..1c7ce23e6e 100644
--- a/libavfilter/qrencode.c
+++ b/libavfilter/qrencode.c
@@ -284,7 +284,7 @@ static int func_eval_expr_formatted(void *ctx, AVBPrint *bp, const char *functio
argv[1][0], positions);
}
-static FFExpandTextFunction expand_text_functions[] = {
+static const FFExpandTextFunction expand_text_functions[] = {
{ "expr", 1, 1, func_eval_expr },
{ "e", 1, 1, func_eval_expr },
{ "expr_formatted", 2, 3, func_eval_expr_formatted },
diff --git a/libavfilter/textutils.c b/libavfilter/textutils.c
index 45967794bc..0b132fd153 100644
--- a/libavfilter/textutils.c
+++ b/libavfilter/textutils.c
@@ -36,7 +36,7 @@ static int ff_expand_text_function_internal(FFExpandTextContext *expand_text, AV
char *name, unsigned argc, char **argv)
{
void *log_ctx = expand_text->log_ctx;
- FFExpandTextFunction *functions = expand_text->functions;
+ const FFExpandTextFunction *functions = expand_text->functions;
unsigned i;
for (i = 0; i < expand_text->functions_nb; i++) {
diff --git a/libavfilter/textutils.h b/libavfilter/textutils.h
index 7fa856c681..d89956bfcc 100644
--- a/libavfilter/textutils.h
+++ b/libavfilter/textutils.h
@@ -74,7 +74,7 @@ typedef struct FFExpandTextContext {
* list of functions to use to expand sequences in the format
* FUNCTION_NAME{PARAMS}
*/
- FFExpandTextFunction *functions;
+ const FFExpandTextFunction *functions;
/**
* number of functions
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 2b6a0d0839..0ac0a0721c 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -950,7 +950,7 @@ static int func_eval_expr_int_format(void *ctx, AVBPrint *bp, const char *functi
argv[1][0], positions);
}
-static FFExpandTextFunction expand_text_functions[] = {
+static const FFExpandTextFunction expand_text_functions[] = {
{ "e", 1, 1, func_eval_expr },
{ "eif", 2, 3, func_eval_expr_int_format },
{ "expr", 1, 1, func_eval_expr },
--
2.40.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-20 21:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-20 21:51 [FFmpeg-devel] [PATCH 1/2] avfilter/textutils, vf_drawtext, qrencode: Constify function pointers Andreas Rheinhardt
2024-06-20 21:52 ` [FFmpeg-devel] [PATCH 2/2] avfilter/textutils: Constify ff_expand_text() Andreas Rheinhardt
-- strict thread matches above, loose matches on Subject: below --
2024-06-20 19:52 [FFmpeg-devel] [PATCH 1/2] avfilter/textutils, vf_drawtext, qrencode: Constify function pointers Andreas Rheinhardt
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git