Fix warnings.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39244 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -10,10 +10,12 @@
|
|||||||
#include <USB.h>
|
#include <USB.h>
|
||||||
//#include <CAM.h>
|
//#include <CAM.h>
|
||||||
#include <stdio.h> //sprintf
|
#include <stdio.h> //sprintf
|
||||||
|
#include <string.h> //strcpy
|
||||||
#include <unistd.h> //posix file i/o - create, write, close
|
#include <unistd.h> //posix file i/o - create, write, close
|
||||||
#include <driver_settings.h>
|
#include <driver_settings.h>
|
||||||
|
|
||||||
#include "usbvision.h"
|
#include "usb_vision.h"
|
||||||
|
#include "tracing.h"
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
bool b_log = true;
|
bool b_log = true;
|
||||||
@@ -31,7 +33,7 @@ bool b_log_settings_loaded = false;
|
|||||||
static const char *private_log_path="/boot/home/"DRIVER_NAME".log";
|
static const char *private_log_path="/boot/home/"DRIVER_NAME".log";
|
||||||
static sem_id loglock;
|
static sem_id loglock;
|
||||||
|
|
||||||
void load_setting(){
|
void load_setting(void){
|
||||||
if(!b_log_settings_loaded){
|
if(!b_log_settings_loaded){
|
||||||
void *settingshandle;
|
void *settingshandle;
|
||||||
settingshandle = load_driver_settings(DRIVER_NAME);
|
settingshandle = load_driver_settings(DRIVER_NAME);
|
||||||
@@ -48,7 +50,7 @@ void load_setting(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_log(){
|
void create_log(void){
|
||||||
int flags = O_WRONLY | O_CREAT | ((!b_log_append) ? O_TRUNC : 0);
|
int flags = O_WRONLY | O_CREAT | ((!b_log_append) ? O_TRUNC : 0);
|
||||||
if(!b_log_file)
|
if(!b_log_file)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _USBVISION_TRACING_H_
|
#ifndef _USBVISION_TRACING_H_
|
||||||
#define _USBVISION_TRACING_H_
|
#define _USBVISION_TRACING_H_
|
||||||
|
|
||||||
void load_setting();
|
void load_setting(void);
|
||||||
void create_log();
|
void create_log(void);
|
||||||
void usbvision_trace(bool b_force, char *fmt, ...);
|
void usbvision_trace(bool b_force, char *fmt, ...);
|
||||||
|
|
||||||
#define TRACE_ALWAYS(x...) usbvision_trace(true, x);
|
#define TRACE_ALWAYS(x...) usbvision_trace(true, x);
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ static status_t usb_vision_write (void* cookie, off_t position, const void* buff
|
|||||||
static status_t xet_nt_register(bool is_read, usb_vision_device *uvd, xet_nt100x_reg *ri)
|
static status_t xet_nt_register(bool is_read, usb_vision_device *uvd, xet_nt100x_reg *ri)
|
||||||
{
|
{
|
||||||
status_t status = B_ERROR;
|
status_t status = B_ERROR;
|
||||||
uint8 req_type = USB_REQTYPE_VENDOR | (is_read ? USB_REQTYPE_DEVICE_IN : USB_REQTYPE_DEVICE_OUT);
|
//uint8 req_type = USB_REQTYPE_VENDOR | (is_read ? USB_REQTYPE_DEVICE_IN : USB_REQTYPE_DEVICE_OUT);
|
||||||
|
|
||||||
TRACE_FUNCALLS("set_nt_register:%08x, %08x\n", uvd, ri);
|
TRACE_FUNCALLS("set_nt_register:%08x, %08x\n", uvd, ri);
|
||||||
TRACE_FUNCRES(trace_reginfo, ri);
|
TRACE_FUNCRES(trace_reginfo, ri);
|
||||||
@@ -254,7 +254,7 @@ device_hooks* find_device(const char* name){
|
|||||||
return &usb_vision_hooks;
|
return &usb_vision_hooks;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t create_add_device(usb_vision_device *uvd, const struct usb_configuration_info *uci,
|
static status_t create_add_device(usb_vision_device *uvd, const struct usb_configuration_info *uci,
|
||||||
struct usb_endpoint_info *control_epi,
|
struct usb_endpoint_info *control_epi,
|
||||||
struct usb_endpoint_info *data_epi){
|
struct usb_endpoint_info *data_epi){
|
||||||
// char name[32];
|
// char name[32];
|
||||||
@@ -306,7 +306,7 @@ status_t create_add_device(usb_vision_device *uvd, const struct usb_configuratio
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t add_device(usb_vision_device *uvd, const usb_configuration_info *uci){
|
static status_t add_device(usb_vision_device *uvd, const usb_configuration_info *uci){
|
||||||
usb_endpoint_info *control_epi = NULL;
|
usb_endpoint_info *control_epi = NULL;
|
||||||
usb_endpoint_info *data_epi = NULL;
|
usb_endpoint_info *data_epi = NULL;
|
||||||
status_t status = ENODEV;
|
status_t status = ENODEV;
|
||||||
@@ -359,7 +359,7 @@ status_t usb_vision_device_added(const usb_device *dev, void **cookie){
|
|||||||
memset(uvd, 0, sizeof(usb_vision_device));
|
memset(uvd, 0, sizeof(usb_vision_device));
|
||||||
uvd->dev = dev;
|
uvd->dev = dev;
|
||||||
if((status = add_device(uvd, uci)) == B_OK){
|
if((status = add_device(uvd, uci)) == B_OK){
|
||||||
*cookie = dev;
|
*cookie = (void *)dev;
|
||||||
TRACE_ALWAYS("(%04x/%04x) added \n", supported_devices[dev_idx].vendor,
|
TRACE_ALWAYS("(%04x/%04x) added \n", supported_devices[dev_idx].vendor,
|
||||||
supported_devices[dev_idx].product);
|
supported_devices[dev_idx].product);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user