remove the pointer from BLI_bitmap's typedef,
authorCampbell Barton <ideasman42@gmail.com>
Mon, 22 Jul 2013 23:20:48 +0000 (23:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 22 Jul 2013 23:20:48 +0000 (23:20 +0000)
hides that an arg passed is really an array which may be modified by other functions.

17 files changed:
source/blender/blenkernel/BKE_pbvh.h
source/blender/blenkernel/intern/editderivedmesh.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/pbvh.c
source/blender/blenkernel/intern/pbvh_intern.h
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenlib/BLI_bitmap.h
source/blender/editors/curve/editcurve.c
source/blender/editors/mesh/editface.c
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_modifier.c
source/blender/editors/sculpt_paint/paint_hide.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_intern.h
source/blender/editors/sculpt_paint/sculpt_undo.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/gpu/intern/gpu_buffers.c

index 48c16f8db388bd604dc74947cab165016d00a0de..7d3d8d7dcbd325394af071d44a2efdc030f00d65 100644 (file)
@@ -223,7 +223,7 @@ typedef struct PBVHVertexIter {
        struct CCGElem **grids;
        struct CCGElem *grid;
        struct CCGKey *key;
-       BLI_bitmap *grid_hidden, gh;
+       BLI_bitmap **grid_hidden, *gh;
        int *grid_indices;
        int totgrid;
        int gridsize;
index c9fc5f15d8be44d0782cf984e5efe75a52f3c45b..01bfe1f7adad06d1a583d405209ee97001182e06 100644 (file)
@@ -2190,7 +2190,7 @@ void BKE_editmesh_statvis_calc(BMEditMesh *em, DerivedMesh *dm,
 struct CageUserData {
        int totvert;
        float (*cos_cage)[3];
-       BLI_bitmap visit_bitmap;
+       BLI_bitmap *visit_bitmap;
 };
 
 static void cage_mapped_verts_callback(void *userData, int index, const float co[3],
@@ -2207,7 +2207,7 @@ static void cage_mapped_verts_callback(void *userData, int index, const float co
 float (*BKE_editmesh_vertexCos_get(BMEditMesh *em, Scene *scene, int *r_numVerts))[3]
 {
        DerivedMesh *cage, *final;
-       BLI_bitmap visit_bitmap;
+       BLI_bitmap *visit_bitmap;
        struct CageUserData data;
        float (*cos_cage)[3];
 
index cba4c9206c948d07c5a33ea1968d2ef5b280281f..95bf56d00f2969ca30122b6077015e491ecc67f2 100644 (file)
@@ -105,15 +105,15 @@ void multires_customdata_delete(Mesh *me)
 }
 
 /** Grid hiding **/
-static BLI_bitmap multires_mdisps_upsample_hidden(BLI_bitmap lo_hidden,
-                                                  int lo_level,
-                                                  int hi_level,
+static BLI_bitmap *multires_mdisps_upsample_hidden(BLI_bitmap *lo_hidden,
+                                                   int lo_level,
+                                                   int hi_level,
 
-                                                  /* assumed to be at hi_level (or
-                                                   *  null) */
-                                                  BLI_bitmap prev_hidden)
+                                                   /* assumed to be at hi_level (or
+                                                    *  null) */
+                                                   BLI_bitmap *prev_hidden)
 {
-       BLI_bitmap subd;
+       BLI_bitmap *subd;
        int hi_gridsize = ccg_gridsize(hi_level);
        int lo_gridsize = ccg_gridsize(lo_level);
        int yh, xh, xl, yl, xo, yo, hi_ndx;
@@ -168,11 +168,11 @@ static BLI_bitmap multires_mdisps_upsample_hidden(BLI_bitmap lo_hidden,
        return subd;
 }
 
-static BLI_bitmap multires_mdisps_downsample_hidden(BLI_bitmap old_hidden,
-                                                    int old_level,
-                                                    int new_level)
+static BLI_bitmap *multires_mdisps_downsample_hidden(BLI_bitmap *old_hidden,
+                                                     int old_level,
+                                                     int new_level)
 {
-       BLI_bitmap new_hidden;
+       BLI_bitmap *new_hidden;
        int new_gridsize = ccg_gridsize(new_level);
        int old_gridsize = ccg_gridsize(old_level);
        int x, y, factor, old_value;
@@ -200,7 +200,7 @@ static void multires_output_hidden_to_ccgdm(CCGDerivedMesh *ccgdm,
                                             Mesh *me, int level)
 {
        const MDisps *mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
-       BLI_bitmap *grid_hidden = ccgdm->gridHidden;
+       BLI_bitmap **grid_hidden = ccgdm->gridHidden;
        int *gridOffset;
        int i, j;
        
@@ -210,7 +210,7 @@ static void multires_output_hidden_to_ccgdm(CCGDerivedMesh *ccgdm,
                for (j = 0; j < me->mpoly[i].totloop; j++) {
                        int g = gridOffset[i] + j;
                        const MDisps *md = &mdisps[g];
-                       BLI_bitmap gh = md->hidden;
+                       BLI_bitmap *gh = md->hidden;
                        
                        if (gh) {
                                grid_hidden[g] =
@@ -224,7 +224,7 @@ static void multires_output_hidden_to_ccgdm(CCGDerivedMesh *ccgdm,
  * the current level of md.hidden) */
 static void multires_mdisps_subdivide_hidden(MDisps *md, int new_level)
 {
-       BLI_bitmap subd;
+       BLI_bitmap *subd;
        
        BLI_assert(md->hidden);
 
@@ -647,7 +647,7 @@ static void multires_del_higher(MultiresModifierData *mmd, Object *ob, int lvl)
 
                                        multires_copy_grid(ndisps, hdisps, nsize, hsize);
                                        if (mdisp->hidden) {
-                                               BLI_bitmap gh =
+                                               BLI_bitmap *gh =
                                                    multires_mdisps_downsample_hidden(mdisp->hidden,
                                                                                      mdisp->level,
                                                                                      lvl);
@@ -1251,7 +1251,7 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm)
 void multires_modifier_update_hidden(DerivedMesh *dm)
 {
        CCGDerivedMesh *ccgdm = (CCGDerivedMesh *)dm;
-       BLI_bitmap *grid_hidden = ccgdm->gridHidden;
+       BLI_bitmap **grid_hidden = ccgdm->gridHidden;
        Mesh *me = ccgdm->multires.ob->data;
        MDisps *mdisps = CustomData_get_layer(&me->ldata, CD_MDISPS);
        int totlvl = ccgdm->multires.totlvl;
@@ -1262,7 +1262,7 @@ void multires_modifier_update_hidden(DerivedMesh *dm)
                
                for (i = 0; i < me->totloop; i++) {
                        MDisps *md = &mdisps[i];
-                       BLI_bitmap gh = grid_hidden[i];
+                       BLI_bitmap *gh = grid_hidden[i];
 
                        if (!gh && md->hidden) {
                                MEM_freeN(md->hidden);
index 99e6e898685cc63b20294019f251d080b4aaa67a..a0cc37dcf3f676c2788bcb45da060512fe3f07d8 100644 (file)
@@ -538,7 +538,7 @@ void BKE_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int
 
 /* Do a full rebuild with on Grids data structure */
 void BKE_pbvh_build_grids(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj,
-                          int totgrid, CCGKey *key, void **gridfaces, DMFlagMat *flagmats, BLI_bitmap *grid_hidden)
+                          int totgrid, CCGKey *key, void **gridfaces, DMFlagMat *flagmats, BLI_bitmap **grid_hidden)
 {
        BBC *prim_bbc = NULL;
        BB cb;
@@ -1253,7 +1253,7 @@ void BKE_pbvh_bounding_box(const PBVH *bvh, float min[3], float max[3])
        }
 }
 
-BLI_bitmap *BKE_pbvh_grid_hidden(const PBVH *bvh)
+BLI_bitmap **BKE_pbvh_grid_hidden(const PBVH *bvh)
 {
        BLI_assert(bvh->type == PBVH_GRIDS);
        return bvh->grid_hidden;
@@ -1469,7 +1469,7 @@ static int pbvh_grids_node_raycast(PBVH *bvh, PBVHNode *node,
 
        for (i = 0; i < totgrid; ++i) {
                CCGElem *grid = bvh->grids[node->prim_indices[i]];
-               BLI_bitmap gh;
+               BLI_bitmap *gh;
 
                if (!grid)
                        continue;
@@ -1664,7 +1664,7 @@ void BKE_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3],
 }
 
 void BKE_pbvh_grids_update(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj, void **gridfaces,
-                           DMFlagMat *flagmats, BLI_bitmap *grid_hidden)
+                           DMFlagMat *flagmats, BLI_bitmap **grid_hidden)
 {
        int a;
 
index b3f7bf6e3d16f58a90af71b28bcd430dfef0a69f..4154b8e4799e4def4037729f6dec4d831c26330d 100644 (file)
@@ -139,11 +139,11 @@ struct PBVH {
        void **gridfaces;
        const DMFlagMat *grid_flag_mats;
        int totgrid;
-       BLI_bitmap *grid_hidden;
+       BLI_bitmap **grid_hidden;
 
        /* Only used during BVH build and update,
         * don't need to remain valid after */
-       BLI_bitmap vert_bitmap;
+       BLI_bitmap *vert_bitmap;
 
 #ifdef PERFCNTRS
        int perf_modified;
index 7c5727b0f690f66579111527d694aef82bb2f5b1..cc33727030af0bcc7c8bf1b124273222785f55b8 100644 (file)
@@ -2930,7 +2930,7 @@ static void ccgdm_create_grids(DerivedMesh *dm)
        gridFaces = MEM_mallocN(sizeof(CCGFace *) * numGrids, "ccgdm.gridFaces");
        gridFlagMats = MEM_mallocN(sizeof(DMFlagMat) * numGrids, "ccgdm.gridFlagMats");
 
-       ccgdm->gridHidden = MEM_callocN(sizeof(BLI_bitmap) * numGrids, "ccgdm.gridHidden");
+       ccgdm->gridHidden = MEM_callocN(sizeof(*ccgdm->gridHidden) * numGrids, "ccgdm.gridHidden");
 
        for (gIndex = 0, index = 0; index < numFaces; index++) {
                CCGFace *f = ccgdm->faceMap[index].face;
@@ -3002,7 +3002,7 @@ static DMFlagMat *ccgDM_getGridFlagMats(DerivedMesh *dm)
        return ccgdm->gridFlagMats;
 }
 
-static BLI_bitmap *ccgDM_getGridHidden(DerivedMesh *dm)
+static BLI_bitmap **ccgDM_getGridHidden(DerivedMesh *dm)
 {
        CCGDerivedMesh *ccgdm = (CCGDerivedMesh *)dm;
        
index 02e5d6bd79705df3fe5cc0d7ab88272bf2dedab6..ca98d28cc402167c50344a1f5ba0bc33c78b2ac4 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef __BLI_BITMAP_H__
 #define __BLI_BITMAP_H__
 
-typedef unsigned int *BLI_bitmap;
+typedef unsigned int BLI_bitmap;
 
 /* warning: the bitmap does not keep track of its own size or check
  * for out-of-bounds access */
@@ -48,7 +48,7 @@ typedef unsigned int *BLI_bitmap;
 /* allocate memory for a bitmap with '_tot' bits; free
  *  with MEM_freeN() */
 #define BLI_BITMAP_NEW(_tot, _alloc_string) \
-       ((BLI_bitmap)MEM_callocN(BLI_BITMAP_SIZE(_tot), \
+       ((BLI_bitmap *)MEM_callocN(BLI_BITMAP_SIZE(_tot), \
                                 _alloc_string))
 
 /* get the value of a single bit at '_index' */
index 75de4e137071ffa307b1057be3a64e9c17449492..5352b367d05f5d05bb72b7c79523932fe4db7de7 100644 (file)
@@ -5174,7 +5174,7 @@ static int select_more_exec(bContext *C, wmOperator *UNUSED(op))
        /* may not be optimal always (example: end of NURBS sphere)   */
        if (obedit->type == OB_SURF) {
                for (nu = editnurb->first; nu; nu = nu->next) {
-                       BLI_bitmap selbpoints;
+                       BLI_bitmap *selbpoints;
                        a = nu->pntsu * nu->pntsv;
                        bp = nu->bp;
                        selbpoints = BLI_BITMAP_NEW(a, "selectlist");
@@ -5260,7 +5260,7 @@ static int select_less_exec(bContext *C, wmOperator *UNUSED(op))
        
        if (obedit->type == OB_SURF) {
                for (nu = editnurb->first; nu; nu = nu->next) {
-                       BLI_bitmap selbpoints;
+                       BLI_bitmap *selbpoints;
                        a = nu->pntsu * nu->pntsv;
                        bp = nu->bp;
                        selbpoints = BLI_BITMAP_NEW(a, "selectlist");
index 6fd198d9ae6063c1448881f02e2d8172bbe8c3d7..db5635d6ea394c812cf96f3a02cce5a3fbbe6e7b 100644 (file)
@@ -198,8 +198,8 @@ static void select_linked_tfaces_with_seams(Mesh *me, const unsigned int index,
        bool do_it = true;
        bool mark = false;
 
-       BLI_bitmap edge_tag = BLI_BITMAP_NEW(me->totedge, __func__);
-       BLI_bitmap poly_tag = BLI_BITMAP_NEW(me->totpoly, __func__);
+       BLI_bitmap *edge_tag = BLI_BITMAP_NEW(me->totedge, __func__);
+       BLI_bitmap *poly_tag = BLI_BITMAP_NEW(me->totpoly, __func__);
 
        if (index != (unsigned int)-1) {
                /* only put face under cursor in array */
index 54e8d8e6599d84275561e2d93cae57d5b9dad82d..a79b06074213ebdb834e3f3074b22426f2427520 100644 (file)
@@ -228,7 +228,7 @@ void LATTICE_OT_select_random(wmOperatorType *ot)
 
 /************************** Select More/Less Operator *************************/
 
-static bool lattice_test_bitmap_uvw(Lattice *lt, BLI_bitmap selpoints, int u, int v, int w, const bool selected)
+static bool lattice_test_bitmap_uvw(Lattice *lt, BLI_bitmap *selpoints, int u, int v, int w, const bool selected)
 {
        if ((u < 0 || u >= lt->pntsu) ||
            (v < 0 || v >= lt->pntsv) ||
@@ -252,7 +252,7 @@ static int lattice_select_more_less(bContext *C, const bool select)
        BPoint *bp;
        const int tot = lt->pntsu * lt->pntsv * lt->pntsw;
        int i, w, u, v;
-       BLI_bitmap selpoints;
+       BLI_bitmap *selpoints;
 
        lt->actbp = LT_ACTBP_NONE;
 
index b1f1f73f493dba44a342965f51f96a62fff52712..b9c97c32fc996d48fecb430716a5874bb90a2a86 100644 (file)
@@ -1671,7 +1671,7 @@ void OBJECT_OT_skin_radii_equalize(wmOperatorType *ot)
 static void skin_armature_bone_create(Object *skin_ob,
                                       MVert *mvert, MEdge *medge,
                                       bArmature *arm,
-                                      BLI_bitmap edges_visited,
+                                      BLI_bitmap *edges_visited,
                                       const MeshElemMap *emap,
                                       EditBone *parent_bone,
                                       int parent_v)
@@ -1720,7 +1720,7 @@ static void skin_armature_bone_create(Object *skin_ob,
 
 static Object *modifier_skin_armature_create(Main *bmain, Scene *scene, Object *skin_ob)
 {
-       BLI_bitmap edges_visited;
+       BLI_bitmap *edges_visited;
        DerivedMesh *deform_dm;
        MVert *mvert;
        Mesh *me = skin_ob->data;
index 3db0bd61f03dd829a565a4180533cd00ad68308a..db6380e920f8dea7267e0daa2a63c726f8003ec4 100644 (file)
@@ -154,7 +154,7 @@ static void partialvis_update_grids(Object *ob,
 {
        CCGElem **grids;
        CCGKey key;
-       BLI_bitmap *grid_hidden;
+       BLI_bitmap **grid_hidden;
        int any_visible = 0;
        int *grid_indices, totgrid, any_changed, i;
 
@@ -171,7 +171,7 @@ static void partialvis_update_grids(Object *ob,
        for (i = 0; i < totgrid; i++) {
                int any_hidden = 0;
                int g = grid_indices[i], x, y;
-               BLI_bitmap gh = grid_hidden[g];
+               BLI_bitmap *gh = grid_hidden[g];
 
                if (!gh) {
                        switch (action) {
index 3aeb2f1597bfcf8718957b08a9561cea4dc2c4db..283cd0b3ee86572402e5c70b303e13ef22db32fb 100644 (file)
@@ -1529,7 +1529,7 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
        float *tmpgrid_mask, *tmprow_mask;
        int v1, v2, v3, v4;
        int thread_num;
-       BLI_bitmap *grid_hidden;
+       BLI_bitmap **grid_hidden;
        int *grid_indices, totgrid, gridsize, i, x, y;
 
        sculpt_brush_test_init(ss, &test);
@@ -1554,7 +1554,7 @@ static void do_multires_smooth_brush(Sculpt *sd, SculptSession *ss, PBVHNode *no
 
        for (i = 0; i < totgrid; ++i) {
                int gi = grid_indices[i];
-               BLI_bitmap gh = grid_hidden[gi];
+               BLI_bitmap *gh = grid_hidden[gi];
                data = griddata[gi];
                adj = &gridadj[gi];
 
index 13f97c50dc76b91c9ca56c1167412ce6e8788d3d..d904ec3bc9699875a53b4bbdc671030d0c16dd8e 100644 (file)
@@ -100,14 +100,14 @@ typedef struct SculptUndoNode {
        /* non-multires */
        int maxvert;                /* to verify if totvert it still the same */
        int *index;                 /* to restore into right location */
-       BLI_bitmap vert_hidden;
+       BLI_bitmap *vert_hidden;
 
        /* multires */
        int maxgrid;                /* same for grid */
        int gridsize;               /* same for grid */
        int totgrid;                /* to restore into right location */
        int *grids;                 /* to restore into right location */
-       BLI_bitmap *grid_hidden;
+       BLI_bitmap **grid_hidden;
 
        /* bmesh */
        struct BMLogEntry *bm_entry;
index 2cc09ea2aa98468b993237d0c850e6fc60954283..8861777f3265fee0da4c4ffe85dbd952f231ec19 100644 (file)
@@ -210,10 +210,10 @@ static int sculpt_undo_restore_hidden(bContext *C, DerivedMesh *dm,
                }
        }
        else if (unode->maxgrid && dm->getGridData) {
-               BLI_bitmap *grid_hidden = dm->getGridHidden(dm);
+               BLI_bitmap **grid_hidden = dm->getGridHidden(dm);
                
                for (i = 0; i < unode->totgrid; i++) {
-                       SWAP(BLI_bitmap,
+                       SWAP(BLI_bitmap *,
                             unode->grid_hidden[i],
                             grid_hidden[unode->grids[i]]);
                        
@@ -531,7 +531,7 @@ static void sculpt_undo_alloc_and_store_hidden(PBVH *pbvh,
                                                SculptUndoNode *unode)
 {
        PBVHNode *node = unode->node;
-       BLI_bitmap *grid_hidden;
+       BLI_bitmap **grid_hidden;
        int i, *grid_indices, totgrid;
 
        grid_hidden = BKE_pbvh_grid_hidden(pbvh);
@@ -539,7 +539,7 @@ static void sculpt_undo_alloc_and_store_hidden(PBVH *pbvh,
        BKE_pbvh_node_get_grids(pbvh, node, &grid_indices, &totgrid,
                                NULL, NULL, NULL, NULL);
                        
-       unode->grid_hidden = MEM_mapallocN(sizeof(BLI_bitmap) * totgrid,
+       unode->grid_hidden = MEM_mapallocN(sizeof(*unode->grid_hidden) * totgrid,
                                           "unode->grid_hidden");
                
        for (i = 0; i < totgrid; i++) {
index 767d4aca3a8b62ac5e2f3121d77f345e4f47d60d..16423c60cac015ec2140d5e9597625e45a7d3586 100644 (file)
@@ -77,7 +77,7 @@
 /* user data structures for derived mesh callbacks */
 typedef struct drawMeshFaceSelect_userData {
        Mesh *me;
-       BLI_bitmap edge_flags; /* pairs of edge options (visible, select) */
+       BLI_bitmap *edge_flags; /* pairs of edge options (visible, select) */
 } drawMeshFaceSelect_userData;
 
 typedef struct drawEMTFMapped_userData {
@@ -100,9 +100,9 @@ typedef struct drawTFace_userData {
 BLI_INLINE int edge_vis_index(const int index) { return index * 2; }
 BLI_INLINE int edge_sel_index(const int index) { return index * 2 + 1; }
 
-static BLI_bitmap get_tface_mesh_marked_edge_info(Mesh *me)
+static BLI_bitmap *get_tface_mesh_marked_edge_info(Mesh *me)
 {
-       BLI_bitmap bitmap_edge_flags = BLI_BITMAP_NEW(me->totedge * 2, __func__);
+       BLI_bitmap *bitmap_edge_flags = BLI_BITMAP_NEW(me->totedge * 2, __func__);
        MPoly *mp;
        MLoop *ml;
        int i, j;
index 4d52afbde93f7681409ab3c562ff9481dda4561e..11cf64b09959f0f8653f8d076ebc73b13c1881e3 100644 (file)
@@ -1266,7 +1266,7 @@ struct GPU_Buffers {
        CCGKey gridkey;
        CCGElem **grids;
        const DMFlagMat *grid_flag_mats;
-       const BLI_bitmap *grid_hidden;
+       BLI_bitmap * const *grid_hidden;
        int *grid_indices;
        int totgrid;
        int has_hidden;
@@ -1686,7 +1686,7 @@ void GPU_update_grid_buffers(GPU_Buffers *buffers, CCGElem **grids,
 }
 
 /* Returns the number of visible quads in the nodes' grids. */
-static int gpu_count_grid_quads(BLI_bitmap *grid_hidden,
+static int gpu_count_grid_quads(BLI_bitmap **grid_hidden,
                                 int *grid_indices, int totgrid,
                                 int gridsize)
 {
@@ -1697,7 +1697,7 @@ static int gpu_count_grid_quads(BLI_bitmap *grid_hidden,
         * visibility */
 
        for (i = 0, totquad = 0; i < totgrid; i++) {
-               const BLI_bitmap gh = grid_hidden[grid_indices[i]];
+               const BLI_bitmap *gh = grid_hidden[grid_indices[i]];
 
                if (gh) {
                        /* grid hidden are present, have to check each element */
@@ -1732,7 +1732,7 @@ static int gpu_count_grid_quads(BLI_bitmap *grid_hidden,
                                           GL_WRITE_ONLY_ARB);                  \
                if (quad_data) {                                                \
                        for (i = 0; i < totgrid; ++i) {                             \
-                               BLI_bitmap gh = NULL;                                   \
+                               BLI_bitmap *gh = NULL;                                  \
                                if (grid_hidden)                                        \
                                        gh = grid_hidden[(grid_indices)[i]];                \
                                                                                                                                                \
@@ -1770,7 +1770,7 @@ static GLuint gpu_get_grid_buffer(int gridsize, GLenum *index_type, unsigned *to
        static unsigned prev_totquad;
 
        /* used in the FILL_QUAD_BUFFER macro */
-       const BLI_bitmap *grid_hidden = NULL;
+       BLI_bitmap * const *grid_hidden = NULL;
        int *grid_indices = NULL;
        int totgrid = 1;
 
@@ -1815,7 +1815,7 @@ static GLuint gpu_get_grid_buffer(int gridsize, GLenum *index_type, unsigned *to
 }
 
 GPU_Buffers *GPU_build_grid_buffers(int *grid_indices, int totgrid,
-                                    BLI_bitmap *grid_hidden, int gridsize)
+                                    BLI_bitmap **grid_hidden, int gridsize)
 {
        GPU_Buffers *buffers;
        int totquad;
@@ -2200,7 +2200,7 @@ static void gpu_draw_buffers_legacy_grids(GPU_Buffers *buffers)
        for (i = 0; i < buffers->totgrid; ++i) {
                int g = buffers->grid_indices[i];
                CCGElem *grid = buffers->grids[g];
-               BLI_bitmap gh = buffers->grid_hidden[g];
+               BLI_bitmap *gh = buffers->grid_hidden[g];
 
                /* TODO: could use strips with hiding as well */