diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-02-06 22:56:10 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-02-09 12:13:18 -0800 |
commit | 8391d926c7355a0ff637c2b604e259d0d25c3cb2 (patch) | |
tree | 36cb3cfe14ef1d688ed39b568a3d35dbe8659971 | |
parent | ee839bf68618fc27f96b04291912c8af09e944b2 (diff) | |
download | subsurface-8391d926c7355a0ff637c2b604e259d0d25c3cb2.tar.gz |
Cleanup: remove const bool parameters and return types
These just make no sense. Since the value is copied, it
has no meaning to the caller whether the function can
change the value (and vice versa for return types).
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r-- | backend-shared/exportfuncs.cpp | 6 | ||||
-rw-r--r-- | backend-shared/exportfuncs.h | 6 | ||||
-rw-r--r-- | commands/command.h | 2 | ||||
-rw-r--r-- | core/dive.h | 2 | ||||
-rw-r--r-- | core/save-html.c | 2 | ||||
-rw-r--r-- | core/save-profiledata.c | 2 | ||||
-rw-r--r-- | core/save-xml.c | 2 | ||||
-rw-r--r-- | core/uploadDiveLogsDE.cpp | 2 | ||||
-rw-r--r-- | core/uploadDiveLogsDE.h | 2 | ||||
-rw-r--r-- | core/worldmap-save.c | 2 | ||||
-rw-r--r-- | core/worldmap-save.h | 2 | ||||
-rw-r--r-- | desktop-widgets/simplewidgets.cpp | 2 | ||||
-rw-r--r-- | desktop-widgets/simplewidgets.h | 2 |
13 files changed, 17 insertions, 17 deletions
diff --git a/backend-shared/exportfuncs.cpp b/backend-shared/exportfuncs.cpp index 54ec08139..a48f60066 100644 --- a/backend-shared/exportfuncs.cpp +++ b/backend-shared/exportfuncs.cpp @@ -12,7 +12,7 @@ #include "core/divesite.h" #include "exportfuncs.h" -void exportProfile(QString filename, const bool selected_only) +void exportProfile(QString filename, bool selected_only) { struct dive *dive; int i; @@ -33,7 +33,7 @@ void exportProfile(QString filename, const bool selected_only) } -void export_TeX(const char *filename, const bool selected_only, bool plain) +void export_TeX(const char *filename, bool selected_only, bool plain) { FILE *f; QDir texdir = QFileInfo(filename).dir(); @@ -233,7 +233,7 @@ void export_TeX(const char *filename, const bool selected_only, bool plain) } -void export_depths(const char *filename, const bool selected_only) +void export_depths(const char *filename, bool selected_only) { FILE *f; struct dive *dive; diff --git a/backend-shared/exportfuncs.h b/backend-shared/exportfuncs.h index ebd2b8fcb..250e8e60f 100644 --- a/backend-shared/exportfuncs.h +++ b/backend-shared/exportfuncs.h @@ -7,9 +7,9 @@ struct dive_site; -void exportProfile(QString filename, const bool selected_only); -void export_TeX(const char *filename, const bool selected_only, bool plain); -void export_depths(const char *filename, const bool selected_only); +void exportProfile(QString filename, bool selected_only); +void export_TeX(const char *filename, bool selected_only, bool plain); +void export_depths(const char *filename, bool selected_only); std::vector<const dive_site *> getDiveSitesToExport(bool selectedOnly); QFuture<int> exportUsingStyleSheet(QString filename, bool doExport, int units, QString stylesheet, bool anonymize); diff --git a/commands/command.h b/commands/command.h index 34df6eba8..bf9bd13ec 100644 --- a/commands/command.h +++ b/commands/command.h @@ -24,7 +24,7 @@ QAction *redoAction(QObject *parent); // Create an redo action. // distance are added to a trip. dive d is consumed (the structure is reset)! // If newNumber is true, the dive is assigned a new number, depending on the // insertion position. -void addDive(dive *d, const bool autogroup, bool newNumber); +void addDive(dive *d, bool autogroup, bool newNumber); void importDives(struct dive_table *dives, struct trip_table *trips, struct dive_site_table *sites, int flags, const QString &source); // The tables are consumed! void deleteDive(const QVector<struct dive*> &divesToDelete); diff --git a/core/dive.h b/core/dive.h index e54006dd8..e602b4f4f 100644 --- a/core/dive.h +++ b/core/dive.h @@ -315,7 +315,7 @@ extern void set_filename(const char *filename); extern int save_dives(const char *filename); extern int save_dives_logic(const char *filename, bool select_only, bool anonymize); extern int save_dive(FILE *f, struct dive *dive, bool anonymize); -extern int export_dives_xslt(const char *filename, const bool selected, const int units, const char *export_xslt, bool anonymize); +extern int export_dives_xslt(const char *filename, bool selected, const int units, const char *export_xslt, bool anonymize); extern int save_dive_sites_logic(const char *filename, const struct dive_site *sites[], int nr_sites, bool anonymize); diff --git a/core/save-html.c b/core/save-html.c index 5902a8a71..d5f472058 100644 --- a/core/save-html.c +++ b/core/save-html.c @@ -344,7 +344,7 @@ void put_HTML_tags(struct membuffer *b, struct dive *dive, const char *pre, cons } /* if exporting list_only mode, we neglect exporting the samples, bookmarks and cylinders */ -void write_one_dive(struct membuffer *b, struct dive *dive, const char *photos_dir, int *dive_no, const bool list_only) +void write_one_dive(struct membuffer *b, struct dive *dive, const char *photos_dir, int *dive_no, bool list_only) { put_string(b, "{"); put_format(b, "\"number\":%d,", *dive_no); diff --git a/core/save-profiledata.c b/core/save-profiledata.c index 87047a34a..696dc7016 100644 --- a/core/save-profiledata.c +++ b/core/save-profiledata.c @@ -239,7 +239,7 @@ void save_subtitles_buffer(struct membuffer *b, struct dive *dive, int offset, i free_plot_info_data(&pi); } -int save_profiledata(const char *filename, const bool select_only) +int save_profiledata(const char *filename, bool select_only) { struct membuffer buf = { 0 }; FILE *f; diff --git a/core/save-xml.c b/core/save-xml.c index 963907fb2..3dde176bd 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -595,7 +595,7 @@ int save_dives(const char *filename) return save_dives_logic(filename, false, false); } -static void save_dives_buffer(struct membuffer *b, const bool select_only, bool anonymize) +static void save_dives_buffer(struct membuffer *b, bool select_only, bool anonymize) { int i; struct dive *dive; diff --git a/core/uploadDiveLogsDE.cpp b/core/uploadDiveLogsDE.cpp index b4b50a7ba..219e13f45 100644 --- a/core/uploadDiveLogsDE.cpp +++ b/core/uploadDiveLogsDE.cpp @@ -61,7 +61,7 @@ void uploadDiveLogsDE::doUpload(bool selected, const QString &userid, const QStr } -bool uploadDiveLogsDE::prepareDives(const QString &tempfile, const bool selected) +bool uploadDiveLogsDE::prepareDives(const QString &tempfile, bool selected) { static const char errPrefix[] = "divelog.de-upload:"; #ifndef SUBSURFACE_MOBILE diff --git a/core/uploadDiveLogsDE.h b/core/uploadDiveLogsDE.h index 5c17e64a5..da47b14af 100644 --- a/core/uploadDiveLogsDE.h +++ b/core/uploadDiveLogsDE.h @@ -30,7 +30,7 @@ private: void uploadDives(const QString &filename, const QString &userid, const QString &password); // only to be used in desktop-widgets::subsurfacewebservices - bool prepareDives(const QString &tempfile, const bool selected); + bool prepareDives(const QString &tempfile, bool selected); QNetworkReply *reply; QHttpMultiPart *multipart; diff --git a/core/worldmap-save.c b/core/worldmap-save.c index 48a5fcf5f..121f0f728 100644 --- a/core/worldmap-save.c +++ b/core/worldmap-save.c @@ -24,7 +24,7 @@ char *getGoogleApi() return "https://maps.googleapis.com/maps/api/js?"; } -void writeMarkers(struct membuffer *b, const bool selected_only) +void writeMarkers(struct membuffer *b, bool selected_only) { int i, dive_no = 0; struct dive *dive; diff --git a/core/worldmap-save.h b/core/worldmap-save.h index 9d74e123a..f3e2ddd29 100644 --- a/core/worldmap-save.h +++ b/core/worldmap-save.h @@ -6,7 +6,7 @@ extern "C" { #endif -extern void export_worldmap_HTML(const char *file_name, const bool selected_only); +extern void export_worldmap_HTML(const char *file_name, bool selected_only); #ifdef __cplusplus } diff --git a/desktop-widgets/simplewidgets.cpp b/desktop-widgets/simplewidgets.cpp index bba06542f..cf4b9b0ae 100644 --- a/desktop-widgets/simplewidgets.cpp +++ b/desktop-widgets/simplewidgets.cpp @@ -637,7 +637,7 @@ QString TextHyperlinkEventFilter::tryToFormulateUrl(QTextCursor *cursor) return stringMeetsOurUrlRequirements(maybeUrlStr) ? maybeUrlStr : QString(); } -QString TextHyperlinkEventFilter::fromCursorTilWhitespace(QTextCursor *cursor, const bool searchBackwards) +QString TextHyperlinkEventFilter::fromCursorTilWhitespace(QTextCursor *cursor, bool searchBackwards) { // fromCursorTilWhitespace calls cursor->movePosition repeatedly, while // preserving the original 'anchor' (qt terminology) of the cursor. diff --git a/desktop-widgets/simplewidgets.h b/desktop-widgets/simplewidgets.h index bf520422f..99cfc0fa2 100644 --- a/desktop-widgets/simplewidgets.h +++ b/desktop-widgets/simplewidgets.h @@ -156,7 +156,7 @@ private: void handleUrlClick(const QString &urlStr); void handleUrlTooltip(const QString &urlStr, const QPoint &pos); bool stringMeetsOurUrlRequirements(const QString &maybeUrlStr); - QString fromCursorTilWhitespace(QTextCursor *cursor, const bool searchBackwards); + QString fromCursorTilWhitespace(QTextCursor *cursor, bool searchBackwards); QString tryToFormulateUrl(QTextCursor *cursor); QTextEdit const *const textEdit; |