mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 20:23:25 +00:00
general: remove (void) function parameter declarations
To my understanding, declaring empty parameter lists using "(void)" is an artifact from the bad old K&R times, when functions were declared without(!) parameters. Which in hindsight was an absolute recipe for disaster. So for backwards compatibility, functions without parameters had to be declared using "(void)" as "()" could also mean "any function". That was 40 years ago. Meanwhile, C++ introduced references, which made it a necessity to declare the function parameters. So "(void)" is redundant and inconsistent in C++ code and just makes no sense. Remove it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
b56dd13add
commit
b82fdd1d20
32 changed files with 71 additions and 71 deletions
|
@ -46,7 +46,7 @@ const char *system_divelist_default_font = android_system_divelist_default_font;
|
|||
double system_divelist_default_font_size = -1;
|
||||
|
||||
int get_usb_fd(uint16_t idVendor, uint16_t idProduct);
|
||||
void subsurface_OS_pref_setup(void)
|
||||
void subsurface_OS_pref_setup()
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -56,13 +56,13 @@ bool subsurface_ignore_font(const char *font)
|
|||
return false;
|
||||
}
|
||||
|
||||
const char *system_default_directory(void)
|
||||
const char *system_default_directory()
|
||||
{
|
||||
static const std::string path = system_default_path();
|
||||
return path.c_str();
|
||||
}
|
||||
|
||||
const char *system_default_filename(void)
|
||||
const char *system_default_filename()
|
||||
{
|
||||
static const std::string fn = make_default_filename();
|
||||
return fn.c_str();
|
||||
|
@ -235,12 +235,12 @@ int subsurface_zip_close(struct zip *zip)
|
|||
}
|
||||
|
||||
/* win32 console */
|
||||
void subsurface_console_init(void)
|
||||
void subsurface_console_init()
|
||||
{
|
||||
/* NOP */
|
||||
}
|
||||
|
||||
void subsurface_console_exit(void)
|
||||
void subsurface_console_exit()
|
||||
{
|
||||
/* NOP */
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ int dive_getUniqID()
|
|||
return maxId;
|
||||
}
|
||||
|
||||
struct dive *alloc_dive(void)
|
||||
struct dive *alloc_dive()
|
||||
{
|
||||
struct dive *dive;
|
||||
|
||||
|
|
|
@ -158,11 +158,11 @@ extern int save_dive_sites_logic(const char *filename, const struct dive_site *s
|
|||
struct membuffer;
|
||||
extern void save_one_dive_to_mb(struct membuffer *b, struct dive *dive, bool anonymize);
|
||||
|
||||
extern void subsurface_console_init(void);
|
||||
extern void subsurface_console_exit(void);
|
||||
extern bool subsurface_user_is_root(void);
|
||||
extern void subsurface_console_init();
|
||||
extern void subsurface_console_exit();
|
||||
extern bool subsurface_user_is_root();
|
||||
|
||||
extern struct dive *alloc_dive(void);
|
||||
extern struct dive *alloc_dive();
|
||||
extern void free_dive(struct dive *);
|
||||
extern void record_dive_to_table(struct dive *dive, struct dive_table *table);
|
||||
extern void clear_dive(struct dive *dive);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <vector>
|
||||
#include <QString>
|
||||
|
||||
extern void clear_event_types(void);
|
||||
extern void clear_event_types();
|
||||
extern void remember_event_type(const struct event *ev);
|
||||
extern bool is_event_type_hidden(const struct event *ev);
|
||||
extern void hide_event_type(const struct event *ev);
|
||||
|
|
|
@ -9,7 +9,7 @@ static filter_preset_table &global_table()
|
|||
return *divelog.filter_presets;
|
||||
}
|
||||
|
||||
int filter_presets_count(void)
|
||||
int filter_presets_count()
|
||||
{
|
||||
return (int)global_table().size();
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ struct filter_preset_table : public std::vector<filter_preset>
|
|||
};
|
||||
|
||||
// The C IO code accesses the filter presets via integer indices.
|
||||
extern int filter_presets_count(void);
|
||||
extern int filter_presets_count();
|
||||
extern const char *filter_preset_fulltext_mode(int preset); // string mode of fulltext query. ownership is *not* passed to caller.
|
||||
extern int filter_preset_constraint_count(int preset); // number of constraints in the filter preset.
|
||||
extern const struct filter_constraint *filter_preset_constraint(int preset, int constraint); // get constraint. ownership is *not* passed to caller.
|
||||
|
|
|
@ -22,7 +22,7 @@ enum remote_transport { RT_LOCAL, RT_HTTPS, RT_SSH, RT_OTHER };
|
|||
|
||||
extern bool git_local_only;
|
||||
extern bool git_remote_sync_successful;
|
||||
extern void clear_git_id(void);
|
||||
extern void clear_git_id();
|
||||
extern void set_git_id(const struct git_oid *);
|
||||
void set_git_update_cb(int(*)(const char *));
|
||||
int git_storage_update_progress(const char *text);
|
||||
|
|
10
core/ios.cpp
10
core/ios.cpp
|
@ -36,7 +36,7 @@ const char mac_system_divelist_default_font[] = "Arial";
|
|||
const char *system_divelist_default_font = mac_system_divelist_default_font;
|
||||
double system_divelist_default_font_size = -1.0;
|
||||
|
||||
void subsurface_OS_pref_setup(void)
|
||||
void subsurface_OS_pref_setup()
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
|
@ -47,13 +47,13 @@ bool subsurface_ignore_font(const char*)
|
|||
return false;
|
||||
}
|
||||
|
||||
const char *system_default_directory(void)
|
||||
const char *system_default_directory()
|
||||
{
|
||||
static const std::string path = system_default_path();
|
||||
return path.c_str();
|
||||
}
|
||||
|
||||
const char *system_default_filename(void)
|
||||
const char *system_default_filename()
|
||||
{
|
||||
static const std::string fn = make_default_filename();
|
||||
return fn.c_str();
|
||||
|
@ -107,12 +107,12 @@ int subsurface_zip_close(struct zip *zip)
|
|||
}
|
||||
|
||||
/* win32 console */
|
||||
void subsurface_console_init(void)
|
||||
void subsurface_console_init()
|
||||
{
|
||||
/* NOP */
|
||||
}
|
||||
|
||||
void subsurface_console_exit(void)
|
||||
void subsurface_console_exit()
|
||||
{
|
||||
/* NOP */
|
||||
}
|
||||
|
|
|
@ -1850,7 +1850,7 @@ static int load_dives_from_tree(git_repository *repo, git_tree *tree, struct git
|
|||
return 0;
|
||||
}
|
||||
|
||||
void clear_git_id(void)
|
||||
void clear_git_id()
|
||||
{
|
||||
saved_git_id.clear();
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ const char mac_system_divelist_default_font[] = "Arial";
|
|||
const char *system_divelist_default_font = mac_system_divelist_default_font;
|
||||
double system_divelist_default_font_size = -1.0;
|
||||
|
||||
void subsurface_OS_pref_setup(void)
|
||||
void subsurface_OS_pref_setup()
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
|
@ -63,13 +63,13 @@ bool subsurface_ignore_font(const char *)
|
|||
return false;
|
||||
}
|
||||
|
||||
const char *system_default_directory(void)
|
||||
const char *system_default_directory()
|
||||
{
|
||||
static const std::string path = system_default_path();
|
||||
return path.c_str();
|
||||
}
|
||||
|
||||
const char *system_default_filename(void)
|
||||
const char *system_default_filename()
|
||||
{
|
||||
static const std::string fn = make_default_filename();
|
||||
return fn.c_str();
|
||||
|
@ -183,12 +183,12 @@ int subsurface_zip_close(struct zip *zip)
|
|||
}
|
||||
|
||||
/* win32 console */
|
||||
void subsurface_console_init(void)
|
||||
void subsurface_console_init()
|
||||
{
|
||||
/* NOP */
|
||||
}
|
||||
|
||||
void subsurface_console_exit(void)
|
||||
void subsurface_console_exit()
|
||||
{
|
||||
/* NOP */
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ void strip_mb(struct membuffer *b)
|
|||
* interface very complex, we'll just die. It won't happen
|
||||
* unless you're running on a potato.
|
||||
*/
|
||||
static void oom(void)
|
||||
static void oom()
|
||||
{
|
||||
fprintf(stderr, "Out of memory\n");
|
||||
exit(1);
|
||||
|
|
|
@ -2274,12 +2274,12 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size, struct divelog *log)
|
|||
}
|
||||
|
||||
|
||||
void parse_xml_init(void)
|
||||
void parse_xml_init()
|
||||
{
|
||||
LIBXML_TEST_VERSION
|
||||
}
|
||||
|
||||
void parse_xml_exit(void)
|
||||
void parse_xml_exit()
|
||||
{
|
||||
xmlCleanupParser();
|
||||
}
|
||||
|
|
|
@ -148,9 +148,9 @@ void nonmatch(const char *type, const char *name, char *buffer);
|
|||
int atoi_n(char *ptr, unsigned int len);
|
||||
void utf8_string(const char *buffer, char **res);
|
||||
|
||||
void parse_xml_init(void);
|
||||
void parse_xml_init();
|
||||
int parse_xml_buffer(const char *url, const char *buf, int size, struct divelog *log, const struct xml_params *params);
|
||||
void parse_xml_exit(void);
|
||||
void parse_xml_exit();
|
||||
int parse_dm4_buffer(sqlite3 *handle, const char *url, const char *buf, int size, struct divelog *log);
|
||||
int parse_dm5_buffer(sqlite3 *handle, const char *url, const char *buf, int size, struct divelog *log);
|
||||
int parse_seac_buffer(sqlite3 *handle, const char *url, const char *buf, int size, struct divelog *log);
|
||||
|
|
|
@ -149,7 +149,7 @@ void copy_prefs(struct preferences *src, struct preferences *dest)
|
|||
* These are not real leaks but they plug the holes found by eg.
|
||||
* valgrind so you can find the real leaks.
|
||||
*/
|
||||
void free_prefs(void)
|
||||
void free_prefs()
|
||||
{
|
||||
// nop
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ extern struct preferences prefs, default_prefs, git_prefs;
|
|||
extern const char *system_divelist_default_font;
|
||||
extern double system_divelist_default_font_size;
|
||||
|
||||
extern const char *system_default_directory(void);
|
||||
extern const char *system_default_directory();
|
||||
extern const char *system_default_filename();
|
||||
extern bool subsurface_ignore_font(const char *font);
|
||||
extern void subsurface_OS_pref_setup();
|
||||
|
|
|
@ -414,7 +414,7 @@ dc_status_t BLEObject::read(void *data, size_t size, size_t *actual)
|
|||
//
|
||||
// That's wrong, but works for the simple case.
|
||||
//
|
||||
dc_status_t BLEObject::select_preferred_service(void)
|
||||
dc_status_t BLEObject::select_preferred_service()
|
||||
{
|
||||
// Wait for each service to finish discovering
|
||||
for (const QLowEnergyService *s: services) {
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
|
||||
inline QLowEnergyService *preferredService() { return preferred; }
|
||||
inline int descriptorWritten() { return desc_written; }
|
||||
dc_status_t select_preferred_service(void);
|
||||
dc_status_t select_preferred_service();
|
||||
|
||||
public slots:
|
||||
void addService(const QBluetoothUuid &newService);
|
||||
|
|
|
@ -63,7 +63,7 @@ bool consecutive_selected()
|
|||
}
|
||||
|
||||
#if DEBUG_SELECTION_TRACKING
|
||||
void dump_selection(void)
|
||||
void dump_selection()
|
||||
{
|
||||
int i;
|
||||
struct dive *dive;
|
||||
|
|
|
@ -12,18 +12,18 @@ struct dive;
|
|||
extern int amount_selected;
|
||||
extern struct dive *current_dive;
|
||||
|
||||
extern struct dive *first_selected_dive(void);
|
||||
extern struct dive *last_selected_dive(void);
|
||||
extern bool consecutive_selected(void);
|
||||
extern struct dive *first_selected_dive();
|
||||
extern struct dive *last_selected_dive();
|
||||
extern bool consecutive_selected();
|
||||
extern void select_newest_visible_dive();
|
||||
extern void select_single_dive(struct dive *d); // wrapper for setSelection() with a single dive. NULL clears the selection.
|
||||
extern void select_trip(struct dive_trip *trip);
|
||||
extern void deselect_trip(struct dive_trip *trip);
|
||||
extern struct dive_trip *single_selected_trip(); // returns trip if exactly one trip is selected, NULL otherwise.
|
||||
extern void clear_selection(void);
|
||||
extern void clear_selection();
|
||||
|
||||
#if DEBUG_SELECTION_TRACKING
|
||||
extern void dump_selection(void);
|
||||
extern void dump_selection();
|
||||
#endif
|
||||
|
||||
// Reset the selection to the dives of the "selection" vector and send the appropriate signals.
|
||||
|
|
|
@ -106,7 +106,7 @@ static dc_status_t serial_ftdi_get_transmitted (ftdi_serial_t *device)
|
|||
/*
|
||||
* Get an msec value on some random base
|
||||
*/
|
||||
static unsigned int serial_ftdi_get_msec(void)
|
||||
static unsigned int serial_ftdi_get_msec()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return GetTickCount();
|
||||
|
|
|
@ -191,7 +191,7 @@ void parse_argument(const char *arg)
|
|||
* I guess Burma and Liberia should trigger this too. I'm too
|
||||
* lazy to look up the territory names, though.
|
||||
*/
|
||||
void setup_system_prefs(void)
|
||||
void setup_system_prefs()
|
||||
{
|
||||
const char *env;
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
extern bool imported;
|
||||
extern int quit, force_root, ignore_bt;
|
||||
|
||||
void setup_system_prefs(void);
|
||||
void setup_system_prefs();
|
||||
void parse_argument(const char *arg);
|
||||
void free_prefs(void);
|
||||
void print_files(void);
|
||||
void print_version(void);
|
||||
void free_prefs();
|
||||
void print_files();
|
||||
void print_version();
|
||||
|
||||
extern char *settings_suffix;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "core/errorhelper.h"
|
||||
|
||||
#ifdef DEBUG_TRIP
|
||||
void dump_trip_list(void)
|
||||
void dump_trip_list()
|
||||
{
|
||||
dive_trip_t *trip;
|
||||
int i = 0;
|
||||
|
@ -126,7 +126,7 @@ void remove_dive_from_trip(struct dive *dive, struct trip_table *trip_table_arg)
|
|||
delete_trip(trip, trip_table_arg);
|
||||
}
|
||||
|
||||
dive_trip_t *alloc_trip(void)
|
||||
dive_trip_t *alloc_trip()
|
||||
{
|
||||
dive_trip_t *res = (dive_trip_t *)calloc(1, sizeof(dive_trip_t));
|
||||
res->id = dive_getUniqID();
|
||||
|
|
|
@ -37,7 +37,7 @@ extern bool trip_less_than(const struct dive_trip *a, const struct dive_trip *b)
|
|||
extern int comp_trips(const struct dive_trip *a, const struct dive_trip *b);
|
||||
extern void sort_trip_table(struct trip_table *table);
|
||||
|
||||
extern dive_trip_t *alloc_trip(void);
|
||||
extern dive_trip_t *alloc_trip();
|
||||
extern dive_trip_t *create_trip_from_dive(struct dive *dive);
|
||||
extern dive_trip_t *get_dives_to_autogroup(struct dive_table *table, int start, int *from, int *to, bool *allocated);
|
||||
extern dive_trip_t *get_trip_for_new_dive(struct dive *new_dive, bool *allocated);
|
||||
|
@ -53,7 +53,7 @@ void move_trip_table(struct trip_table *src, struct trip_table *dst);
|
|||
void clear_trip_table(struct trip_table *table);
|
||||
|
||||
#ifdef DEBUG_TRIP
|
||||
extern void dump_trip_list(void);
|
||||
extern void dump_trip_list();
|
||||
#endif
|
||||
|
||||
/* Make pointers to dive_trip and trip_table "Qt metatypes" so that they can be
|
||||
|
|
|
@ -325,7 +325,7 @@ struct units {
|
|||
|
||||
extern const struct units SI_units, IMPERIAL_units;
|
||||
|
||||
extern const struct units *get_units(void);
|
||||
extern const struct units *get_units();
|
||||
|
||||
extern int get_pressure_units(int mb, const char **units);
|
||||
extern double get_depth_units(int mm, int *frac, const char **units);
|
||||
|
|
|
@ -40,7 +40,7 @@ const char unix_system_divelist_default_font[] = "Sans";
|
|||
const char *system_divelist_default_font = unix_system_divelist_default_font;
|
||||
double system_divelist_default_font_size = -1.0;
|
||||
|
||||
void subsurface_OS_pref_setup(void)
|
||||
void subsurface_OS_pref_setup()
|
||||
{
|
||||
// nothing
|
||||
}
|
||||
|
@ -51,13 +51,13 @@ bool subsurface_ignore_font(const char *)
|
|||
return false;
|
||||
}
|
||||
|
||||
const char *system_default_directory(void)
|
||||
const char *system_default_directory()
|
||||
{
|
||||
static const std::string path = system_default_path();
|
||||
return path.c_str();
|
||||
}
|
||||
|
||||
const char *system_default_filename(void)
|
||||
const char *system_default_filename()
|
||||
{
|
||||
static const std::string fn = make_default_filename();
|
||||
return fn.c_str();
|
||||
|
@ -187,12 +187,12 @@ int subsurface_zip_close(struct zip *zip)
|
|||
}
|
||||
|
||||
/* win32 console */
|
||||
void subsurface_console_init(void)
|
||||
void subsurface_console_init()
|
||||
{
|
||||
/* NOP */
|
||||
}
|
||||
|
||||
void subsurface_console_exit(void)
|
||||
void subsurface_console_exit()
|
||||
{
|
||||
/* NOP */
|
||||
}
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
#include "ssrf-version.h"
|
||||
|
||||
// let's leave the two redundant functions in case we change our minds on git SHAs
|
||||
const char *subsurface_git_version(void)
|
||||
const char *subsurface_git_version()
|
||||
{
|
||||
return CANONICAL_VERSION_STRING_4;
|
||||
}
|
||||
|
||||
const char *subsurface_canonical_version(void)
|
||||
const char *subsurface_canonical_version()
|
||||
{
|
||||
return CANONICAL_VERSION_STRING;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef VERSION_H
|
||||
#define VERSION_H
|
||||
|
||||
const char *subsurface_git_version(void);
|
||||
const char *subsurface_canonical_version(void);
|
||||
const char *subsurface_git_version();
|
||||
const char *subsurface_canonical_version();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#ifndef WEBSERVICE_H
|
||||
#define WEBSERVICE_H
|
||||
|
||||
//extern void webservice_download_dialog(void);
|
||||
//extern void webservice_download_dialog();
|
||||
//extern bool webservice_request_user_xml(const gchar *, gchar **, unsigned int *, unsigned int *);
|
||||
extern int divelogde_upload(char *fn, char **error);
|
||||
extern unsigned int download_dialog_parse_response(char *xmldata, unsigned int len);
|
||||
|
|
|
@ -105,7 +105,7 @@ const char current_system_divelist_default_font[] = "Segoe UI";
|
|||
const char *system_divelist_default_font = non_standard_system_divelist_default_font;
|
||||
double system_divelist_default_font_size = -1;
|
||||
|
||||
void subsurface_OS_pref_setup(void)
|
||||
void subsurface_OS_pref_setup()
|
||||
{
|
||||
if (isWin7Or8())
|
||||
system_divelist_default_font = current_system_divelist_default_font;
|
||||
|
@ -124,13 +124,13 @@ bool subsurface_ignore_font(const char *font)
|
|||
|
||||
/* '\' not included at the end.
|
||||
*/
|
||||
const char *system_default_directory(void)
|
||||
const char *system_default_directory()
|
||||
{
|
||||
static std::string path = utf16_to_utf8(system_default_path());
|
||||
return path.c_str();
|
||||
}
|
||||
|
||||
const char *system_default_filename(void)
|
||||
const char *system_default_filename()
|
||||
{
|
||||
static std::string path = utf16_to_utf8(make_default_filename());
|
||||
return path.c_str();
|
||||
|
@ -373,7 +373,7 @@ static struct {
|
|||
} console_desc;
|
||||
#endif
|
||||
|
||||
void subsurface_console_init(void)
|
||||
void subsurface_console_init()
|
||||
{
|
||||
/* if this is a console app already, do nothing */
|
||||
#ifndef WIN32_CONSOLE_APP
|
||||
|
@ -404,7 +404,7 @@ void subsurface_console_init(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
void subsurface_console_exit(void)
|
||||
void subsurface_console_exit()
|
||||
{
|
||||
#ifndef WIN32_CONSOLE_APP
|
||||
/* close handles */
|
||||
|
|
|
@ -1184,7 +1184,7 @@ void MainWindow::recentFileTriggered(bool)
|
|||
loadFiles(std::vector<std::string> { filename.toStdString() });
|
||||
}
|
||||
|
||||
int MainWindow::file_save_as(void)
|
||||
int MainWindow::file_save_as()
|
||||
{
|
||||
QString filename;
|
||||
std::string default_filename = existing_filename;
|
||||
|
@ -1232,7 +1232,7 @@ int MainWindow::file_save_as(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int MainWindow::file_save(void)
|
||||
int MainWindow::file_save()
|
||||
{
|
||||
const char *current_default;
|
||||
bool is_cloud = false;
|
||||
|
|
|
@ -184,7 +184,7 @@ void PrintDialog::createPrinterObj()
|
|||
}
|
||||
}
|
||||
|
||||
void PrintDialog::previewClicked(void)
|
||||
void PrintDialog::previewClicked()
|
||||
{
|
||||
createPrinterObj();
|
||||
QPrintPreviewDialog previewDialog(qprinter, this, Qt::Window
|
||||
|
@ -194,7 +194,7 @@ void PrintDialog::previewClicked(void)
|
|||
previewDialog.exec();
|
||||
}
|
||||
|
||||
void PrintDialog::exportHtmlClicked(void)
|
||||
void PrintDialog::exportHtmlClicked()
|
||||
{
|
||||
createPrinterObj();
|
||||
QString saveFileName = printOptions.p_template;
|
||||
|
@ -212,7 +212,7 @@ void PrintDialog::exportHtmlClicked(void)
|
|||
}
|
||||
}
|
||||
|
||||
void PrintDialog::printClicked(void)
|
||||
void PrintDialog::printClicked()
|
||||
{
|
||||
createPrinterObj();
|
||||
QPrintDialog printDialog(qprinter, this);
|
||||
|
|
Loading…
Add table
Reference in a new issue