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:
authorHans Goudey <h.goudey@me.com>2022-10-05 21:44:02 +0300
committerHans Goudey <h.goudey@me.com>2022-10-05 21:48:01 +0300
commit548a2cbe06b23d90b0e09da49fc854178c270b8a (patch)
tree8706b5be97ace0ff0ca18d4109586ccb5cf0a666 /source/blender/blenloader/intern/writefile.cc
parent6306d747b770685f38f95bc57f8681335ddfa506 (diff)
Cleanup: Clang tidy
Also remove unnecessary struct keywords in C++ files.
Diffstat (limited to 'source/blender/blenloader/intern/writefile.cc')
-rw-r--r--source/blender/blenloader/intern/writefile.cc36
1 files changed, 17 insertions, 19 deletions
diff --git a/source/blender/blenloader/intern/writefile.cc b/source/blender/blenloader/intern/writefile.cc
index 4625a4471fe..42bc884098e 100644
--- a/source/blender/blenloader/intern/writefile.cc
+++ b/source/blender/blenloader/intern/writefile.cc
@@ -55,12 +55,13 @@
* - write #USER (#UserDef struct) if filename is `~/.config/blender/X.XX/config/startup.blend`.
*/
+#include <cerrno>
+#include <climits>
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#include <fcntl.h>
-#include <limits.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#ifdef WIN32
# include "BLI_winstuff.h"
@@ -116,8 +117,6 @@
#include "readfile.h"
-#include <errno.h>
-
#include <zstd.h>
/* Make preferences read-only. */
@@ -143,19 +142,18 @@ static CLG_LogRef LOG = {"blo.writefile"};
/** \name Internal Write Wrapper's (Abstracts Compression)
* \{ */
-typedef enum {
+enum eWriteWrapType {
WW_WRAP_NONE = 1,
WW_WRAP_ZSTD,
-} eWriteWrapType;
+};
-typedef struct ZstdFrame {
+struct ZstdFrame {
struct ZstdFrame *next, *prev;
uint32_t compressed_size;
uint32_t uncompressed_size;
-} ZstdFrame;
+};
-typedef struct WriteWrap WriteWrap;
struct WriteWrap {
/* callbacks */
bool (*open)(WriteWrap *ww, const char *filepath);
@@ -395,8 +393,8 @@ static void ww_handle_init(eWriteWrapType ww_type, WriteWrap *r_ww)
/** \name Write Data Type & Functions
* \{ */
-typedef struct {
- const struct SDNA *sdna;
+struct WriteData {
+ const SDNA *sdna;
struct {
/** Use for file and memory writing (size stored in max_size). */
@@ -429,11 +427,11 @@ typedef struct {
* Will be nullptr for UNDO.
*/
WriteWrap *ww;
-} WriteData;
+};
-typedef struct BlendWriter {
+struct BlendWriter {
WriteData *wd;
-} BlendWriter;
+};
static WriteData *writedata_new(WriteWrap *ww)
{
@@ -812,11 +810,11 @@ static void current_screen_compat(Main *mainvar,
nullptr;
}
-typedef struct RenderInfo {
+struct RenderInfo {
int sfra;
int efra;
char scene_name[MAX_ID_NAME - 2];
-} RenderInfo;
+};
/**
* This was originally added for the historic render-daemon feature,