diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-12-13 22:39:01 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-12-13 22:39:01 +0200 |
commit | 5c99f9cf37bab8dfb61296f15a602571846ae6d9 (patch) | |
tree | d411d862457dd46c216201e2564152ce6c0ca5a5 /ext | |
parent | 788bb676396a28bed4a6a423500a96a913708ed0 (diff) | |
download | gstreamer-plugins-bad-5c99f9cf37bab8dfb61296f15a602571846ae6d9.tar.gz |
gst: Don't declare variables inside the for loop header
This is a C99 feature.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/gl/gltestsrc.c | 8 | ||||
-rw-r--r-- | ext/libde265/libde265-dec.c | 3 | ||||
-rw-r--r-- | ext/opencv/MotionCells.h | 14 | ||||
-rw-r--r-- | ext/vulkan/vkdevice.c | 2 | ||||
-rw-r--r-- | ext/vulkan/vkinstance.c | 3 |
5 files changed, 18 insertions, 12 deletions
diff --git a/ext/gl/gltestsrc.c b/ext/gl/gltestsrc.c index 80e3c550a..87e302c55 100644 --- a/ext/gl/gltestsrc.c +++ b/ext/gl/gltestsrc.c @@ -334,7 +334,7 @@ _src_smpte_init (gpointer impl, GstGLContext * context, GstVideoInfo * v_info) plane_indices = g_new0 (gushort, N_QUADS * 6); /* top row */ - for (int i = 0; i < 7; i++) { + for (i = 0; i < 7; i++) { coord[color_idx * 4 + 0].X = -1.0f + i * (2.0f / 7.0f); coord[color_idx * 4 + 0].Y = 1.0f / 3.0f; coord[color_idx * 4 + 1].X = -1.0f + (i + 1) * (2.0f / 7.0f); @@ -347,7 +347,7 @@ _src_smpte_init (gpointer impl, GstGLContext * context, GstVideoInfo * v_info) } /* middle row */ - for (int i = 0; i < 7; i++) { + for (i = 0; i < 7; i++) { coord[color_idx * 4 + 0].X = -1.0f + i * (2.0f / 7.0f); coord[color_idx * 4 + 0].Y = 0.5f; coord[color_idx * 4 + 1].X = -1.0f + (i + 1) * (2.0f / 7.0f); @@ -360,7 +360,7 @@ _src_smpte_init (gpointer impl, GstGLContext * context, GstVideoInfo * v_info) } /* bottom row, left three */ - for (int i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) { coord[color_idx * 4 + 0].X = -1.0f + i / 3.0f; coord[color_idx * 4 + 0].Y = 1.0f; coord[color_idx * 4 + 1].X = -1.0f + (i + 1) / 3.0f; @@ -373,7 +373,7 @@ _src_smpte_init (gpointer impl, GstGLContext * context, GstVideoInfo * v_info) } /* bottom row, middle three (the blacks) */ - for (int i = 0; i < 3; i++) { + for (i = 0; i < 3; i++) { coord[color_idx * 4 + 0].X = i / 6.0f; coord[color_idx * 4 + 0].Y = 1.0f; coord[color_idx * 4 + 1].X = (i + 1) / 6.0f; diff --git a/ext/libde265/libde265-dec.c b/ext/libde265/libde265-dec.c index 80531688d..ab376c505 100644 --- a/ext/libde265/libde265-dec.c +++ b/ext/libde265/libde265-dec.c @@ -682,6 +682,7 @@ _gst_libde265_return_image (GstVideoDecoder * decoder, GstVideoFrame outframe; GstVideoCodecFrame *out_frame; int frame_number; + int plane; ref = (struct GstLibde265FrameRef *) de265_get_image_plane_user_data (img, 0); if (ref != NULL) { @@ -731,7 +732,7 @@ _gst_libde265_return_image (GstVideoDecoder * decoder, return GST_FLOW_ERROR; } - for (int plane = 0; plane < 3; plane++) { + for (plane = 0; plane < 3; plane++) { int width = de265_get_image_width (img, plane); int height = de265_get_image_height (img, plane); int srcstride = width; diff --git a/ext/opencv/MotionCells.h b/ext/opencv/MotionCells.h index c858d8739..6c060a9ee 100644 --- a/ext/opencv/MotionCells.h +++ b/ext/opencv/MotionCells.h @@ -214,8 +214,10 @@ private: bool getIsNonZero (IplImage * img) { - for (int lin = 0; lin < img->height; lin++) - for (int col = 0; col < img->width; col++) { + int lin, col; + + for (lin = 0; lin < img->height; lin++) + for (col = 0; col < img->width; col++) { if ((((uchar *) (img->imageData + img->widthStep * lin))[col]) > 0) return true; } @@ -224,15 +226,17 @@ private: void setMotionCells (int p_frameWidth, int p_frameHeight) { + int i, j; + m_cellwidth = (double) p_frameWidth / (double) m_gridx; m_cellheight = (double) p_frameHeight / (double) m_gridy; m_pCells = new Cell *[m_gridy]; - for (int i = 0; i < m_gridy; i++) + for (i = 0; i < m_gridy; i++) m_pCells[i] = new Cell[m_gridx]; //init cells - for (int i = 0; i < m_gridy; i++) - for (int j = 0; j < m_gridx; j++) { + for (i = 0; i < m_gridy; i++) + for (j = 0; j < m_gridx; j++) { m_pCells[i][j].MotionArea = 0; m_pCells[i][j].CellArea = 0; m_pCells[i][j].MotionPercent = 0; diff --git a/ext/vulkan/vkdevice.c b/ext/vulkan/vkdevice.c index 1f7aad81a..d9e15593d 100644 --- a/ext/vulkan/vkdevice.c +++ b/ext/vulkan/vkdevice.c @@ -230,7 +230,7 @@ gst_vulkan_device_open (GstVulkanDevice * device, GError ** error) goto error; } - for (uint32_t i = 0; i < device_extension_count; i++) { + for (i = 0; i < device_extension_count; i++) { GST_TRACE_OBJECT (device, "checking device extension %s", device_extensions[i].extensionName); if (!strcmp (VK_KHR_SWAPCHAIN_EXTENSION_NAME, diff --git a/ext/vulkan/vkinstance.c b/ext/vulkan/vkinstance.c index d61458e9b..14d1435af 100644 --- a/ext/vulkan/vkinstance.c +++ b/ext/vulkan/vkinstance.c @@ -234,6 +234,7 @@ gst_vulkan_instance_open (GstVulkanInstance * instance, GError ** error) gboolean swapchain_ext_found = FALSE; gboolean winsys_ext_found = FALSE; const gchar *winsys_ext_name; + uint32_t i; display_type = gst_vulkan_display_choose_type (instance); @@ -245,7 +246,7 @@ gst_vulkan_instance_open (GstVulkanInstance * instance, GError ** error) } /* TODO: allow outside selection */ - for (uint32_t i = 0; i < instance_extension_count; i++) { + for (i = 0; i < instance_extension_count; i++) { GST_TRACE_OBJECT (instance, "checking instance extension %s", instance_extensions[i].extensionName); |