mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
all: Fix left-shift undefined behaviour
Cast to the target type before shifting (or use macro if available)
This commit is contained in:
parent
538aae2404
commit
4260f8a120
3 changed files with 3 additions and 5 deletions
|
@ -574,7 +574,7 @@ gst_gl_context_get_current_gl_api (GstGLPlatform platform, guint * major,
|
|||
#endif
|
||||
const gchar *version;
|
||||
gint maj, min, n;
|
||||
GstGLAPI ret = (1 << 31);
|
||||
GstGLAPI ret = (1U << 31);
|
||||
|
||||
_init_debug ();
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ static void dvb_sub_init (void);
|
|||
*/
|
||||
|
||||
#define AYUV(y,u,v,a) (((a) << 24) | ((y) << 16) | ((u) << 8) | (v))
|
||||
#define RGBA_TO_AYUV(r,g,b,a) (((a) << 24) | ((rgb_to_y(r,g,b)) << 16) | ((rgb_to_u(r,g,b)) << 8) | (rgb_to_v(r,g,b)))
|
||||
#define RGBA_TO_AYUV(r,g,b,a) ((((guint32)(a)) << 24) | ((rgb_to_y(r,g,b)) << 16) | ((rgb_to_u(r,g,b)) << 8) | (rgb_to_v(r,g,b)))
|
||||
|
||||
|
||||
typedef struct DVBSubCLUT
|
||||
|
|
|
@ -250,9 +250,7 @@ mxf_uuid_hash (const MXFUUID * uuid)
|
|||
g_return_val_if_fail (uuid != NULL, 0);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
ret ^= (uuid->u[i * 4 + 0] << 24) |
|
||||
(uuid->u[i * 4 + 1] << 16) |
|
||||
(uuid->u[i * 4 + 2] << 8) | (uuid->u[i * 4 + 3] << 0);
|
||||
ret ^= GST_READ_UINT32_BE (uuid->u + i * 4);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue