Coding style: remove Java-style function definition

Remove a few cases of
	void fun() {
		...
	}

While touching these functions, fix a few other whitespace
coding style violations.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-02-23 18:31:02 +01:00 committed by Dirk Hohndel
parent 73a230b6e6
commit 9ed5cf16a4
10 changed files with 31 additions and 18 deletions

View file

@ -526,7 +526,8 @@ void dump_tissues(struct deco_state *ds)
} }
#endif #endif
void clear_vpmb_state(struct deco_state *ds) { void clear_vpmb_state(struct deco_state *ds)
{
int ci; int ci;
for (ci = 0; ci < 16; ci++) { for (ci = 0; ci < 16; ci++) {
ds->max_n2_crushing_pressure[ci] = 0.0; ds->max_n2_crushing_pressure[ci] = 0.0;

View file

@ -26,6 +26,7 @@ int report_error(const char *fmt, ...)
return -1; return -1;
} }
void set_error_cb(void(*cb)(char *)) { void set_error_cb(void(*cb)(char *))
{
error_cb = cb; error_cb = cb;
} }

View file

@ -124,7 +124,8 @@ int evn_allocated;
int evn_used; int evn_used;
#if WE_DONT_USE_THIS /* we need to implement event filters in Qt */ #if WE_DONT_USE_THIS /* we need to implement event filters in Qt */
int evn_foreach (void (*callback)(const char *, bool *, void *), void *data) { int evn_foreach (void (*callback)(const char *, bool *, void *), void *data)
{
int i; int i;
for (i = 0; i < evn_used; i++) { for (i = 0; i < evn_used; i++) {

View file

@ -242,7 +242,8 @@ ColumnNameResult::ColumnNameResult(QObject *parent) : QAbstractTableModel(parent
} }
void ColumnNameResult::swapValues(int firstIndex, int secondIndex) { void ColumnNameResult::swapValues(int firstIndex, int secondIndex)
{
QString one = columnNames[firstIndex]; QString one = columnNames[firstIndex];
QString two = columnNames[secondIndex]; QString two = columnNames[secondIndex];
setData(index(0, firstIndex), QVariant(two), Qt::EditRole); setData(index(0, firstIndex), QVariant(two), Qt::EditRole);

View file

@ -213,13 +213,15 @@ void FilterWidget2::updateFilter()
filterDataChanged(filterData); filterDataChanged(filterData);
} }
void FilterWidget2::updateLogged(int value) { void FilterWidget2::updateLogged(int value)
{
if (value == Qt::Unchecked) if (value == Qt::Unchecked)
ui.planned->setChecked(true); ui.planned->setChecked(true);
updateFilter(); updateFilter();
} }
void FilterWidget2::updatePlanned(int value) { void FilterWidget2::updatePlanned(int value)
{
if (value == Qt::Unchecked) if (value == Qt::Unchecked)
ui.logged->setChecked(true); ui.logged->setChecked(true);
updateFilter(); updateFilter();

View file

@ -403,11 +403,11 @@ void MainWindow::enableDisableOtherDCsActions()
ui.actionPreviousDC->setEnabled(nr); ui.actionPreviousDC->setEnabled(nr);
} }
void MainWindow::setDefaultState() { void MainWindow::setDefaultState()
{
setApplicationState("Default"); setApplicationState("Default");
if (mainTab->getEditMode() != MainTab::NONE) { if (mainTab->getEditMode() != MainTab::NONE)
ui.bottomLeft->currentWidget()->setEnabled(false); ui.bottomLeft->currentWidget()->setEnabled(false);
}
} }
MainWindow *MainWindow::instance() MainWindow *MainWindow::instance()
@ -437,7 +437,8 @@ void MainWindow::recreateDiveList()
MultiFilterSortModel::instance()->myInvalidate(); MultiFilterSortModel::instance()->myInvalidate();
} }
void MainWindow::configureToolbar() { void MainWindow::configureToolbar()
{
if (current_dive) { if (current_dive) {
bool freeDiveMode = current_dive->dc.divemode == FREEDIVE; bool freeDiveMode = current_dive->dc.divemode == FREEDIVE;
ui.profCalcCeiling->setDisabled(freeDiveMode); ui.profCalcCeiling->setDisabled(freeDiveMode);
@ -1839,7 +1840,8 @@ void MainWindow::registerApplicationState(const QByteArray& state, QWidget *topL
} }
} }
void MainWindow::setApplicationState(const QByteArray& state) { void MainWindow::setApplicationState(const QByteArray &state)
{
if (!applicationState.keys().contains(state)) if (!applicationState.keys().contains(state))
return; return;

View file

@ -1195,9 +1195,9 @@ void MainTab::escDetected()
setFocus(); setFocus();
} }
void MainTab::clearTabs() { void MainTab::clearTabs()
for (auto widget : extraWidgets) { {
for (auto widget: extraWidgets)
widget->clear(); widget->clear();
}
clearEquipment(); clearEquipment();
} }

View file

@ -128,7 +128,8 @@ void UserManual::linkClickedSlot(const QUrl& url)
} }
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
void UserManual::showEvent(QShowEvent *e) { void UserManual::showEvent(QShowEvent *e)
{
MainWindow *m = MainWindow::instance(); MainWindow *m = MainWindow::instance();
filterAction = m->findChild<QAction *>(QLatin1String("actionFilterTags"), Qt::FindDirectChildrenOnly); filterAction = m->findChild<QAction *>(QLatin1String("actionFilterTags"), Qt::FindDirectChildrenOnly);
if (filterAction != nullptr) if (filterAction != nullptr)
@ -137,7 +138,9 @@ void UserManual::showEvent(QShowEvent *e) {
if (closeAction != nullptr) if (closeAction != nullptr)
closeAction->setShortcut(QKeySequence()); closeAction->setShortcut(QKeySequence());
} }
void UserManual::hideEvent(QHideEvent *e) {
void UserManual::hideEvent(QHideEvent *e)
{
if (closeAction != NULL) if (closeAction != NULL)
closeAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_W)); closeAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_W));
if (filterAction != NULL) if (filterAction != NULL)

View file

@ -638,7 +638,8 @@ void DiveMeanDepthItem::paint(QPainter *painter, const QStyleOptionGraphicsItem*
connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::show_average_depthChanged, this, &DiveAmbPressureItem::setVisible); connect(qPrefTechnicalDetails::instance(), &qPrefTechnicalDetails::show_average_depthChanged, this, &DiveAmbPressureItem::setVisible);
} }
void DiveMeanDepthItem::createTextItem() { void DiveMeanDepthItem::createTextItem()
{
plot_data *entry = dataModel->data().entry; plot_data *entry = dataModel->data().entry;
int sec = entry[dataModel->rowCount()-1].sec; int sec = entry[dataModel->rowCount()-1].sec;
qDeleteAll(texts); qDeleteAll(texts);

View file

@ -645,7 +645,8 @@ static struct types_list *smtk_index_list(MdbHandle *mdb, char *table_name, char
* Buddy table format: * Buddy table format:
* | Idx | Text (nickname) | Name | Firstname | Middlename | Title | Picture | Phone | ... * | Idx | Text (nickname) | Name | Firstname | Middlename | Title | Picture | Phone | ...
*/ */
static void smtk_build_buddies(MdbHandle *mdb, char *array[]) { static void smtk_build_buddies(MdbHandle *mdb, char *array[])
{
MdbTableDef *table; MdbTableDef *table;
MdbColumn *col[MDB_MAX_COLS]; MdbColumn *col[MDB_MAX_COLS];
char *bound_values[MDB_MAX_COLS], *fullname = NULL, *str = NULL; char *bound_values[MDB_MAX_COLS], *fullname = NULL, *str = NULL;