* load_charset warning
@ 2009-05-01 10:40 Emanuele Giaquinta
2009-05-01 10:56 ` Kenichi Handa
0 siblings, 1 reply; 4+ messages in thread
From: Emanuele Giaquinta @ 2009-05-01 10:40 UTC (permalink / raw)
To: Kenichi Handa; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 323 bytes --]
Hi,
gcc emits the following warning for charset.c:load_charset:
charset.c: In function 'load_charset':
charset.c:649: warning: comparisons like X<=Y<=Z do not have their mathematical meaning
Since the code seems correct, i'd suggest the attached patch to
improve readability (and avoid the warning).
Emanuele Giaquinta
[-- Attachment #2: load_charset.diff --]
[-- Type: text/x-diff, Size: 480 bytes --]
diff --git a/src/charset.c b/src/charset.c
index 15975a4..107647f 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -646,7 +646,7 @@ load_charset (charset, control_flag)
if (inhibit_load_charset_map
&& temp_charset_work
&& charset == temp_charset_work->current
- && (control_flag == 2 == temp_charset_work->for_encoder))
+ && ((control_flag == 2) == temp_charset_work->for_encoder))
return;
if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: load_charset warning
2009-05-01 10:40 load_charset warning Emanuele Giaquinta
@ 2009-05-01 10:56 ` Kenichi Handa
2009-05-01 11:06 ` Emanuele Giaquinta
0 siblings, 1 reply; 4+ messages in thread
From: Kenichi Handa @ 2009-05-01 10:56 UTC (permalink / raw)
To: Emanuele Giaquinta; +Cc: emacs-devel
In article <20090501104053.GB37259@orion.local>, Emanuele Giaquinta <emanuele.giaquinta@gmail.com> writes:
> gcc emits the following warning for charset.c:load_charset:
> charset.c: In function 'load_charset':
> charset.c:649: warning: comparisons like X<=Y<=Z do not have their mathematical meaning
> Since the code seems correct, i'd suggest the attached patch to
> improve readability (and avoid the warning).
Thank you. I committed your change.
---
Kenichi Handa
handa@m17n.org
> diff --git a/src/charset.c b/src/charset.c
> index 15975a4..107647f 100644
> --- a/src/charset.c
> +++ b/src/charset.c
> @@ -646,7 +646,7 @@ load_charset (charset, control_flag)
> if (inhibit_load_charset_map
> && temp_charset_work
> && charset == temp_charset_work->current
> - && (control_flag == 2 == temp_charset_work->for_encoder))
> + && ((control_flag == 2) == temp_charset_work->for_encoder))
> return;
> if (CHARSET_METHOD (charset) == CHARSET_METHOD_MAP)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: load_charset warning
2009-05-01 10:56 ` Kenichi Handa
@ 2009-05-01 11:06 ` Emanuele Giaquinta
2009-05-01 12:17 ` Kenichi Handa
0 siblings, 1 reply; 4+ messages in thread
From: Emanuele Giaquinta @ 2009-05-01 11:06 UTC (permalink / raw)
To: Kenichi Handa; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 633 bytes --]
On Fri, May 01, 2009 at 07:56:23PM +0900, Kenichi Handa wrote:
> In article <20090501104053.GB37259@orion.local>, Emanuele Giaquinta <emanuele.giaquinta@gmail.com> writes:
>
> > gcc emits the following warning for charset.c:load_charset:
>
> > charset.c: In function 'load_charset':
> > charset.c:649: warning: comparisons like X<=Y<=Z do not have their mathematical meaning
>
> > Since the code seems correct, i'd suggest the attached patch to
> > improve readability (and avoid the warning).
>
> Thank you. I committed your change.
I also noticed a useless assignment to for_encoder, see attached patch.
Emanuele Giaquinta
[-- Attachment #2: load_charset_map.diff --]
[-- Type: text/x-diff, Size: 359 bytes --]
diff --git a/src/charset.c b/src/charset.c
index 15975a4..7d9bc2f 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -319,7 +319,6 @@ load_charset_map (charset, entries, n_entries, control_flag)
{
memset (temp_charset_work->table.decoder, -1,
sizeof (int) * 0x10000);
- temp_charset_work->for_encoder = 0;
}
else
{
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: load_charset warning
2009-05-01 11:06 ` Emanuele Giaquinta
@ 2009-05-01 12:17 ` Kenichi Handa
0 siblings, 0 replies; 4+ messages in thread
From: Kenichi Handa @ 2009-05-01 12:17 UTC (permalink / raw)
To: Emanuele Giaquinta; +Cc: emacs-devel
In article <20090501110629.GC37259@orion.local>, Emanuele Giaquinta <emanuele.giaquinta@gmail.com> writes:
> I also noticed a useless assignment to for_encoder, see attached patch.
> Emanuele Giaquinta
> --WhfpMioaduB5tiZL
> Content-Type: text/x-diff; charset=us-ascii
> Content-Disposition: attachment; filename="load_charset_map.diff"
> diff --git a/src/charset.c b/src/charset.c
> index 15975a4..7d9bc2f 100644
> --- a/src/charset.c
> +++ b/src/charset.c
> @@ -319,7 +319,6 @@ load_charset_map (charset, entries, n_entries, control_flag)
> {
> memset (temp_charset_work->table.decoder, -1,
> sizeof (int) * 0x10000);
> - temp_charset_work->for_encoder = 0;
> }
> else
> {
Thank you. I committed that change too.
---
Kenichi Handa
handa@m17n.org
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-01 12:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-01 10:40 load_charset warning Emanuele Giaquinta
2009-05-01 10:56 ` Kenichi Handa
2009-05-01 11:06 ` Emanuele Giaquinta
2009-05-01 12:17 ` Kenichi Handa
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.