From b77aa0155d4296ca41fc23d5216a326a97edd0f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 9 Dec 2010 00:40:25 +0000 Subject: [PATCH] Fix gcc4 build: - use new(std::nothrow) from 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 --- src/add-ons/kernel/drivers/ports/usb_serial/Driver.h | 9 --------- .../kernel/drivers/ports/usb_serial/SerialDevice.cpp | 10 ++++++---- .../kernel/drivers/ports/usb_serial/Tracing.cpp | 2 +- src/add-ons/kernel/drivers/ports/usb_serial/Tracing.h | 2 +- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/Driver.h b/src/add-ons/kernel/drivers/ports/usb_serial/Driver.h index 96fce4cc68..a241a25781 100644 --- a/src/add-ons/kernel/drivers/ports/usb_serial/Driver.h +++ b/src/add-ons/kernel/drivers/ports/usb_serial/Driver.h @@ -90,15 +90,6 @@ void uninit_driver(); bool usb_serial_service(struct tty *tty, uint32 op, void *buffer, 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(); device_hooks *find_device(const char *name); } diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp b/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp index 8fa547db87..5209f11dbe 100644 --- a/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp +++ b/src/add-ons/kernel/drivers/ports/usb_serial/SerialDevice.cpp @@ -5,6 +5,8 @@ * Copyright (c) 2003 by Siarzhuk Zharski * Distributed under the terms of the MIT License. */ +#include + #include "SerialDevice.h" #include "USB3.h" @@ -637,7 +639,7 @@ SerialDevice::MakeDevice(usb_device device, uint16 vendorID, if (!description) break; - return new ProlificDevice(device, vendorID, productID, description); + return new(std::nothrow) ProlificDevice(device, vendorID, productID, description); } case VENDOR_FTDI: @@ -650,7 +652,7 @@ SerialDevice::MakeDevice(usb_device device, uint16 vendorID, if (!description) break; - return new FTDIDevice(device, vendorID, productID, description); + return new(std::nothrow) FTDIDevice(device, vendorID, productID, description); } case VENDOR_PALM: @@ -664,9 +666,9 @@ SerialDevice::MakeDevice(usb_device device, uint16 vendorID, if (!description) 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"); } diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.cpp b/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.cpp index 78a406e908..95d1823857 100644 --- a/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.cpp +++ b/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.cpp @@ -70,7 +70,7 @@ create_log_file() void -usb_serial_trace(bool force, char *format, ...) +usb_serial_trace(bool force, const char *format, ...) { if (!gLogEnabled && !force) return; diff --git a/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.h b/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.h index 6b90a7e8e2..6b00eec217 100644 --- a/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.h +++ b/src/add-ons/kernel/drivers/ports/usb_serial/Tracing.h @@ -10,7 +10,7 @@ void load_settings(); 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(x...) usb_serial_trace(false, x);