From f306655319bc30ec48e12bb84679db74021350d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 23 Sep 2006 15:24:55 +0000 Subject: [PATCH] gst/: A few array const-ifications. Original commit message from CVS: * gst/audioconvert/gstaudioconvert.c: (make_lossless_changes), (gst_audio_convert_transform_caps): * gst/videotestsrc/videotestsrc.c: (gst_video_test_src_unicolor): * gst/videotestsrc/videotestsrc.h: A few array const-ifications. --- ChangeLog | 8 ++++++++ gst/audioconvert/gstaudioconvert.c | 6 +++--- gst/videotestsrc/videotestsrc.c | 6 +++--- gst/videotestsrc/videotestsrc.h | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b89a90b1ad..78d23e79f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-09-23 Tim-Philipp Müller + + * gst/audioconvert/gstaudioconvert.c: (make_lossless_changes), + (gst_audio_convert_transform_caps): + * gst/videotestsrc/videotestsrc.c: (gst_video_test_src_unicolor): + * gst/videotestsrc/videotestsrc.h: + A few array const-ifications. + 2006-09-23 Tim-Philipp Müller * tests/check/Makefile.am: diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index 506ecdbcf8..8c592209ef 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -335,8 +335,8 @@ make_lossless_changes (GstStructure * s, gboolean isfloat) GValue list = { 0 }; GValue val = { 0 }; int i; - gint endian[] = { G_LITTLE_ENDIAN, G_BIG_ENDIAN }; - gboolean booleans[] = { TRUE, FALSE }; + const gint endian[] = { G_LITTLE_ENDIAN, G_BIG_ENDIAN }; + const gboolean booleans[] = { TRUE, FALSE }; g_value_init (&list, GST_TYPE_LIST); g_value_init (&val, G_TYPE_INT); @@ -424,7 +424,7 @@ gst_audio_convert_transform_caps (GstBaseTransform * base, GstStructure *s, *structure; gboolean isfloat; gint width, depth, channels; - gchar *fields_used[] = { + const gchar *fields_used[] = { "width", "depth", "rate", "channels", "endianness", "signed" }; const gchar *structure_name; diff --git a/gst/videotestsrc/videotestsrc.c b/gst/videotestsrc/videotestsrc.c index 7cdb57d763..ec404c4437 100644 --- a/gst/videotestsrc/videotestsrc.c +++ b/gst/videotestsrc/videotestsrc.c @@ -204,7 +204,7 @@ enum COLOR_DARK_GREY }; -static struct vts_color_struct vts_colors[] = { +static const struct vts_color_struct vts_colors[] = { /* 100% white */ {255, 128, 128, 255, 255, 255}, /* yellow */ @@ -380,7 +380,7 @@ struct fourcc_list_struct fourcc_list[] = { {"RGB ", "xRGB1555", 16, paint_setup_xRGB1555, paint_hline_xRGB1555, 1, 15, 0x00007c00, 0x000003e0, 0x0000001f}, }; -int n_fourccs = sizeof (fourcc_list) / sizeof (fourcc_list[0]); +int n_fourccs = G_N_ELEMENTS (fourcc_list); struct fourcc_list_struct * paintinfo_find_by_structure (const GstStructure * structure) @@ -692,7 +692,7 @@ gst_video_test_src_snow (GstVideoTestSrc * v, unsigned char *dest, int w, int h) static void gst_video_test_src_unicolor (GstVideoTestSrc * v, unsigned char *dest, int w, - int h, struct vts_color_struct *color) + int h, const struct vts_color_struct *color) { int i; paintinfo pi = { NULL, }; diff --git a/gst/videotestsrc/videotestsrc.h b/gst/videotestsrc/videotestsrc.h index b49ea27ddb..8e3caed3f3 100644 --- a/gst/videotestsrc/videotestsrc.h +++ b/gst/videotestsrc/videotestsrc.h @@ -41,7 +41,7 @@ struct paintinfo_struct int vstride; int width; int height; - struct vts_color_struct *color; + const struct vts_color_struct *color; void (*paint_hline) (paintinfo * p, int x, int y, int w); };