Ticket #9290: 0001-Fix-GCC4.8-narrowing-conversion-warnings.patch
File 0001-Fix-GCC4.8-narrowing-conversion-warnings.patch, 6.1 KB (added by , 11 years ago) |
---|
-
src/add-ons/accelerants/intel_extreme/mode.cpp
From 4cba7a70012320ab7e0df056afd2ce455bcf030e Mon Sep 17 00:00:00 2001 From: Murai Takashi <tmurai01@gmail.com> Date: Sat, 4 May 2013 19:35:23 +0900 Subject: [PATCH] Fix GCC4.8 narrowing conversion warnings --- src/add-ons/accelerants/intel_extreme/mode.cpp | 2 +- .../bus_managers/firewire/firewire_module.cpp | 30 ++++++++++++-------- .../kernel/bus_managers/firewire/fwohci.cpp | 2 +- .../drivers/network/usb_davicom/DavicomDevice.cpp | 4 +-- src/libs/gnu/xattr.cpp | 3 +- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/add-ons/accelerants/intel_extreme/mode.cpp b/src/add-ons/accelerants/intel_extreme/mode.cpp index 2727a16..95d7608 100644
a b sanitize_display_mode(display_mode& mode) 495 495 gInfo->shared_info->pll_info.min_frequency, 496 496 gInfo->shared_info->pll_info.max_frequency, 497 497 // horizontal 498 { olderCard ? 2 : 1, 0, 8160, 32, 8192, 0, 8192},498 {(uint16)(olderCard ? 2 : 1), 0, 8160, 32, 8192, 0, 8192}, 499 499 {1, 1, 4092, 2, 63, 1, 4096} 500 500 }; 501 501 -
src/add-ons/kernel/bus_managers/firewire/firewire_module.cpp
diff --git a/src/add-ons/kernel/bus_managers/firewire/firewire_module.cpp b/src/add-ons/kernel/bus_managers/firewire/firewire_module.cpp index 6f6fbf3..e3d5461 100644
a b struct supported_device supported_devices[] = { 49 49 {FW_VENDORID_NEC, FW_DEVICE_UPD72873, "NEC uPD72873"}, 50 50 {FW_VENDORID_NEC, FW_DEVICE_UPD72874, "NEC uPD72874"}, 51 51 {FW_VENDORID_SIS, FW_DEVICE_7007, "SiS 7007"}, 52 {FW_VENDORID_TI, FW_DEVICE_TITSB22, "Texas Instruments TSB12LV22"}, 53 {FW_VENDORID_TI, FW_DEVICE_TITSB23, "Texas Instruments TSB12LV23"}, 54 {FW_VENDORID_TI, FW_DEVICE_TITSB26, "Texas Instruments TSB12LV26"}, 55 {FW_VENDORID_TI, FW_DEVICE_TITSB43, "Texas Instruments TSB43AA22"}, 56 {FW_VENDORID_TI, FW_DEVICE_TITSB43A, "Texas Instruments TSB43AB22/A"}, 57 {FW_VENDORID_TI, FW_DEVICE_TITSB43AB21, "Texas Instruments TSB43AB21/A/AI/A-EP"}, 58 {FW_VENDORID_TI, FW_DEVICE_TITSB43AB23, "Texas Instruments TSB43AB23"}, 59 {FW_VENDORID_TI, FW_DEVICE_TITSB82AA2, "Texas Instruments TSB82AA2"}, 60 {FW_VENDORID_TI, FW_DEVICE_TIPCI4450, "Texas Instruments PCI4450"}, 61 {FW_VENDORID_TI, FW_DEVICE_TIPCI4410A, "Texas Instruments PCI4410A"}, 62 {FW_VENDORID_TI, FW_DEVICE_TIPCI4451, "Texas Instruments PCI4451"}, 52 {FW_VENDORID_TI, (uint32)FW_DEVICE_TITSB22, "Texas Instruments TSB12LV22"}, 53 {FW_VENDORID_TI, (uint32)FW_DEVICE_TITSB23, "Texas Instruments TSB12LV23"}, 54 {FW_VENDORID_TI, (uint32)FW_DEVICE_TITSB26, "Texas Instruments TSB12LV26"}, 55 {FW_VENDORID_TI, (uint32)FW_DEVICE_TITSB43, "Texas Instruments TSB43AA22"}, 56 {FW_VENDORID_TI, (uint32)FW_DEVICE_TITSB43A, 57 "Texas Instruments TSB43AB22/A"}, 58 {FW_VENDORID_TI, (uint32)FW_DEVICE_TITSB43AB21, 59 "Texas Instruments TSB43AB21/A/AI/A-EP"}, 60 {FW_VENDORID_TI, (uint32)FW_DEVICE_TITSB43AB23, 61 "Texas Instruments TSB43AB23"}, 62 {FW_VENDORID_TI, (uint32)FW_DEVICE_TITSB82AA2, 63 "Texas Instruments TSB82AA2"}, 64 {FW_VENDORID_TI, (uint32)FW_DEVICE_TIPCI4450, 65 "Texas Instruments PCI4450"}, 66 {FW_VENDORID_TI, (uint32)FW_DEVICE_TIPCI4410A, 67 "Texas Instruments PCI4410A"}, 68 {FW_VENDORID_TI, (uint32)FW_DEVICE_TIPCI4451, "Texas Instruments PCI4451"}, 63 69 {FW_VENDORID_VIA, FW_DEVICE_VT6306, "VIA Fire II (VT6306)"}, 64 70 {FW_VENDORID_RICOH, FW_DEVICE_R5C551, "Ricoh R5C551"}, 65 71 {FW_VENDORID_RICOH, FW_DEVICE_R5C552, "Ricoh R5C552"}, … … struct supported_device supported_devices[] = { 69 75 {FW_VENDORID_INTEL, FW_DEVICE_82372FB, "Intel 82372FB"}, 70 76 {FW_VENDORID_ADAPTEC, FW_DEVICE_AIC5800, "Adaptec AHA-894x/AIC-5800"}, 71 77 {FW_VENDORID_SUN, FW_DEVICE_PCIO2FW, "Sun PCIO-2"}, 72 {FW_VENDORID_SONY, FW_DEVICE_CXD3222, "Sony i.LINK (CXD3222)"},78 {FW_VENDORID_SONY, (uint32)FW_DEVICE_CXD3222, "Sony i.LINK (CXD3222)"}, 73 79 {0, 0, NULL} 74 80 }; 75 81 -
src/add-ons/kernel/bus_managers/firewire/fwohci.cpp
diff --git a/src/add-ons/kernel/bus_managers/firewire/fwohci.cpp b/src/add-ons/kernel/bus_managers/firewire/fwohci.cpp index e79b1ae..d8a6301 100644
a b char fwohcicode[32][0x20]={ 87 87 88 88 #define MAX_SPEED 3 89 89 extern const char *const linkspeed[]; 90 uint32_t tagbit[4] = { 1 << 28, 1 << 29, 1 << 30, 1 << 31};90 uint32_t tagbit[4] = { 1 << 28, 1 << 29, 1 << 30, (uint32_t)(1 << 31)}; 91 91 92 92 static struct tcode_info tinfo[] = { 93 93 /* hdr_len block flag valid_response */ -
src/add-ons/kernel/drivers/network/usb_davicom/DavicomDevice.cpp
diff --git a/src/add-ons/kernel/drivers/network/usb_davicom/DavicomDevice.cpp b/src/add-ons/kernel/drivers/network/usb_davicom/DavicomDevice.cpp index 8cff098..7e61378 100644
a b DavicomDevice::Write(const uint8 *buffer, size_t *numBytes) 350 350 uint countHigh :8; 351 351 } __attribute__((__packed__)); 352 352 353 _TXHeader header = { length & 0xff, length >> 8 & 0xff};353 _TXHeader header = {(uint)(length & 0xff), (uint)(length >> 8 & 0xff)}; 354 354 355 355 uint8 padding = 0; 356 356 … … DavicomDevice::_WriteMII(uint8 reg, uint16 data) 1117 1117 } 1118 1118 1119 1119 // put the value to data register 1120 uint8 values[] = { data & 0xff, ( data >> 8 ) & 0xff};1120 uint8 values[] = {(uint8)(data & 0xff), (uint8)(( data >> 8 ) & 0xff)}; 1121 1121 result = _WriteRegister(RegEPDRL, sizeof(uint16), values); 1122 1122 if (result != B_OK) { 1123 1123 TRACE_ALWAYS("Failed to put data %#x. Error:%#x\n", data, result); -
src/libs/gnu/xattr.cpp
diff --git a/src/libs/gnu/xattr.cpp b/src/libs/gnu/xattr.cpp index fadb573..c4adfbb 100644
a b struct AttributeName { 43 43 // printable, just use them as the type string, otherwise convert 44 44 // to hex 45 45 char typeString[9]; 46 uint8 typeBytes[4] = { type >> 24, type >> 16, type >> 8, type }; 46 uint8 typeBytes[4] = {(uint8)(type >> 24), (uint8)(type >> 16), 47 (uint8)(type >> 8), (uint8)type }; 47 48 if (isprint(typeBytes[0]) && isprint(typeBytes[1]) 48 49 && isprint(typeBytes[2]) && isprint(typeBytes[3])) { 49 50 typeString[0] = typeBytes[0];