From patchwork Wed Dec 30 23:31:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24701 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id C284844A7BE for ; Thu, 31 Dec 2020 01:32:52 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AC17768A8BD; Thu, 31 Dec 2020 01:32:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6BCDF68A77B for ; Thu, 31 Dec 2020 01:32:40 +0200 (EET) Received: by mail-ej1-f43.google.com with SMTP id g20so23726373ejb.1 for ; Wed, 30 Dec 2020 15:32:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=NP44ibxvz27Pn6gJiLfLtcKrX7GGlQhn6JJxbiATuI0=; b=TgRJEIMikjKzxMaPyGZfruUcutk69MZJ9WZK0UBMoBU0IloCxeNOT/ekdQkczE2zGX 8hOeHsoV6t8snaNn9f5YcAcx/2CeA0fKlVvtC3Z3OS2z9fGK03Kt39oNsCk7MsEiXdGI YZGkoiz5CuyWY8twqLnszrpwH5T0g62pHrU8oSxZePPn1XT54U/Gkz7XYLKFh8pLM8po xRU0q6puSB5LSocqtzuOND4sz/tHL5Ae7v3oGHkfjCvgrtIXF2GQtRkVvZcJhJ37BJjv EhlX8k+fWYtA8/RZsFfD8ppROQdOtIHvJIwzaT0xneF050dAE4Ypcp6iIaGZ5tG94IuN 8ReQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=NP44ibxvz27Pn6gJiLfLtcKrX7GGlQhn6JJxbiATuI0=; b=oJwfYDBdnyIox2bvMKJBZ1wBSd0fFjZ8ieTMSX9qVKPNPzr9uLwYddl3NLJhZxtrhd P0XgJskCKe/I38XlVKAcV+BRAR++8MihRgufH1a+iVMZ1nGQJwQmpE85FY551lEJASXV LYDqerykHouNvMQN9EWmm0QeokIrf2E25dI35YBmujSHuDSJRfNvPKHKhN3A1ZtyduLs 6+QR7WkZn+ci1eFUv+AjuUfayBIyt46XtdG+cSDy98ptzFBzi9x55sosyqxQB2iZPxwX 7028ogcnxLeb+gq4+rHK0/MtpzVvuZEgLWwUEowN3HcWVJsYjuy+d1uce3t0DL1DGH/J 6BJA== X-Gm-Message-State: AOAM533o1QFCGy3NgL7g2aNU7mWC05zGlablNg74QXXfnvzzoz0k4qcd lS/ZDZa5DSPKr8J1QGaRbskjQMerlkA= X-Google-Smtp-Source: ABdhPJynbTnTunAa8c/5K4zOPXAIpcwNonNehYVdNtABDOzE/u9zK3C06OKtyvVVHavPyEcIw3v4Nw== X-Received: by 2002:a17:906:934c:: with SMTP id p12mr52322966ejw.361.1609371159505; Wed, 30 Dec 2020 15:32:39 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id u19sm19630409ejg.16.2020.12.30.15.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Dec 2020 15:32:39 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 Dec 2020 00:31:33 +0100 Message-Id: <20201230233157.1055287-6-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201230233157.1055287-1-andreas.rheinhardt@gmail.com> References: <20201230233157.1055287-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 06/30] Mark some pointers as const X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Rheinhardt --- fftools/ffmpeg_opt.c | 86 ++++++++++++++++----------------- libavcodec/aacenctab.c | 4 +- libavcodec/aacenctab.h | 4 +- libavcodec/cbs.c | 2 +- libavcodec/h2645_parse.c | 4 +- libavcodec/opustab.c | 2 +- libavcodec/opustab.h | 2 +- libavfilter/af_aiir.c | 2 +- libavfilter/vf_qp.c | 4 +- libavfilter/vf_selectivecolor.c | 2 +- libavfilter/vf_tonemap_opencl.c | 6 +-- libavformat/utils.c | 2 +- libavutil/spherical.c | 2 +- 13 files changed, 61 insertions(+), 61 deletions(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 242468fc64..c295514401 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -51,49 +51,49 @@ #define SPECIFIER_OPT_FMT_f "%f" #define SPECIFIER_OPT_FMT_dbl "%lf" -static const char *opt_name_codec_names[] = {"c", "codec", "acodec", "vcodec", "scodec", "dcodec", NULL}; -static const char *opt_name_audio_channels[] = {"ac", NULL}; -static const char *opt_name_audio_sample_rate[] = {"ar", NULL}; -static const char *opt_name_frame_rates[] = {"r", NULL}; -static const char *opt_name_frame_sizes[] = {"s", NULL}; -static const char *opt_name_frame_pix_fmts[] = {"pix_fmt", NULL}; -static const char *opt_name_ts_scale[] = {"itsscale", NULL}; -static const char *opt_name_hwaccels[] = {"hwaccel", NULL}; -static const char *opt_name_hwaccel_devices[] = {"hwaccel_device", NULL}; -static const char *opt_name_hwaccel_output_formats[] = {"hwaccel_output_format", NULL}; -static const char *opt_name_autorotate[] = {"autorotate", NULL}; -static const char *opt_name_autoscale[] = {"autoscale", NULL}; -static const char *opt_name_max_frames[] = {"frames", "aframes", "vframes", "dframes", NULL}; -static const char *opt_name_bitstream_filters[] = {"bsf", "absf", "vbsf", NULL}; -static const char *opt_name_codec_tags[] = {"tag", "atag", "vtag", "stag", NULL}; -static const char *opt_name_sample_fmts[] = {"sample_fmt", NULL}; -static const char *opt_name_qscale[] = {"q", "qscale", NULL}; -static const char *opt_name_forced_key_frames[] = {"forced_key_frames", NULL}; -static const char *opt_name_force_fps[] = {"force_fps", NULL}; -static const char *opt_name_frame_aspect_ratios[] = {"aspect", NULL}; -static const char *opt_name_rc_overrides[] = {"rc_override", NULL}; -static const char *opt_name_intra_matrices[] = {"intra_matrix", NULL}; -static const char *opt_name_inter_matrices[] = {"inter_matrix", NULL}; -static const char *opt_name_chroma_intra_matrices[] = {"chroma_intra_matrix", NULL}; -static const char *opt_name_top_field_first[] = {"top", NULL}; -static const char *opt_name_presets[] = {"pre", "apre", "vpre", "spre", NULL}; -static const char *opt_name_copy_initial_nonkeyframes[] = {"copyinkfr", NULL}; -static const char *opt_name_copy_prior_start[] = {"copypriorss", NULL}; -static const char *opt_name_filters[] = {"filter", "af", "vf", NULL}; -static const char *opt_name_filter_scripts[] = {"filter_script", NULL}; -static const char *opt_name_reinit_filters[] = {"reinit_filter", NULL}; -static const char *opt_name_fix_sub_duration[] = {"fix_sub_duration", NULL}; -static const char *opt_name_canvas_sizes[] = {"canvas_size", NULL}; -static const char *opt_name_pass[] = {"pass", NULL}; -static const char *opt_name_passlogfiles[] = {"passlogfile", NULL}; -static const char *opt_name_max_muxing_queue_size[] = {"max_muxing_queue_size", NULL}; -static const char *opt_name_muxing_queue_data_threshold[] = {"muxing_queue_data_threshold", NULL}; -static const char *opt_name_guess_layout_max[] = {"guess_layout_max", NULL}; -static const char *opt_name_apad[] = {"apad", NULL}; -static const char *opt_name_discard[] = {"discard", NULL}; -static const char *opt_name_disposition[] = {"disposition", NULL}; -static const char *opt_name_time_bases[] = {"time_base", NULL}; -static const char *opt_name_enc_time_bases[] = {"enc_time_base", NULL}; +static const char *const opt_name_codec_names[] = {"c", "codec", "acodec", "vcodec", "scodec", "dcodec", NULL}; +static const char *const opt_name_audio_channels[] = {"ac", NULL}; +static const char *const opt_name_audio_sample_rate[] = {"ar", NULL}; +static const char *const opt_name_frame_rates[] = {"r", NULL}; +static const char *const opt_name_frame_sizes[] = {"s", NULL}; +static const char *const opt_name_frame_pix_fmts[] = {"pix_fmt", NULL}; +static const char *const opt_name_ts_scale[] = {"itsscale", NULL}; +static const char *const opt_name_hwaccels[] = {"hwaccel", NULL}; +static const char *const opt_name_hwaccel_devices[] = {"hwaccel_device", NULL}; +static const char *const opt_name_hwaccel_output_formats[] = {"hwaccel_output_format", NULL}; +static const char *const opt_name_autorotate[] = {"autorotate", NULL}; +static const char *const opt_name_autoscale[] = {"autoscale", NULL}; +static const char *const opt_name_max_frames[] = {"frames", "aframes", "vframes", "dframes", NULL}; +static const char *const opt_name_bitstream_filters[] = {"bsf", "absf", "vbsf", NULL}; +static const char *const opt_name_codec_tags[] = {"tag", "atag", "vtag", "stag", NULL}; +static const char *const opt_name_sample_fmts[] = {"sample_fmt", NULL}; +static const char *const opt_name_qscale[] = {"q", "qscale", NULL}; +static const char *const opt_name_forced_key_frames[] = {"forced_key_frames", NULL}; +static const char *const opt_name_force_fps[] = {"force_fps", NULL}; +static const char *const opt_name_frame_aspect_ratios[] = {"aspect", NULL}; +static const char *const opt_name_rc_overrides[] = {"rc_override", NULL}; +static const char *const opt_name_intra_matrices[] = {"intra_matrix", NULL}; +static const char *const opt_name_inter_matrices[] = {"inter_matrix", NULL}; +static const char *const opt_name_chroma_intra_matrices[] = {"chroma_intra_matrix", NULL}; +static const char *const opt_name_top_field_first[] = {"top", NULL}; +static const char *const opt_name_presets[] = {"pre", "apre", "vpre", "spre", NULL}; +static const char *const opt_name_copy_initial_nonkeyframes[] = {"copyinkfr", NULL}; +static const char *const opt_name_copy_prior_start[] = {"copypriorss", NULL}; +static const char *const opt_name_filters[] = {"filter", "af", "vf", NULL}; +static const char *const opt_name_filter_scripts[] = {"filter_script", NULL}; +static const char *const opt_name_reinit_filters[] = {"reinit_filter", NULL}; +static const char *const opt_name_fix_sub_duration[] = {"fix_sub_duration", NULL}; +static const char *const opt_name_canvas_sizes[] = {"canvas_size", NULL}; +static const char *const opt_name_pass[] = {"pass", NULL}; +static const char *const opt_name_passlogfiles[] = {"passlogfile", NULL}; +static const char *const opt_name_max_muxing_queue_size[] = {"max_muxing_queue_size", NULL}; +static const char *const opt_name_muxing_queue_data_threshold[] = {"muxing_queue_data_threshold", NULL}; +static const char *const opt_name_guess_layout_max[] = {"guess_layout_max", NULL}; +static const char *const opt_name_apad[] = {"apad", NULL}; +static const char *const opt_name_discard[] = {"discard", NULL}; +static const char *const opt_name_disposition[] = {"disposition", NULL}; +static const char *const opt_name_time_bases[] = {"time_base", NULL}; +static const char *const opt_name_enc_time_bases[] = {"enc_time_base", NULL}; #define WARN_MULTIPLE_OPT_USAGE(name, type, so, st)\ {\ diff --git a/libavcodec/aacenctab.c b/libavcodec/aacenctab.c index f3d70fbe31..874365a593 100644 --- a/libavcodec/aacenctab.c +++ b/libavcodec/aacenctab.c @@ -88,7 +88,7 @@ static const uint8_t swb_size_1024_8[] = { 32, 36, 36, 40, 44, 48, 52, 56, 60, 64, 80 }; -const uint8_t *ff_aac_swb_size_128[] = { +const uint8_t *const ff_aac_swb_size_128[] = { swb_size_128_96, swb_size_128_96, swb_size_128_64, swb_size_128_48, swb_size_128_48, swb_size_128_48, swb_size_128_24, swb_size_128_24, swb_size_128_16, @@ -96,7 +96,7 @@ const uint8_t *ff_aac_swb_size_128[] = { swb_size_128_8 }; -const uint8_t *ff_aac_swb_size_1024[] = { +const uint8_t *const ff_aac_swb_size_1024[] = { swb_size_1024_96, swb_size_1024_96, swb_size_1024_64, swb_size_1024_48, swb_size_1024_48, swb_size_1024_32, swb_size_1024_24, swb_size_1024_24, swb_size_1024_16, diff --git a/libavcodec/aacenctab.h b/libavcodec/aacenctab.h index 64932d709f..dbbdf61dfd 100644 --- a/libavcodec/aacenctab.h +++ b/libavcodec/aacenctab.h @@ -38,9 +38,9 @@ #define AAC_MAX_CHANNELS 16 -extern const uint8_t *ff_aac_swb_size_1024[]; +extern const uint8_t *const ff_aac_swb_size_1024[]; extern const int ff_aac_swb_size_1024_len; -extern const uint8_t *ff_aac_swb_size_128[]; +extern const uint8_t *const ff_aac_swb_size_128[]; extern const int ff_aac_swb_size_128_len; /* Supported layouts without using a PCE */ diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c index f98531e131..e7025cce07 100644 --- a/libavcodec/cbs.c +++ b/libavcodec/cbs.c @@ -28,7 +28,7 @@ #include "cbs_internal.h" -static const CodedBitstreamType *cbs_type_table[] = { +static const CodedBitstreamType *const cbs_type_table[] = { #if CONFIG_CBS_AV1 &ff_cbs_type_av1, #endif diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c index 0f98b49fbe..a36ef4f5a0 100644 --- a/libavcodec/h2645_parse.c +++ b/libavcodec/h2645_parse.c @@ -146,7 +146,7 @@ nsc: return si; } -static const char *hevc_nal_type_name[64] = { +static const char *const hevc_nal_type_name[64] = { "TRAIL_N", // HEVC_NAL_TRAIL_N "TRAIL_R", // HEVC_NAL_TRAIL_R "TSA_N", // HEVC_NAL_TSA_N @@ -219,7 +219,7 @@ static const char *hevc_nal_unit_name(int nal_type) return hevc_nal_type_name[nal_type]; } -static const char *h264_nal_type_name[32] = { +static const char *const h264_nal_type_name[32] = { "Unspecified 0", //H264_NAL_UNSPECIFIED "Coded slice of a non-IDR picture", // H264_NAL_SLICE "Coded slice data partition A", // H264_NAL_DPA diff --git a/libavcodec/opustab.c b/libavcodec/opustab.c index 7276dad793..8a08a26a57 100644 --- a/libavcodec/opustab.c +++ b/libavcodec/opustab.c @@ -1130,7 +1130,7 @@ DECLARE_ALIGNED(32, static const float, ff_celt_window_padded)[136] = { 1.00000000f, 1.00000000f, 1.00000000f, }; -const float *ff_celt_window = &ff_celt_window_padded[8]; +const float *const ff_celt_window = &ff_celt_window_padded[8]; /* square of the window, used for the postfilter */ const float ff_celt_window2[120] = { diff --git a/libavcodec/opustab.h b/libavcodec/opustab.h index cdd0456e3c..4525837942 100644 --- a/libavcodec/opustab.h +++ b/libavcodec/opustab.h @@ -156,7 +156,7 @@ extern const uint16_t ff_celt_qn_exp2[]; extern const float ff_celt_postfilter_taps[3][3]; extern const float ff_celt_window2[120]; -extern const float *ff_celt_window; +extern const float *const ff_celt_window; extern const uint32_t * const ff_celt_pvq_u_row[15]; diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c index 59d2232ac9..f2e9d8e4e2 100644 --- a/libavfilter/af_aiir.c +++ b/libavfilter/af_aiir.c @@ -453,7 +453,7 @@ static int read_zp_coefficients(AVFilterContext *ctx, char *item_str, int nb_ite return 0; } -static const char *format[] = { "%lf", "%lf %lfi", "%lf %lfr", "%lf %lfd", "%lf %lfi" }; +static const char *const format[] = { "%lf", "%lf %lfi", "%lf %lfr", "%lf %lfd", "%lf %lfi" }; static int read_channels(AVFilterContext *ctx, int channels, uint8_t *item_str, int ab) { diff --git a/libavfilter/vf_qp.c b/libavfilter/vf_qp.c index 33d39493bc..4626198d15 100644 --- a/libavfilter/vf_qp.c +++ b/libavfilter/vf_qp.c @@ -53,7 +53,7 @@ static int config_input(AVFilterLink *inlink) int i; int ret; AVExpr *e = NULL; - static const char *var_names[] = { "known", "qp", "x", "y", "w", "h", NULL }; + static const char *const var_names[] = { "known", "qp", "x", "y", "w", "h", NULL }; if (!s->qp_expr_str) return 0; @@ -121,7 +121,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) for (x = 0; x < s->qstride; x++) { int qp = in_qp_table ? in_qp_table[x + stride * y] : NAN; double var_values[] = { !!in_qp_table, qp, x, y, s->qstride, s->h, 0}; - static const char *var_names[] = { "known", "qp", "x", "y", "w", "h", NULL }; + static const char *const var_names[] = { "known", "qp", "x", "y", "w", "h", NULL }; double temp_val; ret = av_expr_parse_and_eval(&temp_val, s->qp_expr_str, diff --git a/libavfilter/vf_selectivecolor.c b/libavfilter/vf_selectivecolor.c index d8f339d540..9bd79a3e60 100644 --- a/libavfilter/vf_selectivecolor.c +++ b/libavfilter/vf_selectivecolor.c @@ -61,7 +61,7 @@ enum correction_method { NB_CORRECTION_METHODS, }; -static const char *color_names[NB_RANGES] = { +static const char *const color_names[NB_RANGES] = { "red", "yellow", "green", "cyan", "blue", "magenta", "white", "neutral", "black" }; diff --git a/libavfilter/vf_tonemap_opencl.c b/libavfilter/vf_tonemap_opencl.c index b880228727..2681ebd1b5 100644 --- a/libavfilter/vf_tonemap_opencl.c +++ b/libavfilter/vf_tonemap_opencl.c @@ -71,12 +71,12 @@ typedef struct TonemapOpenCLContext { cl_mem util_mem; } TonemapOpenCLContext; -static const char *linearize_funcs[AVCOL_TRC_NB] = { +static const char *const linearize_funcs[AVCOL_TRC_NB] = { [AVCOL_TRC_SMPTE2084] = "eotf_st2084", [AVCOL_TRC_ARIB_STD_B67] = "inverse_oetf_hlg", }; -static const char *delinearize_funcs[AVCOL_TRC_NB] = { +static const char *const delinearize_funcs[AVCOL_TRC_NB] = { [AVCOL_TRC_BT709] = "inverse_eotf_bt1886", [AVCOL_TRC_BT2020_10] = "inverse_eotf_bt1886", }; @@ -91,7 +91,7 @@ static const struct WhitepointCoefficients whitepoint_table[AVCOL_PRI_NB] = { [AVCOL_PRI_BT2020] = { 0.3127, 0.3290 }, }; -static const char *tonemap_func[TONEMAP_MAX] = { +static const char *const tonemap_func[TONEMAP_MAX] = { [TONEMAP_NONE] = "direct", [TONEMAP_LINEAR] = "linear", [TONEMAP_GAMMA] = "gamma", diff --git a/libavformat/utils.c b/libavformat/utils.c index 1a87d9422a..f63ff3074a 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2874,7 +2874,7 @@ skip_duration_calc: } /* 1:1 map to AVDurationEstimationMethod */ -static const char *duration_name[] = { +static const char *const duration_name[] = { [AVFMT_DURATION_FROM_PTS] = "pts", [AVFMT_DURATION_FROM_STREAM] = "stream", [AVFMT_DURATION_FROM_BITRATE] = "bit rate", diff --git a/libavutil/spherical.c b/libavutil/spherical.c index 4be55f36cf..4a7f3e49ca 100644 --- a/libavutil/spherical.c +++ b/libavutil/spherical.c @@ -51,7 +51,7 @@ void av_spherical_tile_bounds(const AVSphericalMapping *map, *bottom = orig_height - height - *top; } -static const char *spherical_projection_names[] = { +static const char *const spherical_projection_names[] = { [AV_SPHERICAL_EQUIRECTANGULAR] = "equirectangular", [AV_SPHERICAL_CUBEMAP] = "cubemap", [AV_SPHERICAL_EQUIRECTANGULAR_TILE] = "tiled equirectangular",