Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-11-07 08:36:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-07 08:36:37 +0400
commitbb8fe0bf4afeaa5ae91329b8d8147b94cc54034a (patch)
tree8ce068ee16a8f61a6beeb08c0929f0fa9a8bde3b /source/blender/blenkernel
parent96d73bfdcfd74bfccd58bf02ae25b64577fce904 (diff)
minor edits
- remove unneeded type check from convert grease pencil operator. - correct some error prints & use __func__. - make copy_libblock take an ID* argument rather than void*.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_library.h2
-rw-r--r--source/blender/blenkernel/intern/action.c2
-rw-r--r--source/blender/blenkernel/intern/armature.c2
-rw-r--r--source/blender/blenkernel/intern/brush.c2
-rw-r--r--source/blender/blenkernel/intern/camera.c2
-rw-r--r--source/blender/blenkernel/intern/curve.c2
-rw-r--r--source/blender/blenkernel/intern/key.c2
-rw-r--r--source/blender/blenkernel/intern/lamp.c4
-rw-r--r--source/blender/blenkernel/intern/lattice.c2
-rw-r--r--source/blender/blenkernel/intern/library.c12
-rw-r--r--source/blender/blenkernel/intern/material.c4
-rw-r--r--source/blender/blenkernel/intern/mball.c2
-rw-r--r--source/blender/blenkernel/intern/mesh.c2
-rw-r--r--source/blender/blenkernel/intern/node.c2
-rw-r--r--source/blender/blenkernel/intern/object.c2
-rw-r--r--source/blender/blenkernel/intern/particle.c2
-rw-r--r--source/blender/blenkernel/intern/scene.c2
-rw-r--r--source/blender/blenkernel/intern/speaker.c2
-rw-r--r--source/blender/blenkernel/intern/text.c2
-rw-r--r--source/blender/blenkernel/intern/texture.c4
-rw-r--r--source/blender/blenkernel/intern/world.c4
21 files changed, 29 insertions, 31 deletions
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index 9130cac6cd6..308d7ff22c2 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -46,7 +46,7 @@ struct PointerRNA;
struct PropertyRNA;
void *alloc_libblock(struct ListBase *lb, short type, const char *name);
-void *copy_libblock(void *rt);
+void *copy_libblock(struct ID *id);
void copy_libblock_data(struct ID *id, const struct ID *id_from, const short do_action);
void BKE_id_lib_local_paths(struct Main *bmain, struct ID *id);
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 944f7c6a0b6..5fb03b7bbd0 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -185,7 +185,7 @@ bAction *copy_action (bAction *src)
if (src == NULL)
return NULL;
- dst= copy_libblock(src);
+ dst= copy_libblock(&src->id);
/* duplicate the lists of groups and markers */
BLI_duplicatelist(&dst->groups, &src->groups);
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index f19ed859064..50f305e4400 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -204,7 +204,7 @@ bArmature *copy_armature(bArmature *arm)
Bone *oldBone, *newBone;
Bone *newActBone= NULL;
- newArm= copy_libblock (arm);
+ newArm= copy_libblock(&arm->id);
BLI_duplicatelist(&newArm->bonebase, &arm->bonebase);
/* Duplicate the childrens' lists*/
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index e78b89441c9..09021e71025 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -144,7 +144,7 @@ Brush *copy_brush(Brush *brush)
{
Brush *brushn;
- brushn= copy_libblock(brush);
+ brushn= copy_libblock(&brush->id);
if (brush->mtex.tex)
id_us_plus((ID*)brush->mtex.tex);
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index eeec82c3beb..145eb9363e9 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -68,7 +68,7 @@ Camera *copy_camera(Camera *cam)
{
Camera *camn;
- camn= copy_libblock(cam);
+ camn= copy_libblock(&cam->id);
return camn;
}
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index adc08f5cd9f..160f5703a01 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -192,7 +192,7 @@ Curve *copy_curve(Curve *cu)
Curve *cun;
int a;
- cun= copy_libblock(cu);
+ cun= copy_libblock(&cu->id);
cun->nurb.first= cun->nurb.last= NULL;
duplicateNurblist( &(cun->nurb), &(cu->nurb));
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index c389800b0d1..eb7d07a6f7d 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -154,7 +154,7 @@ Key *copy_key(Key *key)
if(key==NULL) return NULL;
- keyn= copy_libblock(key);
+ keyn= copy_libblock(&key->id);
BLI_duplicatelist(&keyn->block, &key->block);
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index 974aa660e9f..4edd032dc04 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -106,7 +106,7 @@ Lamp *copy_lamp(Lamp *la)
Lamp *lan;
int a;
- lan= copy_libblock(la);
+ lan= copy_libblock(&la->id);
for(a=0; a<MAX_MTEX; a++) {
if(lan->mtex[a]) {
@@ -132,7 +132,7 @@ Lamp *localize_lamp(Lamp *la)
Lamp *lan;
int a;
- lan= copy_libblock(la);
+ lan= copy_libblock(&la->id);
BLI_remlink(&G.main->lamp, lan);
for(a=0; a<MAX_MTEX; a++) {
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index cef23ac3824..7c9e2be4493 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -204,7 +204,7 @@ Lattice *copy_lattice(Lattice *lt)
{
Lattice *ltn;
- ltn= copy_libblock(lt);
+ ltn= copy_libblock(&lt->id);
ltn->def= MEM_dupallocN(lt->def);
ltn->key= copy_key(ltn->key);
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 0b01c3d6dd1..878b87759b7 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -717,14 +717,11 @@ void copy_libblock_data(ID *id, const ID *id_from, const short do_action)
}
/* used everywhere in blenkernel */
-void *copy_libblock(void *rt)
+void *copy_libblock(ID *id)
{
- ID *idn, *id;
+ ID *idn;
ListBase *lb;
- char *cp, *cpn;
size_t idn_len;
-
- id= rt;
lb= which_libbase(G.main, GS(id->name));
idn= alloc_libblock(lb, GS(id->name), id->name+2);
@@ -733,8 +730,9 @@ void *copy_libblock(void *rt)
idn_len= MEM_allocN_len(idn);
if((int)idn_len - (int)sizeof(ID) > 0) { /* signed to allow neg result */
- cp= (char *)id;
- cpn= (char *)idn;
+ const char *cp= (const char *)id;
+ char *cpn= (char *)idn;
+
memcpy(cpn+sizeof(ID), cp+sizeof(ID), idn_len - sizeof(ID));
}
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 7be3514e0f2..48c6d6b2a19 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -215,7 +215,7 @@ Material *copy_material(Material *ma)
Material *man;
int a;
- man= copy_libblock(ma);
+ man= copy_libblock(&ma->id);
id_lib_extern((ID *)man->group);
@@ -247,7 +247,7 @@ Material *localize_material(Material *ma)
Material *man;
int a;
- man= copy_libblock(ma);
+ man= copy_libblock(&ma->id);
BLI_remlink(&G.main->mat, man);
/* no increment for texture ID users, in previewrender.c it prevents decrement */
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 327306b32ee..5c82acde99b 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -120,7 +120,7 @@ MetaBall *copy_mball(MetaBall *mb)
MetaBall *mbn;
int a;
- mbn= copy_libblock(mb);
+ mbn= copy_libblock(&mb->id);
BLI_duplicatelist(&mbn->elems, &mb->elems);
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 4a8bc34cdf7..ec9d4873057 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -206,7 +206,7 @@ Mesh *copy_mesh(Mesh *me)
MTFace *tface;
int a, i;
- men= copy_libblock(me);
+ men= copy_libblock(&me->id);
men->mat= MEM_dupallocN(me->mat);
for(a=0; a<men->totcol; a++) {
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 8f609291351..a9b2ffe7529 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -629,7 +629,7 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree)
for(newtree=G.main->nodetree.first; newtree; newtree= newtree->id.next)
if(newtree==ntree) break;
if(newtree) {
- newtree= copy_libblock(ntree);
+ newtree= copy_libblock(&ntree->id);
} else {
newtree= MEM_dupallocN(ntree);
copy_libblock_data(&newtree->id, &ntree->id, TRUE); /* copy animdata and ID props */
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index ae4e6ea81b8..1d654839969 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1084,7 +1084,7 @@ Object *copy_object(Object *ob)
ModifierData *md;
int a;
- obn= copy_libblock(ob);
+ obn= copy_libblock(&ob->id);
if(ob->totcol) {
obn->mat= MEM_dupallocN(ob->mat);
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 56e4c91ba5e..1064a5af160 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3569,7 +3569,7 @@ ParticleSettings *psys_copy_settings(ParticleSettings *part)
ParticleSettings *partn;
int a;
- partn= copy_libblock(part);
+ partn= copy_libblock(&part->id);
partn->pd= MEM_dupallocN(part->pd);
partn->pd2= MEM_dupallocN(part->pd2);
partn->effector_weights= MEM_dupallocN(part->effector_weights);
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 66d29b02263..14dfe015894 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -126,7 +126,7 @@ Scene *copy_scene(Scene *sce, int type)
scen->r.layers= lb;
}
else {
- scen= copy_libblock(sce);
+ scen= copy_libblock(&sce->id);
BLI_duplicatelist(&(scen->base), &(sce->base));
clear_id_newpoins();
diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c
index 018c7a197ff..a14233e9179 100644
--- a/source/blender/blenkernel/intern/speaker.c
+++ b/source/blender/blenkernel/intern/speaker.c
@@ -69,7 +69,7 @@ Speaker *copy_speaker(Speaker *spk)
{
Speaker *spkn;
- spkn= copy_libblock(spk);
+ spkn= copy_libblock(&spk->id);
if(spkn->sound)
spkn->sound->id.us++;
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 955127a8000..e8be0bb2608 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -431,7 +431,7 @@ Text *copy_text(Text *ta)
Text *tan;
TextLine *line, *tmp;
- tan= copy_libblock(ta);
+ tan= copy_libblock(&ta->id);
/* file name can be NULL */
if(ta->name) {
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 3aa289d0ef8..377eeef117e 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -751,7 +751,7 @@ Tex *copy_texture(Tex *tex)
{
Tex *texn;
- texn= copy_libblock(tex);
+ texn= copy_libblock(&tex->id);
if(texn->type==TEX_IMAGE) id_us_plus((ID *)texn->ima);
else texn->ima= NULL;
@@ -781,7 +781,7 @@ Tex *localize_texture(Tex *tex)
{
Tex *texn;
- texn= copy_libblock(tex);
+ texn= copy_libblock(&tex->id);
BLI_remlink(&G.main->tex, texn);
/* image texture: free_texture also doesn't decrease */
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index c7d2763774d..1d6972b9d61 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -118,7 +118,7 @@ World *copy_world(World *wrld)
World *wrldn;
int a;
- wrldn= copy_libblock(wrld);
+ wrldn= copy_libblock(&wrld->id);
for(a=0; a<MAX_MTEX; a++) {
if(wrld->mtex[a]) {
@@ -142,7 +142,7 @@ World *localize_world(World *wrld)
World *wrldn;
int a;
- wrldn= copy_libblock(wrld);
+ wrldn= copy_libblock(&wrld->id);
BLI_remlink(&G.main->world, wrldn);
for(a=0; a<MAX_MTEX; a++) {