[x265] [PATCH] silence MSVC warning C4334

Mateusz mateuszb at poczta.onet.pl
Sun Oct 8 10:23:00 CEST 2017


MSVC (from VS 2017) gives 6 warnings:
  F:\x265\source\encoder\analysis.cpp(312): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64
-bit shift intended?) [F:\x265\ma\10b\encoder\encoder.vcxproj]

This patch silences these warnings.

Please review.

Mateusz

-------------- next part --------------
# HG changeset patch
# User Ma0 <mateuszb at poczta.onet.pl>
# Date 1507449263 -7200
#      Sun Oct 08 09:54:23 2017 +0200
# Node ID 4db1037a3ab8a1ced5e182910373a67ed028b26f
# Parent  4b95f82c9fb1f210d31acdd93370bfddbecea828
silence MSVC warning C4334

warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits

diff -r 4b95f82c9fb1 -r 4db1037a3ab8 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Thu Oct 05 17:25:58 2017 +0530
+++ b/source/encoder/analysis.cpp	Sun Oct 08 09:54:23 2017 +0200
@@ -309,8 +309,8 @@
 
             if (ctu.m_predMode[puabsPartIdx + absPartIdx] == MODE_SKIP)
             {
-                ctu.m_encData->m_frameStats.cntSkipPu[depth] += (uint64_t)(1 << shift);
-                ctu.m_encData->m_frameStats.totalPu[depth] += (uint64_t)(1 << shift);
+                ctu.m_encData->m_frameStats.cntSkipPu[depth] += 1ULL << shift;
+                ctu.m_encData->m_frameStats.totalPu[depth] += 1ULL << shift;
             }
             else if (ctu.m_predMode[puabsPartIdx + absPartIdx] == MODE_INTRA)
             {
@@ -321,14 +321,14 @@
                 }
                 else
                 {
-                    ctu.m_encData->m_frameStats.cntIntraPu[depth] += (uint64_t)(1 << shift);
-                    ctu.m_encData->m_frameStats.totalPu[depth] += (uint64_t)(1 << shift);
+                    ctu.m_encData->m_frameStats.cntIntraPu[depth] += 1ULL << shift;
+                    ctu.m_encData->m_frameStats.totalPu[depth] += 1ULL << shift;
                 }
             }
             else if (mode == 3)
             {
-                ctu.m_encData->m_frameStats.cntAmp[depth] += (uint64_t)(1 << shift);
-                ctu.m_encData->m_frameStats.totalPu[depth] += (uint64_t)(1 << shift);
+                ctu.m_encData->m_frameStats.cntAmp[depth] += 1ULL << shift;
+                ctu.m_encData->m_frameStats.totalPu[depth] += 1ULL << shift;
                 break;
             }
             else


More information about the x265-devel mailing list