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:
Diffstat (limited to 'source/blender/makesdna/intern/makesdna.c')
-rw-r--r--source/blender/makesdna/intern/makesdna.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index fa0b313a120..da1811656a6 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -133,6 +133,9 @@ static const char *includefiles[] = {
"DNA_tracking_types.h",
"DNA_dynamicpaint_types.h",
"DNA_mask_types.h",
+ "DNA_rigidbody_types.h",
+ "DNA_freestyle_types.h",
+ "DNA_linestyle_types.h",
/* empty string to indicate end of includefiles */
""
@@ -208,7 +211,7 @@ static int calculate_structlens(int);
/**
* Construct the DNA.c file
*/
-void dna_write(FILE *file, void *pntr, int size);
+static void dna_write(FILE *file, const void *pntr, const int size);
/**
* Report all structures found so far, and print their lengths.
@@ -250,7 +253,9 @@ static int add_type(const char *str, int len)
}
/* append new type */
- if (nr_types == 0) cp = typedata;
+ if (nr_types == 0) {
+ cp = typedata;
+ }
else {
cp = types[nr_types - 1] + strlen(types[nr_types - 1]) + 1;
}
@@ -396,7 +401,9 @@ static int add_name(const char *str)
}
/* append new type */
- if (nr_names == 0) cp = namedata;
+ if (nr_names == 0) {
+ cp = namedata;
+ }
else {
cp = names[nr_names - 1] + strlen(names[nr_names - 1]) + 1;
}
@@ -892,7 +899,7 @@ static int calculate_structlens(int firststruct)
#define MAX_DNA_LINE_LENGTH 20
-void dna_write(FILE *file, void *pntr, int size)
+static void dna_write(FILE *file, const void *pntr, const int size)
{
static int linelength = 0;
int i;
@@ -934,7 +941,7 @@ void printStructLengths(void)
}
-static int make_structDNA(char *baseDirectory, FILE *file)
+static int make_structDNA(const char *baseDirectory, FILE *file)
{
int len, i;
short *sp;
@@ -984,7 +991,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
/* little test first... */
/* Mind the breaking condition here! */
if (debugSDNA) printf("\tStart of header scan:\n");
- for (i = 0; strlen(includefiles[i]); i++) {
+ for (i = 0; *(includefiles[i]) != '\0'; i++) {
sprintf(str, "%s%s", baseDirectory, includefiles[i]);
if (debugSDNA) printf("\t|-- Converting %s\n", str);
if (convert_include(str)) {
@@ -1036,12 +1043,10 @@ static int make_structDNA(char *baseDirectory, FILE *file)
/* pass */
}
else {
- strcpy(str, "SDNA");
- dna_write(file, str, 4);
+ dna_write(file, "SDNA", 4);
/* write names */
- strcpy(str, "NAME");
- dna_write(file, str, 4);
+ dna_write(file, "NAME", 4);
len = nr_names;
dna_write(file, &len, 4);
@@ -1053,8 +1058,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
dna_write(file, names[0], len);
/* write TYPES */
- strcpy(str, "TYPE");
- dna_write(file, str, 4);
+ dna_write(file, "TYPE", 4);
len = nr_types;
dna_write(file, &len, 4);
@@ -1067,16 +1071,14 @@ static int make_structDNA(char *baseDirectory, FILE *file)
dna_write(file, types[0], len);
/* WRITE TYPELENGTHS */
- strcpy(str, "TLEN");
- dna_write(file, str, 4);
+ dna_write(file, "TLEN", 4);
len = 2 * nr_types;
if (nr_types & 1) len += 2;
dna_write(file, typelens_native, len);
/* WRITE STRUCTS */
- strcpy(str, "STRC");
- dna_write(file, str, 4);
+ dna_write(file, "STRC", 4);
len = nr_structs;
dna_write(file, &len, 4);
@@ -1100,7 +1102,7 @@ static int make_structDNA(char *baseDirectory, FILE *file)
else {
/* add all include files defined in the global array */
- for (i = 0; strlen(includefiles[i]); i++) {
+ for (i = 0; *(includefiles[i]) != '\0'; i++) {
fprintf(fp, "#include \"%s%s\"\n", baseDirectory, includefiles[i]);
}
@@ -1165,13 +1167,13 @@ int main(int argc, char **argv)
return_status = 1;
}
else {
- char baseDirectory[256];
+ const char *baseDirectory;
if (argc == 3) {
- strcpy(baseDirectory, argv[2]);
+ baseDirectory = argv[2];
}
else {
- strcpy(baseDirectory, BASE_HEADER);
+ baseDirectory = BASE_HEADER;
}
fprintf(file, "const unsigned char DNAstr[] = {\n");
@@ -1267,4 +1269,7 @@ int main(int argc, char **argv)
#include "DNA_tracking_types.h"
#include "DNA_dynamicpaint_types.h"
#include "DNA_mask_types.h"
+#include "DNA_rigidbody_types.h"
+#include "DNA_freestyle_types.h"
+#include "DNA_linestyle_types.h"
/* end of list */