summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2020-01-21 10:20:53 +0000
committerRichard Hughes <richard@hughsie.com>2020-01-21 10:33:11 +0000
commit31ffa6fc9d35dae220e5b2a17cab146b78e2c4fe (patch)
tree4269a1bde61dc8f1b4bac06cf22c207d53a6bb65
parenta281690f5b56faa29fe34fbce6f06813727ed503 (diff)
downloadgusb-31ffa6fc9d35dae220e5b2a17cab146b78e2c4fe.tar.gz
trivial: Use spaces and tabs consistently
-rw-r--r--gusb/gusb-context.c158
-rw-r--r--gusb/gusb-device-list.c36
-rw-r--r--gusb/gusb-device-private.h2
-rw-r--r--gusb/gusb-device.c312
-rw-r--r--gusb/gusb-device.h4
-rw-r--r--gusb/gusb-self-test.c8
-rw-r--r--gusb/gusb-source.c6
7 files changed, 263 insertions, 263 deletions
diff --git a/gusb/gusb-context.c b/gusb/gusb-context.c
index afa821b..d811650 100644
--- a/gusb/gusb-context.c
+++ b/gusb/gusb-context.c
@@ -68,9 +68,9 @@ static GParamSpec *pspecs[N_PROPERTIES] = { NULL, };
static void g_usb_context_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GUsbContext, g_usb_context, G_TYPE_OBJECT,
- G_ADD_PRIVATE (GUsbContext)
- G_IMPLEMENT_INTERFACE(G_TYPE_INITABLE,
- g_usb_context_initable_iface_init))
+ G_ADD_PRIVATE (GUsbContext)
+ G_IMPLEMENT_INTERFACE(G_TYPE_INITABLE,
+ g_usb_context_initable_iface_init))
static void
g_usb_context_replug_helper_free (GUsbContextReplugHelper *replug_helper)
@@ -119,9 +119,9 @@ g_usb_context_dispose (GObject *object)
static void
g_usb_context_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GUsbContext *context = G_USB_CONTEXT (object);
GUsbContextPrivate *priv = context->priv;
@@ -141,9 +141,9 @@ g_usb_context_get_property (GObject *object,
static void
g_usb_context_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GUsbContext *context = G_USB_CONTEXT (object);
GUsbContextPrivate *priv = context->priv;
@@ -177,15 +177,15 @@ g_usb_context_class_init (GUsbContextClass *klass)
*/
pspecs[PROP_LIBUSB_CONTEXT] =
g_param_spec_pointer ("libusb_context", NULL, NULL,
- G_PARAM_READABLE);
+ G_PARAM_READABLE);
/**
* GUsbContext:debug_level:
*/
pspecs[PROP_DEBUG_LEVEL] =
g_param_spec_int ("debug_level", NULL, NULL,
- 0, 3, 0,
- G_PARAM_READWRITE);
+ 0, 3, 0,
+ G_PARAM_READWRITE);
g_object_class_install_properties (object_class, N_PROPERTIES, pspecs);
@@ -251,7 +251,7 @@ g_usb_context_idle_signal_cb (gpointer user_data)
static void
g_usb_context_emit_device_add (GUsbContext *context,
- GUsbDevice *device)
+ GUsbDevice *device)
{
GUsbContextIdleHelper *helper;
helper = g_new0 (GUsbContextIdleHelper, 1);
@@ -267,7 +267,7 @@ g_usb_context_emit_device_add (GUsbContext *context,
static void
g_usb_context_emit_device_remove (GUsbContext *context,
- GUsbDevice *device)
+ GUsbDevice *device)
{
GUsbContextIdleHelper *helper;
helper = g_new0 (GUsbContextIdleHelper, 1);
@@ -282,8 +282,8 @@ g_usb_context_emit_device_remove (GUsbContext *context,
}
static void
-g_usb_context_add_device (GUsbContext *context,
- struct libusb_device *dev)
+g_usb_context_add_device (GUsbContext *context,
+ struct libusb_device *dev)
{
GUsbDevice *device = NULL;
GUsbContextPrivate *priv = context->priv;
@@ -308,7 +308,7 @@ g_usb_context_add_device (GUsbContext *context,
device = _g_usb_device_new (context, dev, &error);
if (device == NULL) {
g_debug ("There was a problem creating the device: %s",
- error->message);
+ error->message);
g_error_free (error);
goto out;
}
@@ -344,8 +344,8 @@ out:
}
static void
-g_usb_context_remove_device (GUsbContext *context,
- struct libusb_device *dev)
+g_usb_context_remove_device (GUsbContext *context,
+ struct libusb_device *dev)
{
GUsbDevice *device = NULL;
GUsbContextPrivate *priv = context->priv;
@@ -382,9 +382,9 @@ out:
static int
g_usb_context_hotplug_cb (struct libusb_context *ctx,
- struct libusb_device *dev,
- libusb_hotplug_event event,
- void *user_data)
+ struct libusb_device *dev,
+ libusb_hotplug_event event,
+ void *user_data)
{
GUsbContext *context = G_USB_CONTEXT (user_data);
@@ -483,7 +483,7 @@ g_usb_context_get_main_context (GUsbContext *context)
**/
void
g_usb_context_set_main_context (GUsbContext *context,
- GMainContext *main_ctx)
+ GMainContext *main_ctx)
{
GUsbContextPrivate *priv = context->priv;
@@ -588,8 +588,8 @@ g_usb_context_init (GUsbContext *context)
static gboolean
g_usb_context_initable_init (GInitable *initable,
- GCancellable *cancellable,
- GError **error)
+ GCancellable *cancellable,
+ GError **error)
{
GUsbContext *context = G_USB_CONTEXT (initable);
GUsbContextPrivate *priv;
@@ -601,10 +601,10 @@ g_usb_context_initable_init (GInitable *initable,
rc = libusb_init (&ctx);
if (rc < 0) {
g_set_error (error,
- G_USB_CONTEXT_ERROR,
- G_USB_CONTEXT_ERROR_INTERNAL,
- "failed to init libusb: %s [%i]",
- g_usb_strerror (rc), rc);
+ G_USB_CONTEXT_ERROR,
+ G_USB_CONTEXT_ERROR_INTERNAL,
+ "failed to init libusb: %s [%i]",
+ g_usb_strerror (rc), rc);
return FALSE;
}
@@ -612,24 +612,24 @@ g_usb_context_initable_init (GInitable *initable,
priv->ctx = ctx;
priv->thread_event_run = 1;
priv->thread_event = g_thread_new ("GUsbEventThread",
- g_usb_context_event_thread_cb,
- context);
+ g_usb_context_event_thread_cb,
+ context);
/* watch for add/remove */
if (libusb_has_capability (LIBUSB_CAP_HAS_HOTPLUG)) {
rc = libusb_hotplug_register_callback (priv->ctx,
- LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED |
- LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT,
- 0,
- LIBUSB_HOTPLUG_MATCH_ANY,
- LIBUSB_HOTPLUG_MATCH_ANY,
- LIBUSB_HOTPLUG_MATCH_ANY,
- g_usb_context_hotplug_cb,
- context,
- &context->priv->hotplug_id);
+ LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED |
+ LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT,
+ 0,
+ LIBUSB_HOTPLUG_MATCH_ANY,
+ LIBUSB_HOTPLUG_MATCH_ANY,
+ LIBUSB_HOTPLUG_MATCH_ANY,
+ g_usb_context_hotplug_cb,
+ context,
+ &context->priv->hotplug_id);
if (rc != LIBUSB_SUCCESS) {
g_warning ("Error creating a hotplug callback: %s",
- g_usb_strerror (rc));
+ g_usb_strerror (rc));
}
}
@@ -671,7 +671,7 @@ _g_usb_context_get_context (GUsbContext *context)
**/
GUsbSource *
g_usb_context_get_source (GUsbContext *context,
- GMainContext *main_ctx)
+ GMainContext *main_ctx)
{
return NULL;
}
@@ -690,7 +690,7 @@ g_usb_context_get_source (GUsbContext *context,
**/
void
g_usb_context_set_debug (GUsbContext *context,
- GLogLevelFlags flags)
+ GLogLevelFlags flags)
{
GUsbContextPrivate *priv;
int debug_level;
@@ -735,9 +735,9 @@ g_usb_context_set_debug (GUsbContext *context,
**/
GUsbDevice *
g_usb_context_find_by_bus_address (GUsbContext *context,
- guint8 bus,
- guint8 address,
- GError **error)
+ guint8 bus,
+ guint8 address,
+ GError **error)
{
GUsbContextPrivate *priv;
GUsbDevice *device = NULL;
@@ -760,10 +760,10 @@ g_usb_context_find_by_bus_address (GUsbContext *context,
if (device == NULL) {
g_set_error (error,
- G_USB_DEVICE_ERROR,
- G_USB_DEVICE_ERROR_NO_DEVICE,
- "Failed to find device %04x:%04x",
- bus, address);
+ G_USB_DEVICE_ERROR,
+ G_USB_DEVICE_ERROR_NO_DEVICE,
+ "Failed to find device %04x:%04x",
+ bus, address);
}
return device;
@@ -783,8 +783,8 @@ g_usb_context_find_by_bus_address (GUsbContext *context,
**/
GUsbDevice *
g_usb_context_find_by_platform_id (GUsbContext *context,
- const gchar *platform_id,
- GError **error)
+ const gchar *platform_id,
+ GError **error)
{
GUsbContextPrivate *priv;
GUsbDevice *device = NULL;
@@ -806,10 +806,10 @@ g_usb_context_find_by_platform_id (GUsbContext *context,
if (device == NULL) {
g_set_error (error,
- G_USB_DEVICE_ERROR,
- G_USB_DEVICE_ERROR_NO_DEVICE,
- "Failed to find device %s",
- platform_id);
+ G_USB_DEVICE_ERROR,
+ G_USB_DEVICE_ERROR_NO_DEVICE,
+ "Failed to find device %s",
+ platform_id);
}
return device;
@@ -830,9 +830,9 @@ g_usb_context_find_by_platform_id (GUsbContext *context,
**/
GUsbDevice *
g_usb_context_find_by_vid_pid (GUsbContext *context,
- guint16 vid,
- guint16 pid,
- GError **error)
+ guint16 vid,
+ guint16 pid,
+ GError **error)
{
GUsbContextPrivate *priv;
GUsbDevice *device = NULL;
@@ -855,17 +855,17 @@ g_usb_context_find_by_vid_pid (GUsbContext *context,
if (device == NULL) {
g_set_error (error,
- G_USB_DEVICE_ERROR,
- G_USB_DEVICE_ERROR_NO_DEVICE,
- "Failed to find device %04x:%04x",
- vid, pid);
+ G_USB_DEVICE_ERROR,
+ G_USB_DEVICE_ERROR_NO_DEVICE,
+ "Failed to find device %04x:%04x",
+ vid, pid);
}
return device;
}
static gboolean
g_usb_context_load_usb_ids (GUsbContext *context,
- GError **error)
+ GError **error)
{
guint16 pid;
guint16 vid = 0x0000;
@@ -899,8 +899,8 @@ g_usb_context_load_usb_ids (GUsbContext *context,
break;
g_hash_table_insert (context->priv->dict_usb_ids,
- g_strdup (lines[i]),
- g_strdup (lines[i] + 6));
+ g_strdup (lines[i]),
+ g_strdup (lines[i] + 6));
} else {
if (vid == 0x0000)
break;
@@ -908,8 +908,8 @@ g_usb_context_load_usb_ids (GUsbContext *context,
lines[i][5] = '\0';
pid = g_ascii_strtoull (lines[i] + 1, NULL, 16);
g_hash_table_insert (context->priv->dict_usb_ids,
- g_strdup_printf ("%04x:%04x", vid, pid),
- g_strdup (lines[i] + 7));
+ g_strdup_printf ("%04x:%04x", vid, pid),
+ g_strdup (lines[i] + 7));
}
}
@@ -932,8 +932,8 @@ g_usb_context_load_usb_ids (GUsbContext *context,
**/
const gchar *
_g_usb_context_lookup_vendor (GUsbContext *context,
- guint16 vid,
- GError **error)
+ guint16 vid,
+ GError **error)
{
const gchar *tmp;
gchar *key = NULL;
@@ -950,9 +950,9 @@ _g_usb_context_lookup_vendor (GUsbContext *context,
tmp = g_hash_table_lookup (context->priv->dict_usb_ids, key);
if (tmp == NULL) {
g_set_error (error,
- G_USB_CONTEXT_ERROR,
- G_USB_CONTEXT_ERROR_INTERNAL,
- "failed to find vid %s", key);
+ G_USB_CONTEXT_ERROR,
+ G_USB_CONTEXT_ERROR_INTERNAL,
+ "failed to find vid %s", key);
g_free (key);
return NULL;
}
@@ -977,9 +977,9 @@ _g_usb_context_lookup_vendor (GUsbContext *context,
**/
const gchar *
_g_usb_context_lookup_product (GUsbContext *context,
- guint16 vid,
- guint16 pid,
- GError **error)
+ guint16 vid,
+ guint16 pid,
+ GError **error)
{
const gchar *tmp;
gchar *key = NULL;
@@ -996,9 +996,9 @@ _g_usb_context_lookup_product (GUsbContext *context,
tmp = g_hash_table_lookup (context->priv->dict_usb_ids, key);
if (tmp == NULL) {
g_set_error (error,
- G_USB_CONTEXT_ERROR,
- G_USB_CONTEXT_ERROR_INTERNAL,
- "failed to find vid %s", key);
+ G_USB_CONTEXT_ERROR,
+ G_USB_CONTEXT_ERROR_INTERNAL,
+ "failed to find vid %s", key);
g_free (key);
return NULL;
}
diff --git a/gusb/gusb-device-list.c b/gusb/gusb-device-list.c
index fa222b6..2005982 100644
--- a/gusb/gusb-device-list.c
+++ b/gusb/gusb-device-list.c
@@ -47,9 +47,9 @@ G_DEFINE_TYPE_WITH_PRIVATE (GUsbDeviceList, g_usb_device_list, G_TYPE_OBJECT);
static void
g_usb_device_list_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GUsbDeviceList *list = G_USB_DEVICE_LIST (object);
GUsbDeviceListPrivate *priv = list->priv;
@@ -66,25 +66,25 @@ g_usb_device_list_get_property (GObject *object,
static void
g_usb_device_added_cb (GUsbContext *context,
- GUsbDevice *device,
- GUsbDeviceList *list)
+ GUsbDevice *device,
+ GUsbDeviceList *list)
{
g_signal_emit (list, signals[DEVICE_ADDED_SIGNAL], 0, device);
}
static void
g_usb_device_removed_cb (GUsbContext *context,
- GUsbDevice *device,
- GUsbDeviceList *list)
+ GUsbDevice *device,
+ GUsbDeviceList *list)
{
g_signal_emit (list, signals[DEVICE_REMOVED_SIGNAL], 0, device);
}
static void
g_usb_device_list_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GUsbDeviceList *list = G_USB_DEVICE_LIST (object);
GUsbDeviceListPrivate *priv = list->priv;
@@ -209,15 +209,15 @@ g_usb_device_list_coldplug (GUsbDeviceList *list)
**/
GUsbDevice *
g_usb_device_list_find_by_bus_address (GUsbDeviceList *list,
- guint8 bus,
- guint8 address,
- GError **error)
+ guint8 bus,
+ guint8 address,
+ GError **error)
{
g_return_val_if_fail (G_USB_IS_DEVICE_LIST (list), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
return g_usb_context_find_by_bus_address (list->priv->context,
- bus, address, error);
+ bus, address, error);
}
/**
@@ -235,15 +235,15 @@ g_usb_device_list_find_by_bus_address (GUsbDeviceList *list,
**/
GUsbDevice *
g_usb_device_list_find_by_vid_pid (GUsbDeviceList *list,
- guint16 vid,
- guint16 pid,
- GError **error)
+ guint16 vid,
+ guint16 pid,
+ GError **error)
{
g_return_val_if_fail (G_USB_IS_DEVICE_LIST (list), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
return g_usb_context_find_by_vid_pid (list->priv->context,
- vid, pid, error);
+ vid, pid, error);
}
/**
diff --git a/gusb/gusb-device-private.h b/gusb/gusb-device-private.h
index 0e05a54..5a313db 100644
--- a/gusb/gusb-device-private.h
+++ b/gusb/gusb-device-private.h
@@ -13,7 +13,7 @@ G_BEGIN_DECLS
GUsbDevice *_g_usb_device_new (GUsbContext *context,
libusb_device *device,
- GError **error);
+ GError **error);
libusb_device *_g_usb_device_get_device (GUsbDevice *device);
gboolean _g_usb_device_open_internal (GUsbDevice *device,
diff --git a/gusb/gusb-device.c b/gusb/gusb-device.c
index 2e62e97..3796156 100644
--- a/gusb/gusb-device.c
+++ b/gusb/gusb-device.c
@@ -54,9 +54,9 @@ static GParamSpec *pspecs[N_PROPERTIES] = { NULL, };
static void g_usb_device_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GUsbDevice, g_usb_device, G_TYPE_OBJECT,
- G_ADD_PRIVATE (GUsbDevice)
- G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
- g_usb_device_initable_iface_init))
+ G_ADD_PRIVATE (GUsbDevice)
+ G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
+ g_usb_device_initable_iface_init))
/**
* g_usb_device_error_quark:
@@ -92,9 +92,9 @@ g_usb_device_dispose (GObject *object)
static void
g_usb_device_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GUsbDevice *device = G_USB_DEVICE (object);
GUsbDevicePrivate *priv = device->priv;
@@ -111,9 +111,9 @@ g_usb_device_get_property (GObject *object,
static void
g_usb_device_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GUsbDevice *device = G_USB_DEVICE (object);
GUsbDevicePrivate *priv = device->priv;
@@ -172,26 +172,26 @@ g_usb_device_class_init (GUsbDeviceClass *klass)
*/
pspecs[PROP_LIBUSB_DEVICE] =
g_param_spec_pointer ("libusb-device", NULL, NULL,
- G_PARAM_CONSTRUCT_ONLY|
- G_PARAM_READWRITE);
+ G_PARAM_CONSTRUCT_ONLY|
+ G_PARAM_READWRITE);
/**
* GUsbDevice:context:
*/
pspecs[PROP_CONTEXT] =
g_param_spec_object ("context", NULL, NULL,
- G_USB_TYPE_CONTEXT,
- G_PARAM_CONSTRUCT_ONLY|
- G_PARAM_WRITABLE);
+ G_USB_TYPE_CONTEXT,
+ G_PARAM_CONSTRUCT_ONLY|
+ G_PARAM_WRITABLE);
/**
* GUsbDevice:platform-id:
*/
pspecs[PROP_PLATFORM_ID] =
g_param_spec_string ("platform-id", NULL, NULL,
- NULL,
- G_PARAM_CONSTRUCT_ONLY|
- G_PARAM_WRITABLE);
+ NULL,
+ G_PARAM_CONSTRUCT_ONLY|
+ G_PARAM_WRITABLE);
g_object_class_install_properties (object_class, N_PROPERTIES, pspecs);
}
@@ -231,8 +231,8 @@ g_usb_device_build_platform_id (struct libusb_device *dev)
static gboolean
g_usb_device_initable_init (GInitable *initable,
- GCancellable *cancellable,
- GError **error)
+ GCancellable *cancellable,
+ GError **error)
{
GUsbDevice *device = G_USB_DEVICE (initable);
GUsbDevicePrivate *priv;
@@ -242,7 +242,7 @@ g_usb_device_initable_init (GInitable *initable,
if (!priv->device) {
g_set_error_literal (error, G_USB_DEVICE_ERROR, G_USB_DEVICE_ERROR_INTERNAL,
- "Constructed without a libusb_device");
+ "Constructed without a libusb_device");
return FALSE;
}
@@ -251,8 +251,8 @@ g_usb_device_initable_init (GInitable *initable,
rc = libusb_get_device_descriptor (priv->device, &priv->desc);
if (rc != LIBUSB_SUCCESS) {
g_set_error (error, G_USB_DEVICE_ERROR, G_USB_DEVICE_ERROR_INTERNAL,
- "Failed to get USB descriptor for device: %s",
- g_usb_strerror (rc));
+ "Failed to get USB descriptor for device: %s",
+ g_usb_strerror (rc));
return FALSE;
}
@@ -277,14 +277,14 @@ g_usb_device_initable_iface_init (GInitableIface *iface)
**/
GUsbDevice *
_g_usb_device_new (GUsbContext *context,
- libusb_device *device,
- GError **error)
+ libusb_device *device,
+ GError **error)
{
return g_initable_new (G_USB_TYPE_DEVICE,
- NULL, error,
- "context", context,
- "libusb-device", device,
- NULL);
+ NULL, error,
+ "context", context,
+ "libusb-device", device,
+ NULL);
}
/**
@@ -303,8 +303,8 @@ _g_usb_device_get_device (GUsbDevice *device)
static gboolean
g_usb_device_libusb_error_to_gerror (GUsbDevice *device,
- gint rc,
- GError **error)
+ gint rc,
+ GError **error)
{
gint error_code = G_USB_DEVICE_ERROR_INTERNAL;
/* Put the rc in libusb's error enum so that gcc warns us if we're
@@ -354,7 +354,7 @@ g_usb_device_libusb_error_to_gerror (GUsbDevice *device,
static gboolean
g_usb_device_not_open_error (GUsbDevice *device,
- GError **error)
+ GError **error)
{
g_set_error (error,
G_USB_DEVICE_ERROR,
@@ -366,17 +366,17 @@ g_usb_device_not_open_error (GUsbDevice *device,
}
static void
-g_usb_device_async_not_open_error (GUsbDevice *device,
- GAsyncReadyCallback callback,
- gpointer user_data,
- gpointer source_tag)
+g_usb_device_async_not_open_error (GUsbDevice *device,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ gpointer source_tag)
{
g_task_report_new_error (device, callback, user_data, source_tag,
- G_USB_DEVICE_ERROR,
- G_USB_DEVICE_ERROR_NOT_OPEN,
- "Device %04x:%04x has not been opened",
- g_usb_device_get_vid (device),
- g_usb_device_get_pid (device));
+ G_USB_DEVICE_ERROR,
+ G_USB_DEVICE_ERROR_NOT_OPEN,
+ "Device %04x:%04x has not been opened",
+ g_usb_device_get_vid (device),
+ g_usb_device_get_pid (device));
}
gboolean
@@ -602,7 +602,7 @@ g_usb_device_get_interfaces (GUsbDevice *device, GError **error)
**/
gboolean
g_usb_device_close (GUsbDevice *device,
- GError **error)
+ GError **error)
{
g_return_val_if_fail (G_USB_IS_DEVICE (device), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
@@ -636,7 +636,7 @@ g_usb_device_close (GUsbDevice *device,
**/
gboolean
g_usb_device_reset (GUsbDevice *device,
- GError **error)
+ GError **error)
{
gint rc;
g_return_val_if_fail (G_USB_IS_DEVICE (device), FALSE);
@@ -666,7 +666,7 @@ g_usb_device_reset (GUsbDevice *device,
**/
gint
g_usb_device_get_configuration (GUsbDevice *device,
- GError **error)
+ GError **error)
{
gint rc;
int config;
@@ -704,8 +704,8 @@ g_usb_device_get_configuration (GUsbDevice *device,
**/
gboolean
g_usb_device_set_configuration (GUsbDevice *device,
- gint configuration,
- GError **error)
+ gint configuration,
+ GError **error)
{
gint rc;
gint config_tmp = 0;
@@ -746,10 +746,10 @@ g_usb_device_set_configuration (GUsbDevice *device,
* Since: 0.1.0
**/
gboolean
-g_usb_device_claim_interface (GUsbDevice *device,
- gint interface,
- GUsbDeviceClaimInterfaceFlags flags,
- GError **error)
+g_usb_device_claim_interface (GUsbDevice *device,
+ gint interface,
+ GUsbDeviceClaimInterfaceFlags flags,
+ GError **error)
{
gint rc;
@@ -788,10 +788,10 @@ g_usb_device_claim_interface (GUsbDevice *device,
* Since: 0.1.0
**/
gboolean
-g_usb_device_release_interface (GUsbDevice *device,
- gint interface,
- GUsbDeviceClaimInterfaceFlags flags,
- GError **error)
+g_usb_device_release_interface (GUsbDevice *device,
+ gint interface,
+ GUsbDeviceClaimInterfaceFlags flags,
+ GError **error)
{
gint rc;
@@ -834,7 +834,7 @@ g_usb_device_release_interface (GUsbDevice *device,
**/
gboolean
g_usb_device_set_interface_alt (GUsbDevice *device, gint interface,
- guint8 alt, GError **error)
+ guint8 alt, GError **error)
{
gint rc;
@@ -865,8 +865,8 @@ g_usb_device_set_interface_alt (GUsbDevice *device, gint interface,
**/
gchar *
g_usb_device_get_string_descriptor (GUsbDevice *device,
- guint8 desc_index,
- GError **error)
+ guint8 desc_index,
+ GError **error)
{
gint rc;
/* libusb_get_string_descriptor_ascii returns max 128 bytes */
@@ -902,8 +902,8 @@ typedef struct {
static void
g_usb_device_sync_transfer_cb (GUsbDevice *device,
- GAsyncResult *res,
- GUsbSyncHelper *helper)
+ GAsyncResult *res,
+ GUsbSyncHelper *helper)
{
helper->ret = (*helper->finish_func) (device, res, helper->error);
g_main_loop_quit (helper->loop);
@@ -935,19 +935,19 @@ g_usb_device_sync_transfer_cb (GUsbDevice *device,
* Since: 0.1.0
**/
gboolean
-g_usb_device_control_transfer (GUsbDevice *device,
- GUsbDeviceDirection direction,
- GUsbDeviceRequestType request_type,
- GUsbDeviceRecipient recipient,
- guint8 request,
- guint16 value,
- guint16 idx,
- guint8 *data,
- gsize length,
- gsize *actual_length,
- guint timeout,
- GCancellable *cancellable,
- GError **error)
+g_usb_device_control_transfer (GUsbDevice *device,
+ GUsbDeviceDirection direction,
+ GUsbDeviceRequestType request_type,
+ GUsbDeviceRecipient recipient,
+ guint8 request,
+ guint16 value,
+ guint16 idx,
+ guint8 *data,
+ gsize length,
+ gsize *actual_length,
+ guint timeout,
+ GCancellable *cancellable,
+ GError **error)
{
GUsbSyncHelper helper;
@@ -1003,13 +1003,13 @@ g_usb_device_control_transfer (GUsbDevice *device,
**/
gboolean
g_usb_device_bulk_transfer (GUsbDevice *device,
- guint8 endpoint,
- guint8 *data,
- gsize length,
- gsize *actual_length,
- guint timeout,
- GCancellable *cancellable,
- GError **error)
+ guint8 endpoint,
+ guint8 *data,
+ gsize length,
+ gsize *actual_length,
+ guint timeout,
+ GCancellable *cancellable,
+ GError **error)
{
GUsbSyncHelper helper;
@@ -1060,13 +1060,13 @@ g_usb_device_bulk_transfer (GUsbDevice *device,
**/
gboolean
g_usb_device_interrupt_transfer (GUsbDevice *device,
- guint8 endpoint,
- guint8 *data,
- gsize length,
- gsize *actual_length,
- guint timeout,
- GCancellable *cancellable,
- GError **error)
+ guint8 endpoint,
+ guint8 *data,
+ gsize length,
+ gsize *actual_length,
+ guint timeout,
+ GCancellable *cancellable,
+ GError **error)
{
GUsbSyncHelper helper;
@@ -1117,7 +1117,7 @@ g_usb_device_req_free (GcmDeviceReq *req)
static gboolean
g_usb_device_libusb_status_to_gerror (gint status,
- GError **error)
+ GError **error)
{
gboolean ret = FALSE;
@@ -1190,7 +1190,7 @@ g_usb_device_async_transfer_cb (struct libusb_transfer *transfer)
static void
g_usb_device_cancelled_cb (GCancellable *cancellable,
- GcmDeviceReq *req)
+ GcmDeviceReq *req)
{
libusb_cancel_transfer (req->transfer);
}
@@ -1210,8 +1210,8 @@ g_usb_device_control_transfer_cb (struct libusb_transfer *transfer)
g_task_return_error (task, error);
} else {
memmove (req->data,
- transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE,
- (gsize) transfer->actual_length);
+ transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE,
+ (gsize) transfer->actual_length);
g_task_return_int (task, transfer->actual_length);
}
@@ -1236,19 +1236,19 @@ g_usb_device_control_transfer_cb (struct libusb_transfer *transfer)
* Since: 0.1.0
**/
void
-g_usb_device_control_transfer_async (GUsbDevice *device,
- GUsbDeviceDirection direction,
- GUsbDeviceRequestType request_type,
- GUsbDeviceRecipient recipient,
- guint8 request,
- guint16 value,
- guint16 idx,
- guint8 *data,
- gsize length,
- guint timeout,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_usb_device_control_transfer_async (GUsbDevice *device,
+ GUsbDeviceDirection direction,
+ GUsbDeviceRequestType request_type,
+ GUsbDeviceRecipient recipient,
+ guint8 request,
+ guint16 value,
+ guint16 idx,
+ guint8 *data,
+ gsize length,
+ guint timeout,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GTask *task;
GcmDeviceReq *req;
@@ -1260,7 +1260,7 @@ g_usb_device_control_transfer_async (GUsbDevice *device,
if (device->priv->handle == NULL) {
g_usb_device_async_not_open_error (device, callback, user_data,
- g_usb_device_control_transfer_async);
+ g_usb_device_control_transfer_async);
return;
}
@@ -1272,9 +1272,9 @@ g_usb_device_control_transfer_async (GUsbDevice *device,
if (cancellable != NULL) {
req->cancellable = g_object_ref (cancellable);
req->cancellable_id = g_cancellable_connect (req->cancellable,
- G_CALLBACK (g_usb_device_cancelled_cb),
- req,
- NULL);
+ G_CALLBACK (g_usb_device_cancelled_cb),
+ req,
+ NULL);
}
task = g_task_new (device, cancellable, callback, user_data);
@@ -1291,15 +1291,15 @@ g_usb_device_control_transfer_async (GUsbDevice *device,
/* fill in setup packet */
libusb_fill_control_setup (req->data_raw, request_type_raw,
- request, value, idx, length);
+ request, value, idx, length);
/* fill in transfer details */
libusb_fill_control_transfer (req->transfer,
- device->priv->handle,
- req->data_raw,
- g_usb_device_control_transfer_cb,
- task,
- timeout);
+ device->priv->handle,
+ req->data_raw,
+ g_usb_device_control_transfer_cb,
+ task,
+ timeout);
/* submit transfer */
rc = libusb_submit_transfer (req->transfer);
@@ -1324,8 +1324,8 @@ g_usb_device_control_transfer_async (GUsbDevice *device,
**/
gssize
g_usb_device_control_transfer_finish (GUsbDevice *device,
- GAsyncResult *res,
- GError **error)
+ GAsyncResult *res,
+ GError **error)
{
g_return_val_if_fail (G_USB_IS_DEVICE (device), -1);
g_return_val_if_fail (g_task_is_valid (res, device), -1);
@@ -1353,14 +1353,14 @@ g_usb_device_control_transfer_finish (GUsbDevice *device,
* Since: 0.1.0
**/
void
-g_usb_device_bulk_transfer_async (GUsbDevice *device,
- guint8 endpoint,
- guint8 *data,
- gsize length,
- guint timeout,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_usb_device_bulk_transfer_async (GUsbDevice *device,
+ guint8 endpoint,
+ guint8 *data,
+ gsize length,
+ guint timeout,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GTask *task;
GcmDeviceReq *req;
@@ -1371,7 +1371,7 @@ g_usb_device_bulk_transfer_async (GUsbDevice *device,
if (device->priv->handle == NULL) {
g_usb_device_async_not_open_error (device, callback, user_data,
- g_usb_device_bulk_transfer_async);
+ g_usb_device_bulk_transfer_async);
return;
}
@@ -1382,9 +1382,9 @@ g_usb_device_bulk_transfer_async (GUsbDevice *device,
if (cancellable != NULL) {
req->cancellable = g_object_ref (cancellable);
req->cancellable_id = g_cancellable_connect (req->cancellable,
- G_CALLBACK (g_usb_device_cancelled_cb),
- req,
- NULL);
+ G_CALLBACK (g_usb_device_cancelled_cb),
+ req,
+ NULL);
}
task = g_task_new (device, cancellable, callback, user_data);
@@ -1392,13 +1392,13 @@ g_usb_device_bulk_transfer_async (GUsbDevice *device,
/* fill in transfer details */
libusb_fill_bulk_transfer (req->transfer,
- device->priv->handle,
- endpoint,
- data,
- length,
- g_usb_device_async_transfer_cb,
- task,
- timeout);
+ device->priv->handle,
+ endpoint,
+ data,
+ length,
+ g_usb_device_async_transfer_cb,
+ task,
+ timeout);
/* submit transfer */
rc = libusb_submit_transfer (req->transfer);
@@ -1423,8 +1423,8 @@ g_usb_device_bulk_transfer_async (GUsbDevice *device,
**/
gssize
g_usb_device_bulk_transfer_finish (GUsbDevice *device,
- GAsyncResult *res,
- GError **error)
+ GAsyncResult *res,
+ GError **error)
{
g_return_val_if_fail (G_USB_IS_DEVICE (device), -1);
g_return_val_if_fail (g_task_is_valid (res, device), -1);
@@ -1452,14 +1452,14 @@ g_usb_device_bulk_transfer_finish (GUsbDevice *device,
* Since: 0.1.0
**/
void
-g_usb_device_interrupt_transfer_async (GUsbDevice *device,
- guint8 endpoint,
- guint8 *data,
- gsize length,
- guint timeout,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_usb_device_interrupt_transfer_async (GUsbDevice *device,
+ guint8 endpoint,
+ guint8 *data,
+ gsize length,
+ guint timeout,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GTask *task;
GcmDeviceReq *req;
@@ -1470,7 +1470,7 @@ g_usb_device_interrupt_transfer_async (GUsbDevice *device,
if (device->priv->handle == NULL) {
g_usb_device_async_not_open_error (device, callback, user_data,
- g_usb_device_interrupt_transfer_async);
+ g_usb_device_interrupt_transfer_async);
return;
}
@@ -1481,9 +1481,9 @@ g_usb_device_interrupt_transfer_async (GUsbDevice *device,
if (cancellable != NULL) {
req->cancellable = g_object_ref (cancellable);
req->cancellable_id = g_cancellable_connect (req->cancellable,
- G_CALLBACK (g_usb_device_cancelled_cb),
- req,
- NULL);
+ G_CALLBACK (g_usb_device_cancelled_cb),
+ req,
+ NULL);
}
task = g_task_new (device, cancellable, callback, user_data);
@@ -1491,13 +1491,13 @@ g_usb_device_interrupt_transfer_async (GUsbDevice *device,
/* fill in transfer details */
libusb_fill_interrupt_transfer (req->transfer,
- device->priv->handle,
- endpoint,
- data,
- length,
- g_usb_device_async_transfer_cb,
- task,
- timeout);
+ device->priv->handle,
+ endpoint,
+ data,
+ length,
+ g_usb_device_async_transfer_cb,
+ task,
+ timeout);
/* submit transfer */
rc = libusb_submit_transfer (req->transfer);
@@ -1522,8 +1522,8 @@ g_usb_device_interrupt_transfer_async (GUsbDevice *device,
**/
gssize
g_usb_device_interrupt_transfer_finish (GUsbDevice *device,
- GAsyncResult *res,
- GError **error)
+ GAsyncResult *res,
+ GError **error)
{
g_return_val_if_fail (G_USB_IS_DEVICE (device), -1);
g_return_val_if_fail (g_task_is_valid (res, device), -1);
diff --git a/gusb/gusb-device.h b/gusb/gusb-device.h
index 8f5a4f1..ba9dcea 100644
--- a/gusb/gusb-device.h
+++ b/gusb/gusb-device.h
@@ -152,8 +152,8 @@ guint16 g_usb_device_get_spec (GUsbDevice *device);
const gchar *g_usb_device_get_vid_as_str (GUsbDevice *device);
const gchar *g_usb_device_get_pid_as_str (GUsbDevice *device);
guint8 g_usb_device_get_device_class (GUsbDevice *device);
-guint8 g_usb_device_get_device_subclass (GUsbDevice *device);
-guint8 g_usb_device_get_device_protocol (GUsbDevice *device);
+guint8 g_usb_device_get_device_subclass (GUsbDevice *device);
+guint8 g_usb_device_get_device_protocol (GUsbDevice *device);
guint8 g_usb_device_get_manufacturer_index (GUsbDevice *device);
guint8 g_usb_device_get_product_index (GUsbDevice *device);
diff --git a/gusb/gusb-self-test.c b/gusb/gusb-self-test.c
index 4b0f6e9..924c66e 100644
--- a/gusb/gusb-self-test.c
+++ b/gusb/gusb-self-test.c
@@ -276,8 +276,8 @@ typedef struct {
static void
g_usb_device_print_data (const gchar *title,
- const guchar *data,
- gsize length)
+ const guchar *data,
+ gsize length)
{
guint i;
@@ -297,8 +297,8 @@ g_usb_device_print_data (const gchar *title,
static void
g_usb_test_button_pressed_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+ GAsyncResult *res,
+ gpointer user_data)
{
gboolean ret;
GError *error = NULL;
diff --git a/gusb/gusb-source.c b/gusb/gusb-source.c
index bc3571f..0ff603b 100644
--- a/gusb/gusb-source.c
+++ b/gusb/gusb-source.c
@@ -47,9 +47,9 @@ g_usb_source_error_quark (void)
**/
void
g_usb_source_set_callback (GUsbSource *source,
- GSourceFunc func,
- gpointer data,
- GDestroyNotify notify)
+ GSourceFunc func,
+ gpointer data,
+ GDestroyNotify notify)
{
g_source_set_callback ((GSource *)source, func, data, notify);
}