diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-17 03:51:42 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-01-17 03:51:42 +0300 |
commit | 9bcdb4b758d96d1fe5345858f6c61a90f7c57eac (patch) | |
tree | 51d1be5c5d7243b9782a10e8ed99a153f5392ef7 /source/blender/blenkernel/intern | |
parent | de9495e51915cae71ecdae05fdc21e5aef09ba4e (diff) |
2.5: various warning fixes.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/context.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/exotic.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/report.c | 2 |
5 files changed, 23 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 063a0e4a31f..2ecc8cb1754 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1635,7 +1635,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos } /* create an orco derivedmesh in parallel */ - mask= (CustomDataMask)curr->link; + mask= (CustomDataMask)GET_INT_FROM_POINTER(curr->link); if(mask & CD_MASK_ORCO) { if(!orcodm) orcodm= create_orco_dm(ob, me, NULL); @@ -1655,7 +1655,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos DM_set_only_copy(dm, mask); /* add an origspace layer if needed */ - if(((CustomDataMask)curr->link) & CD_MASK_ORIGSPACE) + if(((CustomDataMask)GET_INT_FROM_POINTER(curr->link)) & CD_MASK_ORIGSPACE) if(!CustomData_has_layer(&dm->faceData, CD_ORIGSPACE)) DM_add_face_layer(dm, CD_ORIGSPACE, CD_DEFAULT, NULL); @@ -1847,7 +1847,7 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri } /* create an orco derivedmesh in parallel */ - mask= (CustomDataMask)curr->link; + mask= (CustomDataMask)GET_INT_FROM_POINTER(curr->link); if(mask & CD_MASK_ORCO) { if(!orcodm) orcodm= create_orco_dm(ob, ob->data, em); @@ -1864,9 +1864,9 @@ static void editmesh_calc_modifiers(Scene *scene, Object *ob, EditMesh *em, Deri } /* set the DerivedMesh to only copy needed data */ - DM_set_only_copy(dm, (CustomDataMask)curr->link); + DM_set_only_copy(dm, (CustomDataMask)GET_INT_FROM_POINTER(curr->link)); - if(((CustomDataMask)curr->link) & CD_MASK_ORIGSPACE) + if(((CustomDataMask)GET_INT_FROM_POINTER(curr->link)) & CD_MASK_ORIGSPACE) if(!CustomData_has_layer(&dm->faceData, CD_ORIGSPACE)) DM_add_face_layer(dm, CD_ORIGSPACE, CD_DEFAULT, NULL); diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index ef8b922c0b3..ceac604aace 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -310,6 +310,16 @@ void CTX_data_list_add(bContextDataResult *result, void *data) BLI_addtail(&result->list, link); } +int ctx_data_list_count(const bContext *C, int (*func)(const bContext*, ListBase*)) +{ + ListBase list; + + if(func(C, &list)) + return BLI_countlist(&list); + else + return 0; +} + /* data context */ Main *CTX_data_main(const bContext *C) diff --git a/source/blender/blenkernel/intern/exotic.c b/source/blender/blenkernel/intern/exotic.c index f2bcfdb5065..9c5d67660ba 100644 --- a/source/blender/blenkernel/intern/exotic.c +++ b/source/blender/blenkernel/intern/exotic.c @@ -3329,7 +3329,7 @@ static int read_groupf(char *str) } //XXX error() is now printf until we have a callback error -#define id_test(id) if(id<0) {char errmsg[128];fclose(dxf_fp); if(id==-1) sprintf(errmsg, "Error inputting dxf, near line %d", dxf_line); else if(id==-2) sprintf(errmsg, "Error reading dxf, near line %d", dxf_line);printf(errmsg); return;} +#define id_test(id) if(id<0) {char errmsg[128];fclose(dxf_fp); if(id==-1) sprintf(errmsg, "Error inputting dxf, near line %d", dxf_line); else if(id==-2) sprintf(errmsg, "Error reading dxf, near line %d", dxf_line);printf("%s", errmsg); return;} #define read_group(id,str) {id= read_groupf(str); id_test(id);} diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index ae1247a7327..62c9699aaf9 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -8604,7 +8604,7 @@ LinkNode *modifiers_calcDataMasks(ModifierData *md, CustomDataMask dataMask) if(mti->requiredDataMask) mask = mti->requiredDataMask(md); - BLI_linklist_prepend(&dataMasks, (void *)mask); + BLI_linklist_prepend(&dataMasks, SET_INT_IN_POINTER(mask)); } /* build the list of required data masks - each mask in the list must @@ -8615,14 +8615,14 @@ LinkNode *modifiers_calcDataMasks(ModifierData *md, CustomDataMask dataMask) */ for(curr = dataMasks, prev = NULL; curr; prev = curr, curr = curr->next) { if(prev) { - CustomDataMask prev_mask = (CustomDataMask)prev->link; - CustomDataMask curr_mask = (CustomDataMask)curr->link; + CustomDataMask prev_mask = (CustomDataMask)GET_INT_FROM_POINTER(prev->link); + CustomDataMask curr_mask = (CustomDataMask)GET_INT_FROM_POINTER(curr->link); - curr->link = (void *)(curr_mask | prev_mask); + curr->link = SET_INT_IN_POINTER(curr_mask | prev_mask); } else { - CustomDataMask curr_mask = (CustomDataMask)curr->link; + CustomDataMask curr_mask = (CustomDataMask)GET_INT_FROM_POINTER(curr->link); - curr->link = (void *)(curr_mask | dataMask); + curr->link = SET_INT_IN_POINTER(curr_mask | dataMask); } } diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index 89496fda701..116fd069948 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -245,7 +245,7 @@ void BKE_reports_print(ReportList *reports, ReportType level) if (cstring == NULL) return; - printf(cstring); + printf("%s", cstring); fflush(stdout); MEM_freeN(cstring); } |