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
  • protocols/oscar/msgcookie.c

    raf359b4 r5ebff60  
    22 * Cookie Caching stuff. Adam wrote this, apparently just some
    33 * derivatives of n's SNAC work. I cleaned it up, added comments.
    4  * 
     4 *
    55 */
    66
     
    2626 * returns -1 on error, 0 on append, 1 on update.  the cookie you pass
    2727 * in may be free'd, so don't count on its value after calling this!
    28  * 
     28 *
    2929 */
    3030int aim_cachecookie(aim_session_t *sess, aim_msgcookie_t *cookie)
     
    3232        aim_msgcookie_t *newcook;
    3333
    34         if (!sess || !cookie)
     34        if (!sess || !cookie) {
    3535                return -EINVAL;
     36        }
    3637
    3738        newcook = aim_checkcookie(sess, cookie->cookie, cookie->type);
    38        
     39
    3940        if (newcook == cookie) {
    4041                newcook->addtime = time(NULL);
    4142                return 1;
    42         } else if (newcook)
     43        } else if (newcook) {
    4344                aim_cookie_free(sess, newcook);
     45        }
    4446
    45         cookie->addtime = time(NULL); 
     47        cookie->addtime = time(NULL);
    4648
    4749        cookie->next = sess->msgcookies;
     
    6567        aim_msgcookie_t *cur, **prev;
    6668
    67         if (!cookie || !sess->msgcookies)
     69        if (!cookie || !sess->msgcookies) {
    6870                return NULL;
     71        }
    6972
    7073        for (prev = &sess->msgcookies; (cur = *prev); ) {
    71                 if ((cur->type == type) && 
    72                                 (memcmp(cur->cookie, cookie, 8) == 0)) {
     74                if ((cur->type == type) &&
     75                    (memcmp(cur->cookie, cookie, 8) == 0)) {
    7376                        *prev = cur->next;
    7477                        return cur;
     
    9093 *
    9194 */
    92 aim_msgcookie_t *aim_mkcookie(guint8 *c, int type, void *data) 
     95aim_msgcookie_t *aim_mkcookie(guint8 *c, int type, void *data)
    9396{
    9497        aim_msgcookie_t *cookie;
    9598
    96         if (!c)
     99        if (!c) {
    97100                return NULL;
     101        }
    98102
    99         if (!(cookie = g_new0(aim_msgcookie_t,1)))
     103        if (!(cookie = g_new0(aim_msgcookie_t, 1))) {
    100104                return NULL;
     105        }
    101106
    102107        cookie->data = data;
     
    123128
    124129        for (cur = sess->msgcookies; cur; cur = cur->next) {
    125                 if ((cur->type == type) &&
    126                                 (memcmp(cur->cookie, cookie, 8) == 0))
    127                         return cur;   
     130                if ((cur->type == type) &&
     131                    (memcmp(cur->cookie, cookie, 8) == 0)) {
     132                        return cur;
     133                }
    128134        }
    129135
     
    144150 *
    145151 */
    146 int aim_cookie_free(aim_session_t *sess, aim_msgcookie_t *cookie) 
     152int aim_cookie_free(aim_session_t *sess, aim_msgcookie_t *cookie)
    147153{
    148154        aim_msgcookie_t *cur, **prev;
    149155
    150         if (!sess || !cookie)
     156        if (!sess || !cookie) {
    151157                return -EINVAL;
     158        }
    152159
    153160        for (prev = &sess->msgcookies; (cur = *prev); ) {
    154                 if (cur == cookie)
     161                if (cur == cookie) {
    155162                        *prev = cur->next;
    156                 else
     163                } else {
    157164                        prev = &cur->next;
     165                }
    158166        }
    159167
     
    162170
    163171        return 0;
    164 } 
     172}
Note: See TracChangeset for help on using the changeset viewer.