Fix gcc4 build:
- use new(std::nothrow) from <new> since we dropped kernel_cpp.h, - fix "declared 'extern' and later 'static'" warning, - fix "deprecated conversion from string constant to 'char*'" warning in tracing code. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39784 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -90,15 +90,6 @@ void uninit_driver();
|
|||||||
bool usb_serial_service(struct tty *tty, uint32 op, void *buffer,
|
bool usb_serial_service(struct tty *tty, uint32 op, void *buffer,
|
||||||
size_t length);
|
size_t length);
|
||||||
|
|
||||||
status_t usb_serial_open(const char *name, uint32 flags, void **cookie);
|
|
||||||
status_t usb_serial_read(void *cookie, off_t position, void *buffer, size_t *numBytes);
|
|
||||||
status_t usb_serial_write(void *cookie, off_t position, const void *buffer, size_t *numBytes);
|
|
||||||
status_t usb_serial_control(void *cookie, uint32 op, void *arg, size_t length);
|
|
||||||
status_t usb_serial_select(void *cookie, uint8 event, uint32 ref, selectsync *sync);
|
|
||||||
status_t usb_serial_deselect(void *coookie, uint8 event, selectsync *sync);
|
|
||||||
status_t usb_serial_close(void *cookie);
|
|
||||||
status_t usb_serial_free(void *cookie);
|
|
||||||
|
|
||||||
const char **publish_devices();
|
const char **publish_devices();
|
||||||
device_hooks *find_device(const char *name);
|
device_hooks *find_device(const char *name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
* Copyright (c) 2003 by Siarzhuk Zharski <[email protected]>
|
* Copyright (c) 2003 by Siarzhuk Zharski <[email protected]>
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
#include <new>
|
||||||
|
|
||||||
#include "SerialDevice.h"
|
#include "SerialDevice.h"
|
||||||
#include "USB3.h"
|
#include "USB3.h"
|
||||||
|
|
||||||
@@ -637,7 +639,7 @@ SerialDevice::MakeDevice(usb_device device, uint16 vendorID,
|
|||||||
if (!description)
|
if (!description)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
return new ProlificDevice(device, vendorID, productID, description);
|
return new(std::nothrow) ProlificDevice(device, vendorID, productID, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
case VENDOR_FTDI:
|
case VENDOR_FTDI:
|
||||||
@@ -650,7 +652,7 @@ SerialDevice::MakeDevice(usb_device device, uint16 vendorID,
|
|||||||
if (!description)
|
if (!description)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
return new FTDIDevice(device, vendorID, productID, description);
|
return new(std::nothrow) FTDIDevice(device, vendorID, productID, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
case VENDOR_PALM:
|
case VENDOR_PALM:
|
||||||
@@ -664,9 +666,9 @@ SerialDevice::MakeDevice(usb_device device, uint16 vendorID,
|
|||||||
if (!description)
|
if (!description)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
return new KLSIDevice(device, vendorID, productID, description);
|
return new(std::nothrow) KLSIDevice(device, vendorID, productID, description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new ACMDevice(device, vendorID, productID, "CDC ACM compatible device");
|
return new(std::nothrow) ACMDevice(device, vendorID, productID, "CDC ACM compatible device");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ create_log_file()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
usb_serial_trace(bool force, char *format, ...)
|
usb_serial_trace(bool force, const char *format, ...)
|
||||||
{
|
{
|
||||||
if (!gLogEnabled && !force)
|
if (!gLogEnabled && !force)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
void load_settings();
|
void load_settings();
|
||||||
void create_log_file();
|
void create_log_file();
|
||||||
void usb_serial_trace(bool force, char *format, ...);
|
void usb_serial_trace(bool force, const char *format, ...);
|
||||||
|
|
||||||
#define TRACE_ALWAYS(x...) usb_serial_trace(true, x);
|
#define TRACE_ALWAYS(x...) usb_serial_trace(true, x);
|
||||||
#define TRACE(x...) usb_serial_trace(false, x);
|
#define TRACE(x...) usb_serial_trace(false, x);
|
||||||
|
|||||||
Reference in New Issue
Block a user