Coding-style: remove superfluous parentheses

Mostly replace "return (expression);" by "return expression;" and one
case of "function((parameter))" by "function(parameter)".

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-02-17 21:21:16 +01:00 committed by Lubomir I. Ivanov
parent 36b8594cce
commit 5c248d91cd
20 changed files with 30 additions and 30 deletions

View file

@ -47,9 +47,9 @@ static dc_descriptor_t *getDeviceType(QString btName)
}
if (!vendor.isEmpty() && !product.isEmpty())
return(descriptorLookup.value(vendor + product));
return descriptorLookup.value(vendor + product);
return(NULL);
return NULL;
}
BTDiscovery::BTDiscovery(QObject *parent) : m_btValid(false),

View file

@ -2720,7 +2720,7 @@ static int likely_same_dive(struct dive *a, struct dive *b)
if (fuzz < 60)
fuzz = 60;
return ((a->when <= b->when + fuzz) && (a->when >= b->when - fuzz));
return (a->when <= b->when + fuzz) && (a->when >= b->when - fuzz);
}
/*

View file

@ -897,6 +897,6 @@ time_t easyexif::EXIFInfo::epoch()
tm.tm_hour = hour;
tm.tm_min = min;
tm.tm_sec = sec;
return (utc_mktime(&tm));
return utc_mktime(&tm);
}

View file

@ -728,7 +728,7 @@ static git_repository *create_and_push_remote(const char *localdir, const char *
/* finally create an empty commit and push it to the remote */
if (do_git_save(repo, branch, remote, false, true))
return NULL;
return(repo);
return repo;
}
static git_repository *create_local_repo(const char *localdir, const char *remote, const char *branch, enum remote_transport rt)

View file

@ -1194,7 +1194,7 @@ dc_status_t libdc_buffer_parser(struct dive *dive, device_data_t *data, unsigned
return rc;
}
dc_parser_destroy(parser);
return(DC_STATUS_SUCCESS);
return DC_STATUS_SUCCESS;
}
/*

View file

@ -228,5 +228,5 @@ void subsurface_console_exit(void)
bool subsurface_user_is_root()
{
return (geteuid() == 0);
return geteuid() == 0;
}

View file

@ -218,5 +218,5 @@ void subsurface_console_exit(void)
bool subsurface_user_is_root()
{
return (geteuid() == 0);
return geteuid() == 0;
}

View file

@ -187,8 +187,8 @@ void event_end(void)
*/
bool is_dive(void)
{
return (cur_dive &&
(cur_dive->dive_site_uuid || cur_dive->when || cur_dive->dc.samples));
return cur_dive &&
(cur_dive->dive_site_uuid || cur_dive->when || cur_dive->dc.samples);
}
void reset_dc_info(struct divecomputer *dc)

View file

@ -1524,7 +1524,7 @@ struct plot_data *get_plot_details_new(struct plot_info *pi, int time, struct me
}
if (entry)
plot_string(pi, entry, mb);
return (entry);
return entry;
}
/* Compare two plot_data entries and writes the results into a string */

View file

@ -49,7 +49,7 @@ QString weight_string(int weight_in_grams)
double lbs = grams_to_lbs(weight_in_grams);
str = QString("%1").arg(lbs, 0, 'f', lbs >= 40.0 ? 0 : 1);
}
return (str);
return str;
}
QString distance_string(int distanceInMeters)
@ -608,7 +608,7 @@ QString get_weight_string(weight_t weight, bool showunit)
} else {
str = QString("%1%2").arg(str).arg(showunit ? translate("gettextFromC", "lbs") : "");
}
return (str);
return str;
}
QString get_weight_unit()
@ -1017,7 +1017,7 @@ bool is_same_day(timestamp_t trip_when, timestamp_t dive_when)
utc_mkdate(twhen, &tmt);
}
return ((tmd.tm_mday == tmt.tm_mday) && (tmd.tm_mon == tmt.tm_mon) && (tmd.tm_year == tmt.tm_year));
return (tmd.tm_mday == tmt.tm_mday) && (tmd.tm_mon == tmt.tm_mon) && (tmd.tm_year == tmt.tm_year);
}
QString get_trip_date_string(timestamp_t when, int nr, bool getday)
@ -1195,7 +1195,7 @@ void hashPicture(struct picture *picture)
char *oldHash = copy_string(picture->hash);
learnHash(picture, hashFile(localFilePath(picture->filename)));
if (!empty_string(picture->hash) && !same_string(picture->hash, oldHash))
mark_divelist_changed((true));
mark_divelist_changed(true);
free(oldHash);
picture_free(picture);
}
@ -1499,7 +1499,7 @@ void setCurrentAppState(QByteArray state)
extern "C" bool in_planner()
{
return (currentApplicationState == "PlanDive" || currentApplicationState == "EditPlannedDive");
return currentApplicationState == "PlanDive" || currentApplicationState == "EditPlannedDive";
}
extern "C" enum deco_mode decoMode()

View file

@ -119,7 +119,7 @@ QString DiveObjectHelper::gps_decimal() const
prefs.coordinates_traditional = false;
val = gps();
prefs.coordinates_traditional = savep;
return(val);
return val;
}
QString DiveObjectHelper::duration() const

View file

@ -355,7 +355,7 @@ bool TechnicalDetailsSettings::calcndltts() const
bool TechnicalDetailsSettings::buehlmann() const
{
return (prefs.planner_deco_mode == BUEHLMANN);
return prefs.planner_deco_mode == BUEHLMANN;
}
int TechnicalDetailsSettings::gflow() const

View file

@ -437,5 +437,5 @@ void subsurface_console_exit(void)
bool subsurface_user_is_root()
{
/* FIXME: Detect admin rights */
return (false);
return false;
}