From 328a0f975be68404604ee2571c1d0c4cf828dfec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 15 Jan 2019 23:14:35 +1100 Subject: Cleanup: comment line length (DNA) Prevents clang-format wrapping text before comments. --- source/blender/makesdna/intern/dna_genfile.c | 13 +++++++++---- source/blender/makesdna/intern/makesdna.c | 27 +++++++++++++++++---------- 2 files changed, 26 insertions(+), 14 deletions(-) (limited to 'source/blender/makesdna/intern') diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index f04d7ca5fe9..808bef68d2a 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -492,7 +492,8 @@ static bool init_structDNA( /* this is a patch, to change struct names without a conflict with SDNA */ /* be careful to use it, in this case for a system-struct (opengl/X) */ - /* struct Screen was already used by X, 'bScreen' replaces the old IrisGL 'Screen' struct */ + /* struct Screen was already used by X, + * 'bScreen' replaces the old IrisGL 'Screen' struct */ if (strcmp("bScreen", cp) == 0) { sdna->types[nr] = cp + 1; } @@ -844,7 +845,8 @@ static eSDNA_Type sdna_type_nr(const char *dna_type) else if ( strcmp(dna_type, "double") == 0) return SDNA_TYPE_DOUBLE; else if ( strcmp(dna_type, "int64_t") == 0) return SDNA_TYPE_INT64; else if ( strcmp(dna_type, "uint64_t") == 0) return SDNA_TYPE_UINT64; - else return -1; /* invalid! */ + /* invalid! */ + else return -1; } /** @@ -1155,8 +1157,11 @@ static void reconstruct_elem( curdata, olddata); } else if (strcmp(type, otype) == 0) { /* type equal */ - mul = len / oldsize; /* size of single old array element */ - mul *= (cursize < oldsize) ? cursize : oldsize; /* smaller of sizes of old and new arrays */ + /* size of single old array element */ + mul = len / oldsize; + /* smaller of sizes of old and new arrays */ + mul *= (cursize < oldsize) ? cursize : oldsize; + memcpy(curdata, olddata, mul); if (oldsize > cursize && strcmp(type, "char") == 0) { diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index a2c211826ee..1674e45085d 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -142,15 +142,21 @@ static int maxdata = 500000, maxnr = 50000; static int nr_names = 0; static int nr_types = 0; static int nr_structs = 0; -static char **names, *namedata; /* at address names[a] is string a */ -static char **types, *typedata; /* at address types[a] is string a */ -static short *typelens_native; /* at typelens[a] is the length of type 'a' on this systems bitness (32 or 64) */ -static short *typelens_32; /* contains sizes as they are calculated on 32 bit systems */ -static short *typelens_64; /* contains sizes as they are calculated on 64 bit systems */ -static short **structs, *structdata; /* at sp = structs[a] is the first address of a struct definition - * sp[0] is type number - * sp[1] is amount of elements - * sp[2] sp[3] is typenr, namenr (etc) */ +/** at address names[a] is string a */ +static char **names, *namedata; +/** at address types[a] is string a */ +static char **types, *typedata; +/** at typelens[a] is the length of type 'a' on this systems bitness (32 or 64) */ +static short *typelens_native; +/** contains sizes as they are calculated on 32 bit systems */ +static short *typelens_32; +/** contains sizes as they are calculated on 64 bit systems */ +static short *typelens_64; +/** at sp = structs[a] is the first address of a struct definition + * sp[0] is type number + * sp[1] is amount of elements + * sp[2] sp[3] is typenr, namenr (etc) */ +static short **structs, *structdata; /** * Variable to control debug output of makesdna. * debugSDNA: @@ -827,7 +833,8 @@ static int calculate_structlens(int firststruct) } else if (cp[0] == '[') { - /* parsing can cause names "var" and "[3]" to be found for "float var [3]" ... */ + /* parsing can cause names "var" and "[3]" + * to be found for "float var [3]" */ fprintf(stderr, "Parse error in struct, invalid member name: %s %s\n", types[structtype], cp); dna_error = 1; -- cgit v1.2.3