diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-30 11:55:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-30 11:55:15 +0400 |
commit | 6d965f4493871c9bd4550939b8263d0c509b7c41 (patch) | |
tree | eb5fecdc3fc376d056d9e4ea7366c3a8e0dea8b7 /source | |
parent | ca629d5ccc65da456babba6c5bdbfa0de737ac7b (diff) |
style edits for function declarations
Diffstat (limited to 'source')
28 files changed, 208 insertions, 111 deletions
diff --git a/source/blender/blenkernel/BKE_array_mallocn.h b/source/blender/blenkernel/BKE_array_mallocn.h index 45ca4a5e694..0f312360521 100644 --- a/source/blender/blenkernel/BKE_array_mallocn.h +++ b/source/blender/blenkernel/BKE_array_mallocn.h @@ -34,28 +34,28 @@ */ /* example of usage: - -int *arr = NULL; -V_DECLARE(arr); -int i; - -for (i=0; i<10; i++) { - V_GROW(arr); - arr[i] = something; -} -V_FREE(arr); - -arrays are buffered, using double-buffering (so on each reallocation, -the array size is doubled). supposedly this should give good Big Oh -behaviour, though it may not be the best in practice. -*/ + * + * int *arr = NULL; + * V_DECLARE(arr); + * int i; + * + * for (i=0; i<10; i++) { + * V_GROW(arr); + * arr[i] = something; + * } + * V_FREE(arr); + * + * arrays are buffered, using double-buffering (so on each reallocation, + * the array size is doubled). supposedly this should give good Big Oh + * behaviour, though it may not be the best in practice. + */ #define V_DECLARE(vec) int _##vec##_count=0; void *_##vec##_tmp -/*in the future, I plan on having V_DECLARE allocate stack memory it'll - use at first, and switch over to heap when it needs more. that'll mess - up cases where you'd want to use this API to build a dynamic list for - non-local use, so all such cases should use this macro.*/ +/* in the future, I plan on having V_DECLARE allocate stack memory it'll + * use at first, and switch over to heap when it needs more. that'll mess + * up cases where you'd want to use this API to build a dynamic list for + * non-local use, so all such cases should use this macro.*/ #define V_DYNDECLARE(vec) V_DECLARE(vec) /*this returns the entire size of the array, including any buffering.*/ diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index e17566b7d55..a76fa8e8579 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -269,7 +269,8 @@ DagNode * pop_queue(DagNodeQueue *queue) } } -void *pop_ob_queue(struct DagNodeQueue *queue) { +void *pop_ob_queue(struct DagNodeQueue *queue) +{ return(pop_queue(queue)->ob); } @@ -278,7 +279,8 @@ DagNode * get_top_node_queue(DagNodeQueue *queue) return queue->first->node; } -int queue_count(struct DagNodeQueue *queue){ +int queue_count(struct DagNodeQueue *queue) +{ return queue->count; } @@ -1155,7 +1157,8 @@ void graph_bfs(void) queue_delete(nqueue); } -int pre_and_post_BFS(DagForest *dag, short mask, graph_action_func pre_func, graph_action_func post_func, void **data) { +int pre_and_post_BFS(DagForest *dag, short mask, graph_action_func pre_func, graph_action_func post_func, void **data) +{ DagNode *node; node = dag->DagNode.first; @@ -1341,7 +1344,8 @@ DagNodeQueue * graph_dfs(void) } /* unused */ -int pre_and_post_DFS(DagForest *dag, short mask, graph_action_func pre_func, graph_action_func post_func, void **data) { +int pre_and_post_DFS(DagForest *dag, short mask, graph_action_func pre_func, graph_action_func post_func, void **data) +{ DagNode *node; node = dag->DagNode.first; @@ -1552,7 +1556,8 @@ struct DagNodeQueue *get_all_childs(struct DagForest *dag, void *ob) } /* unused */ -short are_obs_related(struct DagForest *dag, void *ob1, void *ob2) { +short are_obs_related(struct DagForest *dag, void *ob1, void *ob2) +{ DagNode * node; DagAdjList *itA; @@ -1568,7 +1573,8 @@ short are_obs_related(struct DagForest *dag, void *ob1, void *ob2) { return DAG_NO_RELATION; } -int is_acyclic( DagForest *dag) { +int is_acyclic( DagForest *dag) +{ return dag->is_acyclic; } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index a3e13b48fe4..ce50c58a6e1 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -90,7 +90,8 @@ static void do_child_modifiers(ParticleSimulationData *sim, float *orco, float mat[4][4], ParticleKey *state, float t); /* few helpers for countall etc. */ -int count_particles(ParticleSystem *psys){ +int count_particles(ParticleSystem *psys) +{ ParticleSettings *part=psys->part; PARTICLE_P; int tot=0; @@ -102,7 +103,8 @@ int count_particles(ParticleSystem *psys){ } return tot; } -int count_particles_mod(ParticleSystem *psys, int totgr, int cur){ +int count_particles_mod(ParticleSystem *psys, int totgr, int cur) +{ ParticleSettings *part=psys->part; PARTICLE_P; int tot=0; @@ -1123,7 +1125,8 @@ static int get_pointcache_times_for_particle(PointCache *cache, int index, float return ret == 2; } -float psys_get_dietime_from_cache(PointCache *cache, int index) { +float psys_get_dietime_from_cache(PointCache *cache, int index) +{ PTCacheMem *pm; int dietime = 10000000; /* some max value so that we can default to pa->time+lifetime */ @@ -1366,7 +1369,9 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData /* Particles on a dm */ /************************************************/ /* interpolate a location on a face based on face coordinates */ -void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*orcodata)[3], float *w, float *vec, float *nor, float *utan, float *vtan, float *orco,float *ornor){ +void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*orcodata)[3], + float *w, float *vec, float *nor, float *utan, float *vtan, float *orco,float *ornor) +{ float *v1=0, *v2=0, *v3=0, *v4=0; float e1[3],e2[3],s1,s2,t1,t2; float *uv1, *uv2, *uv3, *uv4; @@ -1828,7 +1833,8 @@ static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float * /************************************************/ /* Particles on emitter */ /************************************************/ -void psys_particle_on_emitter(ParticleSystemModifierData *psmd, int from, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor){ +void psys_particle_on_emitter(ParticleSystemModifierData *psmd, int from, int index, int index_dmcache, float *fuv, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor) +{ if(psmd){ if(psmd->psys->part->distr==PART_DISTR_GRID && psmd->psys->part->from != PART_FROM_VERT){ if(vec) @@ -3231,7 +3237,8 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf /************************************************/ /* Particle Key handling */ /************************************************/ -void copy_particle_key(ParticleKey *to, ParticleKey *from, int time){ +void copy_particle_key(ParticleKey *to, ParticleKey *from, int time) +{ if(time){ memcpy(to,from,sizeof(ParticleKey)); } @@ -3241,7 +3248,8 @@ void copy_particle_key(ParticleKey *to, ParticleKey *from, int time){ to->time=to_time; } } -void psys_get_from_key(ParticleKey *key, float *loc, float *vel, float *rot, float *time){ +void psys_get_from_key(ParticleKey *key, float *loc, float *vel, float *rot, float *time) +{ if(loc) copy_v3_v3(loc,key->co); if(vel) copy_v3_v3(vel,key->vel); if(rot) copy_qt_qt(rot,key->rot); @@ -3249,7 +3257,8 @@ void psys_get_from_key(ParticleKey *key, float *loc, float *vel, float *rot, flo } /*-------changing particle keys from space to another-------*/ #if 0 -static void key_from_object(Object *ob, ParticleKey *key){ +static void key_from_object(Object *ob, ParticleKey *key) +{ float q[4]; add_v3_v3(key->vel, key->co); @@ -4177,7 +4186,8 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey * } } /* gets particle's state at a time, returns 1 if particle exists and can be seen and 0 if not */ -int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *state, int always){ +int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *state, int always) +{ ParticleSystem *psys = sim->psys; ParticleSettings *part = psys->part; ParticleData *pa = NULL; @@ -4515,7 +4525,8 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3] } -void psys_apply_hair_lattice(Scene *scene, Object *ob, ParticleSystem *psys) { +void psys_apply_hair_lattice(Scene *scene, Object *ob, ParticleSystem *psys) +{ ParticleSimulationData sim= {0}; sim.scene= scene; sim.ob= ob; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index a955643cbcc..e4dcfcf1354 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -107,7 +107,8 @@ /* Reacting to system events */ /************************************************/ -static int particles_are_dynamic(ParticleSystem *psys) { +static int particles_are_dynamic(ParticleSystem *psys) +{ if(psys->pointcache->flag & PTCACHE_BAKED) return 0; @@ -2240,7 +2241,8 @@ static void sph_spring_delete(ParticleSystem *psys, int j) psys->fluid_springs = (ParticleSpring*)MEM_reallocN(psys->fluid_springs, psys->alloc_fluidsprings * sizeof(ParticleSpring)); } } -static void sph_springs_modify(ParticleSystem *psys, float dtime){ +static void sph_springs_modify(ParticleSystem *psys, float dtime) +{ SPHFluidSettings *fluid = psys->part->fluid; ParticleData *pa1, *pa2; ParticleSpring *spring = psys->fluid_springs; @@ -2490,7 +2492,8 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa madd_v3_v3fl(force, gravity, fluid->buoyancy * (pfr.density-rest_density)); } -static void sph_integrate(ParticleSimulationData *sim, ParticleData *pa, float dfra, float *gravity, EdgeHash *springhash, float *element_size, float flow[3]) { +static void sph_integrate(ParticleSimulationData *sim, ParticleData *pa, float dfra, float *gravity, EdgeHash *springhash, float *element_size, float flow[3]) +{ ParticleTarget *pt; int i; @@ -3293,7 +3296,8 @@ static void collision_fail(ParticleData *pa, ParticleCollision *col) * -uses Newton-Rhapson iteration to find the collisions * -handles spherical particles and (nearly) point like particles */ -static void collision_check(ParticleSimulationData *sim, int p, float dfra, float cfra){ +static void collision_check(ParticleSimulationData *sim, int p, float dfra, float cfra) +{ ParticleSettings *part = sim->psys->part; ParticleData *pa = sim->psys->particles + p; ParticleCollision col; @@ -3561,7 +3565,8 @@ static void hair_step(ParticleSimulationData *sim, float cfra) psys->flag |= PSYS_HAIR_UPDATED; } -static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra)){ +static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra)) +{ Object *ob = sim->ob; ParticleSystem *psys = sim->psys; HairKey *key, *root; @@ -4241,7 +4246,8 @@ void psys_check_boid_data(ParticleSystem *psys) } } -static void fluid_default_settings(ParticleSettings *part){ +static void fluid_default_settings(ParticleSettings *part) +{ SPHFluidSettings *fluid = part->fluid; fluid->spring_k = 0.f; diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index e57d2acd41d..1e5783f8ad0 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -187,7 +187,8 @@ void MeshImporter::set_face_indices(MFace *mface, unsigned int *indices, bool qu // not used anymore, test_index_face from blenkernel is better #if 0 // change face indices order so that v4 is not 0 -void MeshImporter::rotate_face_indices(MFace *mface) { +void MeshImporter::rotate_face_indices(MFace *mface) +{ mface->v4 = mface->v1; mface->v1 = mface->v2; mface->v2 = mface->v3; diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index a6e6a041090..995db5aa88b 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -1336,7 +1336,8 @@ void mesh_layers_menu_concat(CustomData *data, int type, char *str) } } -int mesh_layers_menu(CustomData *data, int type) { +int mesh_layers_menu(CustomData *data, int type) +{ int ret; char *str_pt, *str; @@ -2455,7 +2456,8 @@ static int select_linked_limited_invoke(ViewContext *vc, short all, short sel) #undef is_face_tag #undef face_tag -static void linked_limit_default(bContext *C, wmOperator *op) { +static void linked_limit_default(bContext *C, wmOperator *op) +{ if(!RNA_property_is_set(op->ptr, "limit")) { Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(obedit->data); diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 37d3d5b587c..12e51acbda7 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -6308,8 +6308,8 @@ static int validate_loop(EditMesh *em, Collection *edgecollection) return(1); } -static int loop_bisect(EditMesh *em, Collection *edgecollection){ - +static int loop_bisect(EditMesh *em, Collection *edgecollection) +{ EditFace *efa, *sf1, *sf2; EditEdge *eed, *sed; CollectedEdge *curredge; diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index cc60f4a52fd..5294e29d3d5 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -146,7 +146,8 @@ static int fluid_is_animated_mesh(FluidsimSettings *fss) #if 0 /* helper function */ -void fluidsimGetGeometryObjFilename(Object *ob, char *dst) { //, char *srcname) { +void fluidsimGetGeometryObjFilename(Object *ob, char *dst) { //, char *srcname) +{ //BLI_snprintf(dst,FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name); BLI_snprintf(dst,FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name); } @@ -769,7 +770,8 @@ static void fluidbake_endjob(void *customdata) } } -int runSimulationCallback(void *data, int status, int frame) { +int runSimulationCallback(void *data, int status, int frame) +{ FluidBakeJob *fb = (FluidBakeJob *)data; elbeemSimulationSettings *settings = fb->settings; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 0b15ee36355..3cb613ac5ca 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1875,11 +1875,14 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED { Scene *scene= CTX_data_scene(C); struct PaintStroke *stroke = op->customdata; - ToolSettings *ts= CTX_data_tool_settings(C); + ToolSettings *ts= scene->toolsettings; VPaint *wp= ts->wpaint; Object *ob= CTX_data_active_object(C); struct WPaintData *wpd; Mesh *me; + +// bDeformGroup *dg; + float mat[4][4], imat[4][4]; if(scene->obedit) return OPERATOR_CANCELLED; @@ -1924,6 +1927,20 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED return OPERATOR_PASS_THROUGH; } +#if 0 + /* check if we are attempting to paint onto a locked vertex group, + * and other options disallow it from doing anything useful */ + dg = BLI_findlink(&ob->defbase, (ob->actdef-1)); + if ( (dg->flag & DG_LOCK_WEIGHT) && + (ts->auto_normalize == FALSE) && + (ts->multipaint == FALSE) ) + { + BKE_report(op->reports, RPT_WARNING, "Active group is locked, multi-paint/normalize disabled, aborting"); + + return OPERATOR_CANCELLED; + } +#endif + /* ALLOCATIONS! no return after this line */ /* make mode data storage */ wpd= MEM_callocN(sizeof(struct WPaintData), "WPaintData"); diff --git a/source/blender/nodes/shader/nodes/node_shader_dynamic.c b/source/blender/nodes/shader/nodes/node_shader_dynamic.c index 5e7c99f7276..e55b1b164df 100644 --- a/source/blender/nodes/shader/nodes/node_shader_dynamic.c +++ b/source/blender/nodes/shader/nodes/node_shader_dynamic.c @@ -61,7 +61,8 @@ static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNode static void node_dynamic_free_storage_cb(bNode *node); #ifdef WITH_PYTHON -static PyObject *init_dynamicdict(void) { +static PyObject *init_dynamicdict(void) +{ PyObject *newscriptdict, *item; PyGILState_STATE gilstate = PyGILState_Ensure(); @@ -329,7 +330,8 @@ static void node_dynamic_reset_loaded(bNode *node) node->typeinfo = node_dynamic_find_typeinfo(&node_all_shaders, NULL); } -int nodeDynamicUnlinkText(ID *txtid) { +int nodeDynamicUnlinkText(ID *txtid) +{ Material *ma; bNode *nd; @@ -653,7 +655,8 @@ static void node_dynamic_setup(bNode *node) * NODE_DYNAMIC_MENU: for the default Dynamic node type * > NODE_DYNAMIC_MENU: for the new types defined by scripts */ -static void node_dynamic_init_cb(bNode *node) { +static void node_dynamic_init_cb(bNode *node) +{ int type = node->custom2; node->custom2 = 0; @@ -700,7 +703,8 @@ static void node_dynamic_copy_cb(bNode *orig_node, bNode *new_node) /* node_dynamic_exec_cb: the execution callback called per pixel * during rendering. */ -static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { +static void node_dynamic_exec_cb(void *data, bNode *node, bNodeStack **in, bNodeStack **out) +{ #ifndef WITH_PYTHON return; #else diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m index b1fa00d3509..365a06c7cd8 100644 --- a/source/blender/quicktime/apple/qtkit_export.m +++ b/source/blender/quicktime/apple/qtkit_export.m @@ -127,7 +127,8 @@ static QuicktimeCodecTypeDesc qtVideoCodecList[] = { static int qtVideoCodecCount = 18; -int quicktime_get_num_videocodecs() { +int quicktime_get_num_videocodecs() +{ return qtVideoCodecCount; } @@ -138,7 +139,8 @@ QuicktimeCodecTypeDesc* quicktime_get_videocodecType_desc(int indexValue) { return NULL; } -int quicktime_rnatmpvalue_from_videocodectype(int codecType) { +int quicktime_rnatmpvalue_from_videocodectype(int codecType) +{ int i; for (i=0;i<qtVideoCodecCount;i++) { if (qtVideoCodecList[i].codecType == codecType) @@ -148,7 +150,8 @@ int quicktime_rnatmpvalue_from_videocodectype(int codecType) { return 0; } -int quicktime_videocodecType_from_rnatmpvalue(int rnatmpvalue) { +int quicktime_videocodecType_from_rnatmpvalue(int rnatmpvalue) +{ int i; for (i=0;i<qtVideoCodecCount;i++) { if (qtVideoCodecList[i].rnatmpvalue == rnatmpvalue) @@ -168,7 +171,8 @@ static QuicktimeCodecTypeDesc qtAudioCodecList[] = { static int qtAudioCodecCount = 4; -int quicktime_get_num_audiocodecs() { +int quicktime_get_num_audiocodecs() +{ return qtAudioCodecCount; } @@ -179,7 +183,8 @@ QuicktimeCodecTypeDesc* quicktime_get_audiocodecType_desc(int indexValue) { return NULL; } -int quicktime_rnatmpvalue_from_audiocodectype(int codecType) { +int quicktime_rnatmpvalue_from_audiocodectype(int codecType) +{ int i; for (i=0;i<qtAudioCodecCount;i++) { if (qtAudioCodecList[i].codecType == codecType) @@ -189,7 +194,8 @@ int quicktime_rnatmpvalue_from_audiocodectype(int codecType) { return 0; } -int quicktime_audiocodecType_from_rnatmpvalue(int rnatmpvalue) { +int quicktime_audiocodecType_from_rnatmpvalue(int rnatmpvalue) +{ int i; for (i=0;i<qtAudioCodecCount;i++) { if (qtAudioCodecList[i].rnatmpvalue == rnatmpvalue) @@ -200,7 +206,8 @@ int quicktime_audiocodecType_from_rnatmpvalue(int rnatmpvalue) { } -static NSString *stringWithCodecType(int codecType) { +static NSString *stringWithCodecType(int codecType) +{ char str[5]; *((int*)str) = EndianU32_NtoB(codecType); @@ -209,7 +216,8 @@ static NSString *stringWithCodecType(int codecType) { return [NSString stringWithCString:str encoding:NSASCIIStringEncoding]; } -void makeqtstring (RenderData *rd, char *string) { +void makeqtstring (RenderData *rd, char *string) +{ char txt[64]; strcpy(string, rd->pic); @@ -223,7 +231,8 @@ void makeqtstring (RenderData *rd, char *string) { } } -void filepath_qt(char *string, RenderData *rd) { +void filepath_qt(char *string, RenderData *rd) +{ if (string==NULL) return; strcpy(string, rd->pic); @@ -779,7 +788,8 @@ void end_qt(void) } -void free_qtcomponentdata(void) { +void free_qtcomponentdata(void) +{ } void quicktime_verify_image_type(RenderData *rd, ImageFormatData *imf) diff --git a/source/blender/quicktime/apple/qtkit_import.m b/source/blender/quicktime/apple/qtkit_import.m index 4307529002c..4c2bcee0150 100644 --- a/source/blender/quicktime/apple/qtkit_import.m +++ b/source/blender/quicktime/apple/qtkit_import.m @@ -112,7 +112,8 @@ int anim_is_quicktime (const char *name) } -void free_anim_quicktime (struct anim *anim) { +void free_anim_quicktime (struct anim *anim) +{ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; if (anim == NULL) return; diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index 5dfce9d3e80..101fcc0a732 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -148,7 +148,8 @@ static QuicktimeCodecTypeDesc qtVideoCodecList[] = { static int qtVideoCodecCount = 12; -int quicktime_get_num_videocodecs() { +int quicktime_get_num_videocodecs() +{ return qtVideoCodecCount; } @@ -159,7 +160,8 @@ QuicktimeCodecTypeDesc* quicktime_get_videocodecType_desc(int indexValue) { return NULL; } -int quicktime_rnatmpvalue_from_videocodectype(int codecType) { +int quicktime_rnatmpvalue_from_videocodectype(int codecType) +{ int i; for (i=0;i<qtVideoCodecCount;i++) { if (qtVideoCodecList[i].codecType == codecType) @@ -169,7 +171,8 @@ int quicktime_rnatmpvalue_from_videocodectype(int codecType) { return 0; } -int quicktime_videocodecType_from_rnatmpvalue(int rnatmpvalue) { +int quicktime_videocodecType_from_rnatmpvalue(int rnatmpvalue) +{ int i; for (i=0;i<qtVideoCodecCount;i++) { if (qtVideoCodecList[i].rnatmpvalue == rnatmpvalue) @@ -496,7 +499,8 @@ static void QT_EndAddVideoSamplesToMedia (void) } -void filepath_qt(char *string, RenderData *rd) { +void filepath_qt(char *string, RenderData *rd) +{ char txt[64]; if (string==0) return; @@ -513,7 +517,8 @@ void filepath_qt(char *string, RenderData *rd) { } -int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, ReportList *reports) { +int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, ReportList *reports) +{ OSErr err = noErr; char name[2048]; @@ -599,13 +604,15 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R } -int append_qt(struct RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports) { +int append_qt(struct RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports) +{ QT_DoAddVideoSamplesToMedia(frame, pixels, rectx, recty, reports); return 1; } -void end_qt(void) { +void end_qt(void) +{ OSErr err = noErr; short resId = movieInDataForkResID; @@ -639,7 +646,8 @@ void end_qt(void) { } -void free_qtcomponentdata(void) { +void free_qtcomponentdata(void) +{ if(qtdata) { if(qtdata->theComponent) CloseComponent(qtdata->theComponent); MEM_freeN(qtdata); diff --git a/source/blender/quicktime/apple/quicktime_import.c b/source/blender/quicktime/apple/quicktime_import.c index d7ef371873a..b58b4a646e2 100644 --- a/source/blender/quicktime/apple/quicktime_import.c +++ b/source/blender/quicktime/apple/quicktime_import.c @@ -249,7 +249,8 @@ int anim_is_quicktime (const char *name) } -void free_anim_quicktime (struct anim *anim) { +void free_anim_quicktime (struct anim *anim) +{ if (anim == NULL) return; if (anim->qtime == NULL) return; diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 1bfe5945bbc..2aab0498765 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -123,7 +123,8 @@ void BL_ActionActuator::ProcessReplica() } -void BL_ActionActuator::SetBlendTime (float newtime){ +void BL_ActionActuator::SetBlendTime (float newtime) +{ m_blendframe = newtime; } diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index c6a1105124c..d472cce2a44 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1852,7 +1852,8 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, -static KX_LightObject *gamelight_from_blamp(Object *ob, Lamp *la, unsigned int layerflag, KX_Scene *kxscene, RAS_IRenderTools *rendertools, KX_BlenderSceneConverter *converter) { +static KX_LightObject *gamelight_from_blamp(Object *ob, Lamp *la, unsigned int layerflag, KX_Scene *kxscene, RAS_IRenderTools *rendertools, KX_BlenderSceneConverter *converter) +{ RAS_LightObject lightobj; KX_LightObject *gamelight; @@ -1896,7 +1897,8 @@ static KX_LightObject *gamelight_from_blamp(Object *ob, Lamp *la, unsigned int l return gamelight; } -static KX_Camera *gamecamera_from_bcamera(Object *ob, KX_Scene *kxscene, KX_BlenderSceneConverter *converter) { +static KX_Camera *gamecamera_from_bcamera(Object *ob, KX_Scene *kxscene, KX_BlenderSceneConverter *converter) +{ Camera* ca = static_cast<Camera*>(ob->data); RAS_CameraData camdata(ca->lens, ca->ortho_scale, ca->sensor_x, ca->sensor_y, ca->sensor_fit, ca->clipsta, ca->clipend, ca->type == CAM_PERSP, ca->YF_dofdist); KX_Camera *gamecamera; diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp index a7ef518336a..343cf023417 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp @@ -66,7 +66,8 @@ BL_InterpolatorList::~BL_InterpolatorList() { } } -KX_IScalarInterpolator *BL_InterpolatorList::GetScalarInterpolator(const char *rna_path, int array_index) { +KX_IScalarInterpolator *BL_InterpolatorList::GetScalarInterpolator(const char *rna_path, int array_index) +{ for(BL_InterpolatorList::iterator i = begin(); (i != end()) ; i++ ) { FCurve *fcu= (static_cast<BL_ScalarInterpolator *>(*i))->GetFCurve(); diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 2f5125a63dd..4fe436d634c 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -703,8 +703,8 @@ void KX_BlenderSceneConverter::ResetPhysicsObjectsAnimationIpo(bool clearIpo) } -void KX_BlenderSceneConverter::resetNoneDynamicObjectToIpo(){ - +void KX_BlenderSceneConverter::resetNoneDynamicObjectToIpo() +{ if (addInitFromFrame){ KX_SceneList* scenes = m_ketsjiEngine->CurrentScenes(); int numScenes = scenes->size(); diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp index 1db5f1114c2..a56fbe5bef2 100644 --- a/source/gameengine/Converter/KX_IpoConvert.cpp +++ b/source/gameengine/Converter/KX_IpoConvert.cpp @@ -72,7 +72,8 @@ #include "STR_HashedString.h" -static BL_InterpolatorList *GetAdtList(struct bAction *for_act, KX_BlenderSceneConverter *converter) { +static BL_InterpolatorList *GetAdtList(struct bAction *for_act, KX_BlenderSceneConverter *converter) +{ BL_InterpolatorList *adtList= converter->FindInterpolatorList(for_act); if (!adtList) { diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp index 27f4f0b10cb..726fea795ba 100644 --- a/source/gameengine/Expressions/InputParser.cpp +++ b/source/gameengine/Expressions/InputParser.cpp @@ -346,7 +346,8 @@ void CParser::NextSym() } #if 0 -int CParser::MakeInt() { +int CParser::MakeInt() +{ // returns the integer representation of the value in the global // variable const_as_string // pre: const_as_string contains only numercal chars @@ -354,7 +355,8 @@ int CParser::MakeInt() { } #endif -STR_String CParser::Symbol2Str(int s) { +STR_String CParser::Symbol2Str(int s) +{ // returns a string representation of of symbol s, // for use in Term when generating an error switch(s) { @@ -373,7 +375,8 @@ STR_String CParser::Symbol2Str(int s) { } } -void CParser::Term(int s) { +void CParser::Term(int s) +{ // generates an error if the next symbol isn't the specified symbol s // otherwise, skip the symbol if(s == sym) NextSym(); @@ -387,7 +390,8 @@ void CParser::Term(int s) { } } -int CParser::Priority(int optorkind) { +int CParser::Priority(int optorkind) +{ // returns the priority of an operator // higher number means higher priority switch(optorkind) { @@ -409,7 +413,8 @@ int CParser::Priority(int optorkind) { return 0; // should not happen } -CExpression *CParser::Ex(int i) { +CExpression *CParser::Ex(int i) +{ // parses an expression in the imput, starting at priority i, and // returns an CExpression, containing the parsed input CExpression *e1 = NULL, *e2 = NULL; @@ -551,7 +556,8 @@ CExpression *CParser::Ex(int i) { return e1; } -CExpression *CParser::Expr() { +CExpression *CParser::Expr() +{ // parses an expression in the imput, and // returns an CExpression, containing the parsed input return Ex(1); diff --git a/source/gameengine/Expressions/Operator1Expr.cpp b/source/gameengine/Expressions/Operator1Expr.cpp index 0ef35108233..4e93ee0cb09 100644 --- a/source/gameengine/Expressions/Operator1Expr.cpp +++ b/source/gameengine/Expressions/Operator1Expr.cpp @@ -98,10 +98,9 @@ bool COperator1Expr::IsInside(float x, float y, float z,bool bBorderInclude) } */ -bool COperator1Expr::NeedsRecalculated() { - +bool COperator1Expr::NeedsRecalculated() +{ return m_lhs->NeedsRecalculated(); - } CExpression* COperator1Expr::CheckLink(std::vector<CBrokenLinkInfo*>& brokenlinks) { diff --git a/source/gameengine/Expressions/Operator2Expr.cpp b/source/gameengine/Expressions/Operator2Expr.cpp index 7a012c4165c..11a509e59d0 100644 --- a/source/gameengine/Expressions/Operator2Expr.cpp +++ b/source/gameengine/Expressions/Operator2Expr.cpp @@ -168,17 +168,18 @@ bool COperator2Expr::IsInside(float x, float y, float z,bool bBorderInclude) -bool COperator2Expr::IsRightInside(float x, float y, float z,bool bBorderInclude) { - +bool COperator2Expr::IsRightInside(float x, float y, float z,bool bBorderInclude) +{ return m_rhs->IsInside(x,y,z,bBorderInclude) ; - } -bool COperator2Expr::IsLeftInside(float x, float y, float z,bool bBorderInclude) { +bool COperator2Expr::IsLeftInside(float x, float y, float z,bool bBorderInclude) +{ return m_lhs->IsInside(x,y,z,bBorderInclude); } */ -bool COperator2Expr::NeedsRecalculated() { +bool COperator2Expr::NeedsRecalculated() +{ // added some lines, just for debugging purposes, it could be a one-liner :) //bool modleft //bool modright; diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index 3e1c54b0cc7..b1072dd8336 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -54,7 +54,8 @@ extern "C" { } #endif -static inline void Py_Fatal(const char *M) { +static inline void Py_Fatal(const char *M) +{ fprintf(stderr, "%s\n", M); exit(-1); }; diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 91fdbb0dabc..49150fc775f 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -530,7 +530,8 @@ PyAttributeDef CValue::Attributes[] = { { NULL } //Sentinel }; -PyObject * CValue::pyattr_get_name(void * self_v, const KX_PYATTRIBUTE_DEF * attrdef) { +PyObject * CValue::pyattr_get_name(void * self_v, const KX_PYATTRIBUTE_DEF * attrdef) +{ CValue * self = static_cast<CValue *> (self_v); return PyUnicode_From_STR_String(self->GetName()); } diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index 336150b2d6d..2a903e4f8b6 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -86,7 +86,8 @@ void SCA_ISensor::ProcessReplica() m_linkedcontrollers.clear(); } -bool SCA_ISensor::IsPositiveTrigger() { +bool SCA_ISensor::IsPositiveTrigger() +{ bool result = false; if (m_eventval) { @@ -107,40 +108,49 @@ void SCA_ISensor::SetPulseMode(bool posmode, m_pulse_frequency = freq; } -void SCA_ISensor::SetInvert(bool inv) { +void SCA_ISensor::SetInvert(bool inv) +{ m_invert = inv; } -void SCA_ISensor::SetLevel(bool lvl) { +void SCA_ISensor::SetLevel(bool lvl) +{ m_level = lvl; } -void SCA_ISensor::SetTap(bool tap) { +void SCA_ISensor::SetTap(bool tap) +{ m_tap = tap; } -double SCA_ISensor::GetNumber() { +double SCA_ISensor::GetNumber() +{ return GetState(); } -void SCA_ISensor::Suspend() { +void SCA_ISensor::Suspend() +{ m_suspended = true; } -bool SCA_ISensor::IsSuspended() { +bool SCA_ISensor::IsSuspended() +{ return m_suspended; } -void SCA_ISensor::Resume() { +void SCA_ISensor::Resume() +{ m_suspended = false; } -void SCA_ISensor::Init() { +void SCA_ISensor::Init() +{ printf("Sensor %s has no init function, please report this bug to Blender.org\n", m_name.Ptr()); } -void SCA_ISensor::DecLink() { +void SCA_ISensor::DecLink() +{ m_links--; if (m_links < 0) { diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index b055a7b1603..430326cbce0 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -266,7 +266,8 @@ bool SCA_RandomActuator::Update() return false; } -void SCA_RandomActuator::enforceConstraints() { +void SCA_RandomActuator::enforceConstraints() +{ /* The constraints that are checked here are the ones fundamental to */ /* the various distributions. Limitations of the algorithms are checked */ /* elsewhere (or they should be... ). */ diff --git a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp index c3a8ba0e467..a12619aa925 100644 --- a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.cpp @@ -65,7 +65,8 @@ SCA_RandomNumberGenerator::~SCA_RandomNumberGenerator() { /* intentionally empty */ } -void SCA_RandomNumberGenerator::SetStartVector(void) { +void SCA_RandomNumberGenerator::SetStartVector(void) +{ /* setting initial seeds to mt[N] using */ /* the generator Line 25 of Table 1 in */ /* [KNUTH 1981, The Art of Computer Programming */ @@ -85,7 +86,8 @@ void SCA_RandomNumberGenerator::SetSeed(long newseed) /** * This is the important part: copied verbatim :) */ -unsigned long SCA_RandomNumberGenerator::Draw() { +unsigned long SCA_RandomNumberGenerator::Draw() +{ static unsigned long mag01[2] = { 0x0, MATRIX_A }; /* mag01[x] = x * MATRIX_A for x=0,1 */ @@ -121,7 +123,8 @@ unsigned long SCA_RandomNumberGenerator::Draw() { return y; } -float SCA_RandomNumberGenerator::DrawFloat() { +float SCA_RandomNumberGenerator::DrawFloat() +{ return ( (float) Draw()/ (unsigned long) 0xffffffff ); } diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index b30e674e821..aa864349035 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -55,7 +55,8 @@ void KX_TouchSensor::SynchronizeTransform() } -void KX_TouchSensor::EndFrame() { +void KX_TouchSensor::EndFrame() +{ m_colliders->ReleaseAndRemoveAll(); m_hitObject = NULL; m_bTriggered = false; |