Get rid of useless using constructs
authorKevin Ottens <kevin.ottens@nextcloud.com>
Wed, 12 Aug 2020 16:06:57 +0000 (18:06 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Wed, 12 Aug 2020 16:18:57 +0000 (18:18 +0200)
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/csync/csync.cpp
src/csync/csync.h
src/csync/csync_exclude.h
src/csync/csync_private.h
src/csync/csync_util.cpp
src/csync/vio/csync_vio.h
src/csync/vio/csync_vio_local_unix.cpp
src/csync/vio/csync_vio_local_win.cpp
test/csync/vio_tests/check_vio_ext.cpp

index b07a3f4fe81a83558f257b89955482e2f57ff84e..ea2dcc69b8a6c4e3e398c4d729413b5e021d1025 100644 (file)
@@ -326,7 +326,7 @@ int  csync_abort_requested(CSYNC *ctx)
   }
 }
 
-std::unique_ptr<csync_file_stat_t> csync_file_stat_s::fromSyncJournalFileRecord(const OCC::SyncJournalFileRecord &rec)
+std::unique_ptr<csync_file_stat_t> csync_file_stat_t::fromSyncJournalFileRecord(const OCC::SyncJournalFileRecord &rec)
 {
     std::unique_ptr<csync_file_stat_t> st(new csync_file_stat_t);
     st->path = rec._path;
index c57cd6f3d688c786b08fbeff157ef4a041fada50..3e2158348987d0eba9c7d0038622e66bf5b7773f 100644 (file)
@@ -59,7 +59,7 @@ class SyncJournalFileRecord;
 #define BITFIELD(size) :size
 #endif
 
-enum csync_status_codes_e {
+enum CSYNC_STATUS {
   CSYNC_STATUS_OK         = 0,
 
   CSYNC_STATUS_ERROR      = 1024, /* don't use this code,
@@ -95,8 +95,6 @@ enum csync_status_codes_e {
     CSYNC_STATUS_INDIVIDUAL_CANNOT_ENCODE
 };
 
-using CSYNC_STATUS = enum csync_status_codes_e;
-
 #ifndef likely
 # define likely(x) (x)
 #endif
@@ -146,9 +144,7 @@ enum ItemType {
 // currently specified at https://github.com/owncloud/core/issues/8322 are 9 to 10
 #define REMOTE_PERM_BUF_SIZE 15
 
-using csync_file_stat_t = struct csync_file_stat_s;
-
-struct OCSYNC_EXPORT csync_file_stat_s {
+struct OCSYNC_EXPORT csync_file_stat_t {
   time_t modtime = 0;
   int64_t size = 0;
   uint64_t inode = 0;
@@ -179,7 +175,7 @@ struct OCSYNC_EXPORT csync_file_stat_s {
 
   enum csync_instructions_e instruction = CSYNC_INSTRUCTION_NONE; /* u32 */
 
-  csync_file_stat_s()
+  csync_file_stat_t()
     : type(ItemTypeSkip)
     , child_modified(false)
     , has_ignored_files(false)
index 2ec59eb30eb56c0787a189730156dfe4a02d07ce..8134d2384afd3ca13806b348fe89cba841f44412 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <functional>
 
-enum csync_exclude_type_e {
+enum CSYNC_EXCLUDE_TYPE {
   CSYNC_NOT_EXCLUDED   = 0,
   CSYNC_FILE_SILENTLY_EXCLUDED,
   CSYNC_FILE_EXCLUDE_AND_REMOVE,
@@ -45,7 +45,6 @@ enum csync_exclude_type_e {
   CSYNC_FILE_EXCLUDE_CONFLICT,
   CSYNC_FILE_EXCLUDE_CANNOT_ENCODE
 };
-using CSYNC_EXCLUDE_TYPE = enum csync_exclude_type_e;
 
 class ExcludedFilesTest;
 
index 1f9204b53fe6f74a4c48810187d4599942880e06..d62031ed5c0fe08bb0210472253c4321d4de74eb 100644 (file)
@@ -189,7 +189,7 @@ struct OCSYNC_EXPORT csync_s {
   csync_file_stat_t *current_fs = nullptr;
 
   /* csync error code */
-  enum csync_status_codes_e status_code = CSYNC_STATUS_OK;
+  enum CSYNC_STATUS status_code = CSYNC_STATUS_OK;
 
   char *error_string = nullptr;
 
index 60bc348ec583f23120efa8c2b48b6bca920a288a..d697070dc89f2c901117edca69affbf506dd4307 100644 (file)
@@ -37,7 +37,7 @@
 Q_LOGGING_CATEGORY(lcCSyncUtils, "nextcloud.sync.csync.utils", QtInfoMsg)
 
 
-using _instr_code_struct = struct {
+struct _instr_code_struct {
   const char *instr_str;
   enum csync_instructions_e instr_code;
 };
index 54b71cb7a2d48c4c883f17d031fad71466ff44fa..926c98ffb8059e19749f81eed4969212b833cb8e 100644 (file)
 #include "csync.h"
 #include "csync_private.h"
 
-using fhandle_t = struct fhandle_s {
-
+struct fhandle_t {
   int fd;
-
 };
 
 csync_vio_handle_t *csync_vio_opendir(CSYNC *ctx, const char *name);
index 8f704dd24ee3ee1ae1ec3ec1d85762ea1662d05a..1f58623d59d951df0c5d21a5bfe8c29a7addc4dd 100644 (file)
@@ -43,7 +43,7 @@ Q_LOGGING_CATEGORY(lcCSyncVIOLocal, "nextcloud.sync.csync.vio_local", QtInfoMsg)
  * directory functions
  */
 
-using dhandle_t = struct dhandle_s {
+struct dhandle_t {
   DIR *dh;
   char *path;
 };
index 38446289dc1ddb72f322663b577a26bfcba60461..0ca7a430f4c868b5739507f842f1f8e6c9290f2c 100644 (file)
@@ -43,7 +43,7 @@ Q_LOGGING_CATEGORY(lcCSyncVIOLocal, "nextcloud.sync.csync.vio_local", QtInfoMsg)
  * directory functions
  */
 
-using dhandle_t = struct dhandle_s {
+struct dhandle_t {
   WIN32_FIND_DATA ffd;
   HANDLE hFind;
   int firstFind;
index 567dbd70bae1fa1e3469ecb7bca561216a544b26..5fee8ca83c8c738851efeceaddcc42ba44e36636 100644 (file)
@@ -43,7 +43,7 @@
 
 static mbchar_t wd_buffer[WD_BUFFER_SIZE];
 
-using statevar = struct {
+struct statevar {
     CSYNC *csync;
     char  *result;
     char *ignored_dir;