aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorPete Batard <pete@akeo.ie>2013-02-27 22:58:49 +0000
committerPete Batard <pete@akeo.ie>2013-02-27 22:58:49 +0000
commit0ded9c126e9b48b5ed217e60d392cfb882cbc351 (patch)
tree96dcffe37667b4a47845a0e4d8d9af1b6c0022e1 /examples
parentc56f89068452f6ff144cd72ad234540049c06433 (diff)
downloadandroid_external_libusbx-0ded9c126e9b48b5ed217e60d392cfb882cbc351.tar.gz
android_external_libusbx-0ded9c126e9b48b5ed217e60d392cfb882cbc351.tar.bz2
android_external_libusbx-0ded9c126e9b48b5ed217e60d392cfb882cbc351.zip
Misc: Simplify includes and misc. cleanup
* fxload sample provenance * No need for <sys/types.h> 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 <winsock.h> 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
Diffstat (limited to 'examples')
-rw-r--r--examples/fxload.c2
-rw-r--r--examples/listdevs.c3
-rw-r--r--examples/xusb.c7
3 files changed, 2 insertions, 10 deletions
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 <stdio.h>
-#if !defined(_WIN32_WCE)
-#include <sys/types.h>
-#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;
}