This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l-utils: Fix shifting signed 32-bit value by 31 bits problem
Author:  Hans Verkuil <hverkuil-ci...@xs4all.nl>
Date:    Fri Jun 14 10:00:29 2019 +0200

Use 1U << 31 instead of 1 << 31 to avoid the 'shifting a signed
32-bit value by 31 bits problem' where the result is compiler dependent.

Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 utils/common/v4l2-info.cpp         | 2 +-
 utils/qv4l2/general-tab.cpp        | 2 +-
 utils/v4l2-ctl/v4l2-ctl-vidcap.cpp | 4 ++--
 utils/v4l2-ctl/v4l2-ctl.cpp        | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=d4ce603ad821f86256e149fe74305abdf8700ce4
diff --git a/utils/common/v4l2-info.cpp b/utils/common/v4l2-info.cpp
index 212c1a0fee29..effd350c4a8c 100644
--- a/utils/common/v4l2-info.cpp
+++ b/utils/common/v4l2-info.cpp
@@ -147,7 +147,7 @@ std::string fcc2s(__u32 val)
        s += (val >> 8) & 0x7f;
        s += (val >> 16) & 0x7f;
        s += (val >> 24) & 0x7f;
-       if (val & (1 << 31))
+       if (val & (1U << 31))
                s += "-BE";
        return s;
 }
diff --git a/utils/qv4l2/general-tab.cpp b/utils/qv4l2/general-tab.cpp
index 7ab79a05b486..29b3e34e3a72 100644
--- a/utils/qv4l2/general-tab.cpp
+++ b/utils/qv4l2/general-tab.cpp
@@ -51,7 +51,7 @@ static QString pixfmt2s(unsigned id)
        pixfmt += (char)((id >> 8) & 0x7f);
        pixfmt += (char)((id >> 16) & 0x7f);
        pixfmt += (char)((id >> 24) & 0x7f);
-       if (id & (1 << 31))
+       if (id & (1U << 31))
                pixfmt += "-BE";
        return pixfmt;
 }
diff --git a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp 
b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
index 337fb1f2dc18..15ffbeae03ff 100644
--- a/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-vidcap.cpp
@@ -119,7 +119,7 @@ void vidcap_cmd(int ch, char *optarg)
                        frmsize.pixel_format = v4l2_fourcc(optarg[0], optarg[1],
                                                           optarg[2], 
optarg[3]);
                        if (be_pixfmt)
-                               frmsize.pixel_format |= 1 << 31;
+                               frmsize.pixel_format |= 1U << 31;
                } else if (isdigit(optarg[0])) {
                        frmsize.pixel_format = strtol(optarg, 0L, 0);
                } else {
@@ -151,7 +151,7 @@ void vidcap_cmd(int ch, char *optarg)
                                                v4l2_fourcc(value[0], value[1],
                                                            value[2], value[3]);
                                        if (be_pixfmt)
-                                               frmival.pixel_format |= 1 << 31;
+                                               frmival.pixel_format |= 1U << 
31;
                                } else if (isdigit(optarg[0])) {
                                        frmival.pixel_format = strtol(value, 
0L, 0);
                                } else {
diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
index efc18f87c44c..928741aa3522 100644
--- a/utils/v4l2-ctl/v4l2-ctl.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl.cpp
@@ -780,7 +780,7 @@ int parse_fmt(char *optarg, __u32 &width, __u32 &height, 
__u32 &pixelformat,
                                        v4l2_fourcc(value[0], value[1],
                                                    value[2], value[3]);
                                if (be_pixfmt)
-                                       pixelformat |= 1 << 31;
+                                       pixelformat |= 1U << 31;
                        } else if (isdigit(value[0])) {
                                pixelformat = strtol(value, 0L, 0);
                        } else {

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to