From 0ded9c126e9b48b5ed217e60d392cfb882cbc351 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Wed, 27 Feb 2013 22:58:49 +0000 Subject: Misc: Simplify includes and misc. cleanup * fxload sample provenance * No need for in samples as already in libusb.h * Don't bother about sscanf_s in xusb * Use HAVE_### and rely on config.h where possible * Formal inclusion of in libusb.h for WinCE and WDK * Cleanup of Windows' config.h * Avoid ENAMETOOLONG and ENOTEMPTY conflict between errno.h and winsock.h for WinCE * Additional newlines & braces cleanup --- examples/fxload.c | 2 +- examples/listdevs.c | 3 --- examples/xusb.c | 7 +------ 3 files changed, 2 insertions(+), 10 deletions(-) (limited to 'examples') diff --git a/examples/fxload.c b/examples/fxload.c index 93f9fb9..42e0ca4 100644 --- a/examples/fxload.c +++ b/examples/fxload.c @@ -49,7 +49,7 @@ static bool dosyslog = false; #endif #ifndef FXLOAD_VERSION -#define FXLOAD_VERSION (__DATE__ " (development)") +#define FXLOAD_VERSION (__DATE__ " (libusbx)") #endif #ifndef ARRAYSIZE diff --git a/examples/listdevs.c b/examples/listdevs.c index 8538bfa..e3d7ef0 100644 --- a/examples/listdevs.c +++ b/examples/listdevs.c @@ -18,9 +18,6 @@ */ #include -#if !defined(_WIN32_WCE) -#include -#endif #include "libusb.h" diff --git a/examples/xusb.c b/examples/xusb.c index 707b58f..1aa3363 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -33,10 +33,6 @@ #define msleep(msecs) usleep(1000*msecs) #endif -#if !defined(_MSC_VER) || _MSC_VER<=1200 || defined(_WIN32_WCE) -#define sscanf_s sscanf -#endif - #if !defined(bool) #define bool int #endif @@ -47,7 +43,6 @@ #define false (!true) #endif - // Future versions of libusbx will use usb_interface instead of interface // in libusb_config_descriptor => catter for that #define usb_interface interface @@ -992,7 +987,7 @@ int main(int argc, char** argv) break; } if (i != arglen) { - if (sscanf_s(argv[j], "%x:%x" , &tmp_vid, &tmp_pid) != 2) { + if (sscanf(argv[j], "%x:%x" , &tmp_vid, &tmp_pid) != 2) { printf(" Please specify VID & PID as \"vid:pid\" in hexadecimal format\n"); return 1; } -- cgit v1.2.3