Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix white space issues in mce code base
No functional changes.

Files where majority of lines are indented with tabulators are changed
so that every beginning of line uses tabulators for 8 character skips.
The rest of the files use only space characters for indentation.

Remove excess empty lines from all source files.

Make indentation levels uniform within each source file.

[mce] Fix white space issues in mce code base. Fixes JB#18915
  • Loading branch information
spiiroin committed May 13, 2014
1 parent fb0f7d3 commit 9cc0f54
Show file tree
Hide file tree
Showing 38 changed files with 1,504 additions and 1,545 deletions.
13 changes: 6 additions & 7 deletions builtin-gconf.c
Expand Up @@ -689,7 +689,7 @@ gconf_value_str(GConfValue *self)
break; break;
} }
if( v_iter->next ) { if( v_iter->next ) {
fprintf(file, ","); fprintf(file, ",");
} }
} }
break; break;
Expand Down Expand Up @@ -751,7 +751,7 @@ gconf_value_list_validata(GSList *src, GConfValueType type)
if( val->type != type ) if( val->type != type )
{ {
gconf_log_error("list has %s value, expected %s\n", gconf_log_error("list has %s value, expected %s\n",
gconf_type_repr(val->type), gconf_type_repr(type)); gconf_type_repr(val->type), gconf_type_repr(type));
return FALSE; return FALSE;
} }
} }
Expand Down Expand Up @@ -1628,7 +1628,7 @@ static void gconf_client_load_values(GConfClient *self, const char *path)
gconf_strip_string(val); gconf_strip_string(val);


if( (entry = gconf_client_find_entry(self, key, &err)) ) { if( (entry = gconf_client_find_entry(self, key, &err)) ) {
gconf_value_set_from_string(entry->value, val); gconf_value_set_from_string(entry->value, val);
} }
g_clear_error(&err); g_clear_error(&err);
} }
Expand Down Expand Up @@ -1742,10 +1742,10 @@ static void gconf_client_free_default(void)
if( default_client ) if( default_client )
{ {
g_slist_free_full(default_client->entries, g_slist_free_full(default_client->entries,
gconf_entry_free_cb); gconf_entry_free_cb);


g_slist_free_full(default_client->notify_list, g_slist_free_full(default_client->notify_list,
gconf_client_notify_free_cb); gconf_client_notify_free_cb);


free(default_client), default_client = 0; free(default_client), default_client = 0;
} }
Expand Down Expand Up @@ -2136,7 +2136,6 @@ gconf_signal_value_change(GConfEntry *entry)
return; return;
} }



/** Dispatch change notifications via installed callbacks */ /** Dispatch change notifications via installed callbacks */
static static
void void
Expand All @@ -2160,7 +2159,7 @@ gconf_client_notify_change(GConfClient *client,


if( !strcmp(notify->namespace_section, namespace_section) ) if( !strcmp(notify->namespace_section, namespace_section) )
{ {
gconf_log_debug("id=%u, namespace=%s", notify->id, notify->namespace_section); gconf_log_debug("id=%u, namespace=%s", notify->id, notify->namespace_section);
notify->func(client, notify->id, entry, notify->user_data); notify->func(client, notify->id, entry, notify->user_data);
} }
} }
Expand Down
38 changes: 18 additions & 20 deletions evdev.c
Expand Up @@ -317,26 +317,25 @@ int evdev_identify_device(int fd)
if( bit_is_set(bmap_code, ecode) ) if( bit_is_set(bmap_code, ecode) )
{ {
const char *tag = evdev_get_event_code_name(etype, ecode); const char *tag = evdev_get_event_code_name(etype, ecode);
int set = bit_is_set(bmap_stat, ecode); int set = bit_is_set(bmap_stat, ecode);
int add = strlen(tag) + 1 + set; int add = strlen(tag) + 1 + set;
char val[32] = ""; char val[32] = "";



if( etype == EV_ABS )
if( etype == EV_ABS ) {
{ struct input_absinfo info;
struct input_absinfo info; memset(&info, 0, sizeof info);
memset(&info, 0, sizeof info);

if( ioctl(fd, EVIOCGABS(ecode), &info) == -1 )
if( ioctl(fd, EVIOCGABS(ecode), &info) == -1 ) {
{ mce_log(LL_ERR, "EVIOCGABS(%s): %m", tag);
mce_log(LL_ERR, "EVIOCGABS(%s): %m", tag); }
} else
else {
{ snprintf(val, sizeof val, "=%d [%d,%d]", info.value, info.minimum, info.maximum);
snprintf(val, sizeof val, "=%d [%d,%d]", info.value, info.minimum, info.maximum); add += strlen(val);
add += strlen(val); }
} }
}


if( len == 0 ) printf("\t"); if( len == 0 ) printf("\t");
else if( len+add > cols ) printf("\n\t"), len = 0; else if( len+add > cols ) printf("\n\t"), len = 0;
Expand All @@ -348,7 +347,6 @@ int evdev_identify_device(int fd)
if( len ) printf("\n"); if( len ) printf("\n");
} }



err = 0; err = 0;


cleanup: cleanup:
Expand Down
74 changes: 37 additions & 37 deletions event-input.c
Expand Up @@ -436,11 +436,11 @@ static evdevinfo_t *evdevinfo_create(void)
*/ */
static void evdevinfo_delete(evdevinfo_t *self) static void evdevinfo_delete(evdevinfo_t *self)
{ {
if( self ) { if( self ) {
for( int i = 0; i < EV_CNT; ++i ) for( int i = 0; i < EV_CNT; ++i )
evdevbits_delete(self->mask[i]); evdevbits_delete(self->mask[i]);
g_free(self); g_free(self);
} }
} }


/** Check if event type is supported /** Check if event type is supported
Expand All @@ -452,10 +452,10 @@ static void evdevinfo_delete(evdevinfo_t *self)
*/ */
static int evdevinfo_has_type(const evdevinfo_t *self, int type) static int evdevinfo_has_type(const evdevinfo_t *self, int type)
{ {
int res = 0; int res = 0;
if( (unsigned)type < EV_CNT ) if( (unsigned)type < EV_CNT )
res = evdevbits_test(self->mask[0], type); res = evdevbits_test(self->mask[0], type);
return res; return res;
} }


/** Check if any of given event types are supported /** Check if any of given event types are supported
Expand All @@ -467,12 +467,12 @@ static int evdevinfo_has_type(const evdevinfo_t *self, int type)
*/ */
static int evdevinfo_has_types(const evdevinfo_t *self, const int *types) static int evdevinfo_has_types(const evdevinfo_t *self, const int *types)
{ {
int res = 0; int res = 0;
for( size_t i = 0; types[i] >= 0; ++i ) { for( size_t i = 0; types[i] >= 0; ++i ) {
if( (res = evdevinfo_has_type(self, types[i])) ) if( (res = evdevinfo_has_type(self, types[i])) )
break; break;
} }
return res; return res;
} }


/** Check if event code is supported /** Check if event code is supported
Expand Down Expand Up @@ -697,17 +697,17 @@ static evdev_type_t get_evdev_type(int fd)


/* All event classes except EV_ABS */ /* All event classes except EV_ABS */
static const int all_but_abs_lut[] = { static const int all_but_abs_lut[] = {
EV_KEY, EV_KEY,
EV_REL, EV_REL,
EV_MSC, EV_MSC,
EV_SW, EV_SW,
EV_LED, EV_LED,
EV_SND, EV_SND,
EV_REP, EV_REP,
EV_FF, EV_FF,
EV_PWR, EV_PWR,
EV_FF_STATUS, EV_FF_STATUS,
-1 -1
}; };


/* Ambient light and proximity sensor inputs */ /* Ambient light and proximity sensor inputs */
Expand Down Expand Up @@ -1095,15 +1095,15 @@ static void input_grab_set_touching(input_grab_t *self, bool touching)
*/ */
static void input_grab_request_grab(input_grab_t *self, bool want_grab) static void input_grab_request_grab(input_grab_t *self, bool want_grab)
{ {
if( self->ig_want_grab == want_grab ) if( self->ig_want_grab == want_grab )
goto EXIT; goto EXIT;


self->ig_want_grab = want_grab; self->ig_want_grab = want_grab;


input_grab_rethink(self); input_grab_rethink(self);


EXIT: EXIT:
return; return;
} }


/** Callback for changing iomonitor input grab state /** Callback for changing iomonitor input grab state
Expand Down Expand Up @@ -1314,17 +1314,17 @@ static void ts_grab_event_filter_cb(struct input_event *ev)
case EV_ABS: case EV_ABS:
switch( ev->code ) { switch( ev->code ) {
case ABS_MT_POSITION_X: case ABS_MT_POSITION_X:
x = true; x = true;
break; break;


case ABS_MT_POSITION_Y: case ABS_MT_POSITION_Y:
y = true; y = true;
break; break;


case ABS_MT_TOUCH_MAJOR: case ABS_MT_TOUCH_MAJOR:
case ABS_MT_PRESSURE: case ABS_MT_PRESSURE:
p = true; p = true;
break; break;


default: default:
break; break;
Expand Down Expand Up @@ -2264,7 +2264,7 @@ static void match_and_register_io_monitor(const gchar *filename)
} }


/* Get name of the evdev node */ /* Get name of the evdev node */
if (ioctl(fd, EVIOCGNAME(sizeof name), name) < 0) { if (ioctl(fd, EVIOCGNAME(sizeof name), name) < 0) {
mce_log(LL_WARN, mce_log(LL_WARN,
"ioctl(EVIOCGNAME) failed on `%s'", "ioctl(EVIOCGNAME) failed on `%s'",
filename); filename);
Expand Down
1 change: 0 additions & 1 deletion event-switches.h
Expand Up @@ -107,7 +107,6 @@
/** Value for the battery cover closed state */ /** Value for the battery cover closed state */
#define MCE_BATTERY_COVER_CLOSED "closed" #define MCE_BATTERY_COVER_CLOSED "closed"



/* When MCE is made modular, this will be handled differently */ /* When MCE is made modular, this will be handled differently */
gboolean mce_switches_init(void); gboolean mce_switches_init(void);
void mce_switches_exit(void); void mce_switches_exit(void);
Expand Down
4 changes: 2 additions & 2 deletions filewatcher.c
Expand Up @@ -449,8 +449,8 @@ filewatcher_setup_iowatch(filewatcher_t *self)
g_io_channel_set_buffered(chan, FALSE); g_io_channel_set_buffered(chan, FALSE);


self->watch_id = g_io_add_watch(chan, self->watch_id = g_io_add_watch(chan,
G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
filewatcher_input_cb, self); filewatcher_input_cb, self);


if( !self->watch_id ) if( !self->watch_id )
{ {
Expand Down
4 changes: 2 additions & 2 deletions filewatcher.h
Expand Up @@ -16,8 +16,8 @@ extern "C" {
# endif # endif


typedef void (*filewatcher_changed_fn)(const char *path, typedef void (*filewatcher_changed_fn)(const char *path,
const char *file, const char *file,
gpointer user_data); gpointer user_data);


typedef struct filewatcher_t filewatcher_t; typedef struct filewatcher_t filewatcher_t;


Expand Down
2 changes: 1 addition & 1 deletion libwakelock.c
Expand Up @@ -258,5 +258,5 @@ void wakelock_block_suspend_until_exit(void)
*/ */
void lwl_enable_logging(void) void lwl_enable_logging(void)
{ {
lwl_debug_enabled = 1; lwl_debug_enabled = 1;
} }
4 changes: 2 additions & 2 deletions mce-conf.c
Expand Up @@ -408,8 +408,8 @@ static void mce_conf_merge_file(GKeyFile *dest, GKeyFile *srce)
*/ */
static int mce_conf_glob_error_cb(const char *path, int err) static int mce_conf_glob_error_cb(const char *path, int err)
{ {
mce_log(LL_WARN, "%s: glob: %s", path, g_strerror(err)); mce_log(LL_WARN, "%s: glob: %s", path, g_strerror(err));
return 0; return 0;
} }


/** Process config data from /etc/mce/mce.d/xxx.ini files /** Process config data from /etc/mce/mce.d/xxx.ini files
Expand Down

0 comments on commit 9cc0f54

Please sign in to comment.