[glom] libgimpbase: Avoid an assignment to self.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] libgimpbase: Avoid an assignment to self.
- Date: Wed, 3 Dec 2014 08:30:26 +0000 (UTC)
commit c5b636e083e803f563c4e187a76cd186bc7c1a44
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Dec 3 09:29:28 2014 +0100
libgimpbase: Avoid an assignment to self.
gimp_param_unit_value_validate() set a value to itself to not
change the value, which was strange though not particularly wrong.
Found by Coverity Scan.
This was also submitted to gimp here:
https://bugzilla.gnome.org/show_bug.cgi?id=741058
.../gimpruler/libgimpbase/gimpunit.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/glom/utility_widgets/gimpruler/libgimpbase/gimpunit.c
b/glom/utility_widgets/gimpruler/libgimpbase/gimpunit.c
index bc5e103..46aceb5 100644
--- a/glom/utility_widgets/gimpruler/libgimpbase/gimpunit.c
+++ b/glom/utility_widgets/gimpruler/libgimpbase/gimpunit.c
@@ -558,11 +558,7 @@ gimp_param_unit_value_validate (GParamSpec *pspec,
GimpParamSpecUnit *uspec = GIMP_PARAM_SPEC_UNIT (pspec);
gint oval = value->data[0].v_int;
- if (uspec->allow_percent && value->data[0].v_int == GIMP_UNIT_PERCENT)
- {
- value->data[0].v_int = value->data[0].v_int;
- }
- else
+ if (!(uspec->allow_percent && value->data[0].v_int == GIMP_UNIT_PERCENT))
{
value->data[0].v_int = CLAMP (value->data[0].v_int,
ispec->minimum,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]