Changeset 5ebff60 for lib/events_glib.c


Ignore:
Timestamp:
2015-02-20T22:50:54Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
0b9daac, 3d45471, 7733b8c
Parents:
af359b4
git-author:
Indent <please@…> (19-02-15 05:47:20)
git-committer:
dequis <dx@…> (20-02-15 22:50:54)
Message:

Reindent everything to K&R style with tabs

Used uncrustify, with the configuration file in ./doc/uncrustify.cfg

Commit author set to "Indent <please@…>" so that it's easier to
skip while doing git blame.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/events_glib.c

    raf359b4 r5ebff60  
    1   /********************************************************************\
     1/********************************************************************\
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
     
    5050void b_main_init()
    5151{
    52         if( loop == NULL )
    53                 loop = g_main_new( FALSE );
     52        if (loop == NULL) {
     53                loop = g_main_new(FALSE);
     54        }
    5455}
    5556
    5657void b_main_run()
    5758{
    58         g_main_run( loop );
     59        g_main_run(loop);
    5960}
    6061
    6162void b_main_quit()
    6263{
    63         g_main_quit( loop );
     64        g_main_quit(loop);
    6465}
    6566
     
    6970        b_input_condition gaim_cond = 0;
    7071        gboolean st;
    71        
    72         if (condition & G_IO_NVAL)
     72
     73        if (condition & G_IO_NVAL) {
    7374                return FALSE;
     75        }
    7476
    75         if (condition & GAIM_READ_COND)
     77        if (condition & GAIM_READ_COND) {
    7678                gaim_cond |= B_EV_IO_READ;
    77         if (condition & GAIM_WRITE_COND)
     79        }
     80        if (condition & GAIM_WRITE_COND) {
    7881                gaim_cond |= B_EV_IO_WRITE;
    79        
    80         event_debug( "gaim_io_invoke( %d, %d, 0x%x )\n", g_io_channel_unix_get_fd(source), condition, data );
     82        }
     83
     84        event_debug("gaim_io_invoke( %d, %d, 0x%x )\n", g_io_channel_unix_get_fd(source), condition, data);
    8185
    8286        st = closure->function(closure->data, g_io_channel_unix_get_fd(source), gaim_cond);
    83        
    84         if( !st )
    85                 event_debug( "Returned FALSE, cancelling.\n" );
    86        
    87         if (closure->flags & B_EV_FLAG_FORCE_ONCE)
     87
     88        if (!st) {
     89                event_debug("Returned FALSE, cancelling.\n");
     90        }
     91
     92        if (closure->flags & B_EV_FLAG_FORCE_ONCE) {
    8893                return FALSE;
    89         else if (closure->flags & B_EV_FLAG_FORCE_REPEAT)
     94        } else if (closure->flags & B_EV_FLAG_FORCE_REPEAT) {
    9095                return TRUE;
    91         else
     96        } else {
    9297                return st;
     98        }
    9399}
    94100
    95101static void gaim_io_destroy(gpointer data)
    96102{
    97         event_debug( "gaim_io_destroy( 0x%x )\n", data );
     103        event_debug("gaim_io_destroy( 0x%x )\n", data);
    98104        g_free(data);
    99105}
     
    105111        GIOCondition cond = 0;
    106112        int st;
    107        
     113
    108114        closure->function = function;
    109115        closure->data = data;
    110116        closure->flags = condition;
    111        
    112         if (condition & B_EV_IO_READ)
     117
     118        if (condition & B_EV_IO_READ) {
    113119                cond |= GAIM_READ_COND;
    114         if (condition & B_EV_IO_WRITE)
     120        }
     121        if (condition & B_EV_IO_WRITE) {
    115122                cond |= GAIM_WRITE_COND;
    116        
     123        }
     124
    117125        channel = g_io_channel_unix_new(source);
    118126        st = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond,
    119127                                 gaim_io_invoke, closure, gaim_io_destroy);
    120        
    121         event_debug( "b_input_add( %d, %d, 0x%x, 0x%x ) = %d (%p)\n", source, condition, function, data, st, closure );
    122        
     128
     129        event_debug("b_input_add( %d, %d, 0x%x, 0x%x ) = %d (%p)\n", source, condition, function, data, st, closure);
     130
    123131        g_io_channel_unref(channel);
    124132        return st;
     
    131139           for now, BitlBee only looks at the "data" argument. */
    132140        gint st = g_timeout_add(timeout, (GSourceFunc) func, data);
    133        
    134         event_debug( "b_timeout_add( %d, %d, %d ) = %d\n", timeout, func, data, st );
    135        
     141
     142        event_debug("b_timeout_add( %d, %d, %d ) = %d\n", timeout, func, data, st);
     143
    136144        return st;
    137145}
     
    139147void b_event_remove(gint tag)
    140148{
    141         event_debug( "b_event_remove( %d )\n", tag );
    142        
    143         if (tag > 0)
     149        event_debug("b_event_remove( %d )\n", tag);
     150
     151        if (tag > 0) {
    144152                g_source_remove(tag);
     153        }
    145154}
    146155
    147 void closesocket( int fd )
     156void closesocket(int fd)
    148157{
    149         close( fd );
     158        close(fd);
    150159}
Note: See TracChangeset for help on using the changeset viewer.