Skip to content
Permalink
Browse files
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 9cc0f544301012d3563b29d2af0ee4b60a3f0bf6
@@ -689,7 +689,7 @@ gconf_value_str(GConfValue *self)
break;
}
if( v_iter->next ) {
fprintf(file, ",");
fprintf(file, ",");
}
}
break;
@@ -751,7 +751,7 @@ gconf_value_list_validata(GSList *src, GConfValueType type)
if( val->type != type )
{
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;
}
}
@@ -1628,7 +1628,7 @@ static void gconf_client_load_values(GConfClient *self, const char *path)
gconf_strip_string(val);

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);
}
@@ -1742,10 +1742,10 @@ static void gconf_client_free_default(void)
if( default_client )
{
g_slist_free_full(default_client->entries,
gconf_entry_free_cb);
gconf_entry_free_cb);

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

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


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

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);
}
}
38 evdev.c
@@ -317,26 +317,25 @@ int evdev_identify_device(int fd)
if( bit_is_set(bmap_code, 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;
char val[32] = "";


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

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

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

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

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


err = 0;

cleanup:
@@ -436,11 +436,11 @@ static evdevinfo_t *evdevinfo_create(void)
*/
static void evdevinfo_delete(evdevinfo_t *self)
{
if( self ) {
for( int i = 0; i < EV_CNT; ++i )
evdevbits_delete(self->mask[i]);
g_free(self);
}
if( self ) {
for( int i = 0; i < EV_CNT; ++i )
evdevbits_delete(self->mask[i]);
g_free(self);
}
}

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

/** Check if any of given event types are supported
@@ -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)
{
int res = 0;
for( size_t i = 0; types[i] >= 0; ++i ) {
if( (res = evdevinfo_has_type(self, types[i])) )
break;
}
return res;
int res = 0;
for( size_t i = 0; types[i] >= 0; ++i ) {
if( (res = evdevinfo_has_type(self, types[i])) )
break;
}
return res;
}

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

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

/* Ambient light and proximity sensor inputs */
@@ -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)
{
if( self->ig_want_grab == want_grab )
goto EXIT;
if( self->ig_want_grab == want_grab )
goto EXIT;

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

input_grab_rethink(self);
input_grab_rethink(self);

EXIT:
return;
return;
}

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

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

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

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

/* 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,
"ioctl(EVIOCGNAME) failed on `%s'",
filename);
@@ -107,7 +107,6 @@
/** Value for the battery cover closed state */
#define MCE_BATTERY_COVER_CLOSED "closed"


/* When MCE is made modular, this will be handled differently */
gboolean mce_switches_init(void);
void mce_switches_exit(void);
@@ -449,8 +449,8 @@ filewatcher_setup_iowatch(filewatcher_t *self)
g_io_channel_set_buffered(chan, FALSE);

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

if( !self->watch_id )
{
@@ -16,8 +16,8 @@ extern "C" {
# endif

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

typedef struct filewatcher_t filewatcher_t;

@@ -258,5 +258,5 @@ void wakelock_block_suspend_until_exit(void)
*/
void lwl_enable_logging(void)
{
lwl_debug_enabled = 1;
lwl_debug_enabled = 1;
}
@@ -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)
{
mce_log(LL_WARN, "%s: glob: %s", path, g_strerror(err));
return 0;
mce_log(LL_WARN, "%s: glob: %s", path, g_strerror(err));
return 0;
}

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

0 comments on commit 9cc0f54

Please sign in to comment.