diff options
author | wm4 <wm4@nowhere> | 2014-04-13 18:00:51 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-04-13 18:03:01 +0200 |
commit | 78128bddda4bcea1f256fc13cc33fa2652ed277c (patch) | |
tree | 35bf6596cb8e2d7927618845833c3ee36534f890 /input | |
parent | 44f382cf98564c0fe08bdc78579c284362cd6f3c (diff) |
Kill all tabs
I hate tabs.
This replaces all tabs in all source files with spaces. The only
exception is old-makefile. The replacement was made by running the
GNU coreutils "expand" command on every file. Since the replacement was
automatic, it's possible that some formatting was destroyed (but perhaps
only if it was assuming that the end of a tab does not correspond to
aligning the end to multiples of 8 spaces).
Diffstat (limited to 'input')
-rw-r--r-- | input/joystick.c | 38 | ||||
-rw-r--r-- | input/lirc.c | 2 |
2 files changed, 20 insertions, 20 deletions
diff --git a/input/joystick.c b/input/joystick.c index e119fc37c8..c915d4bef6 100644 --- a/input/joystick.c +++ b/input/joystick.c @@ -79,22 +79,22 @@ int mp_input_joystick_init(struct input_ctx *ictx, struct mp_log *log, char *dev while((unsigned int)l < sizeof(struct js_event)) { int r = read(fd,((char*)&ev)+l,sizeof(struct js_event)-l); if(r < 0) { - if(errno == EINTR) - continue; - else if(errno == EAGAIN) { - initialized = 1; - break; - } - MP_ERR(ctx, "Error while reading joystick device: %s\n",strerror(errno)); - close(fd); + if(errno == EINTR) + continue; + else if(errno == EAGAIN) { + initialized = 1; + break; + } + MP_ERR(ctx, "Error while reading joystick device: %s\n",strerror(errno)); + close(fd); talloc_free(ctx); - return -1; + return -1; } l += r; } if((unsigned int)l < sizeof(struct js_event)) { if(l > 0) - MP_WARN(ctx, "Joystick: We lose %d bytes of data\n",l); + MP_WARN(ctx, "Joystick: We lose %d bytes of data\n",l); break; } if(ev.type == JS_EVENT_BUTTON) @@ -116,13 +116,13 @@ static int mp_input_joystick_read(void *pctx, int fd) { int r = read(fd,((char*)&ev)+l,sizeof(struct js_event)-l); if(r <= 0) { if(errno == EINTR) - continue; + continue; else if(errno == EAGAIN) - return MP_INPUT_NOTHING; + return MP_INPUT_NOTHING; if( r < 0) - MP_ERR(ctx, "Error while reading joystick device: %s\n",strerror(errno)); + MP_ERR(ctx, "Error while reading joystick device: %s\n",strerror(errno)); else - MP_ERR(ctx, "Error while reading joystick device: %s\n","EOF"); + MP_ERR(ctx, "Error while reading joystick device: %s\n","EOF"); return MP_INPUT_DEAD; } l += r; @@ -140,14 +140,14 @@ static int mp_input_joystick_read(void *pctx, int fd) { if(ev.type == JS_EVENT_BUTTON) { int s = (ctx->btns >> ev.number) & 1; if(s == ev.value) // State is the same : ignore - return MP_INPUT_NOTHING; + return MP_INPUT_NOTHING; } if(ev.type == JS_EVENT_AXIS) { if( ( ctx->axis[ev.number] == 1 && ev.value > JOY_AXIS_DELTA) || - (ctx->axis[ev.number] == -1 && ev.value < -JOY_AXIS_DELTA) || - (ctx->axis[ev.number] == 0 && ev.value >= -JOY_AXIS_DELTA && ev.value <= JOY_AXIS_DELTA) - ) // State is the same : ignore - return MP_INPUT_NOTHING; + (ctx->axis[ev.number] == -1 && ev.value < -JOY_AXIS_DELTA) || + (ctx->axis[ev.number] == 0 && ev.value >= -JOY_AXIS_DELTA && ev.value <= JOY_AXIS_DELTA) + ) // State is the same : ignore + return MP_INPUT_NOTHING; } } diff --git a/input/lirc.c b/input/lirc.c index c5eb7e2ef4..06036b8858 100644 --- a/input/lirc.c +++ b/input/lirc.c @@ -61,7 +61,7 @@ int mp_input_lirc_init(struct input_ctx *ictx, struct mp_log *log, struct lirc_config *lirc_config = NULL; if(lirc_readconfig( lirc_configfile,&lirc_config,NULL )!=0 ){ mp_err(log, "Failed to read LIRC config file %s.\n", - lirc_configfile == NULL ? "~/.lircrc" : lirc_configfile); + lirc_configfile == NULL ? "~/.lircrc" : lirc_configfile); lirc_deinit(); return -1; } |