[x265] change int literals to char literals to avoid VS 2015 warnings

Mateusz mateuszb at poczta.onet.pl
Fri Apr 8 22:22:59 CEST 2016


Fix VS 2015 warning:
x265\source\common\cpu.cpp(277): warning C4838: conversion from 'int' to 
'const char' requires a narrowing conversion
-------------- next part --------------
diff -r 5b5374cae60f source/common/cpu.cpp
--- a/source/common/cpu.cpp	Fri Apr 08 22:34:39 2016 +0530
+++ b/source/common/cpu.cpp	Fri Apr 08 20:53:41 2016 +0200
@@ -274,9 +274,9 @@
         if (!cache && max_basic_cap >= 2)
         {
             // Cache and TLB Information
-            static const char cache32_ids[] = { 0x0a, 0x0c, 0x41, 0x42, 0x43, 0x44, 0x45, 0x82, 0x83, 0x84, 0x85, 0 };
-            static const char cache64_ids[] = { 0x22, 0x23, 0x25, 0x29, 0x2c, 0x46, 0x47, 0x49, 0x60, 0x66, 0x67,
-                                                0x68, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7c, 0x7f, 0x86, 0x87, 0 };
+            static const char cache32_ids[] = { '\x0a','\x0c','\x41','\x42','\x43','\x44','\x45','\x82','\x83','\x84','\x85','\0' };
+            static const char cache64_ids[] = { '\x22','\x23','\x25','\x29','\x2c','\x46','\x47','\x49','\x60','\x66','\x67',
+                                                '\x68','\x78','\x79','\x7a','\x7b','\x7c','\x7c','\x7f','\x86','\x87','\0' };
             uint32_t buf[4];
             int max, i = 0;
             do


More information about the x265-devel mailing list