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>2013-02-22 17:35:32 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-02-22 17:35:32 +0400
commit7ad0790189c77c1f910578928e69be48cc7aad37 (patch)
tree3c65162923072dbc030ae55ecb9b092f54e81e1e /source/blender/blenloader
parent109b37e2c5e9733673f5c1e35bd54565475c183b (diff)
patch [#34103] Add explanatory comments to dna_genfile.[ch]
from Lawrence D'Oliveiro (ldo)
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c13
-rw-r--r--source/blender/blenloader/intern/writefile.c4
2 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f3dd4e5d54a..9b896c12d10 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -41,6 +41,7 @@
#include <math.h> // for fabs
#include <stdarg.h> /* for va_start/end */
+#include "BLI_utildefines.h"
#ifndef WIN32
# include <unistd.h> // for read close
#else
@@ -829,7 +830,7 @@ static int read_file_dna(FileData *fd)
for (bhead = blo_firstbhead(fd); bhead; bhead = blo_nextbhead(fd, bhead)) {
if (bhead->code == DNA1) {
- int do_endian_swap = (fd->flags & FD_FLAGS_SWITCH_ENDIAN) ? 1 : 0;
+ const bool do_endian_swap = (fd->flags & FD_FLAGS_SWITCH_ENDIAN) != 0;
fd->filesdna = DNA_sdna_from_data(&bhead[1], bhead->len, do_endian_swap);
if (fd->filesdna) {
@@ -952,11 +953,11 @@ static FileData *filedata_new(void)
fd->filedes = -1;
fd->gzfiledes = NULL;
- /* XXX, this doesn't need to be done all the time,
- * but it keeps us re-entrant, remove once we have
- * a lib that provides a nice lock. - zr
- */
- fd->memsdna = DNA_sdna_from_data(DNAstr, DNAlen, 0);
+ /* XXX, this doesn't need to be done all the time,
+ * but it keeps us re-entrant, remove once we have
+ * a lib that provides a nice lock. - zr
+ */
+ fd->memsdna = DNA_sdna_from_data(DNAstr, DNAlen, false);
fd->datamap = oldnewmap_new();
fd->globmap = oldnewmap_new();
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index e7a53670849..ca186455224 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -89,6 +89,8 @@
# include "BLI_winstuff.h"
#endif
+#include "BLI_utildefines.h"
+
/* allow writefile to use deprecated functionality (for forward compatibility code) */
#define DNA_DEPRECATED_ALLOW
@@ -198,7 +200,7 @@ static WriteData *writedata_new(int file)
if (wd == NULL) return NULL;
- wd->sdna = DNA_sdna_from_data(DNAstr, DNAlen, 0);
+ wd->sdna = DNA_sdna_from_data(DNAstr, DNAlen, false);
wd->file= file;