From: softworkz <ffmpegagent-at-gmail.com@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Cc: softworkz <softworkz@hotmail.com> Subject: [FFmpeg-devel] [PATCH 2/3] fftools/textformat: Remove redundant casts Date: Thu, 03 Jul 2025 01:55:24 +0000 Message-ID: <cd25321a5d87b92d5509e8ee83439608e21b08a0.1751507725.git.ffmpegagent@gmail.com> (raw) In-Reply-To: <pull.104.ffstaging.FFmpeg.1751507725.ffmpegagent@gmail.com> From: softworkz <softworkz@hotmail.com> Signed-off-by: softworkz <softworkz@hotmail.com> --- fftools/graph/graphprint.c | 16 ++++++++-------- fftools/resources/resman.c | 6 +++--- fftools/textformat/avtextformat.c | 8 ++++---- fftools/textformat/tf_compact.c | 2 +- fftools/textformat/tf_default.c | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/fftools/graph/graphprint.c b/fftools/graph/graphprint.c index 242eaf8ba1..1218b53383 100644 --- a/fftools/graph/graphprint.c +++ b/fftools/graph/graphprint.c @@ -161,7 +161,7 @@ static inline char *upcase_string(char *dst, size_t dst_size, const char *src) { unsigned i; for (i = 0; src[i] && i < dst_size - 1; i++) - dst[i] = (char)av_toupper(src[i]); + dst[i] = av_toupper(src[i]); dst[i] = 0; return dst; } @@ -261,7 +261,7 @@ static void print_link(GraphPrintContext *gpc, AVFilterLink *link) case AVMEDIA_TYPE_VIDEO: if (hw_frames_ctx && hw_frames_ctx->data) { - AVHWFramesContext * hwfctx = (AVHWFramesContext *)hw_frames_ctx->data; + AVHWFramesContext *hwfctx = (AVHWFramesContext *)hw_frames_ctx->data; const AVPixFmtDescriptor *pix_desc_hw = av_pix_fmt_desc_get(hwfctx->format); const AVPixFmtDescriptor *pix_desc_sw = av_pix_fmt_desc_get(hwfctx->sw_format); if (pix_desc_hw && pix_desc_sw) @@ -498,7 +498,7 @@ static void print_filtergraph_single(GraphPrintContext *gpc, FilterGraph *fg, AV print_int("input_index", ifilter->index); if (ifilter->linklabel) - print_str("link_label", (const char*)ifilter->linklabel); + print_str("link_label", ifilter->linklabel); if (ifilter->filter) { print_id("filter_id", ifilter->filter->name); @@ -506,9 +506,9 @@ static void print_filtergraph_single(GraphPrintContext *gpc, FilterGraph *fg, AV } if (ifilter->linklabel && ifilter->filter) - av_dict_set(&input_map, ifilter->filter->name, (const char *)ifilter->linklabel, 0); + av_dict_set(&input_map, ifilter->filter->name, ifilter->linklabel, 0); else if (ifilter->input_name && ifilter->filter) - av_dict_set(&input_map, ifilter->filter->name, (const char *)ifilter->input_name, 0); + av_dict_set(&input_map, ifilter->filter->name, ifilter->input_name, 0); print_str("media_type", av_get_media_type_string(media_type)); @@ -529,7 +529,7 @@ static void print_filtergraph_single(GraphPrintContext *gpc, FilterGraph *fg, AV print_str("name", ofilter->output_name); if (fg->outputs[i]->linklabel) - print_str("link_label", (const char*)fg->outputs[i]->linklabel); + print_str("link_label", fg->outputs[i]->linklabel); if (ofilter->filter) { print_id("filter_id", ofilter->filter->name); @@ -752,7 +752,7 @@ static int print_streams(GraphPrintContext *gpc, InputFile **ifiles, int nb_ifil for (int n = nb_ofiles - 1; n >= 0; n--) { OutputFile *of = ofiles[n]; - Muxer *muxer = (Muxer *)of; + Muxer *muxer = of; if (!muxer->fc) continue; @@ -1069,7 +1069,7 @@ static int print_filtergraphs_priv(FilterGraph **graphs, int nb_graphs, InputFil goto cleanup; } - avio_write(avio, (const unsigned char *)target_buf.str, FFMIN(target_buf.len, target_buf.size - 1)); + avio_write(avio, target_buf.str, FFMIN(target_buf.len, target_buf.size - 1)); if ((ret = avio_closep(&avio)) < 0) av_log(NULL, AV_LOG_ERROR, "Error closing graph output file, loss of information possible: %s\n", av_err2str(ret)); diff --git a/fftools/resources/resman.c b/fftools/resources/resman.c index aa53e96bf4..4c517b62c0 100644 --- a/fftools/resources/resman.c +++ b/fftools/resources/resman.c @@ -76,7 +76,7 @@ static int decompress_gzip(ResourceManagerContext *ctx, uint8_t *in, unsigned in memset(&strm, 0, sizeof(strm)); // Allocate output buffer with extra byte for null termination - buf = (uint8_t *)av_mallocz(chunk + 1); + buf = av_mallocz(chunk + 1); if (!buf) { av_log(ctx, AV_LOG_ERROR, "Failed to allocate decompression buffer\n"); return AVERROR(ENOMEM); @@ -112,7 +112,7 @@ static int decompress_gzip(ResourceManagerContext *ctx, uint8_t *in, unsigned in buf[*out_len] = 0; // Ensure null termination inflateEnd(&strm); - *out = (char *)buf; + *out = buf; return Z_OK; } #endif @@ -156,7 +156,7 @@ char *ff_resman_get_string(FFResourceId resource_id) char *out = NULL; size_t out_len; - int ret = decompress_gzip(ctx, (uint8_t *)resource_definition.data, *resource_definition.data_len, &out, &out_len); + int ret = decompress_gzip(ctx, resource_definition.data, *resource_definition.data_len, &out, &out_len); if (ret) { av_log(ctx, AV_LOG_ERROR, "Unable to decompress the resource with ID %d\n", resource_id); diff --git a/fftools/textformat/avtextformat.c b/fftools/textformat/avtextformat.c index 651a84578c..39ab4cecb7 100644 --- a/fftools/textformat/avtextformat.c +++ b/fftools/textformat/avtextformat.c @@ -209,8 +209,8 @@ int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter *form /* validate replace string */ { - const uint8_t *p = (uint8_t *)tctx->string_validation_replacement; - const uint8_t *endp = p + strlen((const char *)p); + const uint8_t *p = tctx->string_validation_replacement; + const uint8_t *endp = p + strlen(p); while (*p) { const uint8_t *p0 = p; int32_t code; @@ -313,7 +313,7 @@ void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t va static inline int validate_string(AVTextFormatContext *tctx, char **dstp, const char *src) { - const uint8_t *p, *endp, *srcp = (const uint8_t *)src; + const uint8_t *p, *endp, *srcp = src; AVBPrint dstbuf; AVBPrint invalid_seq; int invalid_chars_nb = 0, ret = 0; @@ -557,7 +557,7 @@ void avtext_print_data_hash(AVTextFormatContext *tctx, const char *key, av_hash_init(tctx->hash); av_hash_update(tctx->hash, data, size); len = snprintf(buf, sizeof(buf), "%s:", av_hash_get_name(tctx->hash)); - av_hash_final_hex(tctx->hash, (uint8_t *)&buf[len], (int)sizeof(buf) - len); + av_hash_final_hex(tctx->hash, &buf[len], (int)sizeof(buf) - len); avtext_print_string(tctx, key, buf, 0); } diff --git a/fftools/textformat/tf_compact.c b/fftools/textformat/tf_compact.c index 62717bba0a..3f38f24f94 100644 --- a/fftools/textformat/tf_compact.c +++ b/fftools/textformat/tf_compact.c @@ -158,7 +158,7 @@ static void compact_print_section_header(AVTextFormatContext *tctx, const void * /* define a prefix for elements not contained in an array or in a wrapper, or for array elements with a type */ - const char *element_name = (char *)av_x_if_null(section->element_name, section->name); + const char *element_name = av_x_if_null(section->element_name, section->name); AVBPrint *section_pbuf = &tctx->section_pbuf[tctx->level]; compact->nested_section[tctx->level] = 1; diff --git a/fftools/textformat/tf_default.c b/fftools/textformat/tf_default.c index 2c91a8dec4..ee0c4137e0 100644 --- a/fftools/textformat/tf_default.c +++ b/fftools/textformat/tf_default.c @@ -57,7 +57,7 @@ static inline char *upcase_string(char *dst, size_t dst_size, const char *src) unsigned i; for (i = 0; src[i] && i < dst_size - 1; i++) - dst[i] = (char)av_toupper(src[i]); + dst[i] = av_toupper(src[i]); dst[i] = 0; return dst; } -- ffmpeg-codebot _______________________________________________ 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".
next prev parent reply other threads:[~2025-07-03 1:56 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-07-03 1:55 [FFmpeg-devel] [PATCH 0/3] fftools/textformat: Cleanup work ffmpegagent 2025-07-03 1:55 ` [FFmpeg-devel] [PATCH 1/3] fftools/textformat: Rename variables wctx to tctx softworkz 2025-07-03 1:55 ` softworkz [this message] 2025-07-03 1:55 ` [FFmpeg-devel] [PATCH 3/3] fftools/textformat: Cleanup unneeded includes softworkz
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=cd25321a5d87b92d5509e8ee83439608e21b08a0.1751507725.git.ffmpegagent@gmail.com \ --to=ffmpegagent-at-gmail.com@ffmpeg.org \ --cc=ffmpeg-devel@ffmpeg.org \ --cc=softworkz@hotmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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