- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
return(NULL);
}
-GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c)
+GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
{
FT_GlyphSlot slot;
GlyphBLF *g;
return(g);
if (sharp)
- err = FT_Load_Glyph(font->face, index, FT_LOAD_TARGET_MONO);
+ err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_MONO);
else
- err = FT_Load_Glyph(font->face, index, FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); /* Sure about NO_* flags? */
+ err = FT_Load_Glyph(font->face, (FT_UInt)index, FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING | FT_LOAD_NO_BITMAP); /* Sure about NO_* flags? */
if (err)
return(NULL);
g->next= NULL;
g->prev= NULL;
g->c= c;
- g->idx= index;
+ g->idx= (FT_UInt)index;
g->tex= 0;
g->build_tex= 0;
g->bitmap= NULL;
#ifndef BLF_INTERNAL_H
#define BLF_INTERNAL_H
+struct FontBLF;
+struct GlyphBLF;
+struct GlyphCacheBLF;
+struct rctf;
+
unsigned int blf_next_p2(unsigned int x);
unsigned int blf_hash(unsigned int val);
int blf_utf8_next(unsigned char *buf, int *iindex);
int blf_font_init(void);
void blf_font_exit(void);
-FontBLF *blf_font_new(const char *name, const char *filename);
-FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_size);
-void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_size);
+struct FontBLF *blf_font_new(const char *name, const char *filename);
+struct FontBLF *blf_font_new_from_mem(const char *name, unsigned char *mem, int mem_size);
+void blf_font_attach_from_mem(struct FontBLF *font, const unsigned char *mem, int mem_size);
-void blf_font_size(FontBLF *font, int size, int dpi);
-void blf_font_draw(FontBLF *font, const char *str, unsigned int len);
-void blf_font_draw_ascii(FontBLF *font, const char *str, unsigned int len);
-void blf_font_buffer(FontBLF *font, const char *str);
-void blf_font_boundbox(FontBLF *font, const char *str, rctf *box);
-void blf_font_width_and_height(FontBLF *font, const char *str, float *width, float *height);
-float blf_font_width(FontBLF *font, const char *str);
-float blf_font_height(FontBLF *font, const char *str);
-float blf_font_fixed_width(FontBLF *font);
-void blf_font_free(FontBLF *font);
+void blf_font_size(struct FontBLF *font, int size, int dpi);
+void blf_font_draw(struct FontBLF *font, const char *str, unsigned int len);
+void blf_font_draw_ascii(struct FontBLF *font, const char *str, unsigned int len);
+void blf_font_buffer(struct FontBLF *font, const char *str);
+void blf_font_boundbox(struct FontBLF *font, const char *str, struct rctf *box);
+void blf_font_width_and_height(struct FontBLF *font, const char *str, float *width, float *height);
+float blf_font_width(struct FontBLF *font, const char *str);
+float blf_font_height(struct FontBLF *font, const char *str);
+float blf_font_fixed_width(struct FontBLF *font);
+void blf_font_free(struct FontBLF *font);
-GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, int size, int dpi);
-GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font);
-void blf_glyph_cache_clear(FontBLF *font);
-void blf_glyph_cache_free(GlyphCacheBLF *gc);
+struct GlyphCacheBLF *blf_glyph_cache_find(struct FontBLF *font, int size, int dpi);
+struct GlyphCacheBLF *blf_glyph_cache_new(struct FontBLF *font);
+void blf_glyph_cache_clear(struct FontBLF *font);
+void blf_glyph_cache_free(struct GlyphCacheBLF *gc);
-GlyphBLF *blf_glyph_search(GlyphCacheBLF *gc, unsigned int c);
-GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c);
+struct GlyphBLF *blf_glyph_search(struct GlyphCacheBLF *gc, unsigned int c);
+struct GlyphBLF *blf_glyph_add(struct FontBLF *font, unsigned int index, unsigned int c);
-void blf_glyph_free(GlyphBLF *g);
-int blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y);
+void blf_glyph_free(struct GlyphBLF *g);
+int blf_glyph_render(struct FontBLF *font, struct GlyphBLF *g, float x, float y);
#endif /* BLF_INTERNAL_H */
#include <stdlib.h>
#include <string.h>
+#include "BLF_api.h"
+
#ifdef INTERNATIONAL
#include <locale.h>
#define FONT_SIZE_DEFAULT 12
/* locale options. */
-char global_messagepath[1024];
-char global_language[32];
-char global_encoding_name[32];
+static char global_messagepath[1024];
+static char global_language[32];
+static char global_encoding_name[32];
void BLF_lang_init(void)
BLI_strncpy(global_language, str, sizeof(global_language));
}
-void BLF_lang_encoding(const char *str)
+static void BLF_lang_encoding(const char *str)
{
BLI_strncpy(global_encoding_name, str, sizeof(global_encoding_name));
/* bind_textdomain_codeset(DOMAIN_NAME, encoding_name); */
return;
}
-void BLF_lang_encoding(const char *str)
+static void BLF_lang_encoding(const char *str)
{
(void)str;
return;
#include <stdlib.h>
#include <string.h>
+#include "blf_internal.h"
unsigned int blf_next_p2(unsigned int x)
{
void vertcos_to_key(struct Object *ob, struct KeyBlock *kb, float (*vertCos)[3]);
void offset_to_key(struct Object *ob, struct KeyBlock *kb, float (*ofs)[3]);
+/* key.c */
+extern int slurph_opt;
+
#ifdef __cplusplus
};
#endif
-#endif
-
+#endif // BKE_KEY_H
(e->v1==v && e->v0==vQ))
return e;
}
- return 0;
+ return NULL;
}
static int _vert_isBoundary(CCGVert *v) {
int i;
static float *_face_getIFNoEdge(CCGFace *f, CCGEdge *e, int lvl, int eX, int eY, int levels, int dataSize, int normalDataOffset) {
return (float*) ((byte*) _face_getIFCoEdge(f, e, lvl, eX, eY, levels, dataSize) + normalDataOffset);
}
-void _face_calcIFNo(CCGFace *f, int lvl, int S, int x, int y, float *no, int levels, int dataSize) {
+static void _face_calcIFNo(CCGFace *f, int lvl, int S, int x, int y, float *no, int levels, int dataSize) {
float *a = _face_getIFCo(f, lvl, S, x+0, y+0, levels, dataSize);
float *b = _face_getIFCo(f, lvl, S, x+1, y+0, levels, dataSize);
float *c = _face_getIFCo(f, lvl, S, x+1, y+1, levels, dataSize);
bAction *actn;
int local=0, lib=0;
- if (act->id.lib==0) return;
+ if (act->id.lib==NULL) return;
if (act->id.us==1) {
- act->id.lib= 0;
+ act->id.lib= NULL;
act->id.flag= LIB_LOCAL;
- new_id(0, (ID *)act, 0);
+ new_id(NULL, (ID *)act, NULL);
return;
}
#endif
if(local && lib==0) {
- act->id.lib= 0;
+ act->id.lib= NULL;
act->id.flag= LIB_LOCAL;
//make_local_action_channels(act);
- new_id(0, (ID *)act, 0);
+ new_id(NULL, (ID *)act, NULL);
}
else if(local && lib) {
actn= copy_action(act);
animsys_evaluate_action_group(&id_ptr, act, agrp, NULL, cframe);
}
else {
- AnimData adt= {0};
+ AnimData adt= {NULL};
/* init animdata, and attach to workob */
workob->adt= &adt;
#include "BKE_scene.h"
#include "BKE_utildefines.h"
#include "BKE_depsgraph.h"
+#include "BKE_anim.h"
// XXX bad level call...
static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, float par_space_mat[][4], ParticleSystem *psys, int level, int animated)
{
GroupObject *go;
- Object *ob=0, **oblist=0, obcopy, *obcopylist=0;
+ Object *ob=NULL, **oblist=NULL, obcopy, *obcopylist=NULL;
DupliObject *dob;
ParticleDupliWeight *dw;
ParticleSettings *part;
ParticleData *pa;
- ChildParticle *cpa=0;
+ ChildParticle *cpa=NULL;
ParticleKey state;
ParticleCacheKey *cache;
float ctime, pa_time, scale = 1.0f;
int no_draw_flag = PARS_UNEXIST;
- if(psys==0) return;
+ if(psys==NULL) return;
/* simple preventing of too deep nested groups */
if(level>MAX_DUPLI_RECUR) return;
part=psys->part;
- if(part==0)
+ if(part==NULL)
return;
if(!psys_check_enabled(par, psys))
BLI_srandom(31415926 + psys->seed);
if((psys->renderdata || part->draw_as==PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) {
- ParticleSimulationData sim= {0};
+ ParticleSimulationData sim= {NULL};
sim.scene= scene;
sim.ob= par;
sim.psys= psys;
pa_num = a;
pa_time = psys->particles[cpa->parent].time;
- size = psys_get_child_size(psys, cpa, ctime, 0);
+ size = psys_get_child_size(psys, cpa, ctime, NULL);
}
/* some hair paths might be non-existent so they can't be used for duplication */
/* hair we handle separate and compute transform based on hair keys */
if(a < totpart) {
cache = psys->pathcache[a];
- psys_get_dupli_path_transform(&sim, pa, 0, cache, pamat, &scale);
+ psys_get_dupli_path_transform(&sim, pa, NULL, cache, pamat, &scale);
}
else {
cache = psys->childcache[a-totpart];
- psys_get_dupli_path_transform(&sim, 0, cpa, cache, pamat, &scale);
+ psys_get_dupli_path_transform(&sim, NULL, cpa, cache, pamat, &scale);
}
VECCOPY(pamat[3], cache->co);
static void font_duplilist(ListBase *lb, Scene *scene, Object *par, int level, int animated)
{
- Object *ob, *obar[256]= {0};
+ Object *ob, *obar[256]= {NULL};
Curve *cu;
struct chartrans *ct, *chartransdata;
float vec[3], obmat[4][4], pmat[4][4], fsize, xof, yof;
/* in par the family name is stored, use this to find the other objects */
chartransdata= BKE_text_to_curve(scene, par, FO_DUPLI);
- if(chartransdata==0) return;
+ if(chartransdata==NULL) return;
cu= par->data;
slen= strlen(cu->str);
eq_id= 0;
/* path */
- if ((ksp->rna_path==0) || strcmp(rna_path, ksp->rna_path))
+ if ((ksp->rna_path==NULL) || strcmp(rna_path, ksp->rna_path))
eq_path= 0;
/* index - need to compare whole-array setting too... */
/* if there are strips, evaluate action as per NLA rules */
if ((has_strips) || (adt->actstrip)) {
/* make dummy NLA strip, and add that to the stack */
- NlaStrip dummy_strip= {0};
+ NlaStrip dummy_strip= {NULL};
ListBase dummy_trackslist;
dummy_trackslist.first= dummy_trackslist.last= &dummy_strip;
/* Clear all overides */
/* Add or get existing Override for given setting */
+#if 0
AnimOverride *BKE_animsys_validate_override (PointerRNA *UNUSED(ptr), char *UNUSED(path), int UNUSED(array_index))
{
// FIXME: need to define how to get overrides
return NULL;
}
+#endif
/* -------------------- */
Object *ob;
bArmature *newArm;
- if (arm->id.lib==0)
+ if (arm->id.lib==NULL)
return;
if (arm->id.us==1) {
- arm->id.lib= 0;
+ arm->id.lib= NULL;
arm->id.flag= LIB_LOCAL;
- new_id(0, (ID*)arm, 0);
+ new_id(NULL, (ID*)arm, NULL);
return;
}
if(local && lib==0) {
- arm->id.lib= 0;
+ arm->id.lib= NULL;
arm->id.flag= LIB_LOCAL;
- new_id(0, (ID *)arm, 0);
+ new_id(NULL, (ID *)arm, NULL);
}
else if(local && lib) {
newArm= copy_armature(arm);
while(ob) {
if(ob->data==arm) {
- if(ob->id.lib==0) {
+ if(ob->id.lib==NULL) {
ob->data= newArm;
newArm->id.us++;
arm->id.us--;
Global G;
UserDef U;
-ListBase WMlist= {NULL, NULL};
+/* ListBase = {NULL, NULL}; */
short ENDIAN_ORDER;
-char versionstr[48]= "";
+static char versionstr[48]= "";
/* ********** free ********** */
BlendFileData *bfd;
int retval= 1;
- if(strstr(dir, BLENDER_STARTUP_FILE)==0) /* dont print user-pref loading */
+ if(strstr(dir, BLENDER_STARTUP_FILE)==NULL) /* dont print user-pref loading */
printf("read blend: %s\n", dir);
bfd= BLO_read_from_file(dir, reports);
#include "BKE_global.h"
#include "IMB_imbuf_types.h"
+#include "BKE_bmfont.h"
#include "BKE_bmfont_types.h"
void printfGlyph(bmGlyph * glyph)
Scene *scene;
int local= 0, lib= 0;
- if(brush->id.lib==0) return;
+ if(brush->id.lib==NULL) return;
if(brush->clone.image) {
/* special case: ima always local immediately */
- brush->clone.image->id.lib= 0;
+ brush->clone.image->id.lib= NULL;
brush->clone.image->id.flag= LIB_LOCAL;
- new_id(0, (ID *)brush->clone.image, 0);
+ new_id(NULL, (ID *)brush->clone.image, NULL);
}
for(scene= G.main->scene.first; scene; scene=scene->id.next)
}
if(local && lib==0) {
- brush->id.lib= 0;
+ brush->id.lib= NULL;
brush->id.flag= LIB_LOCAL;
- new_id(0, (ID *)brush, 0);
+ new_id(NULL, (ID *)brush, NULL);
/* enable fake user by default */
if (!(brush->id.flag & LIB_FAKEUSER)) {
for(scene= G.main->scene.first; scene; scene=scene->id.next)
if(paint_brush(&scene->toolsettings->imapaint.paint)==brush)
- if(scene->id.lib==0) {
+ if(scene->id.lib==NULL) {
paint_brush_set(&scene->toolsettings->imapaint.paint, brushn);
brushn->id.us++;
brush->id.us--;
}
}
-void brush_debug_print_state(Brush *br)
+static void brush_debug_print_state(Brush *br)
{
/* create a fake brush and set it to the defaults */
- Brush def= {{0}};
+ Brush def= {{NULL}};
brush_set_defaults(&def);
#define BR_TEST(field, t) \
id= (ID *)brush->mtex.tex;
idtest= (ID*)BLI_findlink(&G.main->tex, nr-1);
- if(idtest==0) { /* new tex */
+ if(idtest==NULL) { /* new tex */
if(id) idtest= (ID *)copy_texture((Tex *)id);
else idtest= (ID *)add_texture("Tex");
idtest->us--;
GPU_vertex_setup( dm );
GPU_normal_setup( dm );
GPU_uv_setup( dm );
- if( col != 0 ) {
+ if( col != NULL ) {
/*if( realcol && dm->drawObject->colType == CD_TEXTURE_MCOL ) {
col = 0;
} else if( mcol && dm->drawObject->colType == CD_MCOL ) {
glShadeModel(GL_SMOOTH);
- if( GPU_buffer_legacy(dm) || setDrawOptions != 0 ) {
+ if( GPU_buffer_legacy(dm) || setDrawOptions != NULL ) {
DEBUG_VBO( "Using legacy code. cdDM_drawMappedFacesGLSL\n" );
memset(&attribs, 0, sizeof(attribs));
glEnd();
}
else {
- GPUBuffer *buffer = 0;
- char *varray = 0;
+ GPUBuffer *buffer = NULL;
+ char *varray = NULL;
int numdata = 0, elementsize = 0, offset;
int start = 0, numfaces = 0, prevdraw = 0, curface = 0;
int i;
if( numdata != 0 ) {
- GPU_buffer_free(buffer,0);
+ GPU_buffer_free(buffer, NULL);
- buffer = 0;
+ buffer = NULL;
}
}
}
if( numdata != 0 ) {
elementsize = GPU_attrib_element_size( datatypes, numdata );
- buffer = GPU_buffer_alloc( elementsize*dm->drawObject->nelements, 0 );
- if( buffer == 0 ) {
+ buffer = GPU_buffer_alloc( elementsize*dm->drawObject->nelements, NULL );
+ if( buffer == NULL ) {
GPU_buffer_unbind();
dm->drawObject->legacy = 1;
return;
}
varray = GPU_buffer_lock_stream(buffer);
- if( varray == 0 ) {
+ if( varray == NULL ) {
GPU_buffer_unbind();
- GPU_buffer_free(buffer, 0);
+ GPU_buffer_free(buffer, NULL);
dm->drawObject->legacy = 1;
return;
}
}
GPU_buffer_unbind();
}
- GPU_buffer_free( buffer, 0 );
+ GPU_buffer_free( buffer, NULL );
}
glShadeModel(GL_FLAT);
*/
#define mySWAP(a,b) do { double tmp = b ; b = a ; a = tmp ; } while(0)
-
-int
+#if 0 /* UNUSED */
+static int
gsl_poly_solve_cubic (double a, double b, double c,
double *x0, double *x1, double *x2)
{
*
* copied from GSL
*/
-int
+static int
gsl_poly_solve_quadratic (double a, double b, double c,
double *x0, double *x1)
{
return 0;
}
}
-
+#endif /* UNUSED */
BVHTreeRayHit hit;
BVHTreeNearest nearest;
- BVHTreeFromMesh treeData= {0};
+ BVHTreeFromMesh treeData= {NULL};
nearest.index = -1;
nearest.dist = FLT_MAX;
/* context */
-bContext *CTX_create()
+bContext *CTX_create(void)
{
bContext *C;
"texturepaint",
"particlemode",
"objectmode",
- 0
+ NULL
};
const char *CTX_data_mode_string(const bContext *C)
{
int a;
cun= copy_libblock(cu);
- cun->nurb.first= cun->nurb.last= 0;
+ cun->nurb.first= cun->nurb.last= NULL;
duplicateNurblist( &(cun->nurb), &(cu->nurb));
cun->mat= MEM_dupallocN(cu->mat);
cun->key= copy_key(cu->key);
if(cun->key) cun->key->from= (ID *)cun;
- cun->disp.first= cun->disp.last= 0;
- cun->bev.first= cun->bev.last= 0;
- cun->path= 0;
+ cun->disp.first= cun->disp.last= NULL;
+ cun->bev.first= cun->bev.last= NULL;
+ cun->path= NULL;
cun->editnurb= NULL;
cun->editfont= NULL;
void make_local_curve(Curve *cu)
{
- Object *ob = 0;
+ Object *ob = NULL;
Curve *cun;
int local=0, lib=0;
* - mixed: do a copy
*/
- if(cu->id.lib==0) return;
+ if(cu->id.lib==NULL) return;
if(cu->vfont) cu->vfont->id.lib= NULL;
if(cu->vfontb) cu->vfontb->id.lib= NULL;
if(cu->vfontbi) cu->vfontbi->id.lib= NULL;
if(cu->id.us==1) {
- cu->id.lib= 0;
+ cu->id.lib= NULL;
cu->id.flag= LIB_LOCAL;
- new_id(0, (ID *)cu, 0);
+ new_id(NULL, (ID *)cu, NULL);
return;
}
}
if(local && lib==0) {
- cu->id.lib= 0;
+ cu->id.lib= NULL;
cu->id.flag= LIB_LOCAL;
- new_id(0, (ID *)cu, 0);
+ new_id(NULL, (ID *)cu, NULL);
}
else if(local && lib) {
cun= copy_curve(cu);
while(ob) {
if(ob->data==cu) {
- if(ob->id.lib==0) {
+ if(ob->id.lib==NULL) {
ob->data= cun;
cun->id.us++;
cu->id.us--;
void freeNurb(Nurb *nu)
{
- if(nu==0) return;
+ if(nu==NULL) return;
if(nu->bezt) MEM_freeN(nu->bezt);
- nu->bezt= 0;
+ nu->bezt= NULL;
if(nu->bp) MEM_freeN(nu->bp);
- nu->bp= 0;
+ nu->bp= NULL;
if(nu->knotsu) MEM_freeN(nu->knotsu);
nu->knotsu= NULL;
if(nu->knotsv) MEM_freeN(nu->knotsv);
{
Nurb *nu, *next;
- if(lb==0) return;
+ if(lb==NULL) return;
nu= lb->first;
while(nu) {
freeNurb(nu);
nu= next;
}
- lb->first= lb->last= 0;
+ lb->first= lb->last= NULL;
}
Nurb *duplicateNurb(Nurb *nu)
int len;
newnu= (Nurb*)MEM_mallocN(sizeof(Nurb),"duplicateNurb");
- if(newnu==0) return 0;
+ if(newnu==NULL) return NULL;
memcpy(newnu, nu, sizeof(Nurb));
if(nu->bezt) {
{
int a, b, order2, c;
- if(knots==0) return;
+ if(knots==NULL) return;
order2=order-1;
if(nu->knotsu==NULL) return;
if(nu->orderu>nu->pntsu) return;
- if(coord_array==0) return;
+ if(coord_array==NULL) return;
/* allocate and initialize */
len= nu->pntsu;
dl= bevdisp.first;
} else {
dl= cu->bevobj->disp.first;
- if(dl==0) {
+ if(dl==NULL) {
makeDispListCurveTypes(scene, cu->bevobj, 0);
dl= cu->bevobj->disp.first;
}
int nr;
float q[4];
- float cross_tmp[3];
-
bevel_list_calc_bisect(bl);
bevp2= (BevPoint *)(bl+1);
float angle= angle_normalized_v3v3(bevp0->dir, bevp1->dir);
if(angle > 0.0f) { /* otherwise we can keep as is */
+ float cross_tmp[3];
cross_v3_v3v3(cross_tmp, bevp0->dir, bevp1->dir);
axis_angle_to_quat(q, cross_tmp, angle);
mul_qt_qtqt(bevp1->quat, q, bevp0->quat);
p2= bezt->vec[1];
- if(prev==0) {
+ if(prev==NULL) {
p3= next->vec[1];
pt[0]= 2*p2[0]- p3[0];
pt[1]= 2*p2[1]- p3[1];
}
else p1= prev->vec[1];
- if(next==0) {
+ if(next==NULL) {
pt[0]= 2*p2[0]- p1[0];
pt[1]= 2*p2[1]- p1[1];
pt[2]= 2*p2[2]- p1[2];
a= nu->pntsu;
bezt= nu->bezt;
if(nu->flagu & CU_NURB_CYCLIC) prev= bezt+(a-1);
- else prev= 0;
+ else prev= NULL;
next= bezt+1;
while(a--) {
prev= bezt;
if(a==1) {
if(nu->flagu & CU_NURB_CYCLIC) next= nu->bezt;
- else next= 0;
+ else next= NULL;
}
else next++;
BezTriple *bezt2, *bezt1, *bezt0;
int i, align, leftsmall, rightsmall;
- if(nu==0 || nu->bezt==0) return;
+ if(nu==NULL || nu->bezt==NULL) return;
bezt2 = nu->bezt;
bezt1 = bezt2 + (nu->pntsu-1);
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]);
-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},
{sizeof(float)*3, "", 0, NULL, NULL, 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",
{
bDeformGroup *defgroup, *defgroupn;
- outbase->first= outbase->last= 0;
+ outbase->first= outbase->last= NULL;
for (defgroup = inbase->first; defgroup; defgroup=defgroup->next){
defgroupn= defgroup_duplicate(defgroup);
}
-DagForest * dag_init()
+DagForest *dag_init(void)
{
DagForest *forest;
/* use callocN to init all zero */
dl= dl->next;
}
- return 0;
+ return NULL;
}
int displist_has_faces(ListBase *lb)
{
EditVert *eve, *v1, *vlast;
EditFace *efa;
- DispList *dlnew=0, *dl;
+ DispList *dlnew=NULL, *dl;
float *f1;
int colnr=0, charidx=0, cont=1, tot, a, *index, nextcol= 0;
intptr_t totvert;
- if(dispbase==0) return;
- if(dispbase->first==0) return;
+ if(dispbase==NULL) return;
+ if(dispbase->first==NULL) return;
while(cont) {
cont= 0;
/* make editverts and edges */
f1= dl->verts;
a= dl->nr;
- eve= v1= 0;
+ eve= v1= NULL;
while(a--) {
vlast= eve;
eve= BLI_addfillvert(f1);
totvert++;
- if(vlast==0) v1= eve;
+ if(vlast==NULL) v1= eve;
else {
BLI_addfilledge(vlast, eve);
}
f1+=3;
}
- if(eve!=0 && v1!=0) {
+ if(eve!=NULL && v1!=NULL) {
BLI_addfilledge(eve, v1);
}
} else if (colnr<dl->col) {
float *fp, *fp1;
int a, dpoly;
- front.first= front.last= back.first= back.last= 0;
+ front.first= front.last= back.first= back.last= NULL;
dl= dispbase->first;
while(dl) {
/* this is confusing, there's also min_max_object, appplying the obmat... */
static void boundbox_displist(Object *ob)
{
- BoundBox *bb=0;
+ BoundBox *bb=NULL;
float min[3], max[3];
DispList *dl;
float *vert;
Curve *cu= ob->data;
int doit= 0;
- if(cu->bb==0) cu->bb= MEM_callocN(sizeof(BoundBox), "boundbox");
+ if(cu->bb==NULL) cu->bb= MEM_callocN(sizeof(BoundBox), "boundbox");
bb= cu->bb;
dl= ob->disp.first;
if(paf->type==EFF_PARTICLE) return paf;
paf= paf->next;
}
- return 0;
+ return NULL;
}
void free_effect(Effect *eff)
if(eff->psys == point->psys && *efd->index == point->index)
;
else {
- ParticleSimulationData sim= {0};
+ ParticleSimulationData sim= {NULL};
sim.scene= eff->scene;
sim.ob= eff->ob;
sim.psys= eff->psys;
if(!eff->pd->tex)
return;
- result[0].nor = result[1].nor = result[2].nor = result[3].nor = 0;
+ result[0].nor = result[1].nor = result[2].nor = result[3].nor = NULL;
strength= eff->pd->f_strength * efd->falloff;
add_v3_v3(total_force, force);
}
-void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint *point, float *total_force)
+static void do_physical_effector(EffectorCache *eff, EffectorData *efd, EffectedPoint *point, float *total_force)
{
PartDeflect *pd = eff->pd;
RNG *rng = pd->rng;
/* ************************ WRITE ************************** */
-
-char temp_dir[160]= {0, 0};
-
static void write_vert_stl(Object *ob, MVert *verts, int index, FILE *fpSTL)
{
float vert[3];
BKE_reportf(reports, RPT_ERROR, "Can't open file: %s.", strerror(errno));
return;
}
- strcpy(temp_dir, str);
//XXX waitcursor(1);
//XXX error("Can't write file");
return;
}
- strcpy(temp_dir, str);
//XXX waitcursor(1);
ma= G.main->mat.first;
while(ma) {
- if(ma->mtex[0]==0) {
+ if(ma->mtex[0]==NULL) {
if(color[0]==ma->r && color[1]==ma->g && color[2]==ma->b) {
me->mat[0]= ma;
ma->id.us++;
}
ma= ma->id.next;
}
- if(ma==0) {
+ if(ma==NULL) {
ma= add_material("ext");
me->mat[0]= ma;
ma->r= color[0];
/* ......... */
/* Table of Driver Varaiable Type Info Data */
-DriverVarTypeInfo dvar_types[MAX_DVAR_TYPES] = {
+static DriverVarTypeInfo dvar_types[MAX_DVAR_TYPES] = {
BEGIN_DVAR_TYPEDEF(DVAR_TYPE_SINGLE_PROP)
dvar_eval_singleProp, /* eval callback */
1, /* number of targets used */
};
/* Get driver variable typeinfo */
-DriverVarTypeInfo *get_dvar_typeinfo (int type)
+static DriverVarTypeInfo *get_dvar_typeinfo (int type)
{
/* check if valid type */
if ((type >= 0) && (type < MAX_DVAR_TYPES))
/* The vfont code */
void free_vfont(struct VFont *vf)
{
- if (vf == 0) return;
+ if (vf == NULL) return;
if (vf->data) {
while(vf->data->characters.first)
nu2->flagu = CU_NURB_CYCLIC;
bp = (BPoint*)MEM_callocN(4 * sizeof(BPoint),"underline_bp");
- if (bp == 0){
+ if (bp == NULL){
MEM_freeN(nu2);
return;
}
bezt1 = nu1->bezt;
if (bezt1){
nu2 =(Nurb*) MEM_mallocN(sizeof(Nurb),"duplichar_nurb");
- if (nu2 == 0) break;
+ if (nu2 == NULL) break;
memcpy(nu2, nu1, sizeof(struct Nurb));
nu2->resolu= cu->resolu;
- nu2->bp = 0;
+ nu2->bp = NULL;
nu2->knotsu = nu2->knotsv = NULL;
nu2->flag= CU_SMOOTH;
nu2->charidx = charidx;
i = nu2->pntsu;
bezt2 = (BezTriple*)MEM_mallocN(i * sizeof(BezTriple),"duplichar_bezt2");
- if (bezt2 == 0){
+ if (bezt2 == NULL){
MEM_freeN(nu2);
break;
}
/* renark: do calculations including the trailing '\0' of a string
because the cursor can be at that location */
- if(ob->type!=OB_FONT) return 0;
+ if(ob->type!=OB_FONT) return NULL;
// Set font data
cu= (Curve *) ob->data;
vfont= cu->vfont;
- if(cu->str == NULL) return 0;
- if(vfont == NULL) return 0;
+ if(cu->str == NULL) return NULL;
+ if(vfont == NULL) return NULL;
// Create unicode string
utf8len = utf8slen(cu->str);
if(!vfd) {
if(mem)
MEM_freeN(mem);
- return 0;
+ return NULL;
}
/* calc offset and rotation of each char */
che= find_vfont_char(vfd, ascii);
/* No VFont found */
- if (vfont==0) {
+ if (vfont==NULL) {
if(mem)
MEM_freeN(mem);
MEM_freeN(chartransdata);
- return 0;
+ return NULL;
}
if (vfont != oldvfont) {
if(mem)
MEM_freeN(mem);
MEM_freeN(chartransdata);
- return 0;
+ return NULL;
}
twidth = char_width(cu, che, info);
MEM_freeN(mem);
MEM_freeN(chartransdata);
- return 0;
+ return NULL;
}
-
-
gIcons = BLI_ghash_new(BLI_ghashutil_inthash, BLI_ghashutil_intcmp, "icons_init gh");
}
-void BKE_icons_free()
+void BKE_icons_free(void)
{
if(gIcons)
- BLI_ghash_free(gIcons, 0, icon_free);
+ BLI_ghash_free(gIcons, NULL, icon_free);
gIcons = NULL;
}
-struct PreviewImage* BKE_previewimg_create()
+struct PreviewImage* BKE_previewimg_create(void)
{
PreviewImage* prv_img = NULL;
int i;
void BKE_icon_changed(int id)
{
- Icon* icon = 0;
+ Icon* icon = NULL;
if (!id || G.background) return;
int BKE_icon_getid(struct ID* id)
{
- Icon* new_icon = 0;
+ Icon* new_icon = NULL;
if (!id || G.background)
return 0;
new_icon->type = GS(id->name);
/* next two lines make sure image gets created */
- new_icon->drawinfo = 0;
- new_icon->drawinfo_free = 0;
+ new_icon->drawinfo = NULL;
+ new_icon->drawinfo_free = NULL;
BLI_ghash_insert(gIcons, SET_INT_IN_POINTER(id->icon_id), new_icon);
Icon* BKE_icon_get(int icon_id)
{
- Icon* icon = 0;
+ Icon* icon = NULL;
icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id));
if (!icon) {
printf("BKE_icon_get: Internal error, no icon for icon ID: %d\n", icon_id);
- return 0;
+ return NULL;
}
return icon;
void BKE_icon_set(int icon_id, struct Icon* icon)
{
- Icon* old_icon = 0;
+ Icon* old_icon = NULL;
old_icon = BLI_ghash_lookup(gIcons, SET_INT_IN_POINTER(icon_id));
if (!id->icon_id) return; /* no icon defined for library object */
- BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(id->icon_id), 0, icon_free);
+ BLI_ghash_remove(gIcons, SET_INT_IN_POINTER(id->icon_id), NULL, icon_free);
id->icon_id = 0;
}
#include "DNA_ID.h"
+#include "BKE_idcode.h"
+
typedef struct {
unsigned short code;
const char *name, *plural;
return newp;
}
-IDProperty *IDP_CopyArray(IDProperty *prop)
+static IDProperty *IDP_CopyArray(IDProperty *prop)
{
IDProperty *newp = idp_generic_copy(prop);
return prop;
}
-IDProperty *IDP_CopyString(IDProperty *prop)
+static IDProperty *IDP_CopyString(IDProperty *prop)
{
IDProperty *newp = idp_generic_copy(prop);
/*-------- Group Functions -------*/
/*checks if a property with the same name as prop exists, and if so replaces it.*/
-IDProperty *IDP_CopyGroup(IDProperty *prop)
+static IDProperty *IDP_CopyGroup(IDProperty *prop)
{
IDProperty *newp = idp_generic_copy(prop), *link;
newp->len = prop->len;
{
struct ImBuf * tbuf1, * tbuf2;
- if (ibuf == 0) return;
+ if (ibuf == NULL) return;
if (ibuf->flags & IB_fields) return;
ibuf->flags |= IB_fields;
{
struct ImBuf * tbuf1, * tbuf2;
- if (ibuf == 0) return;
+ if (ibuf == NULL) return;
if (ibuf->flags & IB_fields) return;
ibuf->flags |= IB_fields;
}
#endif
-void free_old_images()
+void free_old_images(void)
{
Image *ima;
static int lasttime = 0;
struct ImBuf *ibuf;
anim = IMB_open_anim(name, flags);
- if (anim == NULL) return(0);
+ if (anim == NULL) return NULL;
ibuf = IMB_anim_absolute(anim, 0);
if (ibuf == NULL) {
else
printf("anim file doesn't exist: %s\n", name);
IMB_free_anim(anim);
- return(0);
+ return NULL;
}
IMB_freeImBuf(ibuf);
#include <math.h>
#include <stdlib.h>
+
+#include "BKE_image.h"
#include "BLI_math_color.h"
#include "BLF_api.h"
#include "BLI_utildefines.h"
-
+#include "BKE_ipo.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
#include "BKE_fcurve.h"
Key *keyn;
KeyBlock *kbn, *kb;
- if(key==0) return 0;
+ if(key==NULL) return NULL;
keyn= copy_libblock(key);
* - only local users: set flag
* - mixed: make copy
*/
- if(key==0) return;
+ if(key==NULL) return;
- key->id.lib= 0;
- new_id(0, (ID *)key, 0);
+ key->id.lib= NULL;
+ new_id(NULL, (ID *)key, NULL);
}
/* Sort shape keys and Ipo curves after a change. This assumes that at most
/* if(fac<0.0 || fac>1.0) return 1; */
- if(k1->next==0) return 1;
+ if(k1->next==NULL) return 1;
if(cycl) { /* pre-sort */
k[2]= k1->next;
k[3]= k[2]->next;
- if(k[3]==0) k[3]=k1;
+ if(k[3]==NULL) k[3]=k1;
while(k1) {
- if(k1->next==0) k[0]=k1;
+ if(k1->next==NULL) k[0]=k1;
k1=k1->next;
}
k1= k[1];
k[2]= k1->next;
t[2]= k[2]->pos;
k[3]= k[2]->next;
- if(k[3]==0) k[3]= k[2];
+ if(k[3]==NULL) k[3]= k[2];
t[3]= k[3]->pos;
k1= k[3];
}
while( t[2]<fac ) { /* find correct location */
- if(k1->next==0) {
+ if(k1->next==NULL) {
if(cycl) {
k1= firstkey;
ofs+= dpos;
for(a=0; a<tot; a+=step, cfra+= delta) {
- ctime= bsystem_time(scene, 0, cfra, 0.0); // xxx ugly cruft!
+ ctime= bsystem_time(scene, NULL, cfra, 0.0); // xxx ugly cruft!
#if 0 // XXX old animation system
if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
ctime /= 100.0;
while (a < estep) {
if (remain <= 0) {
cfra+= delta;
- ctime= bsystem_time(scene, 0, cfra, 0.0f); // XXX old cruft
+ ctime= bsystem_time(scene, NULL, cfra, 0.0f); // XXX old cruft
ctime /= 100.0f;
CLAMP(ctime, 0.0f, 1.0f); // XXX for compat, we use this, but this clamping was confusing
for(a=0; a<tot; a++, cfra+= delta) {
- ctime= bsystem_time(scene, 0, cfra, 0.0); // XXX old cruft
+ ctime= bsystem_time(scene, NULL, cfra, 0.0); // XXX old cruft
#if 0 // XXX old animation system
if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
ctime /= 100.0;
* - mixed: make copy
*/
- if(lt->id.lib==0) return;
+ if(lt->id.lib==NULL) return;
if(lt->id.us==1) {
- lt->id.lib= 0;
+ lt->id.lib= NULL;
lt->id.flag= LIB_LOCAL;
- new_id(0, (ID *)lt, 0);
+ new_id(NULL, (ID *)lt, NULL);
return;
}
}
if(local && lib==0) {
- lt->id.lib= 0;
+ lt->id.lib= NULL;
lt->id.flag= LIB_LOCAL;
- new_id(0, (ID *)lt, 0);
+ new_id(NULL, (ID *)lt, NULL);
}
else if(local && lib) {
ltn= copy_lattice(lt);
while(ob) {
if(ob->data==lt) {
- if(ob->id.lib==0) {
+ if(ob->id.lib==NULL) {
ob->data= ltn;
ltn->id.us++;
lt->id.us--;
case ID_GD:
return &(mainlib->gpencil);
}
- return 0;
+ return NULL;
}
/* Flag all ids in listbase */
free_windowmanager_cb= func;
}
-void animdata_dtar_clear_cb(ID *UNUSED(id), AnimData *adt, void *userdata)
+static void animdata_dtar_clear_cb(ID *UNUSED(id), AnimData *adt, void *userdata)
{
ChannelDriver *driver;
FCurve *fcu;
idtest= idtest->next;
}
/* as last */
- if(idtest==0) {
+ if(idtest==NULL) {
BLI_addtail(lb, id);
}
}
}
/* next to indirect usage in read/writefile also in editobject.c scene.c */
-void clear_id_newpoins()
+void clear_id_newpoins(void)
{
ListBase *lbarray[MAX_LIBARRAY];
ID *id;
while(a--) {
id= lbarray[a]->first;
while(id) {
- id->newid= 0;
+ id->newid= NULL;
id->flag &= ~LIB_NEW;
id= id->next;
}
/* if lib!=NULL, only all from lib local */
void all_local(Library *lib, int untagged_only)
{
- ListBase *lbarray[MAX_LIBARRAY], tempbase={0, 0};
+ ListBase *lbarray[MAX_LIBARRAY], tempbase={NULL, NULL};
ID *id, *idn;
int a;
image_fix_relative_path((Image *)id);
id->lib= NULL;
- new_id(lbarray[a], id, 0); /* new_id only does it with double names */
+ new_id(lbarray[a], id, NULL); /* new_id only does it with double names */
sort_alpha_id(lbarray[a], id);
}
}
while( (id=tempbase.first) ) {
BLI_remlink(&tempbase, id);
BLI_addtail(lbarray[a], id);
- new_id(lbarray[a], id, 0);
+ new_id(lbarray[a], id, NULL);
}
}
lb= which_libbase(G.main, GS(name-2) );
- if(lb==0) return;
+ if(lb==NULL) return;
/* search for id */
idtest= BLI_findstring(lb, name, offsetof(ID, name) + 2);
* - mixed: make copy
*/
- if(ma->id.lib==0) return;
+ if(ma->id.lib==NULL) return;
if(ma->id.us==1) {
- ma->id.lib= 0;
+ ma->id.lib= NULL;
ma->id.flag= LIB_LOCAL;
- new_id(0, (ID *)ma, 0);
+ new_id(NULL, (ID *)ma, NULL);
for(a=0; a<MAX_MTEX; a++) {
if(ma->mtex[a]) id_lib_extern((ID *)ma->mtex[a]->tex);
}
}
if(local && lib==0) {
- ma->id.lib= 0;
+ ma->id.lib= NULL;
ma->id.flag= LIB_LOCAL;
for(a=0; a<MAX_MTEX; a++) {
if(ma->mtex[a]) id_lib_extern((ID *)ma->mtex[a]->tex);
}
- new_id(0, (ID *)ma, 0);
+ new_id(NULL, (ID *)ma, NULL);
}
else if(local && lib) {
if(ob->mat) {
for(a=0; a<ob->totcol; a++) {
if(ob->mat[a]==ma) {
- if(ob->id.lib==0) {
+ if(ob->id.lib==NULL) {
ob->mat[a]= man;
man->id.us++;
ma->id.us--;
if(me->mat) {
for(a=0; a<me->totcol; a++) {
if(me->mat[a]==ma) {
- if(me->id.lib==0) {
+ if(me->id.lib==NULL) {
me->mat[a]= man;
man->id.us++;
ma->id.us--;
if(cu->mat) {
for(a=0; a<cu->totcol; a++) {
if(cu->mat[a]==ma) {
- if(cu->id.lib==0) {
+ if(cu->id.lib==NULL) {
cu->mat[a]= man;
man->id.us++;
ma->id.us--;
if(mb->mat) {
for(a=0; a<mb->totcol; a++) {
if(mb->mat[a]==ma) {
- if(mb->id.lib==0) {
+ if(mb->id.lib==NULL) {
mb->mat[a]= man;
man->id.us++;
ma->id.us--;
matarar= give_matarar(ob);
if(matarar && *matarar) ma= (*matarar)[act-1];
- else ma= 0;
+ else ma= NULL;
}
ID *material_from(Object *ob, int act)
{
- if(ob==0) return 0;
+ if(ob==NULL) return NULL;
if(ob->totcol==0) return ob->data;
if(act==0) act= 1;
totcolp= give_totcolp(ob);
matarar= give_matarar(ob);
- if(totcolp==0 || matarar==0) return;
+ if(totcolp==NULL || matarar==NULL) return;
if(act > *totcolp) {
matar= MEM_callocN(sizeof(void *)*act, "matarray1");
{
Material *ma;
- if(ob==0) return FALSE;
+ if(ob==NULL) return FALSE;
if(ob->totcol>=MAXMAT) return FALSE;
ma= give_current_material(ob, ob->actcol);
/* ****************** */
-char colname_array[125][20]= {
+static char colname_array[125][20]= {
"Black","DarkRed","HalfRed","Red","Red",
"DarkGreen","DarkOlive","Brown","Chocolate","OrangeRed",
"HalfGreen","GreenOlive","DryOlive","Goldenrod","DarkOrange",
int nr, r, g, b;
float ref;
- if(ma==0) return;
+ if(ma==NULL) return;
if(ma->mode & MA_SHLESS) ref= 1.0;
else ref= ma->ref;
if(*totcolp==0) {
MEM_freeN(*matarar);
- *matarar= 0;
+ *matarar= NULL;
}
actcol= ob->actcol;
if(obt->totcol==0) {
MEM_freeN(obt->mat);
MEM_freeN(obt->matbits);
- obt->mat= 0;
+ obt->mat= NULL;
obt->matbits= NULL;
}
}
/* copy/paste buffer, if we had a propper py api that would be better */
Material matcopybuf;
-static short matcopied=0;
+static short matcopied= 0;
void clear_matcopybuf(void)
{
for(a=0; a<mb->totcol; a++) {
if(mb->mat[a]) mb->mat[a]->id.us--;
- mb->mat[a]= 0;
+ mb->mat[a]= NULL;
}
}
* - mixed: make copy
*/
- if(mb->id.lib==0) return;
+ if(mb->id.lib==NULL) return;
if(mb->id.us==1) {
- mb->id.lib= 0;
+ mb->id.lib= NULL;
mb->id.flag= LIB_LOCAL;
return;
}
}
if(local && lib==0) {
- mb->id.lib= 0;
+ mb->id.lib= NULL;
mb->id.flag= LIB_LOCAL;
}
else if(local && lib) {
while(ob) {
if(ob->data==mb) {
- if(ob->id.lib==0) {
+ if(ob->id.lib==NULL) {
ob->data= mbn;
mbn->id.us++;
mb->id.us--;
float *data, min[3], max[3], loc[3], size[3];
int tot, doit=0;
- if(ob->bb==0) ob->bb= MEM_callocN(sizeof(BoundBox), "mb boundbox");
+ if(ob->bb==NULL) ob->bb= MEM_callocN(sizeof(BoundBox), "mb boundbox");
bb= ob->bb;
/* Weird one, this. */
BLI_split_name_num(basisname, &basisnr, active_object->id.name+2, '.');
/* XXX recursion check, see scene.c, just too simple code this next_object() */
- if(F_ERROR==next_object(&sce_iter, 0, 0, 0))
+ if(F_ERROR==next_object(&sce_iter, 0, NULL, NULL))
return;
while(next_object(&sce_iter, 1, &base, &ob)) {
totelem= 0;
/* XXX recursion check, see scene.c, just too simple code this next_object() */
- if(F_ERROR==next_object(&sce_iter, 0, 0, 0))
+ if(F_ERROR==next_object(&sce_iter, 0, NULL, NULL))
return NULL;
while(next_object(&sce_iter, 1, &base, &ob)) {
/* ******************************************** */
-int *indices=NULL;
-int totindex, curindex;
+static int *indices=NULL;
+static int totindex, curindex;
void accum_mballfaces(int i1, int i2, int i3, int i4)
*/
int blocksize= 16384;
static int offs= 0; /* the current free address */
- static struct pgn_elements *cur= 0;
- static ListBase lb= {0, 0};
+ static struct pgn_elements *cur= NULL;
+ static ListBase lb= {NULL, NULL};
void *adr;
if(size>10000 || size==0) {
newc.corners[FLIP(c3, bit)] = corn3;
newc.corners[FLIP(c4, bit)] = corn4;
- if(newc.corners[0]==0) newc.corners[0] = setcorner(p, i, j, k);
- if(newc.corners[1]==0) newc.corners[1] = setcorner(p, i, j, k+1);
- if(newc.corners[2]==0) newc.corners[2] = setcorner(p, i, j+1, k);
- if(newc.corners[3]==0) newc.corners[3] = setcorner(p, i, j+1, k+1);
- if(newc.corners[4]==0) newc.corners[4] = setcorner(p, i+1, j, k);
- if(newc.corners[5]==0) newc.corners[5] = setcorner(p, i+1, j, k+1);
- if(newc.corners[6]==0) newc.corners[6] = setcorner(p, i+1, j+1, k);
- if(newc.corners[7]==0) newc.corners[7] = setcorner(p, i+1, j+1, k+1);
+ if(newc.corners[0]==NULL) newc.corners[0] = setcorner(p, i, j, k);
+ if(newc.corners[1]==NULL) newc.corners[1] = setcorner(p, i, j, k+1);
+ if(newc.corners[2]==NULL) newc.corners[2] = setcorner(p, i, j+1, k);
+ if(newc.corners[3]==NULL) newc.corners[3] = setcorner(p, i, j+1, k+1);
+ if(newc.corners[4]==NULL) newc.corners[4] = setcorner(p, i+1, j, k);
+ if(newc.corners[5]==NULL) newc.corners[5] = setcorner(p, i+1, j, k+1);
+ if(newc.corners[6]==NULL) newc.corners[6] = setcorner(p, i+1, j+1, k);
+ if(newc.corners[7]==NULL) newc.corners[7] = setcorner(p, i+1, j+1, k+1);
p->cubes->cube= newc;
}
for (c = 0; c < 8; c++) pos[c] = MB_BIT(i, c);
for (e = 0; e < 12; e++)
if (!done[e] && (pos[corner1[e]] != pos[corner2[e]])) {
- INTLIST *ints = 0;
+ INTLIST *ints = NULL;
INTLISTS *lists = (INTLISTS *) MEM_callocN(sizeof(INTLISTS), "mball_intlist");
int start = e, edge = e;
MEM_freeN(lists);
lists= nlists;
}
- cubetable[i]= 0;
+ cubetable[i]= NULL;
}
}
BLI_split_name_num(obname, &obnr, ob->id.name+2, '.');
/* make main array */
- next_object(&sce_iter, 0, 0, 0);
+ next_object(&sce_iter, 0, NULL, NULL);
while(next_object(&sce_iter, 1, &base, &bob)) {
if(bob->type==OB_MBALL) {
if(G.moving && mb->flag==MB_UPDATE_FAST) return;
curindex= totindex= 0;
- indices= 0;
+ indices= NULL;
thresh= mb->thresh;
/* total number of MetaElems (totelem) is precomputed in find_basis_mball() function */
mbproc.function = metaball;
mbproc.size = width;
mbproc.bounds = nr_cubes;
- mbproc.cubes= 0;
+ mbproc.cubes= NULL;
mbproc.delta = width/(float)(RES*RES);
polygonize(&mbproc, mb);
dl->parts= curindex;
dl->index= indices;
- indices= 0;
+ indices= NULL;
a= mbproc.vertices.count;
dl->verts= ve= MEM_mallocN(sizeof(float)*3*a, "mballverts");
{
int a;
- if(me==0) return;
+ if(me==NULL) return;
for(a=0; a<me->totcol; a++) {
if(me->mat[a]) me->mat[a]->id.us--;
- me->mat[a]= 0;
+ me->mat[a]= NULL;
}
if(me->key) {
if (me->key->id.us == 0 && me->key->ipo )
me->key->ipo->id.us--;
}
- me->key= 0;
+ me->key= NULL;
- if(me->texcomesh) me->texcomesh= 0;
+ if(me->texcomesh) me->texcomesh= NULL;
}
if(tface->tpage) {
ima= tface->tpage;
if(ima->id.lib) {
- ima->id.lib= 0;
+ ima->id.lib= NULL;
ima->id.flag= LIB_LOCAL;
- new_id(0, (ID *)ima, 0);
+ new_id(NULL, (ID *)ima, NULL);
}
}
}
* - mixed: make copy
*/
- if(me->id.lib==0) return;
+ if(me->id.lib==NULL) return;
if(me->id.us==1) {
- me->id.lib= 0;
+ me->id.lib= NULL;
me->id.flag= LIB_LOCAL;
- new_id(0, (ID *)me, 0);
+ new_id(NULL, (ID *)me, NULL);
if(me->mtface) make_local_tface(me);
}
if(local && lib==0) {
- me->id.lib= 0;
+ me->id.lib= NULL;
me->id.flag= LIB_LOCAL;
- new_id(0, (ID *)me, 0);
+ new_id(NULL, (ID *)me, NULL);
if(me->mtface) make_local_tface(me);
ob= bmain->object.first;
while(ob) {
if( me==get_mesh(ob) ) {
- if(ob->id.lib==0) {
+ if(ob->id.lib==NULL) {
set_mesh(ob, men);
}
}
float min[3], max[3];
float mloc[3], msize[3];
- if(me->bb==0) me->bb= MEM_callocN(sizeof(BoundBox), "boundbox");
+ if(me->bb==NULL) me->bb= MEM_callocN(sizeof(BoundBox), "boundbox");
bb= me->bb;
if (!loc) loc= mloc;
Mesh *get_mesh(Object *ob)
{
- if(ob==0) return 0;
+ if(ob==NULL) return NULL;
if(ob->type==OB_MESH) return ob->data;
- else return 0;
+ else return NULL;
}
void set_mesh(Object *ob, Mesh *me)
{
- Mesh *old=0;
+ Mesh *old=NULL;
multires_force_update(ob);
- if(ob==0) return;
+ if(ob==NULL) return;
if(ob->type==OB_MESH) {
old= ob->data;
int a, *index;
dl= lb->first;
- if(dl==0) return;
+ if(dl==NULL) return;
if(dl->type==DL_INDEX4) {
me->totvert= dl->nr;
tex_space_mesh(me);
- cu->mat= 0;
+ cu->mat= NULL;
cu->totcol= 0;
if(ob->data) {
ModifierTypeInfo *modifierType_getInfo(ModifierType type)
{
- static ModifierTypeInfo *types[NUM_MODIFIER_TYPES]= {0};
+ static ModifierTypeInfo *types[NUM_MODIFIER_TYPES]= {NULL};
static int types_init = 1;
if (types_init) {
static DerivedMesh *multires_dm_create_local(Object *ob, DerivedMesh *dm, int lvl, int totlvl, int simple)
{
- MultiresModifierData mmd= {{0}};
+ MultiresModifierData mmd= {{NULL}};
mmd.lvl = lvl;
mmd.sculptlvl = lvl;
static DerivedMesh *subsurf_dm_create_local(Object *UNUSED(ob), DerivedMesh *dm, int lvl, int simple, int optimal)
{
- SubsurfModifierData smd= {{0}};
+ SubsurfModifierData smd= {{NULL}};
smd.levels = smd.renderLevels = lvl;
smd.flags |= eSubsurfModifierFlag_SubsurfUv;
dispdm->release(dispdm);
}
-void multires_subdivide(MultiresModifierData *mmd, Object *ob, int totlvl, int updateblock, int simple)
+static void multires_subdivide(MultiresModifierData *mmd, Object *ob, int totlvl, int updateblock, int simple)
{
Mesh *me = ob->data;
MDisps *mdisps;
else multires_subdivide(mmd, ob, to_mmd->totlvl, 0, mmd->simple);
}
-void multires_apply_smat(Scene *scene, Object *ob, float smat[3][3])
+static void multires_apply_smat(Scene *scene, Object *ob, float smat[3][3])
{
DerivedMesh *dm= NULL, *cddm= NULL, *subdm= NULL;
DMGridData **gridData, **subGridData;
}
/* Determine auto-blending for the given strip */
-void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls)
+static void BKE_nlastrip_validate_autoblends (NlaTrack *nlt, NlaStrip *nls)
{
float *ps=NULL, *pe=NULL;
float *ns=NULL, *ne=NULL;
/* Baking Tools ------------------------------------------- */
-void BKE_nla_bake (Scene *scene, ID *UNUSED(id), AnimData *adt, int UNUSED(flag))
+static void BKE_nla_bake (Scene *scene, ID *UNUSED(id), AnimData *adt, int UNUSED(flag))
{
/* verify that data is valid
if(ntree->id.lib==NULL) return;
if(ntree->id.us==1) {
- ntree->id.lib= 0;
+ ntree->id.lib= NULL;
ntree->id.flag= LIB_LOCAL;
- new_id(0, (ID *)ntree, 0);
+ new_id(NULL, (ID *)ntree, NULL);
return;
}
if(local && lib==0) {
ntree->id.lib= NULL;
ntree->id.flag= LIB_LOCAL;
- new_id(0, (ID *)ntree, 0);
+ new_id(NULL, (ID *)ntree, NULL);
}
else if(local && lib) {
/* this is the mixed case, we copy the tree and assign it to local users */
}
node->exec |= NODE_READY;
- return 0;
+ return NULL;
}
/* return total of executable nodes, for timecursor */
else if(ob->type==OB_CURVE) unlink_curve(ob->data);
else if(ob->type==OB_MBALL) unlink_mball(ob->data);
}
- ob->data= 0;
+ ob->data= NULL;
}
for(a=0; a<ob->totcol; a++) {
}
if(ob->mat) MEM_freeN(ob->mat);
if(ob->matbits) MEM_freeN(ob->matbits);
- ob->mat= 0;
- ob->matbits= 0;
+ ob->mat= NULL;
+ ob->matbits= NULL;
if(ob->bb) MEM_freeN(ob->bb);
- ob->bb= 0;
+ ob->bb= NULL;
if(ob->path) free_path(ob->path);
- ob->path= 0;
+ ob->path= NULL;
if(ob->adt) BKE_free_animdata((ID *)ob);
if(ob->poselib) ob->poselib->id.us--;
if(ob->gpd) ((ID *)ob->gpd)->us--;
* - mixed: make copy
*/
- if(cam->id.lib==0) return;
+ if(cam->id.lib==NULL) return;
if(cam->id.us==1) {
- cam->id.lib= 0;
+ cam->id.lib= NULL;
cam->id.flag= LIB_LOCAL;
- new_id(0, (ID *)cam, 0);
+ new_id(NULL, (ID *)cam, NULL);
return;
}
}
if(local && lib==0) {
- cam->id.lib= 0;
+ cam->id.lib= NULL;
cam->id.flag= LIB_LOCAL;
- new_id(0, (ID *)cam, 0);
+ new_id(NULL, (ID *)cam, NULL);
}
else if(local && lib) {
camn= copy_camera(cam);
while(ob) {
if(ob->data==cam) {
- if(ob->id.lib==0) {
+ if(ob->id.lib==NULL) {
ob->data= camn;
camn->id.us++;
cam->id.us--;
* - mixed: make copy
*/
- if(la->id.lib==0) return;
+ if(la->id.lib==NULL) return;
if(la->id.us==1) {
- la->id.lib= 0;
+ la->id.lib= NULL;
la->id.flag= LIB_LOCAL;
- new_id(0, (ID *)la, 0);
+ new_id(NULL, (ID *)la, NULL);
return;
}
}
if(local && lib==0) {
- la->id.lib= 0;
+ la->id.lib= NULL;
la->id.flag= LIB_LOCAL;
- new_id(0, (ID *)la, 0);
+ new_id(NULL, (ID *)la, NULL);
}
else if(local && lib) {
lan= copy_lamp(la);
while(ob) {
if(ob->data==la) {
- if(ob->id.lib==0) {
+ if(ob->id.lib==NULL) {
ob->data= lan;
lan->id.us++;
la->id.us--;
return bsbn;
}
-ParticleSystem *copy_particlesystem(ParticleSystem *psys)
+static ParticleSystem *copy_particlesystem(ParticleSystem *psys)
{
ParticleSystem *psysn;
ParticleData *pa;
where_is_object(scene, workob);
}
-BoundBox *unit_boundbox()
+BoundBox *unit_boundbox(void)
{
BoundBox *bb;
float min[3] = {-1.0f,-1.0f,-1.0f}, max[3] = {-1.0f,-1.0f,-1.0f};
if (newname != NULL) {
ret_value = RET_OK;
freePackedFile(vfont->packedfile);
- vfont->packedfile = 0;
+ vfont->packedfile = NULL;
strcpy(vfont->name, newname);
MEM_freeN(newname);
}
MEM_freeN(newname);
freePackedFile(sound->packedfile);
- sound->packedfile = 0;
+ sound->packedfile = NULL;
sound_load(bmain, sound);
ParticleSystem *psys_get_current(Object *ob)
{
ParticleSystem *psys;
- if(ob==0) return 0;
+ if(ob==NULL) return NULL;
for(psys=ob->particlesystem.first; psys; psys=psys->next){
if(psys->flag & PSYS_CURRENT)
return psys;
}
- return 0;
+ return NULL;
}
short psys_get_current_num(Object *ob)
{
ParticleSystem *psys;
short i;
- if(ob==0) return 0;
+ if(ob==NULL) return 0;
for(psys=ob->particlesystem.first, i=0; psys; psys=psys->next, i++)
if(psys->flag & PSYS_CURRENT)
ParticleSystem *psys;
short i;
- if(ob==0) return;
+ if(ob==NULL) return;
for(psys=ob->particlesystem.first, i=0; psys; psys=psys->next, i++) {
if(i == index)
}
Object *psys_get_lattice(ParticleSimulationData *sim)
{
- Object *lattice=0;
+ Object *lattice=NULL;
if(psys_in_edit_mode(sim->scene, sim->psys)==0){
}
}
if(lattice)
- init_latt_deform(lattice,0);
+ init_latt_deform(lattice, NULL);
}
return lattice;
/************************************************/
/* Freeing stuff */
/************************************************/
-void fluid_free_settings(SPHFluidSettings *fluid)
+static void fluid_free_settings(SPHFluidSettings *fluid)
{
if(fluid)
MEM_freeN(fluid);
{
if(psys->child) {
MEM_freeN(psys->child);
- psys->child=0;
+ psys->child= NULL;
psys->totchild=0;
}
if(psys->child){
MEM_freeN(psys->child);
- psys->child = 0;
+ psys->child = NULL;
psys->totchild = 0;
}
if(psys->part){
psys->part->id.us--;
- psys->part=0;
+ psys->part=NULL;
}
BKE_ptcache_free_list(&psys->ptcaches);
else
return ELEM3(psys->part->phystype, PART_PHYS_NEWTON, PART_PHYS_BOIDS, PART_PHYS_FLUID);
}
-int psys_get_current_display_percentage(ParticleSystem *psys)
+
+static int psys_get_current_display_percentage(ParticleSystem *psys)
{
ParticleSettings *part=psys->part;
/* reset children */
if(psys->child) {
MEM_freeN(psys->child);
- psys->child= 0;
+ psys->child= NULL;
}
psys->totchild= 0;
if(psys->child) {
MEM_freeN(psys->child);
- psys->child=0;
+ psys->child=NULL;
psys->totchild=0;
}
}
}
MEM_freeN(psys->child);
- psys->child=0;
+ psys->child=NULL;
psys->totchild=0;
}
static void distribute_particles_in_grid(DerivedMesh *dm, ParticleSystem *psys)
{
- ParticleData *pa=0;
+ ParticleData *pa=NULL;
float min[3], max[3], delta[3], d;
MVert *mv, *mvert = dm->getVertDataArray(dm,0);
int totvert=dm->getNumVerts(dm), from=psys->part->from;
#include "BLI_blenlib.h"
+#include "BKE_property.h"
+
void free_property(bProperty *prop)
{
/* also use when property changes type */
if(prop->poin && prop->poin != &prop->data) MEM_freeN(prop->poin);
- prop->poin= 0;
+ prop->poin= NULL;
prop->data= 0;
{
bSensor *sens, *sensn;
- lbn->first= lbn->last= 0;
+ lbn->first= lbn->last= NULL;
sens= lbo->first;
while(sens) {
sensn= copy_sensor(sens);
{
bController *cont, *contn;
- lbn->first= lbn->last= 0;
+ lbn->first= lbn->last= NULL;
cont= lbo->first;
while(cont) {
contn= copy_controller(cont);
/* also use when controller changes type, leave actuators... */
if(cont->data) MEM_freeN(cont->data);
- cont->data= 0;
+ cont->data= NULL;
switch(cont->type) {
case CONT_EXPRESSION:
{
bActuator *act, *actn;
- lbn->first= lbn->last= 0;
+ lbn->first= lbn->last= NULL;
act= lbo->first;
while(act) {
actn= copy_actuator(act);
bSoundActuator *sa;
if(act->data) MEM_freeN(act->data);
- act->data= 0;
+ act->data= NULL;
switch(act->type) {
case ACT_ACTION:
}
}
-void clear_sca_new_poins()
+void clear_sca_new_poins(void)
{
Object *ob;
}
-void set_sca_new_poins()
+void set_sca_new_poins(void)
{
Object *ob;
}
-const ListBase *BKE_spacetypes_list()
+const ListBase *BKE_spacetypes_list(void)
{
return &spacetypes;
}
MEM_CacheLimiterHandleC * c_handle;
} seqCacheEntry;
-static GHash * hash = 0;
-static MEM_CacheLimiterC * limitor = 0;
-static struct BLI_mempool * entrypool = 0;
-static struct BLI_mempool * keypool = 0;
+static GHash * hash = NULL;
+static MEM_CacheLimiterC * limitor = NULL;
+static struct BLI_mempool * entrypool = NULL;
+static struct BLI_mempool * keypool = NULL;
static int ibufs_in = 0;
static int ibufs_rem = 0;
ibufs_rem++;
}
- e->ibuf = 0;
- e->c_handle = 0;
+ e->ibuf = NULL;
+ e->c_handle = NULL;
BLI_mempool_free(entrypool, e);
}
IMB_freeImBuf(e->ibuf);
ibufs_rem++;
- e->ibuf = 0;
- e->c_handle = 0;
+ e->ibuf = NULL;
+ e->c_handle = NULL;
}
}
-void seq_stripelem_cache_init()
+void seq_stripelem_cache_init(void)
{
hash = BLI_ghash_new(HashHash, HashCmp, "seq stripelem cache hash");
limitor = new_MEM_CacheLimiter( IMB_seq_cache_destructor );
keypool = BLI_mempool_create(sizeof(seqCacheKey), 64, 64, 0);
}
-void seq_stripelem_cache_destruct()
+void seq_stripelem_cache_destruct(void)
{
if (!entrypool) {
return;
BLI_mempool_destroy(keypool);
}
-void seq_stripelem_cache_cleanup()
+void seq_stripelem_cache_cleanup(void)
{
if (!entrypool) {
seq_stripelem_cache_init();
seqCacheEntry * e;
if (!seq) {
- return 0;
+ return NULL;
}
if (!entrypool) {
MEM_CacheLimiter_touch(e->c_handle);
return e->ibuf;
}
- return 0;
+ return NULL;
}
void seq_stripelem_cache_put(
e = (seqCacheEntry*) BLI_mempool_alloc(entrypool);
e->ibuf = i;
- e->c_handle = 0;
+ e->c_handle = NULL;
BLI_ghash_remove(hash, key, HashKeyFree, HashValFree);
BLI_ghash_insert(hash, key, e);
char *cp;
/* to be sure: (is tested for) */
- pis->doit= 0;
- pis->pname= 0;
- pis->varstr= 0;
- pis->cfra= 0;
+ pis->doit= NULL;
+ pis->pname= NULL;
+ pis->varstr= NULL;
+ pis->cfra= NULL;
pis->version= 0;
- pis->instance_private_data = 0;
+ pis->instance_private_data = NULL;
/* clear the error list */
PIL_dynlib_get_error_as_string(NULL);
pis->handle= PIL_dynlib_open(pis->name);
if(test_dlerr(pis->name, pis->name)) return;
- if (pis->handle != 0) {
+ if (pis->handle != NULL) {
/* find the address of the version function */
version= (int (*)(void))PIL_dynlib_find_symbol(pis->handle, "plugin_seq_getversion");
if (test_dlerr(pis->name, "plugin_seq_getversion")) return;
- if (version != 0) {
+ if (version != NULL) {
pis->version= version();
if (pis->version >= 2 && pis->version <= 6) {
int (*info_func)(PluginInfo *);
strncpy(pis->name, str, FILE_MAXDIR+FILE_MAXFILE);
open_plugin_seq(pis, seqname);
- if(pis->doit==0) {
- if(pis->handle==0) error("no plugin: %s", str);
+ if(pis->doit==NULL) {
+ if(pis->handle==NULL) error("no plugin: %s", str);
else error("in plugin: %s", str);
MEM_freeN(pis);
- return 0;
+ return NULL;
}
/* default values */
static void free_plugin_seq(PluginSeq *pis)
{
- if(pis==0) return;
+ if(pis==NULL) return;
/* no PIL_dynlib_close: same plugin can be opened multiple times with 1 handle */
static ImBuf * IMB_cast_away_list(ImBuf * i)
{
if (!i) {
- return 0;
+ return NULL;
}
return (ImBuf*) (((void**) i) + 2);
}
static void free_plugin(struct Sequence * seq)
{
free_plugin_seq(seq->plugin);
- seq->plugin = 0;
+ seq->plugin = NULL;
}
/* **********************************************************************
ALPHA UNDER
********************************************************************** */
-void do_alphaunder_effect_byte(
+static void do_alphaunder_effect_byte(
float facf0, float facf1, int x, int y, char *rect1,
char *rect2, char *out)
{
CROSS
********************************************************************** */
-void do_cross_effect_byte(float facf0, float facf1, int x, int y,
+static void do_cross_effect_byte(float facf0, float facf1, int x, int y,
char *rect1, char *rect2,
char *out)
{
}
}
-void do_cross_effect_float(float facf0, float facf1, int x, int y,
+static void do_cross_effect_float(float facf0, float facf1, int x, int y,
float *rect1, float *rect2, float *out)
{
float fac1, fac2, fac3, fac4;
static void free_wipe_effect(Sequence *seq)
{
if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = 0;
+ seq->effectdata = NULL;
}
static void copy_wipe_effect(Sequence *dst, Sequence *src)
static void free_transform_effect(Sequence *seq)
{
if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = 0;
+ seq->effectdata = NULL;
}
static void copy_transform_effect(Sequence *dst, Sequence *src)
static void free_glow_effect(Sequence *seq)
{
if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = 0;
+ seq->effectdata = NULL;
}
static void copy_glow_effect(Sequence *dst, Sequence *src)
static void free_solid_color(Sequence *seq)
{
if(seq->effectdata)MEM_freeN(seq->effectdata);
- seq->effectdata = 0;
+ seq->effectdata = NULL;
}
static void copy_solid_color(Sequence *dst, Sequence *src)
ListBase * seqbasep;
if (seq->multicam_source == 0 || seq->multicam_source >= seq->machine) {
- return 0;
+ return NULL;
}
ed = context.scene->ed;
if (!ed) {
- return 0;
+ return NULL;
}
seqbasep = seq_seqbase(&ed->seqbase, seq);
if (!seqbasep) {
- return 0;
+ return NULL;
}
i = give_ibuf_seqbase(context, cfra, seq->multicam_source, seqbasep);
if (!i) {
- return 0;
+ return NULL;
}
if (input_have_to_preprocess(context, seq, cfra)) {
v = (SpeedControlVars *)seq->effectdata;
v->globalSpeed = 1.0;
- v->frameMap = 0;
+ v->frameMap = NULL;
v->flags |= SEQ_SPEED_INTEGRATE; /* should be default behavior */
v->length = 0;
}
{
SpeedControlVars * v = (SpeedControlVars *)seq->effectdata;
- v->frameMap = 0;
+ v->frameMap = NULL;
v->length = 0;
}
SpeedControlVars * v = (SpeedControlVars *)seq->effectdata;
if(v->frameMap) MEM_freeN(v->frameMap);
if(seq->effectdata) MEM_freeN(seq->effectdata);
- seq->effectdata = 0;
+ seq->effectdata = NULL;
}
static void copy_speed_effect(Sequence *dst, Sequence *src)
SpeedControlVars * v;
dst->effectdata = MEM_dupallocN(src->effectdata);
v = (SpeedControlVars *)dst->effectdata;
- v->frameMap = 0;
+ v->frameMap = NULL;
v->length = 0;
}
struct SeqEffectHandle get_sequence_effect(Sequence * seq)
{
- struct SeqEffectHandle rval= {0};
+ struct SeqEffectHandle rval= {NULL};
if (seq->type & SEQ_EFFECT) {
rval = get_sequence_effect_impl(seq->type);
struct SeqEffectHandle get_sequence_blend(Sequence * seq)
{
- struct SeqEffectHandle rval= {0};
+ struct SeqEffectHandle rval= {NULL};
if (seq->blend_mode != 0) {
rval = get_sequence_effect_impl(seq->blend_mode);
{
if (seq->strip && seq->strip->proxy && seq->strip->proxy->anim) {
IMB_free_anim(seq->strip->proxy->anim);
- seq->strip->proxy->anim = 0;
+ seq->strip->proxy->anim = NULL;
}
}
* in metastrips!)
**********************************************************************
*/
-
+#if 0 /* UNUSED */
static void do_seq_count(ListBase *seqbase, int *totseq)
{
Sequence *seq;
}
}
-void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq)
+static void build_seqar(ListBase *seqbase, Sequence ***seqar, int *totseq)
{
Sequence **tseqar;
do_build_seqar(seqbase, seqar, 0);
*seqar= tseqar;
}
+#endif /* UNUSED */
static void do_seq_count_cb(ListBase *seqbase, int *totseq,
int (*test_func)(Sequence * seq))
if(ed==NULL) return;
- seqbase.first= seqbase.last= 0;
- effbase.first= effbase.last= 0;
+ seqbase.first= seqbase.last= NULL;
+ effbase.first= effbase.last= NULL;
while( (seq= ed->seqbasep->first) ) {
BLI_remlink(ed->seqbasep, seq);
}
seqt= seqt->next;
}
- if(seqt==0) BLI_addtail(&effbase, seq);
+ if(seqt==NULL) BLI_addtail(&effbase, seq);
}
else {
seqt= seqbase.first;
}
seqt= seqt->next;
}
- if(seqt==0) BLI_addtail(&seqbase, seq);
+ if(seqt==NULL) BLI_addtail(&seqbase, seq);
}
}
float *rect_float;
int tot;
- if(ibuf==0 || (ibuf->rect==0 && ibuf->rect_float==0)) return;
+ if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) return;
tot= ibuf->x*ibuf->y;
if(seq->type != SEQ_MOVIE) { /* movie use the first */
int nr = (int) give_stripelem_index(seq, cfra);
- if (nr == -1 || se == 0) return 0;
+ if (nr == -1 || se == NULL) return NULL;
se += nr + seq->anim_startofs;
}
if(evaluate_seq_frame_gen(seq_arr, seqbasep, cfra)) {
if (b > 0) {
- if (seq_arr[b] == 0) {
+ if (seq_arr[b] == NULL) {
return 0;
}
} else {
char name[PROXY_MAXFILE];
if (!(seq->flag & SEQ_USE_PROXY)) {
- return 0;
+ return NULL;
}
/* rendering at 100% ? No real sense in proxy-ing, right? */
if (context.preview_render_size == 100) {
- return 0;
+ return NULL;
}
if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) {
int frameno = (int) give_stripelem_index(seq, cfra) + seq->anim_startofs;
if (seq->strip->proxy->anim == NULL) {
if (seq_proxy_get_fname(context, seq, cfra, name)==0) {
- return 0;
+ return NULL;
}
seq->strip->proxy->anim = openanim(name, IB_rect);
}
if (seq->strip->proxy->anim==NULL) {
- return 0;
+ return NULL;
}
return IMB_anim_absolute(seq->strip->proxy->anim, frameno);
}
if (seq_proxy_get_fname(context, seq, cfra, name) == 0) {
- return 0;
+ return NULL;
}
if (BLI_exists(name)) {
return IMB_loadiffname(name, IB_rect);
} else {
- return 0;
+ return NULL;
}
}
}
if(seq->flag & SEQ_MAKE_PREMUL) {
- if(ibuf->depth == 32 && ibuf->zbuf == 0) {
+ if(ibuf->depth == 32 && ibuf->zbuf == NULL) {
IMB_premultiply_alpha(ibuf);
}
}
static ImBuf * copy_from_ibuf_still(SeqRenderData context, Sequence * seq,
float nr)
{
- ImBuf * rval = 0;
- ImBuf * ibuf = 0;
+ ImBuf * rval = NULL;
+ ImBuf * ibuf = NULL;
if (nr == 0) {
ibuf = seq_stripelem_cache_get(
static ImBuf * seq_render_scene_strip_impl(
SeqRenderData context, Sequence * seq, float nr)
{
- ImBuf * ibuf = 0;
+ ImBuf * ibuf = NULL;
float frame= seq->sfra + nr + seq->anim_startofs;
float oldcfra;
Object *oldcamera;
}
case SEQ_MOVIE:
{
- if(seq->anim==0) {
+ if(seq->anim==NULL) {
BLI_join_dirfile(name, sizeof(name), seq->strip->dir, seq->strip->stripdata->name);
BLI_path_abs(name, G.main->name);
if (swap_input) {
out = sh.execute(context, seq, cfra,
facf, facf,
- ibuf2, ibuf1, 0);
+ ibuf2, ibuf1, NULL);
} else {
out = sh.execute(context, seq, cfra,
facf, facf,
- ibuf1, ibuf2, 0);
+ ibuf1, ibuf2, NULL);
}
IMB_freeImBuf(ibuf1);
}
}
- return e ? e->ibuf : 0;
+ return e ? e->ibuf : NULL;
}
/* Functions to free imbuf and anim data on changes */
{
if(seq->anim) {
IMB_free_anim(seq->anim);
- seq->anim = 0;
+ seq->anim = NULL;
}
}
if (seq->strip->proxy) {
seqn->strip->proxy = MEM_dupallocN(seq->strip->proxy);
- seqn->strip->proxy->anim = 0;
+ seqn->strip->proxy->anim = NULL;
}
if (seq->strip->color_balance) {
}
if(seq->type==SEQ_META) {
- seqn->strip->stripdata = 0;
+ seqn->strip->stripdata = NULL;
- seqn->seqbase.first= seqn->seqbase.last= 0;
+ seqn->seqbase.first= seqn->seqbase.last= NULL;
/* WATCH OUT!!! - This metastrip is not recursively duplicated here - do this after!!! */
/* - seq_dupli_recursive(&seq->seqbase,&seqn->seqbase);*/
} else if(seq->type == SEQ_SCENE) {
- seqn->strip->stripdata = 0;
+ seqn->strip->stripdata = NULL;
if(seq->scene_sound)
seqn->scene_sound = sound_scene_add_scene_sound(sce_audio, seqn, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
} else if(seq->type == SEQ_MOVIE) {
seqn->strip->stripdata =
MEM_dupallocN(seq->strip->stripdata);
- seqn->anim= 0;
+ seqn->anim= NULL;
} else if(seq->type == SEQ_SOUND) {
seqn->strip->stripdata =
MEM_dupallocN(seq->strip->stripdata);
sh.copy(seq, seqn);
}
- seqn->strip->stripdata = 0;
+ seqn->strip->stripdata = NULL;
} else {
fprintf(stderr, "Aiiiiekkk! sequence type not "
void seqbase_dupli_recursive(Scene *scene, Scene *scene_to, ListBase *nseqbase, ListBase *seqbase, int dupe_flag)
{
Sequence *seq;
- Sequence *seqn = 0;
+ Sequence *seqn = NULL;
Sequence *last_seq = seq_active_get(scene);
for(seq= seqbase->first; seq; seq= seq->next) {
{
float itarget[4][4];
invert_m4_m4(itarget, target);
- mul_serie_m4(data->local2target, itarget, local, 0, 0, 0, 0, 0, 0);
+ mul_serie_m4(data->local2target, itarget, local, NULL, NULL, NULL, NULL, NULL, NULL);
invert_m4_m4(data->target2local, data->local2target);
}
MEM_freeN(sketch);
}
-SK_Sketch* createSketch()
+SK_Sketch* createSketch(void)
{
SK_Sketch *sketch;
MEM_freeN(stk);
}
-SK_Stroke* sk_createStroke()
+SK_Stroke* sk_createStroke(void)
{
SK_Stroke *stk;
#define BFF_CLOSEVERT 2 /* collider vertex repulses face */
-float SoftHeunTol = 1.0f; /* humm .. this should be calculated from sb parameters and sizes */
+static float SoftHeunTol = 1.0f; /* humm .. this should be calculated from sb parameters and sizes */
/* local prototypes */
static void free_softbody_intern(SoftBody *sb);
/* just an ID here to reduce the prob for killing objects
** ob->sumohandle points to we should not kill :)
*/
-const int CCD_SAVETY = 190561;
+static const int CCD_SAVETY = 190561;
typedef struct ccdf_minmax{
float minx,miny,minz,maxx,maxy,maxz;
}
/*+++ only with deflecting set */
- if(ob->pd && ob->pd->deflect && BLI_ghash_lookup(hash, ob) == 0) {
+ if(ob->pd && ob->pd->deflect && BLI_ghash_lookup(hash, ob) == NULL) {
DerivedMesh *dm= NULL;
if(ob->softflag & OB_SB_COLLFINAL) /* so maybe someone wants overkill to collide with subsurfed */
{
SB_thread_context *pctx = (SB_thread_context*)data;
_scan_for_ext_spring_forces(pctx->scene, pctx->ob, pctx->timenow, pctx->ifirst, pctx->ilast, pctx->do_effector);
- return 0;
+ return NULL;
}
static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,int totsprings,int *UNUSED(ptr_to_break_func(void)))
{
SB_thread_context *pctx = (SB_thread_context*)data;
_softbody_calc_forces_slice_in_a_thread(pctx->scene, pctx->ob, pctx->forcetime, pctx->timenow, pctx->ifirst, pctx->ilast, NULL, pctx->do_effector,pctx->do_deflector,pctx->fieldfactor,pctx->windfactor);
- return 0;
+ return NULL;
}
static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float timenow,int totpoint,int *UNUSED(ptr_to_break_func(void)),struct ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor)
{
BodyPoint *bp;
ReferenceVert *rp;
- SoftBody *sb = 0;
+ SoftBody *sb = NULL;
float (*opos)[3];
float (*rpos)[3];
float com[3],rcom[3];
force_device = device;
}
-void sound_init_once()
+void sound_init_once(void)
{
AUD_initOnce();
}
#endif
}
-void sound_exit()
+void sound_exit(void)
{
AUD_exit();
}
AUD_moveSequencer(scene->sound_scene, handle, startframe / FPS, endframe / FPS, frameskip / FPS);
}
-void sound_start_play_scene(struct Scene *scene)
+static void sound_start_play_scene(struct Scene *scene)
{
scene->sound_scene_handle = AUD_play(scene->sound_scene, 1);
AUD_setLoop(scene->sound_scene_handle, -1);
/* General tool functions */
/**************************/
-void free_texttools() {
+void free_texttools(void) {
txttl_free_suggest();
txttl_free_docs();
}
}
}
-void texttool_suggest_clear() {
+void texttool_suggest_clear(void) {
txttl_free_suggest();
}
-SuggItem *texttool_suggest_first() {
+SuggItem *texttool_suggest_first(void) {
return suggestions.firstmatch;
}
-SuggItem *texttool_suggest_last() {
+SuggItem *texttool_suggest_last(void) {
return suggestions.lastmatch;
}
suggestions.selected = sel;
}
-SuggItem *texttool_suggest_selected() {
+SuggItem *texttool_suggest_selected(void) {
return suggestions.selected;
}
-int *texttool_suggest_top() {
+int *texttool_suggest_top(void) {
return &suggestions.top;
}
documentation[len] = '\0';
}
-char *texttool_docs_get() {
+char *texttool_docs_get(void) {
return documentation;
}
-void texttool_docs_clear() {
+void texttool_docs_clear(void) {
txttl_free_docs();
}
int (*version)(void);
/* init all the happy variables */
- pit->doit= 0;
- pit->pname= 0;
- pit->stnames= 0;
- pit->varstr= 0;
- pit->result= 0;
- pit->cfra= 0;
+ pit->doit= NULL;
+ pit->pname= NULL;
+ pit->stnames= NULL;
+ pit->varstr= NULL;
+ pit->result= NULL;
+ pit->cfra= NULL;
pit->version= 0;
- pit->instance_init= 0;
+ pit->instance_init= NULL;
/* clear the error list */
PIL_dynlib_get_error_as_string(NULL);
pit->handle= PIL_dynlib_open(pit->name);
if(test_dlerr(pit->name, pit->name)) return;
- if (pit->handle != 0) {
+ if (pit->handle != NULL) {
/* find the address of the version function */
version= (int (*)(void)) PIL_dynlib_find_symbol(pit->handle, "plugin_tex_getversion");
if (test_dlerr(pit->name, "plugin_tex_getversion")) return;
- if (version != 0) {
+ if (version != NULL) {
pit->version= version();
if( pit->version >= 2 && pit->version <=6) {
int (*info_func)(PluginInfo *);
strcpy(pit->name, str);
open_plugin_tex(pit);
- if(pit->doit==0) {
- if(pit->handle==0) {;} //XXX error("no plugin: %s", str);
+ if(pit->doit==NULL) {
+ if(pit->handle==NULL) {;} //XXX error("no plugin: %s", str);
else {;} //XXX error("in plugin: %s", str);
MEM_freeN(pit);
return NULL;
void free_plugin_tex(PluginTex *pit)
{
- if(pit==0) return;
+ if(pit==NULL) return;
/* no PIL_dynlib_close: same plugin can be opened multiple times, 1 handle */
MEM_freeN(pit);
{
mtex->texco= TEXCO_ORCO;
mtex->mapto= MAP_COL;
- mtex->object= 0;
+ mtex->object= NULL;
mtex->projx= PROJ_X;
mtex->projy= PROJ_Y;
mtex->projz= PROJ_Z;
mtex->size[0]= 1.0;
mtex->size[1]= 1.0;
mtex->size[2]= 1.0;
- mtex->tex= 0;
+ mtex->tex= NULL;
mtex->texflag= MTEX_3TAP_BUMP | MTEX_BUMP_OBJECTSPACE;
mtex->colormodel= 0;
mtex->r= 1.0;
/* ------------------------------------------------------------------------- */
-MTex *add_mtex()
+MTex *add_mtex(void)
{
MTex *mtex;
texn= copy_libblock(tex);
if(texn->type==TEX_IMAGE) id_us_plus((ID *)texn->ima);
- else texn->ima= 0;
+ else texn->ima= NULL;
#if 0 // XXX old animation system
id_us_plus((ID *)texn->ipo);
* - mixed: make copy
*/
- if(tex->id.lib==0) return;
+ if(tex->id.lib==NULL) return;
/* special case: ima always local immediately */
if(tex->ima) {
- tex->ima->id.lib= 0;
+ tex->ima->id.lib= NULL;
tex->ima->id.flag= LIB_LOCAL;
- new_id(0, (ID *)tex->ima, 0);
+ new_id(NULL, (ID *)tex->ima, NULL);
}
if(tex->id.us==1) {
- tex->id.lib= 0;
+ tex->id.lib= NULL;
tex->id.flag= LIB_LOCAL;
- new_id(0, (ID *)tex, 0);
+ new_id(NULL, (ID *)tex, NULL);
return;
}
}
if(local && lib==0) {
- tex->id.lib= 0;
+ tex->id.lib= NULL;
tex->id.flag= LIB_LOCAL;
- new_id(0, (ID *)tex, 0);
+ new_id(NULL, (ID *)tex, NULL);
}
else if(local && lib) {
texn= copy_texture(tex);
while(ma) {
for(a=0; a<MAX_MTEX; a++) {
if(ma->mtex[a] && ma->mtex[a]->tex==tex) {
- if(ma->id.lib==0) {
+ if(ma->id.lib==NULL) {
ma->mtex[a]->tex= texn;
texn->id.us++;
tex->id.us--;
while(la) {
for(a=0; a<MAX_MTEX; a++) {
if(la->mtex[a] && la->mtex[a]->tex==tex) {
- if(la->id.lib==0) {
+ if(la->id.lib==NULL) {
la->mtex[a]->tex= texn;
texn->id.us++;
tex->id.us--;
while(wrld) {
for(a=0; a<MAX_MTEX; a++) {
if(wrld->mtex[a] && wrld->mtex[a]->tex==tex) {
- if(wrld->id.lib==0) {
+ if(wrld->id.lib==NULL) {
wrld->mtex[a]->tex= texn;
texn->id.us++;
tex->id.us--;
br= bmain->brush.first;
while(br) {
if(br->mtex.tex==tex) {
- if(br->id.lib==0) {
+ if(br->id.lib==NULL) {
br->mtex.tex= texn;
texn->id.us++;
tex->id.us--;
Material *ma;
Tex *tex= NULL;
- if(ob==0) return 0;
- if(ob->totcol==0 && !(ob->type==OB_LAMP)) return 0;
+ if(ob==NULL) return NULL;
+ if(ob->totcol==0 && !(ob->type==OB_LAMP)) return NULL;
if(ob->type==OB_LAMP) {
tex= give_current_lamp_texture(ob->data);
MTex *mtex= NULL;
Tex *tex= NULL;
- if(!world) return 0;
+ if(!world) return NULL;
mtex= world->mtex[(int)(world->texact)];
if(mtex) tex= mtex->tex;
MTex *mtex= NULL;
Tex *tex= NULL;
- if(!part) return 0;
+ if(!part) return NULL;
mtex= part->mtex[(int)(part->texact)];
if(mtex) tex= mtex->tex;
#define UNIT_SYSTEM_TOT (((sizeof(bUnitSystems) / 9) / sizeof(void *)) - 1)
static struct bUnitCollection *bUnitSystems[][9] = {
- {0, 0, 0, 0, 0, &buNaturalRotCollection, &buNaturalTimeCollecton, 0, 0},
- {0, &buMetricLenCollecton, &buMetricAreaCollecton, &buMetricVolCollecton, &buMetricMassCollecton, &buNaturalRotCollection, &buNaturalTimeCollecton, &buMetricVelCollecton, &buMetricAclCollecton}, /* metric */
- {0, &buImperialLenCollecton, &buImperialAreaCollecton, &buImperialVolCollecton, &buImperialMassCollecton, &buNaturalRotCollection, &buNaturalTimeCollecton, &buImperialVelCollecton, &buImperialAclCollecton}, /* imperial */
- {0, 0, 0, 0, 0, 0, 0, 0, 0}
+ {NULL, NULL, NULL, NULL, NULL, &buNaturalRotCollection, &buNaturalTimeCollecton, NULL, NULL},
+ {NULL, &buMetricLenCollecton, &buMetricAreaCollecton, &buMetricVolCollecton, &buMetricMassCollecton, &buNaturalRotCollection, &buNaturalTimeCollecton, &buMetricVelCollecton, &buMetricAclCollecton}, /* metric */
+ {NULL, &buImperialLenCollecton, &buImperialAreaCollecton, &buImperialVolCollecton, &buImperialMassCollecton, &buNaturalRotCollection, &buNaturalTimeCollecton, &buImperialVelCollecton, &buImperialAclCollecton}, /* imperial */
+ {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}
};
#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
+#include "BKE_world.h"
#include "BKE_library.h"
#include "BKE_animsys.h"
#include "BKE_global.h"
* - mixed: make copy
*/
- if(wrld->id.lib==0) return;
+ if(wrld->id.lib==NULL) return;
if(wrld->id.us==1) {
- wrld->id.lib= 0;
+ wrld->id.lib= NULL;
wrld->id.flag= LIB_LOCAL;
- new_id(0, (ID *)wrld, 0);
+ new_id(NULL, (ID *)wrld, NULL);
return;
}
if(local && lib==0) {
wrld->id.lib= 0;
wrld->id.flag= LIB_LOCAL;
- new_id(0, (ID *)wrld, 0);
+ new_id(NULL, (ID *)wrld, NULL);
}
else if(local && lib) {
wrldn= copy_world(wrld);
sce= bmain->scene.first;
while(sce) {
if(sce->world==wrld) {
- if(sce->id.lib==0) {
+ if(sce->id.lib==NULL) {
sce->world= wrldn;
wrldn->id.us++;
wrld->id.us--;
{
unsigned int hash= gh->hashfp(key)%gh->nbuckets;
Entry *e;
- Entry *p = 0;
+ Entry *p = NULL;
for (e= gh->buckets[hash]; e; e= e->next) {
if (gh->cmpfp(key, e->key)==0) {
#include "BLI_args.h"
#include "BLI_ghash.h"
-char NO_DOCS[] = "NO DOCUMENTATION SPECIFIED";
+static char NO_DOCS[] = "NO DOCUMENTATION SPECIFIED";
struct bArgDoc;
typedef struct bArgDoc {
MEM_freeN(gh->buckets);
BLI_mempool_destroy(gh->entrypool);
- gh->buckets = 0;
+ gh->buckets = NULL;
gh->nentries = 0;
gh->nbuckets = 0;
MEM_freeN(gh);
/***/
-Heap *BLI_heap_new()
+Heap *BLI_heap_new(void)
{
Heap *heap = (Heap*)MEM_callocN(sizeof(Heap), "BLIHeap");
heap->bufsize = 1;
heap[parent] = element; \
}
-int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_size, int size_per_item)
+static int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_size, int size_per_item)
{
int new_max_size = *max_size * 2;
void *new_memblock = NULL;
// check for compatibility of both trees (can't compare 14-DOP with 18-DOP)
if((tree1->axis != tree2->axis) && (tree1->axis == 14 || tree2->axis == 14) && (tree1->axis == 18 || tree2->axis == 18))
- return 0;
+ return NULL;
// fast check root nodes for collision before doing big splitting + traversal
if(!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis)))
- return 0;
+ return NULL;
data = MEM_callocN(sizeof(BVHOverlapData *)* tree1->tree_type, "BVHOverlapData_star");
/* finds the nearest n entries in tree to specified coordinates */
int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTreeNearest *nearest)
{
- KDTreeNode *root, *node=0;
+ KDTreeNode *root, *node= NULL;
KDTreeNode **stack, *defaultstack[100];
float cur_dist;
int i, totstack, cur=0, found=0;
}
int BLI_kdtree_range_search(KDTree *tree, float range, float *co, float *nor, KDTreeNearest **nearest)
{
- KDTreeNode *root, *node=0;
+ KDTreeNode *root, *node= NULL;
KDTreeNode **stack, *defaultstack[100];
KDTreeNearest *foundstack=NULL;
float range2 = range*range, dist2;
BLI_bpathIterator_step(bpi);
}
-void BLI_bpathIterator_alloc(struct BPathIterator **bpi) {
+static void BLI_bpathIterator_alloc(struct BPathIterator **bpi) {
*bpi= MEM_mallocN(sizeof(BPathIterator), "BLI_bpathIterator_alloc");
}
dir= opendir(dirname);
- if (dir==0)
+ if (dir==NULL)
return 0;
if (*filesize == -1)
// No charmap found from the ttf so we need to figure it out
if(glyph_index == 0)
{
- FT_CharMap found = 0;
+ FT_CharMap found = NULL;
FT_CharMap charmap;
int n;
err = FT_Init_FreeType( &library);
if(err) {
//XXX error("Failed to load the Freetype font library");
- return 0;
+ return NULL;
}
success = check_freetypefont(pf);
}
/************************************* SUBGRAPH DETECTION **********************************************/
-void flagSubgraph(BNode *node, int subgraph)
+static void flagSubgraph(BNode *node, int subgraph)
{
if (node->subgraph_index == 0)
{
/*********************************** GRAPH AS TREE FUNCTIONS *******************************************/
-int subtreeShape(BNode *node, BArc *rootArc, int include_root)
+static int subtreeShape(BNode *node, BArc *rootArc, int include_root)
{
int depth = 0;
/* Ripped this from blender.c */
void BLI_movelisttolist(ListBase *dst, ListBase *src)
{
- if (src->first==0) return;
+ if (src->first==NULL) return;
- if (dst->first==0) {
+ if (dst->first==NULL) {
dst->first= src->first;
dst->last= src->last;
}
((Link *)src->first)->prev= dst->last;
dst->last= src->last;
}
- src->first= src->last= 0;
+ src->first= src->last= NULL;
}
void BLI_addhead(ListBase *listbase, void *vlink)
link->prev = listbase->last;
if (listbase->last) ((Link *)listbase->last)->next = link;
- if (listbase->first == 0) listbase->first = link;
+ if (listbase->first == NULL) listbase->first = link;
listbase->last = link;
}
/* insert before first element */
if (prevlink == NULL) {
newlink->next= listbase->first;
- newlink->prev= 0;
+ newlink->prev= NULL;
newlink->next->prev= newlink;
listbase->first= newlink;
return;
/* insert at end of list */
if (nextlink == NULL) {
newlink->prev= listbase->last;
- newlink->next= 0;
+ newlink->next= NULL;
((Link *)listbase->last)->next= newlink;
listbase->last= newlink;
return;
/* in this order, to ensure it works if dst == src */
src_link= src->first;
- dst->first= dst->last= 0;
+ dst->first= dst->last= NULL;
while(src_link) {
dst_link= MEM_dupallocN(src_link);
*/
/* can't believe there is none in math utils */
-float _det_m3(float m2[3][3])
+static float _det_m3(float m2[3][3])
{
float det = 0.f;
if (m2){
{
float temp[3][3];
- if(m1==0 || m2==0) return;
+ if(m1==NULL || m2==NULL) return;
mul_m3_m3m3(answ, m2, m1);
if(m3) {
{
float temp[4][4];
- if(m1==0 || m2==0) return;
+ if(m1==NULL || m2==NULL) return;
mul_m4_m4m4(answ, m2, m1);
if(m3) {
transpose_m4(V);
- mul_serie_m4(Ainv, U, Wm, V, 0, 0, 0, 0, 0);
+ mul_serie_m4(Ainv, U, Wm, V, NULL, NULL, NULL, NULL, NULL);
}
mul_m4_m4m4(S, baseRS, baseRinv);
/* set scaling part */
- mul_serie_m4(dq->scale, basemat, S, baseinv, 0, 0, 0, 0, 0);
+ mul_serie_m4(dq->scale, basemat, S, baseinv, NULL, NULL, NULL, NULL, NULL);
dq->scale_weight= 1.0f;
}
else {
}
mainvar= mainvar->next;
}
- if(mainvar==0) printf("error split_libdata\n");
+ if(mainvar==NULL) printf("error split_libdata\n");
}
id= idnext;
}
static BHeadN *get_bhead(FileData *fd)
{
- BHeadN *new_bhead = 0;
+ BHeadN *new_bhead = NULL;
int readsize;
if (fd) {
if ( ! fd->eof) {
new_bhead = MEM_mallocN(sizeof(BHeadN) + bhead.len, "new_bhead");
if (new_bhead) {
- new_bhead->next = new_bhead->prev = 0;
+ new_bhead->next = new_bhead->prev = NULL;
new_bhead->bhead = bhead;
readsize = fd->read(fd, new_bhead + 1, bhead.len);
if (readsize != bhead.len) {
fd->eof = 1;
MEM_freeN(new_bhead);
- new_bhead = 0;
+ new_bhead = NULL;
}
} else {
fd->eof = 1;
BHead *blo_firstbhead(FileData *fd)
{
BHeadN *new_bhead;
- BHead *bhead = 0;
+ BHead *bhead = NULL;
// Rewind the file
// Read in a new block if necessary
new_bhead = fd->listbase.first;
- if (new_bhead == 0) {
+ if (new_bhead == NULL) {
new_bhead = get_bhead(fd);
}
// get the next BHeadN. If it doesn't exist we read in the next one
new_bhead = new_bhead->next;
- if (new_bhead == 0) {
+ if (new_bhead == NULL) {
new_bhead = get_bhead(fd);
}
}
errno= 0;
gzfile= gzopen(name, "rb");
- if (gzfile == Z_NULL) {
+ if (gzfile == (gzFile)Z_NULL) {
BKE_reportf(reports, RPT_ERROR, "Unable to open \"%s\": %s.", name, errno ? strerror(errno) : "Unknown erro reading file");
return NULL;
} else {
if (fd->buffer && !(fd->flags & FD_FLAGS_NOT_MY_BUFFER)) {
MEM_freeN(fd->buffer);
- fd->buffer = 0;
+ fd->buffer = NULL;
}
// Free all BHeadN data blocks
/* Find the last slash */
fd= BLI_last_slash(dir);
- if(fd==0) return 0;
+ if(fd==NULL) return 0;
*fd= 0;
if(BLO_has_bfile_extension(fd+1)) {
/* the last part of the dir is a .blend file, no group follows */
Link *ln, *prev;
void *poin;
- if(lb->first==0) return;
+ if(lb->first==NULL) return;
poin= newdataadr(fd, lb->first);
if(lb->first) {
oldnewmap_insert(fd->globmap, lb->first, poin, 0);
lb->first= poin;
ln= lb->first;
- prev= 0;
+ prev= NULL;
while(ln) {
poin= newdataadr(fd, ln->next);
if(ln->next) {
}
}
-void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd)
+static void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd)
{
switch (prop->type) {
case IDP_GROUP:
}
/*stub function*/
-void IDP_LibLinkProperty(IDProperty *UNUSED(prop), int UNUSED(switch_endian), FileData *UNUSED(fd))
+static void IDP_LibLinkProperty(IDProperty *UNUSED(prop), int UNUSED(switch_endian), FileData *UNUSED(fd))
{
}
if(cu->vfont == NULL) link_list(fd, &(cu->nurb));
else {
- cu->nurb.first=cu->nurb.last= 0;
+ cu->nurb.first=cu->nurb.last= NULL;
tb= MEM_callocN(MAXTEXTBOX*sizeof(TextBox), "TextBoxread");
if (cu->tb) {
tex->plugin= newdataadr(fd, tex->plugin);
if(tex->plugin) {
- tex->plugin->handle= 0;
+ tex->plugin->handle= NULL;
open_plugin_tex(tex->plugin);
/* initialize data for this instance, if an initialization
* function exists.
}
}
-void lib_link_partdeflect(FileData *fd, ID *id, PartDeflect *pd)
+static void lib_link_partdeflect(FileData *fd, ID *id, PartDeflect *pd)
{
if(pd && pd->tex)
pd->tex=newlibadr_us(fd, id->lib, pd->tex);
if (md->type==eModifierType_Subsurf) {
SubsurfModifierData *smd = (SubsurfModifierData*) md;
- smd->emCache = smd->mCache = 0;
+ smd->emCache = smd->mCache = NULL;
}
else if (md->type==eModifierType_Armature) {
ArmatureModifierData *amd = (ArmatureModifierData*) md;
fluidmd->fss= newdataadr(fd, fluidmd->fss);
fluidmd->fss->fmd= fluidmd;
- fluidmd->fss->meshSurfNormals = 0;
+ fluidmd->fss->meshSurfNormals = NULL;
}
else if (md->type==eModifierType_Smoke) {
SmokeModifierData *smd = (SmokeModifierData*) md;
} else if (md->type==eModifierType_Explode) {
ExplodeModifierData *psmd = (ExplodeModifierData*) md;
- psmd->facepa=0;
+ psmd->facepa=NULL;
}
else if (md->type==eModifierType_MeshDeform) {
MeshDeformModifierData *mmd = (MeshDeformModifierData*) md;
prop= ob->prop.first;
while(prop) {
prop->poin= newdataadr(fd, prop->poin);
- if(prop->poin==0) prop->poin= &prop->data;
+ if(prop->poin==NULL) prop->poin= &prop->data;
prop= prop->next;
}
BKE_reportf(fd->reports, RPT_ERROR, "LIB ERROR: Object lost from scene:'%s\'\n", sce->id.name+2);
if(G.background==0) printf("LIB ERROR: base removed from scene:'%s\'\n", sce->id.name+2);
BLI_remlink(&sce->base, base);
- if(base==sce->basact) sce->basact= 0;
+ if(base==sce->basact) sce->basact= NULL;
MEM_freeN(base);
}
}
seq->scene_sound = sound_add_scene_sound(sce, seq, seq->startdisp, seq->enddisp, seq->startofs + seq->anim_startofs);
}
}
- seq->anim= 0;
+ seq->anim= NULL;
}
SEQ_END
sce->theDag = NULL;
sce->dagisvalid = 0;
sce->obedit= NULL;
- sce->stats= 0;
+ sce->stats= NULL;
sce->fps_info= NULL;
sound_create_scene(sce);
seq->seq2= newdataadr(fd, seq->seq2);
seq->seq3= newdataadr(fd, seq->seq3);
/* a patch: after introduction of effects with 3 input strips */
- if(seq->seq3==0) seq->seq3= seq->seq2;
+ if(seq->seq3==NULL) seq->seq3= seq->seq2;
seq->plugin= newdataadr(fd, seq->plugin);
seq->effectdata= newdataadr(fd, seq->effectdata);
seq->strip->stripdata = newdataadr(
fd, seq->strip->stripdata);
} else {
- seq->strip->stripdata = 0;
+ seq->strip->stripdata = NULL;
}
if (seq->flag & SEQ_USE_CROP) {
seq->strip->crop = newdataadr(
fd, seq->strip->crop);
} else {
- seq->strip->crop = 0;
+ seq->strip->crop = NULL;
}
if (seq->flag & SEQ_USE_TRANSFORM) {
seq->strip->transform = newdataadr(
fd, seq->strip->transform);
} else {
- seq->strip->transform = 0;
+ seq->strip->transform = NULL;
}
if (seq->flag & SEQ_USE_PROXY) {
seq->strip->proxy = newdataadr(
fd, seq->strip->proxy);
- seq->strip->proxy->anim = 0;
+ seq->strip->proxy->anim = NULL;
} else {
- seq->strip->proxy = 0;
+ seq->strip->proxy = NULL;
}
if (seq->flag & SEQ_USE_COLOR_BALANCE) {
seq->strip->color_balance = newdataadr(
fd, seq->strip->color_balance);
} else {
- seq->strip->color_balance = 0;
+ seq->strip->color_balance = NULL;
}
if (seq->strip->color_balance) {
// seq->strip->color_balance->gui = 0; // XXX - peter, is this relevant in 2.5?
/***/
-int mywfile;
-
/**
* Low level WRITE(2) wrapper that buffers data
* @param adr Pointer to new chunk of data
{
BHead bh;
- if(adr==0) return;
+ if(adr==NULL) return;
if(len==0) return;
len+= 3;
else {
/* can't return anything useful - unsupported */
*type= 0;
- return 0;
+ return NULL;
}
}
return NULL;
default: /* unsupported */
- return 0;
+ return NULL;
}
}
return NULL;
default: /* unsupported */
- return 0;
+ return NULL;
}
}
GET_ACF_FLAG_PTR(adt->flag);
}
else
- return 0;
+ return NULL;
case ACHANNEL_SETTING_EXPAND: /* expanded */
GET_ACF_FLAG_PTR(act->flag);
default: /* unsupported */
- return 0;
+ return NULL;
}
}
GET_ACF_FLAG_PTR(adt->flag);
default: /* unsupported */
- return 0;
+ return NULL;
}
}
static short ACF_INIT= 1; /* when non-zero, the list needs to be updated */
/* Initialise type info definitions */
-void ANIM_init_channel_typeinfo_data (void)
+static void ANIM_init_channel_typeinfo_data (void)
{
int type= 0;
/* ****************** Operator Utilities ********************************** */
/* poll callback for being in an Animation Editor channels list region */
-int animedit_poll_channels_active (bContext *C)
+static int animedit_poll_channels_active (bContext *C)
{
ScrArea *sa= CTX_wm_area(C);
}
/* poll callback for Animation Editor channels list region + not in NLA-tweakmode for NLA */
-int animedit_poll_channels_nla_tweakmode_off (bContext *C)
+static int animedit_poll_channels_nla_tweakmode_off (bContext *C)
{
ScrArea *sa= CTX_wm_area(C);
Scene *scene = CTX_data_scene(C);
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_move (wmOperatorType *ot)
+static void ANIM_OT_channels_move (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Move Channels";
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_delete (wmOperatorType *ot)
+static void ANIM_OT_channels_delete (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Delete Channels";
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_visibility_set (wmOperatorType *ot)
+static void ANIM_OT_channels_visibility_set (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Visibility";
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_visibility_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_visibility_toggle (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Toggle Visibility";
}
-void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
+static void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Enable Channel Setting";
ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
-void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
+static void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Disable Channel Setting";
ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
-void ANIM_OT_channels_setting_invert (wmOperatorType *ot)
+static void ANIM_OT_channels_setting_invert (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Invert Channel Setting";
ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
-void ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Toggle Channel Setting";
ot->prop= RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
}
-void ANIM_OT_channels_editable_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_editable_toggle (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Toggle Channel Editability";
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_expand (wmOperatorType *ot)
+static void ANIM_OT_channels_expand (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Expand Channels";
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_collapse (wmOperatorType *ot)
+static void ANIM_OT_channels_collapse (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Collapse Channels";
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_fcurves_enable (wmOperatorType *ot)
+static void ANIM_OT_channels_fcurves_enable (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Revive Disabled F-Curves";
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_select_all_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_select_all_toggle (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select All";
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_select_border(wmOperatorType *ot)
+static void ANIM_OT_channels_select_border(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Border Select";
return OPERATOR_FINISHED;
}
-void ANIM_OT_channels_click (wmOperatorType *ot)
+static void ANIM_OT_channels_click (wmOperatorType *ot)
{
/* identifiers */
ot->name= "Mouse Click on Channels";
/* Draw dark green line if slow-parenting/time-offset is enabled */
if (flag & DRAWCFRA_SHOW_TIMEOFS) {
- Object *ob= (scene->basact) ? (scene->basact->object) : 0;
+ Object *ob= OBACT;
if(ob) {
float timeoffset= give_timeoffset(ob);
// XXX ob->ipoflag is depreceated!
*/
void ANIM_nla_mapping_apply_fcurve (AnimData *adt, FCurve *fcu, short restore, short only_keys)
{
- KeyframeEditData ked= {{0}};
+ KeyframeEditData ked= {{NULL}};
KeyframeEditFunc map_cb;
/* init edit data
/* this function allocates memory for a new bAnimListElem struct for the
* provided animation channel-data.
*/
-bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, short ownertype, ID *owner_id)
+static bAnimListElem *make_new_animlistelem (void *data, short datatype, void *owner, short ownertype, ID *owner_id)
{
bAnimListElem *ale= NULL;
#include "DNA_anim_types.h"
-
-
#include "RNA_access.h"
+#include "ED_anim_api.h"
+
/* ----------------------- Getter functions ----------------------- */
/* Write into "name" buffer, the name of the property (retrieved using RNA from the curve's settings),
/* --------------------------------- */
/* Adds a marker to list of cfra elems */
-void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, short only_sel)
+static void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, short only_sel)
{
CfraElem *ce, *cen;
/* Print debugging prints of list of markers
* BSI's: do NOT make static or put in if-defs as "unused code". That's too much trouble when we need to use for quick debuggging!
*/
-void debug_markers_print_list(ListBase *markers)
+static void debug_markers_print_list(ListBase *markers)
{
TimeMarker *marker;
#include "WM_api.h"
#include "WM_types.h"
+#include "ED_anim_api.h"
#include "ED_screen.h"
#include "anim_intern.h"
return OPERATOR_RUNNING_MODAL;
}
-void ANIM_OT_change_frame(wmOperatorType *ot)
+static void ANIM_OT_change_frame(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Change frame";
return OPERATOR_FINISHED;
}
-void ANIM_OT_previewrange_set(wmOperatorType *ot)
+static void ANIM_OT_previewrange_set(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Set Preview Range";
return OPERATOR_FINISHED;
}
-void ANIM_OT_previewrange_clear(wmOperatorType *ot)
+static void ANIM_OT_previewrange_clear(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Clear Preview Range";
return OPERATOR_FINISHED;
}
-void ANIM_OT_time_toggle(wmOperatorType *ot)
+static void ANIM_OT_time_toggle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Toggle Frames/Seconds";
#include "RNA_access.h"
#include "RNA_define.h"
+#include "anim_intern.h"
+
+/* called by WM */
+void free_anim_drivers_copybuf (void);
+
/* ************************************************** */
/* Animation Data Validation */
static int add_driver_button_exec (bContext *C, wmOperator *op)
{
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
short success= 0;
int index, all= RNA_boolean_get(op->ptr, "all");
static int remove_driver_button_exec (bContext *C, wmOperator *op)
{
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
short success= 0;
int index, all= RNA_boolean_get(op->ptr, "all");
static int copy_driver_button_exec (bContext *C, wmOperator *op)
{
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
short success= 0;
int index;
static int paste_driver_button_exec (bContext *C, wmOperator *op)
{
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
short success= 0;
int index;
{
Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
char *path;
float cfra= (float)CFRA; // XXX for now, don't bother about all the yucky offset crap
{
Main *bmain= CTX_data_main(C);
Scene *scene= CTX_data_scene(C);
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
PropertyRNA *prop= NULL;
char *path;
float cfra= (float)CFRA; // XXX for now, don't bother about all the yucky offset crap
Scene *scene= CTX_data_scene(C);
KeyingSet *ks = NULL;
PropertyRNA *prop= NULL;
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
char *path = NULL;
short success= 0;
int index=0, pflag=0;
Scene *scene= CTX_data_scene(C);
KeyingSet *ks = NULL;
PropertyRNA *prop= NULL;
- PointerRNA ptr= {{0}};
+ PointerRNA ptr= {{NULL}};
char *path = NULL;
short success= 0;
int index=0;
}
}
-void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object *par, int heat, int mirror)
+static void add_verts_to_dgroups(ReportList *reports, Scene *scene, Object *ob, Object *par, int heat, int mirror)
{
/* This functions implements the automatic computation of vertex group
* weights, either through envelopes or using a heat equilibrium.
return get_named_bone((bArmature *)arg, name) != NULL;
}
-void unique_bone_name(bArmature *arm, char *name)
+static void unique_bone_name(bArmature *arm, char *name)
{
BLI_uniquename_cb(bone_unique_check, (void *)arm, "Bone", '.', name, sizeof(((Bone *)NULL)->name));
}
/*********************************** EDITBONE UTILS ****************************************************/
-int countEditBoneChildren(ListBase *list, EditBone *parent)
+static int countEditBoneChildren(ListBase *list, EditBone *parent)
{
EditBone *ebone;
int count = 0;
return count;
}
-EditBone* nextEditBoneChild(ListBase *list, EditBone *parent, int n)
+static EditBone* nextEditBoneChild(ListBase *list, EditBone *parent, int n)
{
EditBone *ebone;
return NULL;
}
-void getEditBoneRollUpAxis(EditBone *bone, float roll, float up_axis[3])
+static void getEditBoneRollUpAxis(EditBone *bone, float roll, float up_axis[3])
{
float mat[3][3], nor[3];
}
}
-float rollBoneByQuatJoint(RigEdge *edge, RigEdge *previous, float qrot[4], float qroll[4], float up_axis[3])
+static float rollBoneByQuatJoint(RigEdge *edge, RigEdge *previous, float qrot[4], float qroll[4], float up_axis[3])
{
if (previous == NULL)
{
/************************************ DESTRUCTORS ******************************************************/
-void RIG_freeRigArc(BArc *arc)
+static void RIG_freeRigArc(BArc *arc)
{
BLI_freelistN(&((RigArc*)arc)->edges);
}
/* remove pathes for removed control points
need this to make further step with copying non-cv related curves copying
not touching cv's f-cruves */
- fcu= orig_curves->first;
for(fcu= orig_curves->first; fcu; fcu= next) {
next= fcu->next;
#define YIC 20
/* proposal = put scene pointers on function calls? */
-#define BASACT (scene->basact)
-#define OBACT (BASACT? BASACT->object: 0)
+// #define BASACT (scene->basact)
+// #define OBACT (BASACT? BASACT->object: NULL)
MTFace *tface;
MFace *mface;
int a;
-
- if(me==0 || me->mtface==0) return;
-
+
+ if(me==NULL || me->mtface==NULL) return;
+
nr= pupmenu("Specials%t|Set Tex%x1| Shared%x2| Light%x3| Invisible%x4| Collision%x5| TwoSide%x6|Clr Tex%x7| Shared%x8| Light%x9| Invisible%x10| Collision%x11| TwoSide%x12");
tface= me->mtface;
tface->mode |= TF_TWOSIDE; break;
case 7:
tface->mode &= ~TF_TEX;
- tface->tpage= 0;
+ tface->tpage= NULL;
break;
case 8:
tface->mode &= ~TF_SHAREDCOL; break;
else if(ob->mode & OB_MODE_VERTEX_PAINT) {
Mesh *me= get_mesh(ob);
- if(me==0 || (me->mcol==NULL && me->mtface==NULL) ) return;
+ if(me==NULL || (me->mcol==NULL && me->mtface==NULL) ) return;
nr= pupmenu("Specials%t|Shared VertexCol%x1");
if(nr==1) {
#include "WM_api.h"
#include "WM_types.h"
+
+#include "ED_sculpt.h"
#include "ED_screen.h"
#include "ED_view3d.h"
#include "ED_util.h" /* for crazyspace correction */
{
Brush *brush= paint_brush(&sd->paint);
PBVHNode** nodes;
- int use_orco, totnode, n;
+ int totnode, n;
BLI_pbvh_gather_proxies(ss->pbvh, &nodes, &totnode);
if(!ELEM(brush->sculpt_tool, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_LAYER)) {
/* these brushes start from original coordinates */
- use_orco = (ELEM3(brush->sculpt_tool, SCULPT_TOOL_GRAB,
+ const int use_orco = (ELEM3(brush->sculpt_tool, SCULPT_TOOL_GRAB,
SCULPT_TOOL_ROTATE, SCULPT_TOOL_THUMB));
#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
static int console_textview_main__internal(struct SpaceConsole *sc, struct ARegion *ar, int draw, int mval[2], void **mouse_pick, int *pos_pick)
{
- ConsoleLine cl_dummy= {0};
+ ConsoleLine cl_dummy= {NULL};
int ret= 0;
View2D *v2d= &ar->v2d;
- TextViewContext tvc= {0};
+ TextViewContext tvc= {NULL};
tvc.begin= console_textview_begin;
tvc.end= console_textview_end;
return block;
}
-static void do_script_buttons(bContext *UNUSED(C), void *UNUSED(arg), int event)
+static void do_script_buttons(bContext *UNUSED(C), void *UNUSED(arg), int UNUSED(event))
{
- switch(event) {
- }
+ //switch(event) {
+ //}
}
/* str is allocated past the end */
} ViewCachedString;
-void view3d_cached_text_draw_begin()
+void view3d_cached_text_draw_begin(void)
{
ListBase *strings= &CachedText[CachedTextLevel];
strings->first= strings->last= NULL;
static void draw_bounding_volume(Scene *scene, Object *ob)
{
- BoundBox *bb=0;
+ BoundBox *bb= NULL;
if(ob->type==OB_MESH) {
bb= mesh_get_bb(ob);
else if(ob->type==OB_MBALL) {
if(is_basis_mball(ob)) {
bb= ob->bb;
- if(bb==0) {
+ if(bb==NULL) {
makeDispListMBall(scene, ob);
bb= ob->bb;
}
return;
}
- if(bb==0) return;
+ if(bb==NULL) return;
if(ob->boundtype==OB_BOUND_BOX) draw_box(bb->vec);
else draw_bb_quadric(bb, ob->boundtype);
/* ************************** TRANSFORMATIONS **************************** */
-void BIF_selectOrientation() {
+void BIF_selectOrientation(void) {
#if 0 // TRANSFORM_FIX_ME
short val;
char *str_menu = BIF_menustringTransformOrientation("Orientation");
}
}
-void drawTransformView(const struct bContext *C, struct ARegion *UNUSED(ar), void *arg)
+static void drawTransformView(const struct bContext *C, struct ARegion *UNUSED(ar), void *arg)
{
TransInfo *t = arg;
drawSnapping(C, t);
}
-void drawTransformPixel(const struct bContext *UNUSED(C), struct ARegion *UNUSED(ar), void *UNUSED(arg))
+static void drawTransformPixel(const struct bContext *UNUSED(C), struct ARegion *UNUSED(ar), void *UNUSED(arg))
{
// TransInfo *t = arg;
//
if(td->flag & TD_USEQUAT) {
- mul_serie_m3(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
+ mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
mat3_to_quat( quat,fmat); // Actual transform
if(td->ext->quat){
if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself
/* euler or quaternion/axis-angle? */
if (td->ext->rotOrder == ROT_MODE_QUAT) {
- mul_serie_m3(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
+ mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
mat3_to_quat( quat,fmat); // Actual transform
axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle);
- mul_serie_m3(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
+ mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
mat3_to_quat( quat,fmat); // Actual transform
mul_qt_qtqt(tquat, quat, iquat);
if ((t->flag & T_V3D_ALIGN)==0) { // align mode doesn't rotate objects itself
/* euler or quaternion? */
if ((td->ext->rotOrder == ROT_MODE_QUAT) || (td->flag & TD_USEQUAT)) {
- mul_serie_m3(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
+ mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
mat3_to_quat( quat,fmat); // Actual transform
mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat);
axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle);
- mul_serie_m3(fmat, td->mtx, mat, td->smtx, 0, 0, 0, 0, 0);
+ mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL);
mat3_to_quat( quat,fmat); // Actual transform
mul_qt_qtqt(tquat, quat, iquat);
if (constraints_list_needinv(t, &pchan->constraints)) {
copy_m3_m4(tmat, pchan->constinv);
invert_m3_m3(cmat, tmat);
- mul_serie_m3(td->mtx, bmat, pmat, omat, cmat, 0,0,0,0); // dang mulserie swaps args
+ mul_serie_m3(td->mtx, bmat, pmat, omat, cmat, NULL,NULL,NULL,NULL); // dang mulserie swaps args
}
else
- mul_serie_m3(td->mtx, bmat, pmat, omat, 0,0,0,0,0); // dang mulserie swaps args
+ mul_serie_m3(td->mtx, bmat, pmat, omat, NULL,NULL,NULL,NULL,NULL); // dang mulserie swaps args
}
else {
if (constraints_list_needinv(t, &pchan->constraints)) {
copy_m3_m4(tmat, pchan->constinv);
invert_m3_m3(cmat, tmat);
- mul_serie_m3(td->mtx, bmat, omat, cmat, 0,0,0,0,0); // dang mulserie swaps args
+ mul_serie_m3(td->mtx, bmat, omat, cmat, NULL,NULL,NULL,NULL,NULL); // dang mulserie swaps args
}
else
mul_m3_m3m3(td->mtx, omat, bmat); // Mat3MulMat3 has swapped args!
#define FIRSTBASE scene->base.first
#define LASTBASE scene->base.last
#define BASACT (scene->basact)
-#define OBACT (BASACT? BASACT->object: 0)
+#define OBACT (BASACT? BASACT->object: NULL)
#define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid
#define ID_NEW_US(a) if( (a)->id.newid) {(a)= (void *)(a)->id.newid; (a)->id.us++;}
prop= RNA_def_property(srna, "material_slots", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
RNA_def_property_struct_type(prop, "MaterialSlot");
- RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", 0, 0, 0); /* don't dereference pointer! */
+ RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, "rna_iterator_array_get", NULL, NULL, NULL); /* don't dereference pointer! */
RNA_def_property_ui_text(prop, "Material Slots", "Material slots in the object");
prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE);
/* flags */ eModifierTypeFlag_AcceptsCVs
| eModifierTypeFlag_SupportsEditmode,
- /* copyData */ 0,
+ /* copyData */ NULL,
/* deformVerts */ deformVerts,
/* deformMatrices */ deformMatrices,
/* deformVertsEM */ deformVertsEM,
/* deformMatricesEM */ deformMatricesEM,
- /* applyModifier */ 0,
- /* applyModifierEM */ 0,
- /* initData */ 0,
- /* requiredDataMask */ 0,
- /* freeData */ 0,
- /* isDisabled */ 0,
- /* updateDepgraph */ 0,
- /* dependsOnTime */ 0,
- /* dependsOnNormals */ 0,
- /* foreachObjectLink */ 0,
- /* foreachIDLink */ 0,
+ /* applyModifier */ NULL,
+ /* applyModifierEM */ NULL,
+ /* initData */ NULL,
+ /* requiredDataMask */ NULL,
+ /* freeData */ NULL,
+ /* isDisabled */ NULL,
+ /* updateDepgraph */ NULL,
+ /* dependsOnTime */ NULL,
+ /* dependsOnNormals */ NULL,
+ /* foreachObjectLink */ NULL,
+ /* foreachIDLink */ NULL
};
return NULL;
};
-void outputs_multilayer_get(RenderData *rd, RenderLayer *rl, bNodeStack **out, Image *ima, ImageUser *iuser)
+static void outputs_multilayer_get(RenderData *rd, RenderLayer *rl, bNodeStack **out, Image *ima, ImageUser *iuser)
{
if(out[RRES_OUT_Z]->hasoutput)
out[RRES_OUT_Z]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_Z);
/*********************** ID Property Main Wrapper Stuff ***************/
-PyObject *IDGroup_repr( BPy_IDProperty *self )
+static PyObject *IDGroup_repr( BPy_IDProperty *self )
{
return PyUnicode_FromFormat( "<bpy ID property from \"%s\">", self->id->name);
}
Py_RETURN_NONE;
}
-int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value)
+static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value)
{
switch (prop->type) {
case IDP_STRING:
return 0;
}
-PyObject *BPy_IDGroup_GetName(BPy_IDProperty *self, void *UNUSED(closure))
+static PyObject *BPy_IDGroup_GetName(BPy_IDProperty *self, void *UNUSED(closure))
{
return PyUnicode_FromString(self->prop->name);
}
/* Matches python dict.get(key, [default]) */
-PyObject* BPy_IDGroup_Get(BPy_IDProperty *self, PyObject *args)
+static PyObject* BPy_IDGroup_Get(BPy_IDProperty *self, PyObject *args)
{
IDProperty *idprop;
char *key;
"idprop.get(k[,d]) -> idprop[k]