synched with trunk at revision 36569
[blender.git] / source / blender / blenkernel / intern / customdata.c
index 6ba7268..bffb4c3 100644 (file)
 *
 * BKE_customdata.h contains the function prototypes for this file.
 *
-*/ 
+*/
+
+/** \file blender/blenkernel/intern/customdata.c
+ *  \ingroup bke
+ */
 
 #include <math.h>
 #include <string.h>
@@ -469,19 +474,19 @@ static void layerInterp_mdisps(void **sources, float *UNUSED(weights),
                                                        vindex[x] = y;
 
                        for(i = 0; i < 2; i++) {
-                               float sw[4][4] = {{0}};
+                               float sw_m4[4][4] = {{0}};
                                int a = 7 & ~(1 << vindex[i*2] | 1 << vindex[i*2+1]);
 
-                               sw[0][vindex[i*2+1]] = 1;
-                               sw[1][vindex[i*2]] = 1;
+                               sw_m4[0][vindex[i*2+1]] = 1;
+                               sw_m4[1][vindex[i*2]] = 1;
 
                                for(x = 0; x < 3; x++)
                                        if(a & (1 << x))
-                                               sw[2][x] = 1;
+                                               sw_m4[2][x] = 1;
 
                                tris[i] = *((MDisps*)sources[i]);
                                tris[i].disps = MEM_dupallocN(tris[i].disps);
-                               layerInterp_mdisps(&sources[i], NULL, (float*)sw, 1, &tris[i]);
+                               layerInterp_mdisps(&sources[i], NULL, (float*)sw_m4, 1, &tris[i]);
                        }
 
                        mdisp_join_tris(d, &tris[0], &tris[1]);
@@ -502,7 +507,7 @@ static void layerInterp_mdisps(void **sources, float *UNUSED(weights),
        }
 
        /* Initialize the destination */
-       out = disps = MEM_callocN(3*d->totdisp*sizeof(float), "iterp disps");
+       disps = MEM_callocN(3*d->totdisp*sizeof(float), "iterp disps");
 
        side = sqrt(d->totdisp / dst_corners);
        st = (side<<1)-1;
@@ -803,7 +808,7 @@ static void layerDefault_mcol(void *data, int count)
 
 
 
-const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
+static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
        {sizeof(MVert), "MVert", 1, NULL, NULL, NULL, NULL, NULL, NULL},
        {sizeof(MSticky), "MSticky", 1, NULL, NULL, NULL, layerInterp_msticky, NULL,
         NULL},
@@ -829,7 +834,7 @@ const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
        {sizeof(MTexPoly), "MTexPoly", 1, "Face Texture", NULL, NULL, NULL, NULL, NULL},
        {sizeof(MLoopUV), "MLoopUV", 1, "UV coord", NULL, NULL, layerInterp_mloopuv, NULL, NULL},
        {sizeof(MLoopCol), "MLoopCol", 1, "Col", NULL, NULL, layerInterp_mloopcol, NULL, layerDefault_mloopcol},
-       {sizeof(float)*3*4, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
+       {sizeof(float)*4*4, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
        {sizeof(MDisps), "MDisps", 1, NULL, layerCopy_mdisps,
         layerFree_mdisps, layerInterp_mdisps, layerSwap_mdisps, NULL, layerRead_mdisps, layerWrite_mdisps,
         layerFilesize_mdisps, layerValidate_mdisps},
@@ -843,7 +848,7 @@ const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
        {sizeof(MRecast), "MRecast", 1,"Recast",NULL,NULL,NULL,NULL}
 };
 
-const char *LAYERTYPENAMES[CD_NUMTYPES] = {
+static const char *LAYERTYPENAMES[CD_NUMTYPES] = {
        /*   0-4 */ "CDMVert", "CDMSticky", "CDMDeformVert", "CDMEdge", "CDMFace",
        /*   5-9 */ "CDMTFace", "CDMCol", "CDOrigIndex", "CDNormal", "CDFlags",
        /* 10-14 */ "CDMFloatProperty", "CDMIntProperty","CDMStringProperty", "CDOrigSpace", "CDOrco",