Changeset 5ebff60 for lib/json_util.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/json_util.c

    raf359b4 r5ebff60  
    2828#include "json_util.h"
    2929
    30 json_value *json_o_get( const json_value *obj, const json_char *name )
    31 { 
     30json_value *json_o_get(const json_value *obj, const json_char *name)
     31{
    3232        int i;
    33        
    34         if( !obj || obj->type != json_object )
     33
     34        if (!obj || obj->type != json_object) {
    3535                return NULL;
     36        }
    3637
    37         for( i = 0; i < obj->u.object.length; ++ i)
    38                 if( strcmp( obj->u.object.values[i].name, name ) == 0 )
     38        for (i = 0; i < obj->u.object.length; ++i) {
     39                if (strcmp(obj->u.object.values[i].name, name) == 0) {
    3940                        return obj->u.object.values[i].value;
     41                }
     42        }
    4043
    4144        return NULL;
    4245}
    4346
    44 const char *json_o_str( const json_value *obj, const json_char *name )
    45 { 
    46         json_value *ret = json_o_get( obj, name );
    47        
    48         if( ret && ret->type == json_string )
     47const char *json_o_str(const json_value *obj, const json_char *name)
     48{
     49        json_value *ret = json_o_get(obj, name);
     50
     51        if (ret && ret->type == json_string) {
    4952                return ret->u.string.ptr;
    50         else
     53        } else {
    5154                return NULL;
     55        }
    5256}
    5357
    54 char *json_o_strdup( const json_value *obj, const json_char *name )
     58char *json_o_strdup(const json_value *obj, const json_char *name)
    5559{
    56         json_value *ret = json_o_get( obj, name );
    57        
    58         if( ret && ret->type == json_string && ret->u.string.ptr )
    59                 return g_memdup( ret->u.string.ptr, ret->u.string.length + 1 );
    60         else
     60        json_value *ret = json_o_get(obj, name);
     61
     62        if (ret && ret->type == json_string && ret->u.string.ptr) {
     63                return g_memdup(ret->u.string.ptr, ret->u.string.length + 1);
     64        } else {
    6165                return NULL;
     66        }
    6267}
Note: See TracChangeset for help on using the changeset viewer.