diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-03 20:05:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-03 20:05:21 +0300 |
commit | 263830f0004481cd4921f03f4242d7c80794b08d (patch) | |
tree | 30b512a06df2e619681ecacf97faee69e46913f8 /source/blender/blenkernel | |
parent | 7c86a1a95cbc643fdbbf8c28f0422face8a15a19 (diff) |
Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for 'const char's,.
Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into.
Diffstat (limited to 'source/blender/blenkernel')
34 files changed, 92 insertions, 89 deletions
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index 07ab0e7ec2c..3952b6066d3 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -95,7 +95,7 @@ void BKE_keyingsets_free(struct ListBase *list); /* Path Fixing API */ /* Fix all the paths for the given ID+AnimData */ -void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, char *prefix, char *oldName, char *newName, int oldSubscript, int newSubscript, int verify_paths); +void BKE_animdata_fix_paths_rename(struct ID *owner_id, struct AnimData *adt, const char *prefix, char *oldName, char *newName, int oldSubscript, int newSubscript, int verify_paths); /* Fix all the paths for the entire database... */ void BKE_all_animdata_fix_paths_rename(char *prefix, char *oldName, char *newName); diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h index 19f6ab4b0a8..83af573bd42 100644 --- a/source/blender/blenkernel/BKE_cloth.h +++ b/source/blender/blenkernel/BKE_cloth.h @@ -252,7 +252,7 @@ typedef enum */ typedef struct { - char *name; + const char *name; CM_SOLVER_ID id; int ( *init ) ( struct Object *ob, struct ClothModifierData *clmd ); int ( *solver ) ( struct Object *ob, float framenr, struct ClothModifierData *clmd, struct ListBase *effectors ); diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index 742c5049ed8..1b103890e06 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -225,7 +225,7 @@ struct Main *CTX_data_main(const bContext *C); struct Scene *CTX_data_scene(const bContext *C); struct ToolSettings *CTX_data_tool_settings(const bContext *C); -char *CTX_data_mode_string(const bContext *C); +const char *CTX_data_mode_string(const bContext *C); int CTX_data_mode_enum(const bContext *C); void CTX_data_main_set(bContext *C, struct Main *bmain); diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 3c04d6ec643..fb079d44bb5 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -266,7 +266,7 @@ void CustomData_from_bmesh_block(const struct CustomData *source, /* query info over types */ -void CustomData_file_write_info(int type, char **structname, int *structnum); +void CustomData_file_write_info(int type, const char **structname, int *structnum); int CustomData_sizeof(int type); /* get the name of a layer type */ diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index fa4b99b896c..5fbb7f37d15 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -193,7 +193,7 @@ struct FCurve *list_find_fcurve(ListBase *list, const char rna_path[], const int struct FCurve *iter_step_fcurve (struct FCurve *fcu_iter, const char rna_path[]); /* high level function to get an fcurve from C without having the rna */ -struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, char *prop_name, int index); +struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index); /* Get list of LinkData's containing pointers to the F-Curves which control the types of data indicated * e.g. numMatches = list_find_data_fcurves(matches, &act->curves, "pose.bones[", "MyFancyBone"); diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h index 65bcb54408b..898538c6820 100644 --- a/source/blender/blenkernel/BKE_gpencil.h +++ b/source/blender/blenkernel/BKE_gpencil.h @@ -42,7 +42,7 @@ void free_gpencil_data(struct bGPdata *gpd); struct bGPDframe *gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe); struct bGPDlayer *gpencil_layer_addnew(struct bGPdata *gpd); -struct bGPdata *gpencil_data_addnew(char name[]); +struct bGPdata *gpencil_data_addnew(const char name[]); struct bGPDframe *gpencil_frame_duplicate(struct bGPDframe *src); struct bGPDlayer *gpencil_layer_duplicate(struct bGPDlayer *src); diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index d7cc6590f94..83c35cc9799 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -67,17 +67,17 @@ void free_libblock_us(struct ListBase *lb, void *idv); void free_main(struct Main *mainvar); void tag_main(struct Main *mainvar, int tag); -void rename_id(struct ID *id, char *name); +void rename_id(struct ID *id, const char *name); void name_uiprefix_id(char *name, struct ID *id); void test_idbutton(char *name); void text_idbutton(struct ID *id, char *text); void all_local(struct Library *lib, int untagged_only); -struct ID *find_id(char *type, const char *name); +struct ID *find_id(const char *type, const char *name); void clear_id_newpoins(void); -void IDnames_to_pupstring(char **str, char *title, char *extraops, struct ListBase *lb,struct ID* link, short *nr); -void IMAnames_to_pupstring(char **str, char *title, char *extraops, struct ListBase *lb, struct ID *link, short *nr); -void IPOnames_to_pupstring(char **str, char *title, char *extraops, struct ListBase *lb, struct ID* link, short *nr, int blocktype); +void IDnames_to_pupstring(const char **str, const char *title, const char *extraops, struct ListBase *lb,struct ID* link, short *nr); +void IMAnames_to_pupstring(const char **str, const char *title, const char *extraops, struct ListBase *lb, struct ID *link, short *nr); +void IPOnames_to_pupstring(const char **str, const char *title, const char *extraops, struct ListBase *lb, struct ID* link, short *nr, int blocktype); void flag_listbase_ids(ListBase *lb, short flag, short value); void flag_all_listbases_ids(short flag, short value); diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index 0225a402fb8..306debc442c 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -294,7 +294,7 @@ int modifier_couldBeCage(struct Scene *scene, struct ModifierData *md) int modifier_isCorrectableDeformed(struct ModifierData *md); int modifier_sameTopology(ModifierData *md); int modifier_isEnabled(struct Scene *scene, struct ModifierData *md, int required_mode); -void modifier_setError(struct ModifierData *md, char *format, ...); +void modifier_setError(struct ModifierData *md, const char *format, ...); void modifiers_foreachObjectLink(struct Object *ob, ObjectWalkFunc walk, diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 0e96587446e..312292635df 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -61,7 +61,7 @@ struct uiLayout; typedef struct bNodeSocketType { int type, limit; - char *name; + const char *name; float val1, val2, val3, val4; /* default alloc value for inputs */ float min, max; /* default range for inputs */ @@ -75,7 +75,7 @@ typedef struct bNodeSocketType { typedef struct bNodeType { void *next,*prev; int type; - char *name; + const char *name; /* can be allocated too */ float width, minwidth, maxwidth; short nclass, flag; diff --git a/source/blender/blenkernel/BKE_property.h b/source/blender/blenkernel/BKE_property.h index b9cca612846..5fab97b35e5 100644 --- a/source/blender/blenkernel/BKE_property.h +++ b/source/blender/blenkernel/BKE_property.h @@ -42,7 +42,7 @@ void copy_properties(struct ListBase *lbn, struct ListBase *lbo); void init_property(struct bProperty *prop); struct bProperty *new_property(int type); void unique_property(struct bProperty *first, struct bProperty *prop, int force); -struct bProperty *get_ob_property(struct Object *ob, char *name); +struct bProperty *get_ob_property(struct Object *ob, const char *name); void set_ob_property(struct Object *ob, struct bProperty *propc); int compare_property(struct bProperty *prop, char *str); void set_property(struct bProperty *prop, char *str); diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index e3b6ebd1ff8..d8d4c75a74b 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -97,8 +97,8 @@ SeqRenderData seq_new_render_data( struct Main * bmain, struct Scene * scene, int rectx, int recty, int preview_render_size); -int seq_cmp_render_data(SeqRenderData * a, SeqRenderData * b); -unsigned int seq_hash_render_data(SeqRenderData * a); +int seq_cmp_render_data(const SeqRenderData * a, const SeqRenderData * b); +unsigned int seq_hash_render_data(const SeqRenderData * a); /* Wipe effect */ enum {DO_SINGLE_WIPE, DO_DOUBLE_WIPE, DO_BOX_WIPE, DO_CROSS_WIPE, @@ -177,7 +177,7 @@ void seq_free_strip(struct Strip *strip); void seq_free_editing(struct Scene *scene); void seq_free_clipboard(void); struct Editing *seq_give_editing(struct Scene *scene, int alloc); -char *give_seqname(struct Sequence *seq); +const char *give_seqname(struct Sequence *seq); void calc_sequence(struct Scene *scene, struct Sequence *seq); void calc_sequence_disp(struct Scene *scene, struct Sequence *seq); void new_tstripdata(struct Sequence *seq); diff --git a/source/blender/blenkernel/depsgraph_private.h b/source/blender/blenkernel/depsgraph_private.h index 0527fe406bc..808ce661628 100644 --- a/source/blender/blenkernel/depsgraph_private.h +++ b/source/blender/blenkernel/depsgraph_private.h @@ -51,7 +51,7 @@ typedef struct DagAdjList short type; int count; // number of identical arcs unsigned int lay; // for flushing redraw/rebuild events - char *name; + const char *name; struct DagAdjList *next; } DagAdjList; @@ -117,7 +117,7 @@ DagNode * dag_find_node (DagForest *forest,void * fob); DagNode * dag_add_node (DagForest *forest,void * fob); DagNode * dag_get_node (DagForest *forest,void * fob); DagNode * dag_get_sub_node (DagForest *forest,void * fob); -void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, char *name); +void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, const char *name); void graph_bfs(void); diff --git a/source/blender/blenkernel/intern/BME_Customdata.c b/source/blender/blenkernel/intern/BME_Customdata.c index 1087b3a873c..b64efa811de 100644 --- a/source/blender/blenkernel/intern/BME_Customdata.c +++ b/source/blender/blenkernel/intern/BME_Customdata.c @@ -43,7 +43,7 @@ /********************* Layer type information **********************/ typedef struct BME_LayerTypeInfo { int size; - char *defaultname; + const char *defaultname; void (*copy)(const void *source, void *dest, int count); void (*free)(void *data, int count, int size); void (*interp)(void **sources, float *weights, float *sub_weights, int count, void *dest); diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index ae683dab7b2..e48183ac479 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -294,7 +294,7 @@ static short check_rna_path_is_valid (ID *owner_id, char *path) /* Check if some given RNA Path needs fixing - free the given path and set a new one as appropriate * NOTE: we assume that oldName and newName have [" "] padding around them */ -static char *rna_path_rename_fix (ID *owner_id, char *prefix, char *oldName, char *newName, char *oldpath, int verify_paths) +static char *rna_path_rename_fix (ID *owner_id, const char *prefix, char *oldName, char *newName, char *oldpath, int verify_paths) { char *prefixPtr= strstr(oldpath, prefix); char *oldNamePtr= strstr(oldpath, oldName); @@ -352,7 +352,7 @@ static char *rna_path_rename_fix (ID *owner_id, char *prefix, char *oldName, cha } /* Check RNA-Paths for a list of F-Curves */ -static void fcurves_path_rename_fix (ID *owner_id, char *prefix, char *oldName, char *newName, ListBase *curves, int verify_paths) +static void fcurves_path_rename_fix (ID *owner_id, const char *prefix, char *oldName, char *newName, ListBase *curves, int verify_paths) { FCurve *fcu; @@ -365,7 +365,7 @@ static void fcurves_path_rename_fix (ID *owner_id, char *prefix, char *oldName, } /* Check RNA-Paths for a list of Drivers */ -static void drivers_path_rename_fix (ID *owner_id, char *prefix, char *oldName, char *newName, char *oldKey, char *newKey, ListBase *curves, int verify_paths) +static void drivers_path_rename_fix (ID *owner_id, const char *prefix, char *oldName, char *newName, char *oldKey, char *newKey, ListBase *curves, int verify_paths) { FCurve *fcu; @@ -405,7 +405,7 @@ static void drivers_path_rename_fix (ID *owner_id, char *prefix, char *oldName, } /* Fix all RNA-Paths for Actions linked to NLA Strips */ -static void nlastrips_path_rename_fix (ID *owner_id, char *prefix, char *oldName, char *newName, ListBase *strips, int verify_paths) +static void nlastrips_path_rename_fix (ID *owner_id, const char *prefix, char *oldName, char *newName, ListBase *strips, int verify_paths) { NlaStrip *strip; @@ -425,7 +425,7 @@ static void nlastrips_path_rename_fix (ID *owner_id, char *prefix, char *oldName * NOTE: it is assumed that the structure we're replacing is <prefix><["><name><"]> * i.e. pose.bones["Bone"] */ -void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, char *prefix, char *oldName, char *newName, int oldSubscript, int newSubscript, int verify_paths) +void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, const char *prefix, char *oldName, char *newName, int oldSubscript, int newSubscript, int verify_paths) { NlaTrack *nlt; char *oldN, *newN; diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index fe010d812b1..96dbe727505 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -773,7 +773,7 @@ int CTX_data_mode_enum(const bContext *C) /* would prefer if we can use the enum version below over this one - Campbell */ /* must be aligned with above enum */ -static char *data_mode_strings[] = { +static const char *data_mode_strings[] = { "mesh_edit", "curve_edit", "surface_edit", @@ -790,7 +790,7 @@ static char *data_mode_strings[] = { "objectmode", 0 }; -char *CTX_data_mode_string(const bContext *C) +const char *CTX_data_mode_string(const bContext *C) { return data_mode_strings[CTX_data_mode_enum(C)]; } diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 1ef1cefa120..1a3d31bdcf8 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -60,9 +60,9 @@ /********************* Layer type information **********************/ typedef struct LayerTypeInfo { int size; /* the memory size of one element of this layer's data */ - char *structname; /* name of the struct used, for file writing */ + const char *structname; /* name of the struct used, for file writing */ int structnum; /* number of structs per element, for file writing */ - char *defaultname; /* default layer name */ + const char *defaultname; /* default layer name */ /* a function to copy count elements of this layer's data * (deep copy if appropriate) @@ -2212,7 +2212,7 @@ void CustomData_from_bmesh_block(const CustomData *source, CustomData *dest, } -void CustomData_file_write_info(int type, char **structname, int *structnum) +void CustomData_file_write_info(int type, const char **structname, int *structnum) { const LayerTypeInfo *typeInfo = layerType_getInfo(type); diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index c4ee97c21c5..65a58b02377 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -846,7 +846,7 @@ DagNode * dag_get_sub_node (DagForest *forest,void * fob) return node; } -static void dag_add_parent_relation(DagForest *UNUSED(forest), DagNode *fob1, DagNode *fob2, short rel, char *name) +static void dag_add_parent_relation(DagForest *UNUSED(forest), DagNode *fob1, DagNode *fob2, short rel, const char *name) { DagAdjList *itA = fob2->parent; @@ -868,7 +868,7 @@ static void dag_add_parent_relation(DagForest *UNUSED(forest), DagNode *fob1, Da fob2->parent = itA; } -void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, char *name) +void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, const char *name) { DagAdjList *itA = fob1->child; @@ -893,7 +893,7 @@ void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel fob1->child = itA; } -static char *dag_node_name(DagNode *node) +static const char *dag_node_name(DagNode *node) { if(node->ob == NULL) return "null"; @@ -938,7 +938,7 @@ static int dag_node_print_dependency_recurs(DagNode *node, DagNode *endnode) return 0; } -static void dag_node_print_dependency_cycle(DagForest *dag, DagNode *startnode, DagNode *endnode, char *name) +static void dag_node_print_dependency_cycle(DagForest *dag, DagNode *startnode, DagNode *endnode, const char *name) { DagNode *node; diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 888eae3ed78..325e64bf768 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -166,7 +166,7 @@ void copy_fcurves (ListBase *dst, ListBase *src) /* ----------------- Finding F-Curves -------------------------- */ /* high level function to get an fcurve from C without having the rna */ -FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, char *prop_name, int index) +FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *prop_name, int index) { /* anim vars */ AnimData *adt= BKE_animdata_from_id(id); @@ -884,7 +884,7 @@ typedef struct DriverVarTypeInfo { /* allocation of target slots */ int num_targets; /* number of target slots required */ - char *target_names[MAX_DRIVER_TARGETS]; /* UI names that should be given to the slots */ + const char *target_names[MAX_DRIVER_TARGETS]; /* UI names that should be given to the slots */ int target_flags[MAX_DRIVER_TARGETS]; /* flags defining the requirements for each slot */ } DriverVarTypeInfo; diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 5612d69ed76..80f26277689 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -190,7 +190,7 @@ bGPDlayer *gpencil_layer_addnew (bGPdata *gpd) } /* add a new gp-datablock */ -bGPdata *gpencil_data_addnew (char name[]) +bGPdata *gpencil_data_addnew (const char name[]) { bGPdata *gpd; diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c index 6411959e655..359603e9a50 100644 --- a/source/blender/blenkernel/intern/idcode.c +++ b/source/blender/blenkernel/intern/idcode.c @@ -35,7 +35,7 @@ typedef struct { unsigned short code; - char *name, *plural; + const char *name, *plural; int flags; #define IDTYPE_FLAGS_ISLINKABLE (1<<0) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index da1d59a0835..5c48569575e 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -766,7 +766,7 @@ int BKE_imtype_is_movie(int imtype) int BKE_add_image_extension(char *string, int imtype) { - char *extension= NULL; + const char *extension= NULL; if(imtype== R_IRIS) { if(!BLI_testextensie(string, ".rgb")) diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 5dc1cc2d746..7a32562d3d7 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -102,7 +102,7 @@ void free_ipo (Ipo *ipo) /* Mapping Table for bitflag <-> RNA path */ typedef struct AdrBit2Path { int bit; - char *path; + const char *path; int array_index; } AdrBit2Path; @@ -171,7 +171,7 @@ static AdrBit2Path *adrcode_bitmaps_to_paths (int blocktype, int adrcode, int *t /* ADRCODE to RNA-Path Conversion Code - Standard */ /* Object types */ -static char *ob_adrcodes_to_paths (int adrcode, int *array_index) +static const char *ob_adrcodes_to_paths (int adrcode, int *array_index) { /* set array index like this in-case nothing sets it correctly */ *array_index= 0; @@ -252,7 +252,7 @@ static char *ob_adrcodes_to_paths (int adrcode, int *array_index) /* PoseChannel types * NOTE: pchan name comes from 'actname' added earlier... */ -static char *pchan_adrcodes_to_paths (int adrcode, int *array_index) +static const char *pchan_adrcodes_to_paths (int adrcode, int *array_index) { /* set array index like this in-case nothing sets it correctly */ *array_index= 0; @@ -296,7 +296,7 @@ static char *pchan_adrcodes_to_paths (int adrcode, int *array_index) } /* Constraint types */ -static char *constraint_adrcodes_to_paths (int adrcode, int *array_index) +static const char *constraint_adrcodes_to_paths (int adrcode, int *array_index) { /* set array index like this in-case nothing sets it correctly */ *array_index= 0; @@ -330,9 +330,9 @@ static char *shapekey_adrcodes_to_paths (int adrcode, int *UNUSED(array_index)) } /* MTex (Texture Slot) types */ -static char *mtex_adrcodes_to_paths (int adrcode, int *UNUSED(array_index)) +static const char *mtex_adrcodes_to_paths (int adrcode, int *UNUSED(array_index)) { - char *base=NULL, *prop=NULL; + const char *base=NULL, *prop=NULL; static char buf[128]; /* base part of path */ @@ -400,7 +400,7 @@ static char *mtex_adrcodes_to_paths (int adrcode, int *UNUSED(array_index)) } /* Texture types */ -static char *texture_adrcodes_to_paths (int adrcode, int *array_index) +static const char *texture_adrcodes_to_paths (int adrcode, int *array_index) { /* set array index like this in-case nothing sets it correctly */ *array_index= 0; @@ -480,7 +480,7 @@ static char *texture_adrcodes_to_paths (int adrcode, int *array_index) } /* Material Types */ -static char *material_adrcodes_to_paths (int adrcode, int *array_index) +static const char *material_adrcodes_to_paths (int adrcode, int *array_index) { /* set array index like this in-case nothing sets it correctly */ *array_index= 0; @@ -564,7 +564,7 @@ static char *material_adrcodes_to_paths (int adrcode, int *array_index) } /* Camera Types */ -static char *camera_adrcodes_to_paths (int adrcode, int *array_index) +static const char *camera_adrcodes_to_paths (int adrcode, int *array_index) { /* set array index like this in-case nothing sets it correctly */ *array_index= 0; @@ -604,7 +604,7 @@ static char *camera_adrcodes_to_paths (int adrcode, int *array_index) } /* Lamp Types */ -static char *lamp_adrcodes_to_paths (int adrcode, int *array_index) +static const char *lamp_adrcodes_to_paths (int adrcode, int *array_index) { /* set array index like this in-case nothing sets it correctly */ *array_index= 0; @@ -646,7 +646,7 @@ static char *lamp_adrcodes_to_paths (int adrcode, int *array_index) } /* Sound Types */ -static char *sound_adrcodes_to_paths (int adrcode, int *array_index) +static const char *sound_adrcodes_to_paths (int adrcode, int *array_index) { /* set array index like this in-case nothing sets it correctly */ *array_index= 0; @@ -669,7 +669,7 @@ static char *sound_adrcodes_to_paths (int adrcode, int *array_index) } /* World Types */ -static char *world_adrcodes_to_paths (int adrcode, int *array_index) +static const char *world_adrcodes_to_paths (int adrcode, int *array_index) { /* set array index like this in-case nothing sets it correctly */ *array_index= 0; @@ -722,7 +722,7 @@ static char *world_adrcodes_to_paths (int adrcode, int *array_index) } /* Particle Types */ -static char *particle_adrcodes_to_paths (int adrcode, int *array_index) +static const char *particle_adrcodes_to_paths (int adrcode, int *array_index) { /* set array index like this in-case nothing sets it correctly */ *array_index= 0; @@ -800,7 +800,8 @@ static char *particle_adrcodes_to_paths (int adrcode, int *array_index) static char *get_rna_access (int blocktype, int adrcode, char actname[], char constname[], Sequence * seq, int *array_index) { DynStr *path= BLI_dynstr_new(); - char *propname=NULL, *rpath=NULL; + const char *propname=NULL; + char *rpath=NULL; char buf[512]; int dummy_index= 0; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 8ce89182a3a..8e1220dde24 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -852,7 +852,7 @@ void free_main(Main *mainvar) /* ***************** ID ************************ */ -ID *find_id(char *type, const char *name) /* type: "OB" or "MA" etc */ +ID *find_id(const char *type, const char *name) /* type: "OB" or "MA" etc */ { ListBase *lb= which_libbase(G.main, GS(type)); return BLI_findstring(lb, name, offsetof(ID, name) + 2); @@ -941,7 +941,7 @@ static void IDnames_to_dyn_pupstring(DynStr *pupds, ListBase *lb, ID *link, shor /* used by headerbuttons.c buttons.c editobject.c editseq.c */ /* if nr==NULL no MAX_IDPUP, this for non-header browsing */ -void IDnames_to_pupstring(char **str, char *title, char *extraops, ListBase *lb, ID *link, short *nr) +void IDnames_to_pupstring(const char **str, const char *title, const char *extraops, ListBase *lb, ID *link, short *nr) { DynStr *pupds= BLI_dynstr_new(); @@ -963,7 +963,7 @@ void IDnames_to_pupstring(char **str, char *title, char *extraops, ListBase *lb, } /* skips viewer images */ -void IMAnames_to_pupstring(char **str, char *title, char *extraops, ListBase *lb, ID *link, short *nr) +void IMAnames_to_pupstring(const char **str, const char *title, const char *extraops, ListBase *lb, ID *link, short *nr) { DynStr *pupds= BLI_dynstr_new(); @@ -1361,7 +1361,7 @@ void text_idbutton(struct ID *id, char *text) } } -void rename_id(ID *id, char *name) +void rename_id(ID *id, const char *name) { ListBase *lb; diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index dc2992662c9..6381315a8ca 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -216,7 +216,7 @@ int modifier_sameTopology(ModifierData *md) return ( mti->type == eModifierTypeType_OnlyDeform || mti->type == eModifierTypeType_Nonconstructive); } -void modifier_setError(ModifierData *md, char *format, ...) +void modifier_setError(ModifierData *md, const char *format, ...) { char buffer[2048]; va_list ap; diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 7f6fcdbdf40..120e6466608 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -3220,7 +3220,7 @@ static void remove_dynamic_typeinfos(ListBase *list) if(ntype->inputs) { bNodeSocketType *sock= ntype->inputs; while(sock->type!=-1) { - MEM_freeN(sock->name); + MEM_freeN((void *)sock->name); sock++; } MEM_freeN(ntype->inputs); @@ -3228,13 +3228,13 @@ static void remove_dynamic_typeinfos(ListBase *list) if(ntype->outputs) { bNodeSocketType *sock= ntype->outputs; while(sock->type!=-1) { - MEM_freeN(sock->name); + MEM_freeN((void *)sock->name); sock++; } MEM_freeN(ntype->outputs); } if(ntype->name) { - MEM_freeN(ntype->name); + MEM_freeN((void *)ntype->name); } MEM_freeN(ntype); } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index fe557dfefa0..5f2a10c0b3e 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -969,7 +969,7 @@ static void *add_obdata_from_type(int type) } } -static char *get_obdata_defname(int type) +static const char *get_obdata_defname(int type) { switch (type) { case OB_MESH: return "Mesh"; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index f4af518d137..4e393af1a1c 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -3625,8 +3625,8 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra)) FluidsimSettings *fss= fluidmd->fss; ParticleSettings *part = psys->part; ParticleData *pa=0; - char *suffix = "fluidsurface_particles_####"; - char *suffix2 = ".gz"; + const char *suffix = "fluidsurface_particles_####"; + const char *suffix2 = ".gz"; char filename[256]; char debugStrBuffer[256]; int curFrame = sim->scene->r.cfra -1; // warning - sync with derived mesh fsmesh loading diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index fb0d04b7473..f7af3c68814 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1233,7 +1233,7 @@ static int ptcache_file_read_header_begin(PTCacheFile *pf) static int ptcache_file_write_header_begin(PTCacheFile *pf) { - char *bphysics = "BPHYSICS"; + const char *bphysics = "BPHYSICS"; if(fwrite(bphysics, sizeof(char), 8, pf->fp) != 8) return 0; diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c index d8001572b4f..dd57fef50c5 100644 --- a/source/blender/blenkernel/intern/property.c +++ b/source/blender/blenkernel/intern/property.c @@ -179,7 +179,7 @@ void unique_property(bProperty *first, bProperty *prop, int force) } } -bProperty *get_ob_property(Object *ob, char *name) +bProperty *get_ob_property(Object *ob, const char *name) { return BLI_findstring(&ob->prop, name, offsetof(bProperty, name)); } diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c index f69547fd1da..5df912c871d 100644 --- a/source/blender/blenkernel/intern/report.c +++ b/source/blender/blenkernel/intern/report.c @@ -44,7 +44,7 @@ #endif #endif -static char *report_type_str(int type) +static const char *report_type_str(int type) { switch(type) { case RPT_DEBUG: return "Debug"; @@ -82,7 +82,7 @@ void BKE_reports_clear(ReportList *reports) while (report) { report_next= report->next; - MEM_freeN(report->message); + MEM_freeN((void *)report->message); MEM_freeN(report); report= report_next; } @@ -105,13 +105,15 @@ void BKE_report(ReportList *reports, ReportType type, const char *message) } if(reports && (reports->flag & RPT_STORE) && (type >= reports->storelevel)) { + char *message_alloc; report= MEM_callocN(sizeof(Report), "Report"); report->type= type; report->typestr= report_type_str(type); len= strlen(message); - report->message= MEM_callocN(sizeof(char)*(len+1), "ReportMessage"); - memcpy(report->message, message, sizeof(char)*(len+1)); + message_alloc= MEM_callocN(sizeof(char)*(len+1), "ReportMessage"); + memcpy(message_alloc, message, sizeof(char)*(len+1)); + report->message= message_alloc; report->len= len; BLI_addtail(&reports->list, report); } @@ -163,7 +165,7 @@ void BKE_reports_prepend(ReportList *reports, const char *prepend) BLI_dynstr_append(ds, prepend); BLI_dynstr_append(ds, report->message); - MEM_freeN(report->message); + MEM_freeN((void *)report->message); report->message= BLI_dynstr_get_cstring(ds); report->len= BLI_dynstr_get_len(ds); @@ -188,7 +190,7 @@ void BKE_reports_prependf(ReportList *reports, const char *prepend, ...) va_end(args); BLI_dynstr_append(ds, report->message); - MEM_freeN(report->message); + MEM_freeN((void *)report->message); report->message= BLI_dynstr_get_cstring(ds); report->len= BLI_dynstr_get_len(ds); diff --git a/source/blender/blenkernel/intern/seqcache.c b/source/blender/blenkernel/intern/seqcache.c index 73351edbdd5..b25c533ad4c 100644 --- a/source/blender/blenkernel/intern/seqcache.c +++ b/source/blender/blenkernel/intern/seqcache.c @@ -60,9 +60,9 @@ static struct BLI_mempool * keypool = 0; static int ibufs_in = 0; static int ibufs_rem = 0; -static unsigned int HashHash(void *key_) +static unsigned int HashHash(const void *key_) { - seqCacheKey * key = (seqCacheKey*) key_; + const seqCacheKey *key = (seqCacheKey*) key_; unsigned int rval = seq_hash_render_data(&key->context); rval ^= *(unsigned int*) &key->cfra; @@ -72,10 +72,10 @@ static unsigned int HashHash(void *key_) return rval; } -static int HashCmp(void *a_, void *b_) +static int HashCmp(const void *a_, const void *b_) { - seqCacheKey * a = (seqCacheKey*) a_; - seqCacheKey * b = (seqCacheKey*) b_; + const seqCacheKey * a = (seqCacheKey*) a_; + const seqCacheKey * b = (seqCacheKey*) b_; if (a->seq < b->seq) { return -1; diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index f5842fbe72d..fac773b2c6f 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -263,7 +263,7 @@ SeqRenderData seq_new_render_data( return rval; } -int seq_cmp_render_data(SeqRenderData * a, SeqRenderData * b) +int seq_cmp_render_data(const SeqRenderData * a, const SeqRenderData * b) { if (a->preview_render_size < b->preview_render_size) { return -1; @@ -317,7 +317,7 @@ int seq_cmp_render_data(SeqRenderData * a, SeqRenderData * b) return 0; } -unsigned int seq_hash_render_data(SeqRenderData * a) +unsigned int seq_hash_render_data(const SeqRenderData * a) { unsigned int rval = a->rectx + a->recty; @@ -875,7 +875,7 @@ void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq) strcpy(seq->name+2, sui.name_dest); } -static char *give_seqname_by_type(int type) +static const char *give_seqname_by_type(int type) { switch(type) { case SEQ_META: return "Meta"; @@ -902,9 +902,9 @@ static char *give_seqname_by_type(int type) } } -char *give_seqname(Sequence *seq) +const char *give_seqname(Sequence *seq) { - char * name = give_seqname_by_type(seq->type); + const char *name = give_seqname_by_type(seq->type); if (!name) { if(seq->type<SEQ_EFFECT) { diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index b78525d4f4e..f6833596883 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -585,7 +585,7 @@ static void make_new_line (TextLine *line, char *newline) line->format= NULL; } -static TextLine *txt_new_line(char *str) +static TextLine *txt_new_line(const char *str) { TextLine *tmp; @@ -1431,7 +1431,7 @@ void txt_print_undo(Text *text) { int i= 0; int op; - char *ops; + const char *ops; int linep, charp; dump_buffer(text); @@ -2470,7 +2470,7 @@ void indent(Text *text) int len, num; char *tmp; - char *add = "\t"; + const char *add = "\t"; int indentlen = 1; /* hardcoded: TXT_TABSIZE = 4 spaces: */ @@ -2531,7 +2531,7 @@ void indent(Text *text) void unindent(Text *text) { int num = 0; - char *remove = "\t"; + const char *remove = "\t"; int indent = 1; /* hardcoded: TXT_TABSIZE = 4 spaces: */ @@ -2694,7 +2694,7 @@ int setcurr_tab_spaces (Text *text, int space) const char *word = ":"; const char *comm = "#"; const char indent= (text->flags & TXT_TABSTOSPACES) ? ' ' : '\t'; - static char *back_words[]= {"return", "break", "continue", "pass", "yield", NULL}; + static const char *back_words[]= {"return", "break", "continue", "pass", "yield", NULL}; if (!text) return 0; if (!text->curl) return 0; diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 0ec38a035aa..bb00e6de5ce 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -69,7 +69,7 @@ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" -extern void do_init_ffmpeg(); +extern void do_init_ffmpeg(void); static int ffmpeg_type = 0; static int ffmpeg_codec = CODEC_ID_MPEG4; |