[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 604b541d5c: Avoid uninitialized variable warning
From: |
YAMAMOTO Mitsuharu |
Subject: |
master 604b541d5c: Avoid uninitialized variable warning |
Date: |
Mon, 26 Sep 2022 23:40:52 -0400 (EDT) |
branch: master
commit 604b541d5ce394a1e4f157a81a0cf77df98d61d0
Author: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Commit: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Avoid uninitialized variable warning
* src/composite.c (composition_gstring_adjust_zero_width): Simplify
last change with respect to an exit condition.
---
src/composite.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/composite.c b/src/composite.c
index 0417bc866d..6b256171ac 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -815,9 +815,12 @@ composition_gstring_adjust_zero_width (Lisp_Object gstring)
{
Lisp_Object glyph;
- if (i == LGSTRING_GLYPH_LEN (gstring)
- || (glyph = LGSTRING_GLYPH (gstring, i),
- (NILP (glyph) || from != LGLYPH_FROM (glyph))))
+ if (i < LGSTRING_GLYPH_LEN (gstring))
+ glyph = LGSTRING_GLYPH (gstring, i);
+ else
+ glyph = Qnil;
+
+ if (NILP (glyph) || from != LGLYPH_FROM (glyph))
{
eassert (i > 0);
Lisp_Object last = LGSTRING_GLYPH (gstring, i - 1);
@@ -834,7 +837,7 @@ composition_gstring_adjust_zero_width (Lisp_Object gstring)
ASET (LGLYPH_ADJUSTMENT (last), 2,
make_fixnum (LGLYPH_WADJUST (last) + 1));
}
- if (i == LGSTRING_GLYPH_LEN (gstring) || NILP (glyph))
+ if (NILP (glyph))
break;
from = LGLYPH_FROM (glyph);
width = 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 604b541d5c: Avoid uninitialized variable warning,
YAMAMOTO Mitsuharu <=