usb_davicom: fixes 64 bit warnings
This commit is contained in:
@@ -346,11 +346,12 @@ DavicomDevice::Write(const uint8 *buffer, size_t *numBytes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct _TXHeader {
|
struct _TXHeader {
|
||||||
uint countLow :8;
|
uint8 countLow;
|
||||||
uint countHigh :8;
|
uint8 countHigh;
|
||||||
} __attribute__((__packed__));
|
} __attribute__((__packed__));
|
||||||
|
|
||||||
_TXHeader header = { length & 0xff, length >> 8 & 0xff };
|
_TXHeader header = { (uint8)(length & 0xff),
|
||||||
|
(uint8)((length >> 8) & 0xff) };
|
||||||
|
|
||||||
uint8 padding = 0;
|
uint8 padding = 0;
|
||||||
|
|
||||||
@@ -821,7 +822,7 @@ DavicomDevice::_ModifyMulticastTable(bool join, ether_address_t *group)
|
|||||||
|
|
||||||
void
|
void
|
||||||
DavicomDevice::_ReadCallback(void *cookie, int32 status, void *data,
|
DavicomDevice::_ReadCallback(void *cookie, int32 status, void *data,
|
||||||
uint32 actualLength)
|
size_t actualLength)
|
||||||
{
|
{
|
||||||
TRACE_RX("ReadCB: %d bytes; status:%#010x\n", actualLength, status);
|
TRACE_RX("ReadCB: %d bytes; status:%#010x\n", actualLength, status);
|
||||||
DavicomDevice *device = (DavicomDevice *)cookie;
|
DavicomDevice *device = (DavicomDevice *)cookie;
|
||||||
@@ -834,7 +835,7 @@ DavicomDevice::_ReadCallback(void *cookie, int32 status, void *data,
|
|||||||
|
|
||||||
void
|
void
|
||||||
DavicomDevice::_WriteCallback(void *cookie, int32 status, void *data,
|
DavicomDevice::_WriteCallback(void *cookie, int32 status, void *data,
|
||||||
uint32 actualLength)
|
size_t actualLength)
|
||||||
{
|
{
|
||||||
TRACE_TX("WriteCB: %d bytes; status:%#010x\n", actualLength, status);
|
TRACE_TX("WriteCB: %d bytes; status:%#010x\n", actualLength, status);
|
||||||
DavicomDevice *device = (DavicomDevice *)cookie;
|
DavicomDevice *device = (DavicomDevice *)cookie;
|
||||||
@@ -847,7 +848,7 @@ DavicomDevice::_WriteCallback(void *cookie, int32 status, void *data,
|
|||||||
|
|
||||||
void
|
void
|
||||||
DavicomDevice::_NotifyCallback(void *cookie, int32 status, void *data,
|
DavicomDevice::_NotifyCallback(void *cookie, int32 status, void *data,
|
||||||
uint32 actualLength)
|
size_t actualLength)
|
||||||
{
|
{
|
||||||
DavicomDevice *device = (DavicomDevice *)cookie;
|
DavicomDevice *device = (DavicomDevice *)cookie;
|
||||||
atomic_add(&device->fInsideNotify, 1);
|
atomic_add(&device->fInsideNotify, 1);
|
||||||
@@ -1117,7 +1118,7 @@ DavicomDevice::_WriteMII(uint8 reg, uint16 data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// put the value to data register
|
// put the value to data register
|
||||||
uint8 values[] = { data & 0xff, ( data >> 8 ) & 0xff };
|
uint8 values[] = { (uint8)(data & 0xff), (uint8)((data >> 8) & 0xff) };
|
||||||
result = _WriteRegister(RegEPDRL, sizeof(uint16), values);
|
result = _WriteRegister(RegEPDRL, sizeof(uint16), values);
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
TRACE_ALWAYS("Failed to put data %#x. Error:%#x\n", data, result);
|
TRACE_ALWAYS("Failed to put data %#x. Error:%#x\n", data, result);
|
||||||
|
|||||||
@@ -123,11 +123,11 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static void _ReadCallback(void *cookie, int32 status,
|
static void _ReadCallback(void *cookie, int32 status,
|
||||||
void *data, uint32 actualLength);
|
void *data, size_t actualLength);
|
||||||
static void _WriteCallback(void *cookie, int32 status,
|
static void _WriteCallback(void *cookie, int32 status,
|
||||||
void *data, uint32 actualLength);
|
void *data, size_t actualLength);
|
||||||
static void _NotifyCallback(void *cookie, int32 status,
|
static void _NotifyCallback(void *cookie, int32 status,
|
||||||
void *data, uint32 actualLength);
|
void *data, size_t actualLength);
|
||||||
|
|
||||||
status_t _SetupEndpoints();
|
status_t _SetupEndpoints();
|
||||||
|
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ publish_devices()
|
|||||||
|
|
||||||
gDeviceNames[deviceCount] = (char *)malloc(strlen(sDeviceBaseName) + 4);
|
gDeviceNames[deviceCount] = (char *)malloc(strlen(sDeviceBaseName) + 4);
|
||||||
if (gDeviceNames[deviceCount]) {
|
if (gDeviceNames[deviceCount]) {
|
||||||
sprintf(gDeviceNames[deviceCount], "%s%ld", sDeviceBaseName, i);
|
sprintf(gDeviceNames[deviceCount], "%s%" B_PRId32, sDeviceBaseName, i);
|
||||||
TRACE("publishing %s\n", gDeviceNames[deviceCount]);
|
TRACE("publishing %s\n", gDeviceNames[deviceCount]);
|
||||||
deviceCount++;
|
deviceCount++;
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ void usb_davicom_trace(bool force, const char* func, const char *fmt, ...)
|
|||||||
bigtime_t time = system_time();
|
bigtime_t time = system_time();
|
||||||
uint32 msec = time / 1000;
|
uint32 msec = time / 1000;
|
||||||
uint32 sec = msec / 1000;
|
uint32 sec = msec / 1000;
|
||||||
sprintf(buf_ptr, "%02ld.%02ld.%03ld:",
|
sprintf(buf_ptr, "%02" B_PRId32 ".%02" B_PRId32 ".%03" B_PRId32 ":",
|
||||||
sec / 60, sec % 60, msec % 1000);
|
sec / 60, sec % 60, msec % 1000);
|
||||||
buf_ptr += strlen(buf_ptr);
|
buf_ptr += strlen(buf_ptr);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user