quiet some compiler warnings & fix possible (but unlikely) crash.
authorCampbell Barton <ideasman42@gmail.com>
Sat, 30 Jul 2011 09:24:10 +0000 (09:24 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 30 Jul 2011 09:24:10 +0000 (09:24 +0000)
also added GPLv2+ header to resources.c.

source/blender/blenlib/intern/BLI_args.c
source/blender/editors/curve/editcurve.c
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/resources.c
source/blender/editors/object/object_relations.c

index 7bc93a3..5f31565 100644 (file)
@@ -290,8 +290,10 @@ void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *
                                        }
                                        i += retval;
                                } else if (retval == -1){
-                                       if (a->key->pass != -1)
-                                               ba->passes[i] = pass;
+                                       if (a) {
+                                               if (a->key->pass != -1)
+                                                       ba->passes[i] = pass;
+                                       }
                                        break;
                                }
                        }
index 06d88b1..8b9477a 100644 (file)
@@ -6544,12 +6544,15 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob)
                BLI_assert(!"invalid nurbs type");
                return NULL;
        }
-       
-       /* always do: */
-       nu->flag |= CU_SMOOTH;
-       
-       test2DNurb(nu);
-       
+
+       BLI_assert(nu != NULL);
+
+       if(nu) { /* should always be set */
+               nu->flag |= CU_SMOOTH;
+
+               test2DNurb(nu);
+       }
+
        return nu;
 }
 
index 75e7ee7..0300317 100644 (file)
@@ -1,3 +1,27 @@
+/*
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributor(s):
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
 /** \file blender/editors/interface/interface_anim.c
  *  \ingroup edinterface
  */
index 56ef5e9..2b4003c 100644 (file)
@@ -1,6 +1,3 @@
-/** \file blender/editors/interface/resources.c
- *  \ingroup edinterface
- */
 /*
  * $Id$
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
 
+/** \file blender/editors/interface/resources.c
+ *  \ingroup edinterface
+ */
+
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
index f21241b..0fb7cf8 100644 (file)
@@ -1096,7 +1096,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
        Scene *scene= CTX_data_scene(C);
        View3D *v3d= CTX_wm_view3d(C);
        unsigned int lay, local;
-       int islamp= 0;
+       /* int islamp= 0; */ /* UNUSED */
        
        lay= move_to_layer_init(C, op);
        lay &= 0xFFFFFF;
@@ -1112,7 +1112,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
                        base->object->lay= lay;
                        base->object->flag &= ~SELECT;
                        base->flag &= ~SELECT;
-                       if(base->object->type==OB_LAMP) islamp= 1;
+                       /* if(base->object->type==OB_LAMP) islamp= 1; */
                }
                CTX_DATA_END;
        }
@@ -1124,7 +1124,7 @@ static int move_to_layer_exec(bContext *C, wmOperator *op)
                        local= base->lay & 0xFF000000;  
                        base->lay= lay + local;
                        base->object->lay= lay;
-                       if(base->object->type==OB_LAMP) islamp= 1;
+                       /* if(base->object->type==OB_LAMP) islamp= 1; */
                }
                CTX_DATA_END;
        }