diff options
author | Philipp Storz <philipp.storz@bareos.com> | 2022-11-04 13:41:32 +0300 |
---|---|---|
committer | Philipp Storz <philipp.storz@bareos.com> | 2022-11-04 13:41:32 +0300 |
commit | 77c1e5b0afa52be47d8f5e6d905c5c95b7e49df8 (patch) | |
tree | 5c9a68ec3b5ff68270156d6b841012a834223096 | |
parent | e3291d658ea22a9b97ed313ea3ccdd64334e1812 (diff) |
bareos-check-sources: apply modifications
-rw-r--r-- | core/src/dird/dird_conf.h | 3 | ||||
-rw-r--r-- | core/src/lib/alist.h | 31 | ||||
-rw-r--r-- | core/src/lib/attribs.cc | 2 | ||||
-rw-r--r-- | core/src/lib/bareos_resource.cc | 2 | ||||
-rw-r--r-- | core/src/lib/bareos_resource.h | 2 | ||||
-rw-r--r-- | core/src/lib/dlist.h | 5 | ||||
-rw-r--r-- | core/src/lib/output_formatter_resource.h | 15 | ||||
-rw-r--r-- | core/src/lib/parse_conf.h | 4 | ||||
-rw-r--r-- | core/src/lib/plugins.cc | 2 | ||||
-rw-r--r-- | core/src/lib/rblist.h | 2 | ||||
-rw-r--r-- | core/src/stored/reserve.cc | 2 | ||||
-rw-r--r-- | core/src/stored/reserve.h | 2 | ||||
-rw-r--r-- | core/src/tests/alist_test.cc | 2 |
13 files changed, 35 insertions, 39 deletions
diff --git a/core/src/dird/dird_conf.h b/core/src/dird/dird_conf.h index 78b4689c6..93d161e12 100644 --- a/core/src/dird/dird_conf.h +++ b/core/src/dird/dird_conf.h @@ -210,7 +210,8 @@ class ProfileResource : public BareosResource { struct UserAcl { BareosResource* corresponding_resource = nullptr; alist<const char*>* ACL_lists[Num_ACL] = {0}; /**< Pointers to ACLs */ - alist<ProfileResource*>* profiles = nullptr; /**< Pointers to profile resources */ + alist<ProfileResource*>* profiles + = nullptr; /**< Pointers to profile resources */ }; // Console Resource diff --git a/core/src/lib/alist.h b/core/src/lib/alist.h index 3f00d768a..45a3b3f94 100644 --- a/core/src/lib/alist.h +++ b/core/src/lib/alist.h @@ -2,7 +2,7 @@ BAREOS® - Backup Archiving REcovery Open Sourced Copyright (C) 2003-2012 Free Software Foundation Europe e.V. - Copyright (C) 2016-2021 Bareos GmbH & Co. KG + Copyright (C) 2016-2022 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public @@ -35,23 +35,18 @@ * Loop var through each member of list using an increasing index. * Loop var through each member of list using an decreasing index. */ -#define foreach_alist(var, list) \ - for ((var) = list ? (list)->first() : 0; (var); \ - (var) = (list)->next()) - -#define foreach_alist_null(var, list) \ - for ((var) = list ? (list)->first() : nullptr; (var); \ - (var) = (list)->next()) - -#define foreach_alist_index(inx, var, list) \ - for ((inx) = 0; \ - (list != nullptr) ? ((var) = (list)->get((inx))) : 0; \ - (inx)++) - -#define foreach_alist_rindex(inx, var, list) \ - for ((list != nullptr) ? (inx) = ((list)->size() - 1) : 0; \ - (list != nullptr) ? ((var) = (list)->get((inx))) : 0; \ - (inx)--) +#define foreach_alist(var, list) \ + for ((var) = list ? (list)->first() : 0; (var); (var) = (list)->next()) + +#define foreach_alist_null(var, list) \ + for ((var) = list ? (list)->first() : nullptr; (var); (var) = (list)->next()) + +#define foreach_alist_index(inx, var, list) \ + for ((inx) = 0; (list != nullptr) ? ((var) = (list)->get((inx))) : 0; (inx)++) + +#define foreach_alist_rindex(inx, var, list) \ + for ((list != nullptr) ? (inx) = ((list)->size() - 1) : 0; \ + (list != nullptr) ? ((var) = (list)->get((inx))) : 0; (inx)--) #include <string> diff --git a/core/src/lib/attribs.cc b/core/src/lib/attribs.cc index 69f229248..b84733035 100644 --- a/core/src/lib/attribs.cc +++ b/core/src/lib/attribs.cc @@ -2,7 +2,7 @@ BAREOS® - Backup Archiving REcovery Open Sourced Copyright (C) 2002-2011 Free Software Foundation Europe e.V. - Copyright (C) 2016-2018 Bareos GmbH & Co. KG + Copyright (C) 2016-2022 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public diff --git a/core/src/lib/bareos_resource.cc b/core/src/lib/bareos_resource.cc index 8a377343b..b042c9153 100644 --- a/core/src/lib/bareos_resource.cc +++ b/core/src/lib/bareos_resource.cc @@ -3,7 +3,7 @@ Copyright (C) 2000-2010 Free Software Foundation Europe e.V. Copyright (C) 2011-2012 Planets Communications B.V. - Copyright (C) 2013-2020 Bareos GmbH & Co. KG + Copyright (C) 2013-2022 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public diff --git a/core/src/lib/bareos_resource.h b/core/src/lib/bareos_resource.h index caf5ba716..288695012 100644 --- a/core/src/lib/bareos_resource.h +++ b/core/src/lib/bareos_resource.h @@ -3,7 +3,7 @@ Copyright (C) 2000-2010 Free Software Foundation Europe e.V. Copyright (C) 2011-2012 Planets Communications B.V. - Copyright (C) 2013-2021 Bareos GmbH & Co. KG + Copyright (C) 2013-2022 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public diff --git a/core/src/lib/dlist.h b/core/src/lib/dlist.h index de80afc43..0d2333333 100644 --- a/core/src/lib/dlist.h +++ b/core/src/lib/dlist.h @@ -35,9 +35,8 @@ #include "lib/message_severity.h" #define foreach_dlist(var, list) \ - for ((var) = nullptr; \ - (list ? ((var) = (list)->next(var)) : nullptr) \ - != nullptr;) + for ((var) = nullptr; \ + (list ? ((var) = (list)->next(var)) : nullptr) != nullptr;) template <typename T> class dlist { T* head{nullptr}; diff --git a/core/src/lib/output_formatter_resource.h b/core/src/lib/output_formatter_resource.h index 732e1021f..ee893b51d 100644 --- a/core/src/lib/output_formatter_resource.h +++ b/core/src/lib/output_formatter_resource.h @@ -1,7 +1,7 @@ /* BAREOS® - Backup Archiving REcovery Open Sourced - Copyright (C) 2020-2021 Bareos GmbH & Co. KG + Copyright (C) 2020-2022 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public @@ -117,12 +117,13 @@ class OutputFormatterResource { bool quoted_strings = true, bool escape_strings = false); - void KeyMultipleStringsOnePerLine(const char* key, - alist<const char*>* list, - std::function<const char*(const void*)> GetValue, - bool as_comment = false, - bool quoted_strings = true, - bool escape_strings = false); + void KeyMultipleStringsOnePerLine( + const char* key, + alist<const char*>* list, + std::function<const char*(const void*)> GetValue, + bool as_comment = false, + bool quoted_strings = true, + bool escape_strings = false); void KeyMultipleStringsOnePerLine(const char* key, const std::vector<std::string>&, diff --git a/core/src/lib/parse_conf.h b/core/src/lib/parse_conf.h index 288083837..7368224ea 100644 --- a/core/src/lib/parse_conf.h +++ b/core/src/lib/parse_conf.h @@ -489,8 +489,8 @@ inline std::shared_ptr<ConfigResourcesContainer> _init_foreach_res_( // Loop through each resource of type, returning in var #define foreach_res(var, type) \ for (auto _config_table_ = _init_foreach_res_(my_config, &var); \ - ((var) \ - = static_cast<decltype(var)>(my_config->GetNextRes((type), var)));) + ((var) \ + = static_cast<decltype(var)>(my_config->GetNextRes((type), var)));) #define LockRes(x) (x)->b_LockRes(__FILE__, __LINE__) #define UnlockRes(x) (x)->b_UnlockRes(__FILE__, __LINE__) diff --git a/core/src/lib/plugins.cc b/core/src/lib/plugins.cc index eb2fb33ea..6eee9c858 100644 --- a/core/src/lib/plugins.cc +++ b/core/src/lib/plugins.cc @@ -3,7 +3,7 @@ Copyright (C) 2007-2012 Free Software Foundation Europe e.V. Copyright (C) 2011-2012 Planets Communications B.V. - Copyright (C) 2013-2021 Bareos GmbH & Co. KG + Copyright (C) 2013-2022 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public diff --git a/core/src/lib/rblist.h b/core/src/lib/rblist.h index 5127c300d..3a161e3e9 100644 --- a/core/src/lib/rblist.h +++ b/core/src/lib/rblist.h @@ -2,7 +2,7 @@ BAREOS® - Backup Archiving REcovery Open Sourced Copyright (C) 2005-2007 Free Software Foundation Europe e.V. - Copyright (C) 2016-2021 Bareos GmbH & Co. KG + Copyright (C) 2016-2022 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public diff --git a/core/src/stored/reserve.cc b/core/src/stored/reserve.cc index 57b383ab0..bf353714d 100644 --- a/core/src/stored/reserve.cc +++ b/core/src/stored/reserve.cc @@ -2,7 +2,7 @@ BAREOS® - Backup Archiving REcovery Open Sourced Copyright (C) 2000-2012 Free Software Foundation Europe e.V. - Copyright (C) 2016-2021 Bareos GmbH & Co. KG + Copyright (C) 2016-2022 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public diff --git a/core/src/stored/reserve.h b/core/src/stored/reserve.h index f4526572c..6770a2b2c 100644 --- a/core/src/stored/reserve.h +++ b/core/src/stored/reserve.h @@ -2,7 +2,7 @@ BAREOS® - Backup Archiving REcovery Open Sourced Copyright (C) 2006-2007 Free Software Foundation Europe e.V. - Copyright (C) 2016-2021 Bareos GmbH & Co. KG + Copyright (C) 2016-2022 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public diff --git a/core/src/tests/alist_test.cc b/core/src/tests/alist_test.cc index 9ad07e05d..a95b9962a 100644 --- a/core/src/tests/alist_test.cc +++ b/core/src/tests/alist_test.cc @@ -2,7 +2,7 @@ BAREOS® - Backup Archiving REcovery Open Sourced Copyright (C) 2003-2011 Free Software Foundation Europe e.V. - Copyright (C) 2015-2021 Bareos GmbH & Co. KG + Copyright (C) 2015-2022 Bareos GmbH & Co. KG This program is Free Software; you can redistribute it and/or modify it under the terms of version three of the GNU Affero General Public |