omx: Make sure to compare the error codes as unsigned integers so that comparisons...
authorSebastian Dröge <sebastian@centricular.com>
Mon, 19 May 2014 06:45:10 +0000 (08:45 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 19 May 2014 06:47:33 +0000 (08:47 +0200)
CID 1214592

omx/gstomx.c

index 1467465926e37538642cd49845a0727aacd31cfd..04c5502999f38dd148db0e8a88e37ac89459dba1 100644 (file)
@@ -2285,7 +2285,9 @@ gst_omx_get_configuration (void)
 const gchar *
 gst_omx_error_to_string (OMX_ERRORTYPE err)
 {
-  switch (err) {
+  guint err_u = (guint) err;
+
+  switch (err_u) {
     case OMX_ErrorNone:
       return "None";
     case OMX_ErrorInsufficientResources:
@@ -2363,11 +2365,11 @@ gst_omx_error_to_string (OMX_ERRORTYPE err)
     case OMX_ErrorTunnelingUnsupported:
       return "Tunneling unsupported";
     default:
-      if (err >= (guint32) OMX_ErrorKhronosExtensions
-          && err < (guint32) OMX_ErrorVendorStartUnused) {
+      if (err_u >= (guint) OMX_ErrorKhronosExtensions
+          && err_u < (guint) OMX_ErrorVendorStartUnused) {
         return "Khronos extension error";
-      } else if (err >= (guint32) OMX_ErrorVendorStartUnused
-          && err < (guint32) OMX_ErrorMax) {
+      } else if (err_u >= (guint) OMX_ErrorVendorStartUnused
+          && err_u < (guint) OMX_ErrorMax) {
         return "Vendor specific error";
       } else {
         return "Unknown error";