style cleanup
authorCampbell Barton <ideasman42@gmail.com>
Sun, 29 Jul 2012 00:20:28 +0000 (00:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 29 Jul 2012 00:20:28 +0000 (00:20 +0000)
21 files changed:
source/blender/avi/intern/avi.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/ocean.c
source/blender/blenkernel/intern/writeframeserver.c
source/blender/blenlib/intern/BLI_args.c
source/blender/blenlib/intern/DLRB_tree.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/interface/interface.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/object/object_modifier.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_clip/clip_toolbar.c
source/blender/editors/space_logic/logic_ops.c
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/sss.c

index cceba82aca77aa707f17ec0628dc72887ed86267..f64b693fb1c116b5f70167786c7b4a2e5b07d444 100644 (file)
@@ -857,9 +857,9 @@ AviError AVI_open_compress(char *name, AviMovie *movie, int streams, ...)
 #if 0
                        if (movie->streams[i].format == AVI_FORMAT_MJPEG) {
                                AviMJPEGUnknown *tmp;
-                               
-                               tmp = (AviMJPEGUnknown *) ((char*) movie->streams[i].sf +sizeof(AviBitmapInfoHeader));
-                               
+
+                               tmp = (AviMJPEGUnknown *)((char *) movie->streams[i].sf + sizeof(AviBitmapInfoHeader));
+
                                tmp->a = 44;
                                tmp->b = 24;
                                tmp->c = 0;
index 866194eea0e2323af1b5b90c8cf831d08ff40dd2..1c06d95a70b1a58a415e2c1754f6fb4a74b282e7 100644 (file)
@@ -1311,7 +1311,7 @@ void multires_set_space(DerivedMesh *dm, Object *ob, int from, int to)
                memcpy(subGridData[i], gridData[i], key.elem_size * gridSize * gridSize);
        }
        
-       /*numGrids = ccgdm->dm->getNumGrids((DerivedMesh*)ccgdm);*/ /*UNUSED*/
+       /* numGrids = ccgdm->dm->getNumGrids((DerivedMesh *)ccgdm); */ /*UNUSED*/
        gridSize = ccgdm->getGridSize((DerivedMesh *)ccgdm);
        gridData = ccgdm->getGridData((DerivedMesh *)ccgdm);
        gridOffset = ccgdm->getGridOffset((DerivedMesh *)ccgdm);
index 56b1c0a17e864450bf9633d5535220d7f6e2faef..592bc10424f54dc2d07d59ddbf78f5d20589d538 100644 (file)
@@ -91,8 +91,8 @@ bNodeTreeType *ntreeGetType(int type)
 static bNodeType *node_get_type(bNodeTree *ntree, int type)
 {
        bNodeType *ntype = ntreeGetType(ntree->type)->node_types.first;
-       for (; ntype; ntype= ntype->next)
-               if (ntype->type==type)
+       for (; ntype; ntype = ntype->next)
+               if (ntype->type == type)
                        return ntype;
        
        return NULL;
@@ -105,12 +105,12 @@ bNodeType *ntreeGetNodeType(bNodeTree *ntree)
 
 bNodeSocketType *ntreeGetSocketType(int type)
 {
-       static bNodeSocketType *types[NUM_SOCKET_TYPES]= {NULL};
+       static bNodeSocketType *types[NUM_SOCKET_TYPES] = {NULL};
        static int types_init = 1;
 
        if (types_init) {
                node_socket_type_init(types);
-               types_init= 0;
+               types_init = 0;
        }
 
        if (type < NUM_SOCKET_TYPES) {
@@ -125,8 +125,8 @@ void ntreeInitTypes(bNodeTree *ntree)
 {
        bNode *node, *next;
        
-       for (node= ntree->nodes.first; node; node= next) {
-               next= node->next;
+       for (node = ntree->nodes.first; node; node = next) {
+               next = node->next;
                
                node->typeinfo = node_get_type(ntree, node->type);
 
@@ -143,11 +143,11 @@ static bNodeSocket *make_socket(bNodeTree *UNUSED(ntree), int in_out, const char
 {
        bNodeSocket *sock;
        
-       sock= MEM_callocN(sizeof(bNodeSocket), "sock");
+       sock = MEM_callocN(sizeof(bNodeSocket), "sock");
        
        BLI_strncpy(sock->name, name, NODE_MAXSTR);
-       sock->limit = (in_out==SOCK_IN ? 1 : 0xFFF);
-       sock->type= type;
+       sock->limit = (in_out == SOCK_IN ? 1 : 0xFFF);
+       sock->type = type;
        sock->storage = NULL;
        
        sock->default_value = node_socket_make_default_value(type);
@@ -159,9 +159,9 @@ static bNodeSocket *make_socket(bNodeTree *UNUSED(ntree), int in_out, const char
 bNodeSocket *nodeAddSocket(bNodeTree *ntree, bNode *node, int in_out, const char *name, int type)
 {
        bNodeSocket *sock = make_socket(ntree, in_out, name, type);
-       if (in_out==SOCK_IN)
+       if (in_out == SOCK_IN)
                BLI_addtail(&node->inputs, sock);
-       else if (in_out==SOCK_OUT)
+       else if (in_out == SOCK_OUT)
                BLI_addtail(&node->outputs, sock);
        
        node->update |= NODE_UPDATE;
@@ -172,9 +172,9 @@ bNodeSocket *nodeAddSocket(bNodeTree *ntree, bNode *node, int in_out, const char
 bNodeSocket *nodeInsertSocket(bNodeTree *ntree, bNode *node, int in_out, bNodeSocket *next_sock, const char *name, int type)
 {
        bNodeSocket *sock = make_socket(ntree, in_out, name, type);
-       if (in_out==SOCK_IN)
+       if (in_out == SOCK_IN)
                BLI_insertlinkbefore(&node->inputs, next_sock, sock);
-       else if (in_out==SOCK_OUT)
+       else if (in_out == SOCK_OUT)
                BLI_insertlinkbefore(&node->outputs, next_sock, sock);
        
        node->update |= NODE_UPDATE;
@@ -186,9 +186,9 @@ void nodeRemoveSocket(bNodeTree *ntree, bNode *node, bNodeSocket *sock)
 {
        bNodeLink *link, *next;
        
-       for (link= ntree->links.first; link; link= next) {
-               next= link->next;
-               if (link->fromsock==sock || link->tosock==sock) {
+       for (link = ntree->links.first; link; link = next) {
+               next = link->next;
+               if (link->fromsock == sock || link->tosock == sock) {
                        nodeRemLink(ntree, link);
                }
        }
@@ -208,17 +208,17 @@ void nodeRemoveAllSockets(bNodeTree *ntree, bNode *node)
        bNodeSocket *sock;
        bNodeLink *link, *next;
        
-       for (link= ntree->links.first; link; link= next) {
-               next= link->next;
-               if (link->fromnode==node || link->tonode==node) {
+       for (link = ntree->links.first; link; link = next) {
+               next = link->next;
+               if (link->fromnode == node || link->tonode == node) {
                        nodeRemLink(ntree, link);
                }
        }
        
-       for (sock=node->inputs.first; sock; sock=sock->next)
+       for (sock = node->inputs.first; sock; sock = sock->next)
                node_socket_free_default_value(sock->type, sock->default_value);
        BLI_freelistN(&node->inputs);
-       for (sock=node->outputs.first; sock; sock=sock->next)
+       for (sock = node->outputs.first; sock; sock = sock->next)
                node_socket_free_default_value(sock->type, sock->default_value);
        BLI_freelistN(&node->outputs);
        
@@ -236,20 +236,20 @@ int nodeFindNode(bNodeTree *ntree, bNodeSocket *sock, bNode **nodep, int *sockin
 {
        bNode *node;
        bNodeSocket *tsock;
-       int index= 0;
+       int index = 0;
        
-       for (node= ntree->nodes.first; node; node= node->next) {
-               for (index=0, tsock= node->inputs.first; tsock; tsock= tsock->next, index++) {
-                       if (tsock==sock) {
-                               if (in_out) *in_out= SOCK_IN;
+       for (node = ntree->nodes.first; node; node = node->next) {
+               for (index = 0, tsock = node->inputs.first; tsock; tsock = tsock->next, index++) {
+                       if (tsock == sock) {
+                               if (in_out) *in_out = SOCK_IN;
                                break;
                        }
                }
                if (tsock)
                        break;
-               for (index=0, tsock= node->outputs.first; tsock; tsock= tsock->next, index++) {
-                       if (tsock==sock) {
-                               if (in_out) *in_out= SOCK_OUT;
+               for (index = 0, tsock = node->outputs.first; tsock; tsock = tsock->next, index++) {
+                       if (tsock == sock) {
+                               if (in_out) *in_out = SOCK_OUT;
                                break;
                        }
                }
@@ -258,12 +258,12 @@ int nodeFindNode(bNodeTree *ntree, bNodeSocket *sock, bNode **nodep, int *sockin
        }
 
        if (node) {
-               *nodep= node;
-               if (sockindex) *sockindex= index;
+               *nodep = node;
+               if (sockindex) *sockindex = index;
                return 1;
        }
        
-       *nodep= NULL;
+       *nodep = NULL;
        return 0;
 }
 
@@ -274,7 +274,7 @@ static void node_add_sockets_from_type(bNodeTree *ntree, bNode *node, bNodeType
        /* bNodeSocket *sock; */ /* UNUSED */
 
        if (ntype->inputs) {
-               sockdef= ntype->inputs;
+               sockdef = ntype->inputs;
                while (sockdef->type != -1) {
                        /* sock = */ node_add_input_from_template(ntree, node, sockdef);
                        
@@ -282,7 +282,7 @@ static void node_add_sockets_from_type(bNodeTree *ntree, bNode *node, bNodeType
                }
        }
        if (ntype->outputs) {
-               sockdef= ntype->outputs;
+               sockdef = ntype->outputs;
                while (sockdef->type != -1) {
                        /* sock = */ node_add_output_from_template(ntree, node, sockdef);
                        
@@ -302,7 +302,7 @@ bNode *nodeAddNode(bNodeTree *ntree, struct bNodeTemplate *ntemp)
        bNode *node;
        bNodeType *ntype;
        
-       ntype= node_get_type(ntree, ntemp->type);
+       ntype = node_get_type(ntree, ntemp->type);
        if (ntype == NULL) {
                printf("nodeAddNodeType() error: '%d' type invalid\n", ntemp->type);
                return NULL;
@@ -311,20 +311,20 @@ bNode *nodeAddNode(bNodeTree *ntree, struct bNodeTemplate *ntemp)
        if (!nodeValid(ntree, ntemp))
                return NULL;
        
-       node= MEM_callocN(sizeof(bNode), "new node");
-       node->type= ntype->type;
-       node->typeinfo= ntype;
-       node->flag= NODE_SELECT|ntype->flag;
-       node->width= ntype->width;
-       node->miniwidth= 42.0f;
-       node->height= ntype->height;
-       node->color[0] = node->color[1] = node->color[2] = 0.608;       /* default theme color */
+       node = MEM_callocN(sizeof(bNode), "new node");
+       node->type = ntype->type;
+       node->typeinfo = ntype;
+       node->flag = NODE_SELECT | ntype->flag;
+       node->width = ntype->width;
+       node->miniwidth = 42.0f;
+       node->height = ntype->height;
+       node->color[0] = node->color[1] = node->color[2] = 0.608;   /* default theme color */
        
        node_add_sockets_from_type(ntree, node, ntype);
 
        BLI_addtail(&ntree->nodes, node);
        
-       if (ntype->initfunc!=NULL)
+       if (ntype->initfunc != NULL)
                ntype->initfunc(ntree, node, ntemp);
 
        /* initialize the node name with the node label.
@@ -343,19 +343,19 @@ bNode *nodeAddNode(bNodeTree *ntree, struct bNodeTemplate *ntemp)
 /* ntree is the target tree */
 bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
 {
-       bNode *nnode= MEM_callocN(sizeof(bNode), "dupli node");
+       bNode *nnode = MEM_callocN(sizeof(bNode), "dupli node");
        bNodeSocket *sock, *oldsock;
 
-       *nnode= *node;
+       *nnode = *node;
        nodeUniqueName(ntree, nnode);
        
        BLI_addtail(&ntree->nodes, nnode);
 
        BLI_duplicatelist(&nnode->inputs, &node->inputs);
-       oldsock= node->inputs.first;
-       for (sock= nnode->inputs.first; sock; sock= sock->next, oldsock= oldsock->next) {
-               oldsock->new_sock= sock;
-               sock->stack_index= 0;
+       oldsock = node->inputs.first;
+       for (sock = nnode->inputs.first; sock; sock = sock->next, oldsock = oldsock->next) {
+               oldsock->new_sock = sock;
+               sock->stack_index = 0;
                
                sock->default_value = node_socket_make_default_value(oldsock->type);
                node_socket_copy_default_value(oldsock->type, sock->default_value, oldsock->default_value);
@@ -367,10 +367,10 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
        }
        
        BLI_duplicatelist(&nnode->outputs, &node->outputs);
-       oldsock= node->outputs.first;
-       for (sock= nnode->outputs.first; sock; sock= sock->next, oldsock= oldsock->next) {
-               oldsock->new_sock= sock;
-               sock->stack_index= 0;
+       oldsock = node->outputs.first;
+       for (sock = nnode->outputs.first; sock; sock = sock->next, oldsock = oldsock->next) {
+               oldsock->new_sock = sock;
+               sock->stack_index = 0;
                
                sock->default_value = node_socket_make_default_value(oldsock->type);
                node_socket_copy_default_value(oldsock->type, sock->default_value, oldsock->default_value);
@@ -386,9 +386,9 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
        if (node->typeinfo->copystoragefunc)
                node->typeinfo->copystoragefunc(node, nnode);
        
-       node->new_node= nnode;
-       nnode->new_node= NULL;
-       nnode->preview= NULL;
+       node->new_node = nnode;
+       nnode->new_node = NULL;
+       nnode->preview = NULL;
        
        ntree->update |= NTREE_UPDATE_NODES;
        
@@ -399,84 +399,84 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
 bNodeLink *nodeAddLink(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock, bNode *tonode, bNodeSocket *tosock)
 {
        bNodeSocket *sock;
-       bNodeLink *link= NULL; 
-       int from= 0, to= 0;
+       bNodeLink *link = NULL;
+       int from = 0, to = 0;
        
        if (fromnode) {
                /* test valid input */
-               for (sock= fromnode->outputs.first; sock; sock= sock->next)
-                       if (sock==fromsock)
+               for (sock = fromnode->outputs.first; sock; sock = sock->next)
+                       if (sock == fromsock)
                                break;
                if (sock)
-                       from= 1; /* OK */
+                       from = 1;  /* OK */
                else {
-                       for (sock= fromnode->inputs.first; sock; sock= sock->next)
-                               if (sock==fromsock)
+                       for (sock = fromnode->inputs.first; sock; sock = sock->next)
+                               if (sock == fromsock)
                                        break;
                        if (sock)
-                               from= -1; /* OK but flip */
+                               from = -1;  /* OK but flip */
                }
        }
        else {
                /* check tree sockets */
-               for (sock= ntree->inputs.first; sock; sock= sock->next)
-                       if (sock==fromsock)
+               for (sock = ntree->inputs.first; sock; sock = sock->next)
+                       if (sock == fromsock)
                                break;
                if (sock)
-                       from= 1; /* OK */
+                       from = 1;  /* OK */
                else {
-                       for (sock= ntree->outputs.first; sock; sock= sock->next)
-                               if (sock==fromsock)
+                       for (sock = ntree->outputs.first; sock; sock = sock->next)
+                               if (sock == fromsock)
                                        break;
                        if (sock)
-                               from= -1; /* OK but flip */
+                               from = -1;  /* OK but flip */
                }
        }
        if (tonode) {
-               for (sock= tonode->inputs.first; sock; sock= sock->next)
-                       if (sock==tosock)
+               for (sock = tonode->inputs.first; sock; sock = sock->next)
+                       if (sock == tosock)
                                break;
                if (sock)
-                       to= 1; /* OK */
+                       to = 1;  /* OK */
                else {
-                       for (sock= tonode->outputs.first; sock; sock= sock->next)
-                               if (sock==tosock)
+                       for (sock = tonode->outputs.first; sock; sock = sock->next)
+                               if (sock == tosock)
                                        break;
                        if (sock)
-                               to= -1; /* OK but flip */
+                               to = -1;  /* OK but flip */
                }
        }
        else {
                /* check tree sockets */
-               for (sock= ntree->outputs.first; sock; sock= sock->next)
-                       if (sock==tosock)
+               for (sock = ntree->outputs.first; sock; sock = sock->next)
+                       if (sock == tosock)
                                break;
                if (sock)
-                       to= 1; /* OK */
+                       to = 1;  /* OK */
                else {
-                       for (sock= ntree->inputs.first; sock; sock= sock->next)
-                               if (sock==tosock)
+                       for (sock = ntree->inputs.first; sock; sock = sock->next)
+                               if (sock == tosock)
                                        break;
                        if (sock)
-                               to= -1; /* OK but flip */
+                               to = -1;  /* OK but flip */
                }
        }
        
        if (from >= 0 && to >= 0) {
-               link= MEM_callocN(sizeof(bNodeLink), "link");
+               link = MEM_callocN(sizeof(bNodeLink), "link");
                BLI_addtail(&ntree->links, link);
-               link->fromnode= fromnode;
-               link->fromsock= fromsock;
-               link->tonode= tonode;
-               link->tosock= tosock;
+               link->fromnode = fromnode;
+               link->fromsock = fromsock;
+               link->tonode = tonode;
+               link->tosock = tosock;
        }
        else if (from <= 0 && to <= 0) {
-               link= MEM_callocN(sizeof(bNodeLink), "link");
+               link = MEM_callocN(sizeof(bNodeLink), "link");
                BLI_addtail(&ntree->links, link);
-               link->fromnode= tonode;
-               link->fromsock= tosock;
-               link->tonode= fromnode;
-               link->tosock= fromsock;
+               link->fromnode = tonode;
+               link->fromsock = tosock;
+               link->tonode = fromnode;
+               link->tosock = fromsock;
        }
        
        ntree->update |= NTREE_UPDATE_LINKS;
@@ -488,7 +488,7 @@ void nodeRemLink(bNodeTree *ntree, bNodeLink *link)
 {
        BLI_remlink(&ntree->links, link);
        if (link->tosock)
-               link->tosock->link= NULL;
+               link->tosock->link = NULL;
        MEM_freeN(link);
        
        ntree->update |= NTREE_UPDATE_LINKS;
@@ -498,9 +498,9 @@ void nodeRemSocketLinks(bNodeTree *ntree, bNodeSocket *sock)
 {
        bNodeLink *link, *next;
        
-       for (link= ntree->links.first; link; link= next) {
-               next= link->next;
-               if (link->fromsock==sock || link->tosock==sock) {
+       for (link = ntree->links.first; link; link = next) {
+               next = link->next;
+               if (link->fromsock == sock || link->tosock == sock) {
                        nodeRemLink(ntree, link);
                }
        }
@@ -519,15 +519,15 @@ void nodeInternalRelink(bNodeTree *ntree, bNode *node)
        intlinks = node->typeinfo->internal_connect(ntree, node);
        
        /* store link pointers in output sockets, for efficient lookup */
-       for (link=intlinks.first; link; link=link->next)
+       for (link = intlinks.first; link; link = link->next)
                link->tosock->link = link;
        
        /* redirect downstream links */
-       for (link=ntree->links.first; link; link=link_next) {
+       for (link = ntree->links.first; link; link = link_next) {
                link_next = link->next;
                
                /* do we have internal link? */
-               if (link->fromnode==node) {
+               if (link->fromnode == node) {
                        if (link->fromsock->link) {
                                /* get the upstream input link */
                                bNodeLink *fromlink = link->fromsock->link->fromsock->link;
@@ -547,10 +547,10 @@ void nodeInternalRelink(bNodeTree *ntree, bNode *node)
        }
        
        /* remove remaining upstream links */
-       for (link=ntree->links.first; link; link=link_next) {
+       for (link = ntree->links.first; link; link = link_next) {
                link_next = link->next;
                
-               if (link->tonode==node)
+               if (link->tonode == node)
                        nodeRemLink(ntree, link);
        }
        
@@ -612,15 +612,15 @@ bNodeTree *ntreeAddTree(const char *name, int type, int nodetype)
        /* trees are created as local trees if they of compositor, material or texture type,
         * node groups and other tree types are created as library data.
         */
-       if (ELEM3(type, NTREE_COMPOSIT, NTREE_SHADER, NTREE_TEXTURE) && nodetype==0) {
-               ntree= MEM_callocN(sizeof(bNodeTree), "new node tree");
-               *( (short *)ntree->id.name )= ID_NT; /* not "type", as that is ntree->type */
-               BLI_strncpy(ntree->id.name+2, name, sizeof(ntree->id.name));
+       if (ELEM3(type, NTREE_COMPOSIT, NTREE_SHADER, NTREE_TEXTURE) && nodetype == 0) {
+               ntree = MEM_callocN(sizeof(bNodeTree), "new node tree");
+               *( (short *)ntree->id.name= ID_NT; /* not "type", as that is ntree->type */
+               BLI_strncpy(ntree->id.name + 2, name, sizeof(ntree->id.name));
        }
        else
-               ntree= BKE_libblock_alloc(&G.main->nodetree, ID_NT, name);
+               ntree = BKE_libblock_alloc(&G.main->nodetree, ID_NT, name);
        
-       ntree->type= type;
+       ntree->type = type;
        ntree->nodetype = nodetype;
        
        ntreeInitTypes(ntree);
@@ -648,53 +648,53 @@ static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, const short do_make_e
        bNodeLink *link;
        bNodeSocket *gsock, *oldgsock;
        
-       if (ntree==NULL) return NULL;
+       if (ntree == NULL) return NULL;
        
        /* is ntree part of library? */
-       for (newtree=G.main->nodetree.first; newtree; newtree= newtree->id.next)
-               if (newtree==ntree) break;
+       for (newtree = G.main->nodetree.first; newtree; newtree = newtree->id.next)
+               if (newtree == ntree) break;
        if (newtree) {
-               newtree= BKE_libblock_copy(&ntree->id);
+               newtree = BKE_libblock_copy(&ntree->id);
        }
        else {
-               newtree= MEM_dupallocN(ntree);
+               newtree = MEM_dupallocN(ntree);
                BKE_libblock_copy_data(&newtree->id, &ntree->id, TRUE); /* copy animdata and ID props */
        }
 
        id_us_plus((ID *)newtree->gpd);
 
        /* in case a running nodetree is copied */
-       newtree->execdata= NULL;
+       newtree->execdata = NULL;
        
-       newtree->nodes.first= newtree->nodes.last= NULL;
-       newtree->links.first= newtree->links.last= NULL;
+       newtree->nodes.first = newtree->nodes.last = NULL;
+       newtree->links.first = newtree->links.last = NULL;
        
        last = ntree->nodes.last;
-       for (node= ntree->nodes.first; node; node= node->next) {
+       for (node = ntree->nodes.first; node; node = node->next) {
 
                if (do_make_extern) {
                        id_lib_extern(node->id);
                }
 
-               node->new_node= NULL;
-               /* nnode= */ nodeCopyNode(newtree, node);       /* sets node->new */
+               node->new_node = NULL;
+               /* nnode= */ nodeCopyNode(newtree, node);   /* sets node->new */
                
                /* make sure we don't copy new nodes again! */
-               if (node==last)
+               if (node == last)
                        break;
        }
        
        /* socket definition for group usage */
        BLI_duplicatelist(&newtree->inputs, &ntree->inputs);
-       for (gsock= newtree->inputs.first, oldgsock= ntree->inputs.first; gsock; gsock=gsock->next, oldgsock=oldgsock->next) {
-               oldgsock->new_sock= gsock;
+       for (gsock = newtree->inputs.first, oldgsock = ntree->inputs.first; gsock; gsock = gsock->next, oldgsock = oldgsock->next) {
+               oldgsock->new_sock = gsock;
                gsock->groupsock = (oldgsock->groupsock ? oldgsock->groupsock->new_sock : NULL);
                gsock->default_value = node_socket_make_default_value(oldgsock->type);
                node_socket_copy_default_value(oldgsock->type, gsock->default_value, oldgsock->default_value);
        }
        BLI_duplicatelist(&newtree->outputs, &ntree->outputs);
-       for (gsock= newtree->outputs.first, oldgsock= ntree->outputs.first; gsock; gsock=gsock->next, oldgsock=oldgsock->next) {
-               oldgsock->new_sock= gsock;
+       for (gsock = newtree->outputs.first, oldgsock = ntree->outputs.first; gsock; gsock = gsock->next, oldgsock = oldgsock->next) {
+               oldgsock->new_sock = gsock;
                gsock->groupsock = (oldgsock->groupsock ? oldgsock->groupsock->new_sock : NULL);
                gsock->default_value = node_socket_make_default_value(oldgsock->type);
                node_socket_copy_default_value(oldgsock->type, gsock->default_value, oldgsock->default_value);
@@ -702,7 +702,7 @@ static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, const short do_make_e
        
        /* copy links */
        BLI_duplicatelist(&newtree->links, &ntree->links);
-       for (link= newtree->links.first; link; link= link->next) {
+       for (link = newtree->links.first; link; link = link->next) {
                link->fromnode = (link->fromnode ? link->fromnode->new_node : NULL);
                link->fromsock = (link->fromsock ? link->fromsock->new_sock : NULL);
                link->tonode = (link->tonode ? link->tonode->new_node : NULL);
@@ -713,7 +713,7 @@ static bNodeTree *ntreeCopyTree_internal(bNodeTree *ntree, const short do_make_e
        }
        
        /* update node->parent pointers */
-       for (node=newtree->nodes.first; node; node=node->next) {
+       for (node = newtree->nodes.first; node; node = node->next) {
                if (node->parent)
                        node->parent = node->parent->new_node;
        }
@@ -731,9 +731,9 @@ void ntreeSwitchID(bNodeTree *ntree, ID *id_from, ID *id_to)
 {
        bNode *node;
        /* for scene duplication only */
-       for (node= ntree->nodes.first; node; node= node->next) {
-               if (node->id==id_from) {
-                       node->id= id_to;
+       for (node = ntree->nodes.first; node; node = node->next) {
+               if (node->id == id_from) {
+                       node->id = id_to;
                }
        }
 }
@@ -747,34 +747,34 @@ void nodeFreePreview(bNode *node)
                if (node->preview->rect)
                        MEM_freeN(node->preview->rect);
                MEM_freeN(node->preview);
-               node->preview= NULL;
+               node->preview = NULL;
        }       
 }
 
 static void node_init_preview(bNode *node, int xsize, int ysize)
 {
        
-       if (node->preview==NULL) {
-               node->preview= MEM_callocN(sizeof(bNodePreview), "node preview");
+       if (node->preview == NULL) {
+               node->preview = MEM_callocN(sizeof(bNodePreview), "node preview");
                //              printf("added preview %s\n", node->name);
        }
        
        /* node previews can get added with variable size this way */
-       if (xsize==0 || ysize==0)
+       if (xsize == 0 || ysize == 0)
                return;
        
        /* sanity checks & initialize */
        if (node->preview->rect) {
-               if (node->preview->xsize!=xsize && node->preview->ysize!=ysize) {
+               if (node->preview->xsize != xsize && node->preview->ysize != ysize) {
                        MEM_freeN(node->preview->rect);
-                       node->preview->rect= NULL;
+                       node->preview->rect = NULL;
                }
        }
        
-       if (node->preview->rect==NULL) {
-               node->preview->rect= MEM_callocN(4*xsize + xsize*ysize*sizeof(char)*4, "node preview rect");
-               node->preview->xsize= xsize;
-               node->preview->ysize= ysize;
+       if (node->preview->rect == NULL) {
+               node->preview->rect = MEM_callocN(4 * xsize + xsize * ysize * sizeof(char) * 4, "node preview rect");
+               node->preview->xsize = xsize;
+               node->preview->ysize = ysize;
        }
        /* no clear, makes nicer previews */
 }
@@ -783,13 +783,13 @@ void ntreeInitPreview(bNodeTree *ntree, int xsize, int ysize)
 {
        bNode *node;
        
-       if (ntree==NULL)
+       if (ntree == NULL)
                return;
        
-       for (node= ntree->nodes.first; node; node= node->next) {
-               if (node->typeinfo->flag & NODE_PREVIEW)        /* hrms, check for closed nodes? */
+       for (node = ntree->nodes.first; node; node = node->next) {
+               if (node->typeinfo->flag & NODE_PREVIEW)    /* hrms, check for closed nodes? */
                        node_init_preview(node, xsize, ysize);
-               if (node->type==NODE_GROUP && (node->flag & NODE_GROUP_EDIT))
+               if (node->type == NODE_GROUP && (node->flag & NODE_GROUP_EDIT))
                        ntreeInitPreview((bNodeTree *)node->id, xsize, ysize);
        }               
 }
@@ -805,13 +805,13 @@ void ntreeClearPreview(bNodeTree *ntree)
 {
        bNode *node;
        
-       if (ntree==NULL)
+       if (ntree == NULL)
                return;
        
-       for (node= ntree->nodes.first; node; node= node->next) {
+       for (node = ntree->nodes.first; node; node = node->next) {
                if (node->typeinfo->flag & NODE_PREVIEW)
                        nodeClearPreview(node);
-               if (node->type==NODE_GROUP && (node->flag & NODE_GROUP_EDIT))
+               if (node->type == NODE_GROUP && (node->flag & NODE_GROUP_EDIT))
                        ntreeClearPreview((bNodeTree *)node->id);
        }               
 }
@@ -821,11 +821,11 @@ void ntreeClearPreview(bNodeTree *ntree)
  * add the color once. Preview gets cleared before it starts render though */
 void nodeAddToPreview(bNode *node, float col[4], int x, int y, int do_manage)
 {
-       bNodePreview *preview= node->preview;
+       bNodePreview *preview = node->preview;
        if (preview) {
-               if (x>=0 && y>=0) {
-                       if (x<preview->xsize && y<preview->ysize) {
-                               unsigned char *tar= preview->rect+ 4*((preview->xsize*y) + x);
+               if (x >= 0 && y >= 0) {
+                       if (x < preview->xsize && y < preview->ysize) {
+                               unsigned char *tar = preview->rect + 4 * ((preview->xsize * y) + x);
                                
                                if (do_manage) {
                                        linearrgb_to_srgb_uchar4(tar, col);
@@ -849,22 +849,22 @@ void nodeUnlinkNode(bNodeTree *ntree, bNode *node)
        bNodeSocket *sock;
        ListBase *lb;
        
-       for (link= ntree->links.first; link; link= next) {
-               next= link->next;
+       for (link = ntree->links.first; link; link = next) {
+               next = link->next;
                
-               if (link->fromnode==node) {
-                       lb= &node->outputs;
+               if (link->fromnode == node) {
+                       lb = &node->outputs;
                        if (link->tonode)
                                link->tonode->update |= NODE_UPDATE;
                }
-               else if (link->tonode==node)
-                       lb= &node->inputs;
+               else if (link->tonode == node)
+                       lb = &node->inputs;
                else
-                       lb= NULL;
+                       lb = NULL;
 
                if (lb) {
-                       for (sock= lb->first; sock; sock= sock->next) {
-                               if (link->fromsock==sock || link->tosock==sock)
+                       for (sock = lb->first; sock; sock = sock->next) {
+                               if (link->fromsock == sock || link->tosock == sock)
                                        break;
                        }
                        if (sock) {
@@ -877,7 +877,7 @@ void nodeUnlinkNode(bNodeTree *ntree, bNode *node)
 static void node_unlink_attached(bNodeTree *ntree, bNode *parent)
 {
        bNode *node;
-       for (node=ntree->nodes.first; node; node=node->next) {
+       for (node = ntree->nodes.first; node; node = node->next) {
                if (node->parent == parent)
                        nodeDetachNode(node);
        }
@@ -885,7 +885,7 @@ static void node_unlink_attached(bNodeTree *ntree, bNode *parent)
 
 void nodeFreeNode(bNodeTree *ntree, bNode *node)
 {
-       bNodeTreeType *treetype= ntreeGetType(ntree->type);
+       bNodeTreeType *treetype = ntreeGetType(ntree->type);
        bNodeSocket *sock, *nextsock;
        
        /* remove all references to this node */
@@ -902,12 +902,12 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node)
        if (node->typeinfo && node->typeinfo->freestoragefunc)
                node->typeinfo->freestoragefunc(node);
        
-       for (sock=node->inputs.first; sock; sock = nextsock) {
+       for (sock = node->inputs.first; sock; sock = nextsock) {
                nextsock = sock->next;
                node_socket_free_default_value(sock->type, sock->default_value);
                MEM_freeN(sock);
        }
-       for (sock=node->outputs.first; sock; sock = nextsock) {
+       for (sock = node->outputs.first; sock; sock = nextsock) {
                nextsock = sock->next;
                node_socket_free_default_value(sock->type, sock->default_value);
                MEM_freeN(sock);
@@ -926,7 +926,7 @@ void ntreeFreeTree(bNodeTree *ntree)
        bNode *node, *next;
        bNodeSocket *sock;
        
-       if (ntree==NULL) return;
+       if (ntree == NULL) return;
        
        /* XXX hack! node trees should not store execution graphs at all.
         * This should be removed when old tree types no longer require it.
@@ -935,15 +935,15 @@ void ntreeFreeTree(bNodeTree *ntree)
         */
        if (ntree->execdata) {
                switch (ntree->type) {
-               case NTREE_COMPOSIT:
-                       ntreeCompositEndExecTree(ntree->execdata, 1);
-                       break;
-               case NTREE_SHADER:
-                       ntreeShaderEndExecTree(ntree->execdata, 1);
-                       break;
-               case NTREE_TEXTURE:
-                       ntreeTexEndExecTree(ntree->execdata, 1);
-                       break;
+                       case NTREE_COMPOSIT:
+                               ntreeCompositEndExecTree(ntree->execdata, 1);
+                               break;
+                       case NTREE_SHADER:
+                               ntreeShaderEndExecTree(ntree->execdata, 1);
+                               break;
+                       case NTREE_TEXTURE:
+                               ntreeTexEndExecTree(ntree->execdata, 1);
+                               break;
                }
        }
        
@@ -951,17 +951,17 @@ void ntreeFreeTree(bNodeTree *ntree)
        
        id_us_min((ID *)ntree->gpd);
 
-       BLI_freelistN(&ntree->links);   /* do first, then unlink_node goes fast */
+       BLI_freelistN(&ntree->links);   /* do first, then unlink_node goes fast */
        
-       for (node= ntree->nodes.first; node; node= next) {
-               next= node->next;
+       for (node = ntree->nodes.first; node; node = next) {
+               next = node->next;
                nodeFreeNode(ntree, node);
        }
        
-       for (sock=ntree->inputs.first; sock; sock=sock->next)
+       for (sock = ntree->inputs.first; sock; sock = sock->next)
                node_socket_free_default_value(sock->type, sock->default_value);
        BLI_freelistN(&ntree->inputs);
-       for (sock=ntree->outputs.first; sock; sock=sock->next)
+       for (sock = ntree->outputs.first; sock; sock = sock->next)
                node_socket_free_default_value(sock->type, sock->default_value);
        BLI_freelistN(&ntree->outputs);
 }
@@ -970,9 +970,9 @@ void ntreeFreeCache(bNodeTree *ntree)
 {
        bNodeTreeType *treetype;
        
-       if (ntree==NULL) return;
+       if (ntree == NULL) return;
        
-       treetype= ntreeGetType(ntree->type);
+       treetype = ntreeGetType(ntree->type);
        if (treetype->free_cache)
                treetype->free_cache(ntree);
 }
@@ -982,45 +982,46 @@ void ntreeSetOutput(bNodeTree *ntree)
        bNode *node;
 
        /* find the active outputs, might become tree type dependent handler */
-       for (node= ntree->nodes.first; node; node= node->next) {
-               if (node->typeinfo->nclass==NODE_CLASS_OUTPUT) {
+       for (node = ntree->nodes.first; node; node = node->next) {
+               if (node->typeinfo->nclass == NODE_CLASS_OUTPUT) {
                        bNode *tnode;
-                       int output= 0;
+                       int output = 0;
                        
                        /* we need a check for which output node should be tagged like this, below an exception */
-                       if (node->type==CMP_NODE_OUTPUT_FILE)
+                       if (node->type == CMP_NODE_OUTPUT_FILE)
                                continue;
 
                        /* there is more types having output class, each one is checked */
-                       for (tnode= ntree->nodes.first; tnode; tnode= tnode->next) {
-                               if (tnode->typeinfo->nclass==NODE_CLASS_OUTPUT) {
+                       for (tnode = ntree->nodes.first; tnode; tnode = tnode->next) {
+                               if (tnode->typeinfo->nclass == NODE_CLASS_OUTPUT) {
                                        
-                                       if (ntree->type==NTREE_COMPOSIT) {
+                                       if (ntree->type == NTREE_COMPOSIT) {
                                                        
                                                /* same type, exception for viewer */
-                                               if (tnode->type==node->type ||
-                                                  (ELEM(tnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER) &&
-                                                       ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER))) {
+                                               if (tnode->type == node->type ||
+                                                   (ELEM(tnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER) &&
+                                                    ELEM(node->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)))
+                                               {
                                                        if (tnode->flag & NODE_DO_OUTPUT) {
                                                                output++;
-                                                               if (output>1)
+                                                               if (output > 1)
                                                                        tnode->flag &= ~NODE_DO_OUTPUT;
                                                        }
                                                }
                                        }
                                        else {
                                                /* same type */
-                                               if (tnode->type==node->type) {
+                                               if (tnode->type == node->type) {
                                                        if (tnode->flag & NODE_DO_OUTPUT) {
                                                                output++;
-                                                               if (output>1)
+                                                               if (output > 1)
                                                                        tnode->flag &= ~NODE_DO_OUTPUT;
                                                        }
                                                }
                                        }
                                }
                        }
-                       if (output==0)
+                       if (output == 0)
                                node->flag |= NODE_DO_OUTPUT;
                }
        }
@@ -1037,28 +1038,32 @@ typedef struct MakeLocalCallData {
 
 static void ntreeMakeLocal_CheckLocal(void *calldata, ID *owner_id, bNodeTree *ntree)
 {
-       MakeLocalCallData *cd= (MakeLocalCallData*)calldata;
+       MakeLocalCallData *cd = (MakeLocalCallData *)calldata;
        bNode *node;
        
        /* find if group is in tree */
-       for (node= ntree->nodes.first; node; node= node->next) {
+       for (node = ntree->nodes.first; node; node = node->next) {
                if (node->id == cd->group_id) {
-                       if (owner_id->lib) cd->lib= 1;
-                       else cd->local= 1;
+                       if (owner_id->lib) {
+                               cd->lib = TRUE;
+                       }
+                       else {
+                               cd->local = TRUE;
+                       }
                }
        }
 }
 
 static void ntreeMakeLocal_LinkNew(void *calldata, ID *owner_id, bNodeTree *ntree)
 {
-       MakeLocalCallData *cd= (MakeLocalCallData*)calldata;
+       MakeLocalCallData *cd = (MakeLocalCallData *)calldata;
        bNode *node;
        
        /* find if group is in tree */
-       for (node= ntree->nodes.first; node; node= node->next) {
+       for (node = ntree->nodes.first; node; node = node->next) {
                if (node->id == cd->group_id) {
-                       if (owner_id->lib==NULL) {
-                               node->id= cd->new_id;
+                       if (owner_id->lib == NULL) {
+                               node->id = cd->new_id;
                                cd->new_id->us++;
                                cd->group_id->us--;
                        }
@@ -1068,8 +1073,8 @@ static void ntreeMakeLocal_LinkNew(void *calldata, ID *owner_id, bNodeTree *ntre
 
 void ntreeMakeLocal(bNodeTree *ntree)
 {
-       Main *bmain= G.main;
-       bNodeTreeType *treetype= ntreeGetType(ntree->type);
+       Main *bmain = G.main;
+       bNodeTreeType *treetype = ntreeGetType(ntree->type);
        MakeLocalCallData cd;
        
        /* - only lib users: do nothing
@@ -1077,8 +1082,8 @@ void ntreeMakeLocal(bNodeTree *ntree)
         * - mixed: make copy
         */
        
-       if (ntree->id.lib==NULL) return;
-       if (ntree->id.us==1) {
+       if (ntree->id.lib == NULL) return;
+       if (ntree->id.us == 1) {
                id_clear_lib_data(bmain, (ID *)ntree);
                return;
        }
@@ -1092,14 +1097,14 @@ void ntreeMakeLocal(bNodeTree *ntree)
        treetype->foreach_nodetree(G.main, &cd, &ntreeMakeLocal_CheckLocal);
        
        /* if all users are local, we simply make tree local */
-       if (cd.local && cd.lib==0) {
+       if (cd.local && cd.lib == 0) {
                id_clear_lib_data(bmain, (ID *)ntree);
        }
        else if (cd.local && cd.lib) {
                /* this is the mixed case, we copy the tree and assign it to local users */
-               bNodeTree *newtree= ntreeCopyTree(ntree);
+               bNodeTree *newtree = ntreeCopyTree(ntree);
                
-               newtree->id.us= 0;
+               newtree->id.us = 0;
                
 
                cd.new_id = &newtree->id;
@@ -1109,18 +1114,18 @@ void ntreeMakeLocal(bNodeTree *ntree)
 
 int ntreeNodeExists(bNodeTree *ntree, bNode *testnode)
 {
-       bNode *node= ntree->nodes.first;
-       for (; node; node= node->next)
-               if (node==testnode)
+       bNode *node = ntree->nodes.first;
+       for (; node; node = node->next)
+               if (node == testnode)
                        return 1;
        return 0;
 }
 
 int ntreeOutputExists(bNode *node, bNodeSocket *testsock)
 {
-       bNodeSocket *sock= node->outputs.first;
-       for (; sock; sock= sock->next)
-               if (sock==testsock)
+       bNodeSocket *sock = node->outputs.first;
+       for (; sock; sock = sock->next)
+               if (sock == testsock)
                        return 1;
        return 0;
 }
@@ -1128,33 +1133,33 @@ int ntreeOutputExists(bNode *node, bNodeSocket *testsock)
 /* returns localized tree for execution in threads */
 bNodeTree *ntreeLocalize(bNodeTree *ntree)
 {
-       bNodeTreeType *ntreetype= ntreeGetType(ntree->type);
+       bNodeTreeType *ntreetype = ntreeGetType(ntree->type);
 
        bNodeTree *ltree;
        bNode *node;
        
-       bAction *action_backup= NULL, *tmpact_backup= NULL;
+       bAction *action_backup = NULL, *tmpact_backup = NULL;
        
        /* Workaround for copying an action on each render!
         * set action to NULL so animdata actions don't get copied */
-       AnimData *adt= BKE_animdata_from_id(&ntree->id);
+       AnimData *adt = BKE_animdata_from_id(&ntree->id);
 
        if (adt) {
-               action_backup= adt->action;
-               tmpact_backup= adt->tmpact;
+               action_backup = adt->action;
+               tmpact_backup = adt->tmpact;
 
-               adt->action= NULL;
-               adt->tmpact= NULL;
+               adt->action = NULL;
+               adt->tmpact = NULL;
        }
 
        /* node copy func */
        ltree = ntreeCopyTree_internal(ntree, FALSE);
 
        if (adt) {
-               AnimData *ladt= BKE_animdata_from_id(&ltree->id);
+               AnimData *ladt = BKE_animdata_from_id(&ltree->id);
 
-               adt->action= ladt->action= action_backup;
-               adt->tmpact= ladt->tmpact= tmpact_backup;
+               adt->action = ladt->action = action_backup;
+               adt->tmpact = ladt->tmpact = tmpact_backup;
 
                if (action_backup) action_backup->id.us++;
                if (tmpact_backup) tmpact_backup->id.us++;
@@ -1165,9 +1170,9 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
        /* ensures only a single output node is enabled */
        ntreeSetOutput(ntree);
 
-       for (node= ntree->nodes.first; node; node= node->next) {
+       for (node = ntree->nodes.first; node; node = node->next) {
                /* store new_node pointer to original */
-               node->new_node->new_node= node;
+               node->new_node->new_node = node;
        }
 
        if (ntreetype->localize)
@@ -1181,7 +1186,7 @@ bNodeTree *ntreeLocalize(bNodeTree *ntree)
 /* is called by jobs manager, outside threads, so it doesnt happen during draw */
 void ntreeLocalSync(bNodeTree *localtree, bNodeTree *ntree)
 {
-       bNodeTreeType *ntreetype= ntreeGetType(ntree->type);
+       bNodeTreeType *ntreetype = ntreeGetType(ntree->type);
 
        if (ntreetype->local_sync)
                ntreetype->local_sync(localtree, ntree);
@@ -1191,16 +1196,16 @@ void ntreeLocalSync(bNodeTree *localtree, bNodeTree *ntree)
 /* we have to assume the editor already changed completely */
 void ntreeLocalMerge(bNodeTree *localtree, bNodeTree *ntree)
 {
-       bNodeTreeType *ntreetype= ntreeGetType(ntree->type);
+       bNodeTreeType *ntreetype = ntreeGetType(ntree->type);
        bNode *lnode;
        
        /* move over the compbufs and previews */
-       for (lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
+       for (lnode = localtree->nodes.first; lnode; lnode = lnode->next) {
                if (ntreeNodeExists(ntree, lnode->new_node)) {
                        if (lnode->preview && lnode->preview->rect) {
                                nodeFreePreview(lnode->new_node);
-                               lnode->new_node->preview= lnode->preview;
-                               lnode->preview= NULL;
+                               lnode->new_node->preview = lnode->preview;
+                               lnode->preview = NULL;
                        }
                }
        }
@@ -1219,7 +1224,7 @@ int ntreeHasType(bNodeTree *ntree, int type)
        bNode *node;
        
        if (ntree)
-               for (node= ntree->nodes.first; node; node= node->next)
+               for (node = ntree->nodes.first; node; node = node->next)
                        if (node->type == type)
                                return 1;
        return 0;
@@ -1229,10 +1234,10 @@ bNodeLink *nodeFindLink(bNodeTree *ntree, bNodeSocket *from, bNodeSocket *to)
 {
        bNodeLink *link;
        
-       for (link= ntree->links.first; link; link= link->next) {
-               if (link->fromsock==from && link->tosock==to)
+       for (link = ntree->links.first; link; link = link->next) {
+               if (link->fromsock == from && link->tosock == to)
                        return link;
-               if (link->fromsock==to && link->tosock==from)   /* hrms? */
+               if (link->fromsock == to && link->tosock == from) /* hrms? */
                        return link;
        }
        return NULL;
@@ -1241,10 +1246,10 @@ bNodeLink *nodeFindLink(bNodeTree *ntree, bNodeSocket *from, bNodeSocket *to)
 int nodeCountSocketLinks(bNodeTree *ntree, bNodeSocket *sock)
 {
        bNodeLink *link;
-       int tot= 0;
+       int tot = 0;
        
-       for (link= ntree->links.first; link; link= link->next) {
-               if (link->fromsock==sock || link->tosock==sock)
+       for (link = ntree->links.first; link; link = link->next) {
+               if (link->fromsock == sock || link->tosock == sock)
                        tot++;
        }
        return tot;
@@ -1254,9 +1259,9 @@ bNode *nodeGetActive(bNodeTree *ntree)
 {
        bNode *node;
        
-       if (ntree==NULL) return NULL;
+       if (ntree == NULL) return NULL;
        
-       for (node= ntree->nodes.first; node; node= node->next)
+       for (node = ntree->nodes.first; node; node = node->next)
                if (node->flag & NODE_ACTIVE)
                        break;
        return node;
@@ -1267,19 +1272,19 @@ bNode *nodeGetActiveID(bNodeTree *ntree, short idtype)
 {
        bNode *node;
        
-       if (ntree==NULL) return NULL;
+       if (ntree == NULL) return NULL;
 
        /* check for group edit */
-       for (node= ntree->nodes.first; node; node= node->next)
+       for (node = ntree->nodes.first; node; node = node->next)
                if (node->flag & NODE_GROUP_EDIT)
                        break;
 
        if (node)
-               ntree= (bNodeTree*)node->id;
+               ntree = (bNodeTree *)node->id;
        
        /* now find active node with this id */
-       for (node= ntree->nodes.first; node; node= node->next)
-               if (node->id && GS(node->id->name)==idtype)
+       for (node = ntree->nodes.first; node; node = node->next)
+               if (node->id && GS(node->id->name) == idtype)
                        if (node->flag & NODE_ACTIVE_ID)
                                break;
 
@@ -1289,24 +1294,24 @@ bNode *nodeGetActiveID(bNodeTree *ntree, short idtype)
 int nodeSetActiveID(bNodeTree *ntree, short idtype, ID *id)
 {
        bNode *node;
-       int ok= FALSE;
+       int ok = FALSE;
 
-       if (ntree==NULL) return ok;
+       if (ntree == NULL) return ok;
 
        /* check for group edit */
-       for (node= ntree->nodes.first; node; node= node->next)
+       for (node = ntree->nodes.first; node; node = node->next)
                if (node->flag & NODE_GROUP_EDIT)
                        break;
 
        if (node)
-               ntree= (bNodeTree*)node->id;
+               ntree = (bNodeTree *)node->id;
 
        /* now find active node with this id */
-       for (node= ntree->nodes.first; node; node= node->next) {
-               if (node->id && GS(node->id->name)==idtype) {
-                       if (id && ok==FALSE && node->id==id) {
+       for (node = ntree->nodes.first; node; node = node->next) {
+               if (node->id && GS(node->id->name) == idtype) {
+                       if (id && ok == FALSE && node->id == id) {
                                node->flag |= NODE_ACTIVE_ID;
-                               ok= TRUE;
+                               ok = TRUE;
                        }
                        else {
                                node->flag &= ~NODE_ACTIVE_ID;
@@ -1323,10 +1328,10 @@ void nodeClearActiveID(bNodeTree *ntree, short idtype)
 {
        bNode *node;
        
-       if (ntree==NULL) return;
+       if (ntree == NULL) return;
        
-       for (node= ntree->nodes.first; node; node= node->next)
-               if (node->id && GS(node->id->name)==idtype)
+       for (node = ntree->nodes.first; node; node = node->next)
+               if (node->id && GS(node->id->name) == idtype)
                        node->flag &= ~NODE_ACTIVE_ID;
 }
 
@@ -1334,9 +1339,9 @@ void nodeClearActive(bNodeTree *ntree)
 {
        bNode *node;
 
-       if (ntree==NULL) return;
+       if (ntree == NULL) return;
 
-       for (node= ntree->nodes.first; node; node= node->next)
+       for (node = ntree->nodes.first; node; node = node->next)
                node->flag &= ~(NODE_ACTIVE | NODE_ACTIVE_ID);
 }
 
@@ -1347,7 +1352,7 @@ void nodeSetActive(bNodeTree *ntree, bNode *node)
        bNode *tnode;
        
        /* make sure only one node is active, and only one per ID type */
-       for (tnode= ntree->nodes.first; tnode; tnode= tnode->next) {
+       for (tnode = ntree->nodes.first; tnode; tnode = tnode->next) {
                tnode->flag &= ~NODE_ACTIVE;
                
                if (node->id && tnode->id) {
@@ -1395,12 +1400,12 @@ static int node_get_deplist_recurs(bNode *node, bNode ***nsort)
        node->done = TRUE;
        
        /* check linked nodes */
-       for (sock= node->inputs.first; sock; sock= sock->next) {
+       for (sock = node->inputs.first; sock; sock = sock->next) {
                if (sock->link) {
-                       fromnode= sock->link->fromnode;
+                       fromnode = sock->link->fromnode;
                        if (fromnode) {
-                               if (fromnode->done==0)
-                                       fromnode->level= node_get_deplist_recurs(fromnode, nsort);
+                               if (fromnode->done == 0)
+                                       fromnode->level = node_get_deplist_recurs(fromnode, nsort);
                                if (fromnode->level <= level)
                                        level = fromnode->level - 1;
                        }
@@ -1409,14 +1414,14 @@ static int node_get_deplist_recurs(bNode *node, bNode ***nsort)
        
        /* check parent node */
        if (node->parent) {
-               if (node->parent->done==0)
-                       node->parent->level= node_get_deplist_recurs(node->parent, nsort);
+               if (node->parent->done == 0)
+                       node->parent->level = node_get_deplist_recurs(node->parent, nsort);
                if (node->parent->level <= level)
                        level = node->parent->level - 1;
        }
        
        if (nsort) {
-               **nsort= node;
+               **nsort = node;
                (*nsort)++;
        }
        
@@ -1427,24 +1432,24 @@ void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, in
 {
        bNode *node, **nsort;
        
-       *totnodes=0;
+       *totnodes = 0;
        
        /* first clear data */
-       for (node= ntree->nodes.first; node; node= node->next) {
+       for (node = ntree->nodes.first; node; node = node->next) {
                node->done = FALSE;
                (*totnodes)++;
        }
-       if (*totnodes==0) {
+       if (*totnodes == 0) {
                *deplist = NULL;
                return;
        }
        
-       nsort= *deplist= MEM_callocN((*totnodes)*sizeof(bNode*), "sorted node array");
+       nsort = *deplist = MEM_callocN((*totnodes) * sizeof(bNode *), "sorted node array");
        
        /* recursive check */
-       for (node= ntree->nodes.first; node; node= node->next) {
-               if (node->done==0) {
-                       node->level= node_get_deplist_recurs(node, &nsort);
+       for (node = ntree->nodes.first; node; node = node->next) {
+               if (node->done == 0) {
+                       node->level = node_get_deplist_recurs(node, &nsort);
                }
        }
 }
@@ -1455,14 +1460,14 @@ static void ntree_update_node_level(bNodeTree *ntree)
        bNode *node;
        
        /* first clear tag */
-       for (node= ntree->nodes.first; node; node= node->next) {
+       for (node = ntree->nodes.first; node; node = node->next) {
                node->done = FALSE;
        }
        
        /* recursive check */
-       for (node= ntree->nodes.first; node; node= node->next) {
-               if (node->done==0) {
-                       node->level= node_get_deplist_recurs(node, NULL);
+       for (node = ntree->nodes.first; node; node = node->next) {
+               if (node->done == 0) {
+                       node->level = node_get_deplist_recurs(node, NULL);
                }
        }
 }
@@ -1474,25 +1479,25 @@ static void ntree_update_link_pointers(bNodeTree *ntree)
        bNodeLink *link;
        
        /* first clear data */
-       for (node= ntree->nodes.first; node; node= node->next) {
-               for (sock= node->inputs.first; sock; sock= sock->next) {
-                       sock->link= NULL;
+       for (node = ntree->nodes.first; node; node = node->next) {
+               for (sock = node->inputs.first; sock; sock = sock->next) {
+                       sock->link = NULL;
                        sock->flag &= ~SOCK_IN_USE;
                }
-               for (sock= node->outputs.first; sock; sock= sock->next) {
+               for (sock = node->outputs.first; sock; sock = sock->next) {
                        sock->flag &= ~SOCK_IN_USE;
                }
        }
-       for (sock= ntree->inputs.first; sock; sock= sock->next) {
+       for (sock = ntree->inputs.first; sock; sock = sock->next) {
                sock->flag &= ~SOCK_IN_USE;
        }
-       for (sock= ntree->outputs.first; sock; sock= sock->next) {
-               sock->link= NULL;
+       for (sock = ntree->outputs.first; sock; sock = sock->next) {
+               sock->link = NULL;
                sock->flag &= ~SOCK_IN_USE;
        }
 
-       for (link= ntree->links.first; link; link= link->next) {
-               link->tosock->link= link;
+       for (link = ntree->links.first; link; link = link->next) {
+               link->tosock->link = link;
                
                link->fromsock->flag |= SOCK_IN_USE;
                link->tosock->flag |= SOCK_IN_USE;
@@ -1517,10 +1522,10 @@ static void ntree_validate_links(bNodeTree *ntree)
 
 static void ntree_verify_nodes_cb(void *calldata, struct ID *UNUSED(owner_id), struct bNodeTree *ntree)
 {
-       ID *id= (ID*)calldata;
+       ID *id = (ID *)calldata;
        bNode *node;
        
-       for (node=ntree->nodes.first; node; node=node->next)
+       for (node = ntree->nodes.first; node; node = node->next)
                if (node->typeinfo->verifyfunc)
                        node->typeinfo->verifyfunc(ntree, node, id);
 }
@@ -1531,21 +1536,21 @@ void ntreeVerifyNodes(struct Main *main, struct ID *id)
        bNodeTree *ntree;
        int n;
        
-       for (n=0; n < NUM_NTREE_TYPES; ++n) {
-               ntreetype= ntreeGetType(n);
+       for (n = 0; n < NUM_NTREE_TYPES; ++n) {
+               ntreetype = ntreeGetType(n);
                if (ntreetype && ntreetype->foreach_nodetree)
                        ntreetype->foreach_nodetree(main, id, ntree_verify_nodes_cb);
        }
-       for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
+       for (ntree = main->nodetree.first; ntree; ntree = ntree->id.next)
                ntree_verify_nodes_cb(id, NULL, ntree);
 }
 
 void ntreeUpdateTree(bNodeTree *ntree)
 {
-       bNodeTreeType *ntreetype= ntreeGetType(ntree->type);
+       bNodeTreeType *ntreetype = ntreeGetType(ntree->type);
        bNode *node;
        
-       if (ntree->update & (NTREE_UPDATE_LINKS|NTREE_UPDATE_NODES)) {
+       if (ntree->update & (NTREE_UPDATE_LINKS | NTREE_UPDATE_NODES)) {
                /* set the bNodeSocket->link pointers */
                ntree_update_link_pointers(ntree);
                
@@ -1554,7 +1559,7 @@ void ntreeUpdateTree(bNodeTree *ntree)
        }
        
        /* update individual nodes */
-       for (node=ntree->nodes.first; node; node=node->next) {
+       for (node = ntree->nodes.first; node; node = node->next) {
                /* node tree update tags override individual node update flags */
                if ((node->update & NODE_UPDATE) || (ntree->update & NTREE_UPDATE)) {
                        if (ntreetype->update_node)
@@ -1567,7 +1572,7 @@ void ntreeUpdateTree(bNodeTree *ntree)
        }
        
        /* check link validity */
-       if (ntree->update & (NTREE_UPDATE_LINKS|NTREE_UPDATE_NODES))
+       if (ntree->update & (NTREE_UPDATE_LINKS | NTREE_UPDATE_NODES))
                ntree_validate_links(ntree);
        
        /* generic tree update callback */
@@ -1577,7 +1582,7 @@ void ntreeUpdateTree(bNodeTree *ntree)
                /* Trees can be associated with a specific node type (i.e. group nodes),
                 * in that case a tree update function may be defined by that node type.
                 */
-               bNodeType *ntype= node_get_type(ntree, ntree->nodetype);
+               bNodeType *ntype = node_get_type(ntree, ntree->nodetype);
                if (ntype && ntype->updatetreefunc)
                        ntype->updatetreefunc(ntree);
        }
@@ -1591,7 +1596,7 @@ void ntreeUpdateTree(bNodeTree *ntree)
 
 void nodeUpdate(bNodeTree *ntree, bNode *node)
 {
-       bNodeTreeType *ntreetype= ntreeGetType(ntree->type);
+       bNodeTreeType *ntreetype = ntreeGetType(ntree->type);
        
        if (ntreetype->update_node)
                ntreetype->update_node(ntree, node);
@@ -1613,8 +1618,8 @@ int nodeUpdateID(bNodeTree *ntree, ID *id)
        ntreetype = ntreeGetType(ntree->type);
        
        if (ntreetype->update_node) {
-               for (node= ntree->nodes.first; node; node= node->next) {
-                       if (node->id==id) {
+               for (node = ntree->nodes.first; node; node = node->next) {
+                       if (node->id == id) {
                                change = TRUE;
                                node->update |= NODE_UPDATE_ID;
                                ntreetype->update_node(ntree, node);
@@ -1624,8 +1629,8 @@ int nodeUpdateID(bNodeTree *ntree, ID *id)
                }
        }
        else {
-               for (node= ntree->nodes.first; node; node= node->next) {
-                       if (node->id==id) {
+               for (node = ntree->nodes.first; node; node = node->next) {
+                       if (node->id == id) {
                                change = TRUE;
                                node->update |= NODE_UPDATE_ID;
                                if (node->typeinfo->updatefunc)
@@ -1644,7 +1649,7 @@ int nodeUpdateID(bNodeTree *ntree, ID *id)
 
 int nodeValid(bNodeTree *ntree, bNodeTemplate *ntemp)
 {
-       bNodeType *ntype= node_get_type(ntree, ntemp->type);
+       bNodeType *ntype = node_get_type(ntree, ntemp->type);
        if (ntype) {
                if (ntype->validfunc)
                        return ntype->validfunc(ntree, ntemp);
@@ -1655,9 +1660,9 @@ int nodeValid(bNodeTree *ntree, bNodeTemplate *ntemp)
                return 0;
 }
 
-const charnodeLabel(bNode *node)
+const char *nodeLabel(bNode *node)
 {
-       if (node->label[0]!='\0')
+       if (node->label[0] != '\0')
                return node->label;
        else if (node->typeinfo->labelfunc)
                return node->typeinfo->labelfunc(node);
@@ -1769,8 +1774,8 @@ void node_type_template(struct bNodeType *ntype, struct bNodeTemplate (*template
 }
 
 void node_type_update(struct bNodeType *ntype,
-                                         void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node),
-                                         void (*verifyfunc)(struct bNodeTree *ntree, struct bNode *node, struct ID *id))
+                      void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node),
+                      void (*verifyfunc)(struct bNodeTree *ntree, struct bNode *node, struct ID *id))
 {
        ntype->updatefunc = updatefunc;
        ntype->verifyfunc = verifyfunc;
@@ -1783,9 +1788,9 @@ void node_type_tree(struct bNodeType *ntype, void (*inittreefunc)(struct bNodeTr
 }
 
 void node_type_group_edit(struct bNodeType *ntype,
-                                                 struct bNodeTree *(*group_edit_get)(struct bNode *node),
-                                                 struct bNodeTree *(*group_edit_set)(struct bNode *node, int edit),
-                                                 void (*group_edit_clear)(struct bNode *node))
+                          struct bNodeTree *(*group_edit_get)(struct bNode *node),
+                          struct bNodeTree *(*group_edit_set)(struct bNode *node, int edit),
+                          void (*group_edit_clear)(struct bNode *node))
 {
        ntype->group_edit_get = group_edit_get;
        ntype->group_edit_set = group_edit_set;
@@ -1798,9 +1803,9 @@ void node_type_exec(struct bNodeType *ntype, void (*execfunc)(void *data, struct
 }
 
 void node_type_exec_new(struct bNodeType *ntype,
-                                               void *(*initexecfunc)(struct bNode *node),
-                                               void (*freeexecfunc)(struct bNode *node, void *nodedata),
-                                               void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **))
+                        void *(*initexecfunc)(struct bNode *node),
+                        void (*freeexecfunc)(struct bNode *node, void *nodedata),
+                        void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **))
 {
        ntype->initexecfunc = initexecfunc;
        ntype->freeexecfunc = freeexecfunc;
@@ -1829,10 +1834,10 @@ void node_type_compatibility(struct bNodeType *ntype, short compatibility)
 
 static bNodeType *is_nodetype_registered(ListBase *typelist, int type) 
 {
-       bNodeType *ntype= typelist->first;
+       bNodeType *ntype = typelist->first;
        
-       for (;ntype; ntype= ntype->next )
-               if (ntype->type==type)
+       for (; ntype; ntype = ntype->next)
+               if (ntype->type == type)
                        return ntype;
        
        return NULL;
@@ -1841,9 +1846,9 @@ static bNodeType *is_nodetype_registered(ListBase *typelist, int type)
 void nodeRegisterType(bNodeTreeType *ttype, bNodeType *ntype) 
 {
        ListBase *typelist = &(ttype->node_types);
-       bNodeType *found= is_nodetype_registered(typelist, ntype->type);
+       bNodeType *found = is_nodetype_registered(typelist, ntype->type);
        
-       if (found==NULL)
+       if (found == NULL)
                BLI_addtail(typelist, ntype);
 }
 
@@ -2070,7 +2075,7 @@ static void registerTextureNodes(bNodeTreeType *ttype)
 static void free_typeinfos(ListBase *list)
 {
        bNodeType *ntype, *next;
-       for (ntype=list->first; ntype; ntype=next) {
+       for (ntype = list->first; ntype; ntype = next) {
                next = ntype->next;
 
                if (ntype->needs_free)
@@ -2102,14 +2107,14 @@ void clear_scene_in_nodes(Main *bmain, Scene *sce)
        Scene *sce1;
        bNode *node;
 
-       for (sce1= bmain->scene.first; sce1; sce1=sce1->id.next) {
-               if (sce1!=sce) {
+       for (sce1 = bmain->scene.first; sce1; sce1 = sce1->id.next) {
+               if (sce1 != sce) {
                        if (sce1->nodetree) {
-                               for (node= sce1->nodetree->nodes.first; node; node= node->next) {
-                                       if (node->type==CMP_NODE_R_LAYERS) {
-                                               Scene *nodesce= (Scene *)node->id;
+                               for (node = sce1->nodetree->nodes.first; node; node = node->next) {
+                                       if (node->type == CMP_NODE_R_LAYERS) {
+                                               Scene *nodesce = (Scene *)node->id;
                                                
-                                               if (nodesce==sce) node->id = NULL;
+                                               if (nodesce == sce) node->id = NULL;
                                        }
                                }
                        }
index 13ea70d652d588f8cc54d0d77454a0ff4b2b6475..66b0cff691e20ff2a96f8c0a6bdf2e85bf52d511 100644 (file)
@@ -834,7 +834,7 @@ void BKE_init_ocean(struct Ocean *o, int M, int N, float Lx, float Lz, float V,
                o->_fft_in_nz = (fftw_complex *) MEM_mallocN(o->_M * (1 + o->_N / 2) * sizeof(fftw_complex), "ocean_fft_in_nz");
 
                o->_N_x = (double *) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_N_x");
-               /*o->_N_y = (float*) fftwf_malloc(o->_M * o->_N * sizeof(float)); (MEM01)*/
+               /* o->_N_y = (float *) fftwf_malloc(o->_M * o->_N * sizeof(float)); (MEM01) */
                o->_N_z = (double *) MEM_mallocN(o->_M * o->_N * sizeof(double), "ocean_N_z");
 
                o->_N_x_plan = fftw_plan_dft_c2r_2d(o->_M, o->_N, o->_fft_in_nx, o->_N_x, FFTW_ESTIMATE);
index a2028ff5fa1e434375a5552dde9259e204e47b05..a0f367961d21ab95414e53b1f39362bcfd9ed001 100644 (file)
@@ -128,7 +128,7 @@ int BKE_frameserver_start(struct Scene *scene, RenderData *UNUSED(rd), int rectx
                return 0;
        }
 
-       setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*) &arg, sizeof(arg));
+       setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &arg, sizeof(arg));
 
        addr.sin_family = AF_INET;
        addr.sin_port = htons(U.frameserverport);
@@ -177,7 +177,7 @@ static char good_bye[] =
 "<body><pre>\n"
 "Render stopped. Goodbye</pre></body></html>";
 
-static int safe_write(char * s, int tosend)
+static int safe_write(char *s, int tosend)
 {
        int total = tosend;
        do {
@@ -192,15 +192,15 @@ static int safe_write(char * s, int tosend)
        return total;
 }
 
-static int safe_puts(char * s)
+static int safe_puts(char *s)
 {
        return safe_write(s, strlen(s));
 }
 
-static int handle_request(RenderData *rd, char * req)
+static int handle_request(RenderData *rd, char *req)
 {
-       char * p;
-       char * path;
+       char *p;
+       char *path;
        int pathlen;
 
        if (memcmp(req, "GET ", 4) != 0) {
@@ -230,22 +230,22 @@ static int handle_request(RenderData *rd, char * req)
                char buf[4096];
 
                sprintf(buf,
-                       "HTTP/1.1 200 OK\r\n"
-                       "Content-Type: text/html\r\n"
-                       "\r\n"
-                       "start %d\n"
-                       "end %d\n"
-                       "width %d\n"
-                       "height %d\n"
-                       "rate %d\n"
-                       "ratescale %d\n",
-                       rd->sfra,
-                       rd->efra,
-                       render_width,
-                       render_height,
-                       rd->frs_sec,
-                       1
-                       );
+                       "HTTP/1.1 200 OK\r\n"
+                       "Content-Type: text/html\r\n"
+                       "\r\n"
+                       "start %d\n"
+                       "end %d\n"
+                       "width %d\n"
+                       "height %d\n"
+                       "rate %d\n"
+                       "ratescale %d\n",
+                       rd->sfra,
+                       rd->efra,
+                       render_width,
+                       render_height,
+                       rd->frs_sec,
+                       1
+                       );
 
                safe_puts(buf);
                return -1;
@@ -262,7 +262,7 @@ int BKE_frameserver_loop(RenderData *rd, ReportList *UNUSED(reports))
 {
        fd_set readfds;
        struct timeval tv;
-       struct sockaddr_in      addr;
+       struct sockaddr_in addr;
        int len, rval;
 #ifdef FREE_WINDOWS
        int socklen;
@@ -305,7 +305,7 @@ int BKE_frameserver_loop(RenderData *rd, ReportList *UNUSED(reports))
                tv.tv_sec = 10;
                tv.tv_usec = 0;
 
-                       rval = select(connsock + 1, &readfds, NULL, NULL, &tv);
+               rval = select(connsock + 1, &readfds, NULL, NULL, &tv);
                if (rval > 0) {
                        break;
                }
@@ -332,30 +332,30 @@ int BKE_frameserver_loop(RenderData *rd, ReportList *UNUSED(reports))
 
 static void serve_ppm(int *pixels, int rectx, int recty)
 {
-       unsigned charrendered_frame;
-       unsigned char* row = (unsigned char*) malloc(render_width * 3);
+       unsigned char *rendered_frame;
+       unsigned char *row = (unsigned char *) malloc(render_width * 3);
        int y;
        char header[1024];
 
        sprintf(header,
-               "HTTP/1.1 200 OK\r\n"
-               "Content-Type: image/ppm\r\n"
-               "Connection: close\r\n"
-               "\r\n"
-               "P6\n"
-               "# Creator: blender frameserver v0.0.1\n"
-               "%d %d\n"
-               "255\n",
-               rectx, recty);
+               "HTTP/1.1 200 OK\r\n"
+               "Content-Type: image/ppm\r\n"
+               "Connection: close\r\n"
+               "\r\n"
+               "P6\n"
+               "# Creator: blender frameserver v0.0.1\n"
+               "%d %d\n"
+               "255\n",
+               rectx, recty);
 
        safe_puts(header);
 
        rendered_frame = (unsigned char *)pixels;
 
        for (y = recty - 1; y >= 0; y--) {
-               unsigned chartarget = row;
-               unsigned charsrc = rendered_frame + rectx * 4 * y;
-               unsigned charend = src + rectx * 4;
+               unsigned char *target = row;
+               unsigned char *src = rendered_frame + rectx * 4 * y;
+               unsigned char *end = src + rectx * 4;
                while (src != end) {
                        target[2] = src[2];
                        target[1] = src[1];
@@ -364,7 +364,7 @@ static void serve_ppm(int *pixels, int rectx, int recty)
                        target += 3;
                        src += 4;
                }
-               safe_write((char*)row, 3 * rectx);
+               safe_write((char *)row, 3 * rectx);
        }
        free(row);
        closesocket(connsock);
@@ -372,7 +372,7 @@ static void serve_ppm(int *pixels, int rectx, int recty)
 }
 
 int BKE_frameserver_append(RenderData *UNUSED(rd), int UNUSED(start_frame), int frame, int *pixels,
-                       int rectx, int recty, ReportList *UNUSED(reports))
+                           int rectx, int recty, ReportList *UNUSED(reports))
 {
        fprintf(stderr, "Serving frame: %d\n", frame);
        if (write_ppm) {
index 22b939485124b0ac8cc4437444768f0a0dfd387f..6a5952465fea20859a964e0732764d671e3dfbf5 100644 (file)
@@ -88,7 +88,7 @@ static unsigned int case_strhash(const void *ptr)
 static unsigned int keyhash(const void *ptr)
 {
        const bAKey *k = ptr;
-       return case_strhash(k->arg); // ^ BLI_ghashutil_inthash((void*)k->pass);
+       return case_strhash(k->arg);  /* ^ BLI_ghashutil_inthash((void *)k->pass); */
 }
 
 static int keycmp(const void *a, const void *b)
index 53ae086782b7b22ae4aa519391476ad5926569a9..930ab4fc4008603319a839d45ceccdb8e7fd9bad 100644 (file)
@@ -330,7 +330,7 @@ static void rotate_left(DLRBT_Tree *tree, DLRBT_Node *root)
                        root_slot = &root->parent->right;
        }
        else
-               root_slot = ((DLRBT_Node **)&tree->root);  //&((DLRBT_Node*)tree->root);
+               root_slot = ((DLRBT_Node **)&tree->root);  /* &((DLRBT_Node *)tree->root); */
                
        /* - pivot's left child becomes root's right child
         * - root now becomes pivot's left child  
@@ -364,7 +364,7 @@ static void rotate_right(DLRBT_Tree *tree, DLRBT_Node *root)
                        root_slot = &root->parent->right;
        }
        else
-               root_slot = ((DLRBT_Node **)&tree->root);  //&((DLRBT_Node*)tree->root);
+               root_slot = ((DLRBT_Node **)&tree->root);  /* &((DLRBT_Node*)tree->root); */
                
        /* - pivot's right child becomes root's left child
         * - root now becomes pivot's right child  
index caadee5f941337ce997e62aa42ceaf352ceb6550..fad06f0d020f5b8232a1693ecf3269d2c29fba74 100644 (file)
@@ -2379,7 +2379,7 @@ static void findCorrespondingArc(RigGraph *rigg, RigArc *start_arc, RigNode *sta
 //             printf("CANDIDATES\n");
 //             for (i = 0; i < enode->degree; i++)
 //             {
-//                     next_earc = (ReebArc*)enode->arcs[i];
+//                     next_earc = (ReebArc *)enode->arcs[i];
 //                     printf("flag %i -- level %i -- flag %i -- group %i\n", next_earc->flag, next_earc->symmetry_level, next_earc->symmetry_flag, next_earc->symmetry_group);
 //             }
                
index e588f2ade80ba987389c303fab37229a871df44c..7b1150669e8cad168c71e2a310224189447db448 100644 (file)
@@ -2674,10 +2674,11 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str,
  * of our UI functions take prop rather then propname.
  */
 
-#define UI_DEF_BUT_RNA_DISABLE(but) \
-       but->flag |= UI_BUT_DISABLED; \
-       but->lock = 1; \
-       but->lockstr = ""
+#define UI_DEF_BUT_RNA_DISABLE(but)  { \
+               but->flag |= UI_BUT_DISABLED;  \
+               but->lock = TRUE;              \
+               but->lockstr = "";             \
+       } (void)0
 
 
 static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str,
@@ -3713,7 +3714,7 @@ void uiButGetStrInfo(bContext *C, uiBut *but, int nbr, ...)
 
        va_start(args, nbr);
        while (nbr--) {
-               uiStringInfo *si = (uiStringInfo*) va_arg(args, void*);
+               uiStringInfo *si = (uiStringInfo *) va_arg(args, void *);
                int type = si->type;
                char *tmp = NULL;
 
@@ -3727,13 +3728,13 @@ void uiButGetStrInfo(bContext *C, uiBut *but, int nbr, ...)
                                        tmp = BLI_strdup(but->str);
                        }
                        else
-                               type = BUT_GET_RNA_LABEL; /* Fail-safe solution... */
+                               type = BUT_GET_RNA_LABEL;  /* Fail-safe solution... */
                }
                else if (type == BUT_GET_TIP) {
                        if (but->tip && but->tip[0])
                                tmp = BLI_strdup(but->tip);
                        else
-                               type = BUT_GET_RNA_TIP; /* Fail-safe solution... */
+                               type = BUT_GET_RNA_TIP;  /* Fail-safe solution... */
                }
 
                if (type == BUT_GET_RNAPROP_IDENTIFIER) {
index 802f8a6d5d64c75d3de77136be3ec1dd21e602c2..8a3cf87e96a19e89c23434b93e772743b438efba 100644 (file)
@@ -291,14 +291,14 @@ static void knife_add_edge_faces_to_vert(KnifeTool_OpData *kcd, KnifeVert *kfv,
 
 /* Find a face in common in the two faces lists.
    If more than one, return the first; if none, return NULL */
-static BMFaceknife_find_common_face(ListBase *faces1, ListBase *faces2)
+static BMFace *knife_find_common_face(ListBase *faces1, ListBase *faces2)
 {
        Ref *ref1, *ref2;
 
        for (ref1 = faces1->first; ref1; ref1 = ref1->next) {
                for (ref2 = faces2->first; ref2; ref2 = ref2->next) {
                        if (ref1->ref == ref2->ref)
-                               return (BMFace*)(ref1->ref);
+                               return (BMFace *)(ref1->ref);
                }
        }
        return NULL;
@@ -454,7 +454,8 @@ static KnifeVert *knife_split_edge(KnifeTool_OpData *kcd, KnifeEdge *kfe, float
        newkfe->v2->draw = 1;
        if (kfe->e) {
                knife_add_edge_faces_to_vert(kcd, newkfe->v2, kfe->e);
-       } else {
+       }
+       else {
                /* kfe cuts across an existing face.
                   If v1 and v2 are in multiple faces together (e.g., if they
                   are in doubled polys) then this arbitrarily chooses one of them */
@@ -1097,7 +1098,7 @@ static BMEdgeHit *knife_edge_tri_isect(KnifeTool_OpData *kcd, BMBVHTree *bmtree,
 
        /* for comparing distances, error of intersection depends on triangle scale.
         * need to scale down before squaring for accurate comparison */
-       const float depsilon = 50 * FLT_EPSILON * len_v3_tri_side_max(v1, v2, v3);
+       const float depsilon = 50 *FLT_EPSILON *len_v3_tri_side_max(v1, v2, v3);
        const float depsilon_squared = depsilon * depsilon;
 
        copy_v3_v3(cos + 0, v1);
@@ -2944,7 +2945,8 @@ wmKeyMap *knifetool_modal_keymap(wmKeyConfig *keyconf)
                {KNF_MODAL_CUT_THROUGH_TOGGLE, "CUT_THROUGH_TOGGLE", 0, "Toggle Cut Through", ""},
                {KNF_MODAL_NEW_CUT, "NEW_CUT", 0, "End Current Cut", ""},
                {KNF_MODAL_ADD_CUT, "ADD_CUT", 0, "Add Cut", ""},
-               {0, NULL, 0, NULL, NULL}};
+               {0, NULL, 0, NULL, NULL}
+       };
 
        wmKeyMap *keymap = WM_modalkeymap_get(keyconf, "Knife Tool Modal Map");
 
index 3d9e62b1a164a606efa82ca31963f16f9c6367c5..cf3e04b84b8798876b0748762ff3a6ed7a096f9a 100644 (file)
@@ -212,10 +212,10 @@ int ED_object_iter_other(Main *bmain, Object *orig_ob, int include_orig,
                int totfound = include_orig ? 0 : 1;
 
                for (ob = bmain->object.first; ob && totfound < users;
-                        ob = ob->id.next)
+                    ob = ob->id.next)
                {
                        if (((ob != orig_ob) || include_orig) &&
-                               (ob->data == orig_ob->data))
+                           (ob->data == orig_ob->data))
                        {
                                if (callback(ob, callback_data))
                                        return TRUE;
@@ -233,7 +233,7 @@ int ED_object_iter_other(Main *bmain, Object *orig_ob, int include_orig,
 
 static int object_has_modifier_cb(Object *ob, void *data)
 {
-       ModifierType type = *((ModifierType*)data);
+       ModifierType type = *((ModifierType *)data);
 
        return object_has_modifier(ob, NULL, type);
 }
@@ -244,7 +244,7 @@ static int object_has_modifier_cb(Object *ob, void *data)
 int ED_object_multires_update_totlevels_cb(Object *ob, void *totlevel_v)
 {
        ModifierData *md;
-       int totlevel = *((int*)totlevel_v);
+       int totlevel = *((int *)totlevel_v);
 
        for (md = ob->modifiers.first; md; md = md->next) {
                if (md->type == eModifierType_Multires) {
@@ -1148,8 +1148,8 @@ static int multires_higher_levels_delete_exec(bContext *C, wmOperator *op)
        multiresModifier_del_levels(mmd, ob, 1);
 
        ED_object_iter_other(CTX_data_main(C), ob, TRUE,
-                                                ED_object_multires_update_totlevels_cb,
-                                                &mmd->totlvl);
+                            ED_object_multires_update_totlevels_cb,
+                            &mmd->totlvl);
        
        WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
        
@@ -1192,8 +1192,8 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op)
        multiresModifier_subdivide(mmd, ob, 0, mmd->simple);
 
        ED_object_iter_other(CTX_data_main(C), ob, TRUE,
-                                                ED_object_multires_update_totlevels_cb,
-                                                &mmd->totlvl);
+                            ED_object_multires_update_totlevels_cb,
+                            &mmd->totlvl);
 
        DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
        WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
index 4932a41579e96f26c4c68bbaa746ef45ea9f7ed6..09ef3d7a894894f7e2dfd0a6fd63c529e9586f20 100644 (file)
@@ -3254,9 +3254,9 @@ static void sculpt_omp_start(Sculpt *sd, SculptSession *ss)
        if (ss->multires) {
                int i, gridsize, array_mem_size;
                BLI_pbvh_node_get_grids(ss->pbvh, NULL, NULL, NULL, NULL,
-                                                               &gridsize, NULL, NULL);
+                                       &gridsize, NULL, NULL);
 
-               array_mem_size = cache->num_threads * sizeof(void*);
+               array_mem_size = cache->num_threads * sizeof(void *);
 
                cache->tmpgrid_co = MEM_mallocN(array_mem_size, "tmpgrid_co array");
                cache->tmprow_co = MEM_mallocN(array_mem_size, "tmprow_co array");
index db1d4ed1155119a4d3cc227c5c7797ccae00ec55..1f641829e7e2d7a639882912f6f66ee5c30c5f0f 100644 (file)
@@ -129,8 +129,7 @@ static SpaceLink *action_new(const bContext *C)
 /* not spacelink itself */
 static void action_free(SpaceLink *UNUSED(sl))
 {      
-//     SpaceAction *saction= (SpaceAction*) sl;
-       
+//     SpaceAction *saction= (SpaceAction *) sl;
 }
 
 
index 3ffba75f2efaf44f7fc9bd3c92762868dd2084a7..d8c7bf3f809c1ea6f2691541b7dbaf0ab1b6921f 100644 (file)
@@ -224,7 +224,7 @@ static void clip_panel_operator_redo(const bContext *C, Panel *pa)
        if (op == NULL)
                return;
 
-       if (WM_operator_poll((bContext*)C, op->type) == 0)
+       if (WM_operator_poll((bContext *)C, op->type) == 0)
                return;
 
        block = uiLayoutGetBlock(pa->layout);
index 1e976cebafd9e52117d49edf2b675942466bb95c..f2013e405e2bbdbfa27e0940d4ab6b075cc33a18 100644 (file)
 /* ************* Generic Operator Helpers ************* */
 static int edit_sensor_poll(bContext *C)
 {
-       PointerRNA ptr= CTX_data_pointer_get_type(C, "sensor", &RNA_Sensor);
+       PointerRNA ptr = CTX_data_pointer_get_type(C, "sensor", &RNA_Sensor);
 
-       if (ptr.data && ((ID*)ptr.id.data)->lib) return 0;
+       if (ptr.data && ((ID *)ptr.id.data)->lib) return 0;
        return 1;
 }
 
 static int edit_controller_poll(bContext *C)
 {
-       PointerRNA ptr= CTX_data_pointer_get_type(C, "controller", &RNA_Controller);
+       PointerRNA ptr = CTX_data_pointer_get_type(C, "controller", &RNA_Controller);
 
-       if (ptr.data && ((ID*)ptr.id.data)->lib) return 0;
+       if (ptr.data && ((ID *)ptr.id.data)->lib) return 0;
        return 1;
 }
 
 static int edit_actuator_poll(bContext *C)
 {
-       PointerRNA ptr= CTX_data_pointer_get_type(C, "actuator", &RNA_Actuator);
+       PointerRNA ptr = CTX_data_pointer_get_type(C, "actuator", &RNA_Actuator);
 
-       if (ptr.data && ((ID*)ptr.id.data)->lib) return 0;
+       if (ptr.data && ((ID *)ptr.id.data)->lib) return 0;
        return 1;
 }
 
@@ -94,7 +94,7 @@ static void edit_sensor_properties(wmOperatorType *ot)
 
 static int edit_sensor_invoke_properties(bContext *C, wmOperator *op)
 {
-       PointerRNA ptr= CTX_data_pointer_get_type(C, "sensor", &RNA_Sensor);
+       PointerRNA ptr = CTX_data_pointer_get_type(C, "sensor", &RNA_Sensor);
        
        if (RNA_struct_property_is_set(op->ptr, "sensor") && RNA_struct_property_is_set(op->ptr, "object") )
                return 1;
@@ -104,7 +104,7 @@ static int edit_sensor_invoke_properties(bContext *C, wmOperator *op)
                Object *ob = ptr.id.data;
                
                RNA_string_set(op->ptr, "sensor", sens->name);
-               RNA_string_set(op->ptr, "object", ob->id.name+2);
+               RNA_string_set(op->ptr, "object", ob->id.name + 2);
                return 1;
        }
        
@@ -123,7 +123,7 @@ static Object *edit_object_property_get(bContext *C, wmOperator *op)
        if (BLI_strnlen(ob_name, MAX_NAME) > 0)
                ob = BLI_findstring(&(CTX_data_main(C)->object), ob_name, offsetof(ID, name) + 2);
        else
-               ob= ED_object_active_context(C);
+               ob = ED_object_active_context(C);
 
        return ob;
 }
@@ -135,7 +135,7 @@ static bSensor *edit_sensor_property_get(bContext *C, wmOperator *op, Object **o
        
        RNA_string_get(op->ptr, "sensor", sensor_name);
 
-       *ob= edit_object_property_get(C, op);
+       *ob = edit_object_property_get(C, op);
        if (!*ob) return NULL;
        
        sens = BLI_findstring(&((*ob)->sensors), sensor_name, offsetof(bSensor, name)); 
@@ -150,7 +150,7 @@ static void edit_controller_properties(wmOperatorType *ot)
 
 static int edit_controller_invoke_properties(bContext *C, wmOperator *op)
 {
-       PointerRNA ptr= CTX_data_pointer_get_type(C, "controller", &RNA_Controller);
+       PointerRNA ptr = CTX_data_pointer_get_type(C, "controller", &RNA_Controller);
        
        if (RNA_struct_property_is_set(op->ptr, "controller") && RNA_struct_property_is_set(op->ptr, "object") )
                return 1;
@@ -160,7 +160,7 @@ static int edit_controller_invoke_properties(bContext *C, wmOperator *op)
                Object *ob = ptr.id.data;
                
                RNA_string_set(op->ptr, "controller", cont->name);
-               RNA_string_set(op->ptr, "object", ob->id.name+2);
+               RNA_string_set(op->ptr, "object", ob->id.name + 2);
                return 1;
        }
        
@@ -174,7 +174,7 @@ static bController *edit_controller_property_get(bContext *C, wmOperator *op, Ob
        
        RNA_string_get(op->ptr, "controller", controller_name);
 
-       *ob= edit_object_property_get(C, op);
+       *ob = edit_object_property_get(C, op);
        if (!*ob) return NULL;
        
        cont = BLI_findstring(&((*ob)->controllers), controller_name, offsetof(bController, name));     
@@ -189,7 +189,7 @@ static void edit_actuator_properties(wmOperatorType *ot)
 
 static int edit_actuator_invoke_properties(bContext *C, wmOperator *op)
 {
-       PointerRNA ptr= CTX_data_pointer_get_type(C, "actuator", &RNA_Actuator);
+       PointerRNA ptr = CTX_data_pointer_get_type(C, "actuator", &RNA_Actuator);
        
        if (RNA_struct_property_is_set(op->ptr, "actuator") && RNA_struct_property_is_set(op->ptr, "object") )
                return 1;
@@ -199,7 +199,7 @@ static int edit_actuator_invoke_properties(bContext *C, wmOperator *op)
                Object *ob = ptr.id.data;
                
                RNA_string_set(op->ptr, "actuator", act->name);
-               RNA_string_set(op->ptr, "object", ob->id.name+2);
+               RNA_string_set(op->ptr, "object", ob->id.name + 2);
                return 1;
        }
        
@@ -213,7 +213,7 @@ static bActuator *edit_actuator_property_get(bContext *C, wmOperator *op, Object
        
        RNA_string_get(op->ptr, "actuator", actuator_name);
 
-       *ob= edit_object_property_get(C, op);
+       *ob = edit_object_property_get(C, op);
        if (!*ob) return NULL;
        
        act = BLI_findstring(&((*ob)->actuators), actuator_name, offsetof(bActuator, name));    
@@ -234,7 +234,7 @@ static int logicbricks_move_property_get(wmOperator *op)
 
 static int sensor_remove_exec(bContext *C, wmOperator *op)
 {
-       Object *ob=NULL;
+       Object *ob = NULL;
        bSensor *sens = edit_sensor_property_get(C, op, &ob);
        
        if (!sens)
@@ -248,7 +248,7 @@ static int sensor_remove_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
- static int sensor_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+static int sensor_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {
        if (edit_sensor_invoke_properties(C, op))
                return sensor_remove_exec(C, op);
@@ -267,7 +267,7 @@ static void LOGIC_OT_sensor_remove(wmOperatorType *ot)
        ot->poll = edit_sensor_poll;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        edit_sensor_properties(ot);
 }
 
@@ -279,13 +279,13 @@ static int sensor_add_exec(bContext *C, wmOperator *op)
        PropertyRNA *prop;
        const char *sens_name;
        char name[MAX_NAME];
-       int type= RNA_enum_get(op->ptr, "type");
+       int type = RNA_enum_get(op->ptr, "type");
 
-       ob= edit_object_property_get(C, op);
+       ob = edit_object_property_get(C, op);
        if (!ob)
                return OPERATOR_CANCELLED;
 
-       sens= new_sensor(type);
+       sens = new_sensor(type);
        BLI_addtail(&(ob->sensors), sens);
        
        /* set the sensor name based on rna type enum */
@@ -323,10 +323,10 @@ static void LOGIC_OT_sensor_add(wmOperatorType *ot)
        ot->poll = ED_operator_object_active_editable;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* properties */
-       ot->prop = prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
+       ot->prop = prop = RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
        RNA_def_enum_funcs(prop, rna_Sensor_type_itemf);
        RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Sensor to add");
        RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Sensor to");
@@ -351,7 +351,7 @@ static int controller_remove_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
- static int controller_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+static int controller_remove_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
 {
        if (edit_controller_invoke_properties(C, op))
                return controller_remove_exec(C, op);
@@ -370,7 +370,7 @@ static void LOGIC_OT_controller_remove(wmOperatorType *ot)
        ot->poll = edit_controller_poll;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        edit_controller_properties(ot);
 }
 
@@ -383,13 +383,13 @@ static int controller_add_exec(bContext *C, wmOperator *op)
        const char *cont_name;
        int bit;
        char name[MAX_NAME];
-       int type= RNA_enum_get(op->ptr, "type");
+       int type = RNA_enum_get(op->ptr, "type");
 
-       ob= edit_object_property_get(C, op);
+       ob = edit_object_property_get(C, op);
        if (!ob)
                return OPERATOR_CANCELLED;
        
-       cont= new_controller(type);
+       cont = new_controller(type);
        BLI_addtail(&(ob->controllers), cont);
        
        /* set the controller name based on rna type enum */
@@ -408,11 +408,11 @@ static int controller_add_exec(bContext *C, wmOperator *op)
        /* set the controller state mask from the current object state.
         * A controller is always in a single state, so select the lowest bit set
         * from the object state */
-       for (bit=0; bit<OB_MAX_STATES; bit++) {
-               if (ob->state & (1<<bit))
+       for (bit = 0; bit < OB_MAX_STATES; bit++) {
+               if (ob->state & (1 << bit))
                        break;
        }
-       cont->state_mask = (1<<bit);
+       cont->state_mask = (1 << bit);
        if (cont->state_mask == 0) {
                /* shouldn't happen, object state is never 0 */
                cont->state_mask = 1;
@@ -438,7 +438,7 @@ static void LOGIC_OT_controller_add(wmOperatorType *ot)
        ot->poll = ED_operator_object_active_editable;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* properties */
        ot->prop = RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
@@ -450,7 +450,7 @@ static void LOGIC_OT_controller_add(wmOperatorType *ot)
 
 static int actuator_remove_exec(bContext *C, wmOperator *op)
 {
-       Object *ob=NULL;
+       Object *ob = NULL;
        bActuator *act = edit_actuator_property_get(C, op, &ob);
        
        if (!act)
@@ -484,7 +484,7 @@ static void LOGIC_OT_actuator_remove(wmOperatorType *ot)
        ot->poll = edit_actuator_poll;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        edit_actuator_properties(ot);
 }
 
@@ -495,14 +495,14 @@ static int actuator_add_exec(bContext *C, wmOperator *op)
        PointerRNA act_ptr;
        PropertyRNA *prop;
        const char *act_name;
-       char  name[MAX_NAME];
-       int type= RNA_enum_get(op->ptr, "type");
+       char name[MAX_NAME];
+       int type = RNA_enum_get(op->ptr, "type");
                
-       ob= edit_object_property_get(C, op);
+       ob = edit_object_property_get(C, op);
        if (!ob)
                return OPERATOR_CANCELLED;
 
-       act= new_actuator(type);
+       act = new_actuator(type);
        BLI_addtail(&(ob->actuators), act);
        
        /* set the actuator name based on rna type enum */
@@ -540,27 +540,28 @@ static void LOGIC_OT_actuator_add(wmOperatorType *ot)
        ot->poll = ED_operator_object_active_editable;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* properties */
-       ot->prop = prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
+       ot->prop = prop = RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
        RNA_def_enum_funcs(prop, rna_Actuator_type_itemf);
        RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Actuator to add");
        RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Actuator to");
 }
 
 /* ************* Move Logic Bricks Operator ************* */
-static EnumPropertyItem logicbricks_move_direction[] ={
-               {1, "UP", 0, "Move Up", ""},
-               {2, "DOWN", 0, "Move Down", ""},
-               {0, NULL, 0, NULL, NULL}};
+static EnumPropertyItem logicbricks_move_direction[] = {
+       {1, "UP", 0, "Move Up", ""},
+       {2, "DOWN", 0, "Move Down", ""},
+       {0, NULL, 0, NULL, NULL}
+};
 
 
 static int sensor_move_exec(bContext *C, wmOperator *op)
 {
-       Object *ob=NULL;
-       bSensor *sens= edit_sensor_property_get(C, op, &ob);
-       int move_up= logicbricks_move_property_get(op);
+       Object *ob = NULL;
+       bSensor *sens = edit_sensor_property_get(C, op, &ob);
+       int move_up = logicbricks_move_property_get(op);
        
        if (!sens)
                return OPERATOR_CANCELLED;
@@ -594,7 +595,7 @@ static void LOGIC_OT_sensor_move(wmOperatorType *ot)
        ot->poll = edit_sensor_poll;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* properties */
        edit_sensor_properties(ot);
@@ -603,9 +604,9 @@ static void LOGIC_OT_sensor_move(wmOperatorType *ot)
 
 static int controller_move_exec(bContext *C, wmOperator *op)
 {
-       Object *ob=NULL;
-       bController *cont= edit_controller_property_get(C, op, &ob);
-       int move_up= logicbricks_move_property_get(op);
+       Object *ob = NULL;
+       bController *cont = edit_controller_property_get(C, op, &ob);
+       int move_up = logicbricks_move_property_get(op);
        
        if (!cont)
                return OPERATOR_CANCELLED;
@@ -639,7 +640,7 @@ static void LOGIC_OT_controller_move(wmOperatorType *ot)
        ot->poll = edit_controller_poll;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* properties */
        edit_controller_properties(ot);
@@ -648,9 +649,9 @@ static void LOGIC_OT_controller_move(wmOperatorType *ot)
 
 static int actuator_move_exec(bContext *C, wmOperator *op)
 {
-       Object *ob=NULL;
+       Object *ob = NULL;
        bActuator *act = edit_actuator_property_get(C, op, &ob);
-       int move_up= logicbricks_move_property_get(op);
+       int move_up = logicbricks_move_property_get(op);
 
        if (!act)
                return OPERATOR_CANCELLED;
@@ -684,7 +685,7 @@ static void LOGIC_OT_actuator_move(wmOperatorType *ot)
        ot->poll = edit_actuator_poll;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* properties */
        edit_actuator_properties(ot);
@@ -694,7 +695,7 @@ static void LOGIC_OT_actuator_move(wmOperatorType *ot)
 /* ************* TexFace Converter Operator ************* */
 static int texface_convert_exec(bContext *C, wmOperator *UNUSED(op))
 {
-       Main *bmain= CTX_data_main(C);
+       Main *bmain = CTX_data_main(C);
        do_version_tface(bmain, 0);
        
        return OPERATOR_FINISHED;
@@ -705,7 +706,7 @@ static int texface_convert_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
        return texface_convert_exec(C, op);
 }
 
- static void LOGIC_OT_texface_convert(wmOperatorType *ot)
+static void LOGIC_OT_texface_convert(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "TexFace to Material Converter";
@@ -718,7 +719,7 @@ static int texface_convert_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(e
 //     ot->poll = texface_convert_poll;
  
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
 
index 6436d04f54f83e4581ccc35b0c6605fe579eac9e..a4d9261ad5aa589c1a124287316bea935209680c 100644 (file)
@@ -291,7 +291,7 @@ static int add_name(const char *str)
        if (str[0] == '(' && str[1] == '*') {
                /* we handle function pointer and special array cases here, e.g.
                 * void (*function)(...) and float (*array)[..]. the array case
-                * name is still converted to (array*)() though because it is that
+                * name is still converted to (array *)() though because it is that
                 * way in old dna too, and works correct with elementsize() */
                int isfuncptr = (strchr(str + 1, '(')) != NULL;
 
index 8e9c0dbc4c459fd567cbce8317e3bef9a6720629..5b5367654eb4b4fc1a301743960208670e5e7989 100644 (file)
@@ -2590,7 +2590,7 @@ void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr
 
 PointerRNA RNA_property_pointer_get_default(PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop))
 {
-       /*PointerPropertyRNA *pprop = (PointerPropertyRNA*)prop; */
+       /*PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; */
 
        /* BLI_assert(RNA_property_type(prop) == PROP_POINTER); */
 
@@ -2729,7 +2729,7 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
 void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
 {
        IDProperty *idprop;
-/*     CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; */
+/*     CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; */
 
        BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
 
@@ -2788,7 +2788,7 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA
 int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key)
 {
        IDProperty *idprop;
-/*     CollectionPropertyRNA *cprop = (CollectionPropertyRNA*)prop; */
+/*     CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; */
 
        BLI_assert(RNA_property_type(prop) == PROP_COLLECTION);
 
@@ -3035,11 +3035,11 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, Proper
 #define RAW_GET(dtype, var, raw, a)                                           \
 {                                                                             \
        switch (raw.type) {                                                       \
-               case PROP_RAW_CHAR: var = (dtype)((char*)raw.array)[a]; break;        \
-               case PROP_RAW_SHORT: var = (dtype)((short*)raw.array)[a]; break;      \
-               case PROP_RAW_INT: var = (dtype)((int*)raw.array)[a]; break;          \
-               case PROP_RAW_FLOAT: var = (dtype)((float*)raw.array)[a]; break;      \
-               case PROP_RAW_DOUBLE: var = (dtype)((double*)raw.array)[a]; break;    \
+               case PROP_RAW_CHAR: var = (dtype)((char *)raw.array)[a]; break;       \
+               case PROP_RAW_SHORT: var = (dtype)((short *)raw.array)[a]; break;     \
+               case PROP_RAW_INT: var = (dtype)((int *)raw.array)[a]; break;         \
+               case PROP_RAW_FLOAT: var = (dtype)((float *)raw.array)[a]; break;     \
+               case PROP_RAW_DOUBLE: var = (dtype)((double *)raw.array)[a]; break;   \
                default: var = (dtype)0;                                              \
        }                                                                         \
 } (void)0
@@ -3047,11 +3047,11 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, Proper
 #define RAW_SET(dtype, raw, a, var)                                           \
 {                                                                             \
        switch (raw.type) {                                                       \
-               case PROP_RAW_CHAR: ((char*)raw.array)[a] = (char)var; break;         \
-               case PROP_RAW_SHORT: ((short*)raw.array)[a] = (short)var; break;      \
-               case PROP_RAW_INT: ((int*)raw.array)[a] = (int)var; break;            \
-               case PROP_RAW_FLOAT: ((float*)raw.array)[a] = (float)var; break;      \
-               case PROP_RAW_DOUBLE: ((double*)raw.array)[a] = (double)var; break;   \
+               case PROP_RAW_CHAR: ((char *)raw.array)[a] = (char)var; break;        \
+               case PROP_RAW_SHORT: ((short *)raw.array)[a] = (short)var; break;     \
+               case PROP_RAW_INT: ((int *)raw.array)[a] = (int)var; break;           \
+               case PROP_RAW_FLOAT: ((float *)raw.array)[a] = (float)var; break;     \
+               case PROP_RAW_DOUBLE: ((double *)raw.array)[a] = (double)var; break;  \
                default: break;                                                       \
        }                                                                         \
 } (void)0
index 6b380886e2889895408950749b66291cb8dbe44a..5e95fa25cba18a16594de04087d737785d760ec5 100644 (file)
@@ -24,7 +24,6 @@
  *  \ingroup RNA
  */
 
-
 #include <stdlib.h>
 #include <string.h>
 
@@ -206,30 +205,6 @@ EnumPropertyItem prop_wave_items[] = {
 #include "DNA_scene_types.h"
 #include "WM_api.h"
 
-static void rna_Node_custom3_set_as_int(PointerRNA *ptr, int value)
-{
-       bNode *node = (bNode *)ptr->data;
-       node->custom3 = value;
-}
-
-static int rna_Node_custom3_get_as_int(PointerRNA *ptr)
-{
-       bNode *node = (bNode *)ptr->data;
-       return (int)node->custom3;
-}
-
-static void rna_Node_custom4_set_as_int(PointerRNA *ptr, int value)
-{
-       bNode *node = (bNode *)ptr->data;
-       node->custom4 = value;
-}
-
-static int rna_Node_custom4_get_as_int(PointerRNA *ptr)
-{
-       bNode *node = (bNode *)ptr->data;
-       return (int)node->custom4;
-}
-
 static StructRNA *rna_Node_refine(struct PointerRNA *ptr)
 {
        bNode *node = (bNode *)ptr->data;
index 3703f819b3bb494327587c8f7fc75fc7734544df..d47fdff80763866eed0a6c2c26b37a1e75311454 100644 (file)
@@ -3636,7 +3636,7 @@ void RE_sample_material_color(Material *mat, float color[3], float *alpha, const
                                        float *uv1, *uv2, *uv3;
                                        float l;
                                        CustomData *data = &orcoDm->faceData;
-                                       MTFace *tface = (MTFace*) data->layers[layer_index+i].data;
+                                       MTFace *tface = (MTFace *) data->layers[layer_index+i].data;
                                        float uv[3];
                                        /* point layer name from actual layer data */
                                        shi.uv[i].name = data->layers[i].name;
index 7dc77d3632ad830e4465ee957d424bc717184460..db9e201704fa38479e077b1337d34b2bdcc7ed63 100644 (file)
@@ -322,8 +322,8 @@ static void compress_deepshadowbuf(Render *re, ShadBuf *shb, APixstr *apixbuf, A
        shsample= MEM_callocN(sizeof(ShadSampleBuf), "shad sample buf");
        BLI_addtail(&shb->buffers, shsample);
 
-       shsample->totbuf= MEM_callocN(sizeof(int)*size*size, "deeptotbuf");
-       shsample->deepbuf= MEM_callocN(sizeof(DeepSample*)*size*size, "deepbuf");
+       shsample->totbuf = MEM_callocN(sizeof(int) * size * size, "deeptotbuf");
+       shsample->deepbuf = MEM_callocN(sizeof(DeepSample *) * size * size, "deepbuf");
 
        ap= apixbuf;
        aps= apixbufstrand;
index 46d52e83eda29d48616d7f5f8c8bad6e1d4bed1c..5ca1262107be6571105c7771d815fe3055093914 100644 (file)
@@ -747,8 +747,8 @@ ScatterTree *scatter_tree_new(ScatterSettings *ss[3], float scale, float error,
        tree->ss[1]= ss[1];
        tree->ss[2]= ss[2];
 
-       points= MEM_callocN(sizeof(ScatterPoint)*totpoint, "ScatterPoints");
-       refpoints= MEM_callocN(sizeof(ScatterPoint*)*totpoint, "ScatterRefPoints");
+       points = MEM_callocN(sizeof(ScatterPoint) * totpoint, "ScatterPoints");
+       refpoints = MEM_callocN(sizeof(ScatterPoint *) * totpoint, "ScatterRefPoints");
 
        tree->points= points;
        tree->refpoints= refpoints;
@@ -777,8 +777,8 @@ void scatter_tree_build(ScatterTree *tree)
        float mid[3], size[3];
        int totpoint= tree->totpoint;
 
-       newpoints= MEM_callocN(sizeof(ScatterPoint)*totpoint, "ScatterPoints");
-       tmppoints= MEM_callocN(sizeof(ScatterPoint*)*totpoint, "ScatterTmpPoints");
+       newpoints = MEM_callocN(sizeof(ScatterPoint) * totpoint, "ScatterPoints");
+       tmppoints = MEM_callocN(sizeof(ScatterPoint *) * totpoint, "ScatterTmpPoints");
        tree->tmppoints= tmppoints;
 
        tree->arena= BLI_memarena_new(0x8000 * sizeof(ScatterNode), "sss tree arena");