[PATCH] dfa: narrow the scope of many local variables

2017-01-01 Thread Jim Meyering
FYI, I've just pushed this: >From 387fd77e70fe9016d30e462d46c1126b32fe449b Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 31 Dec 2016 08:06:24 -0800 Subject: [PATCH] dfa: narrow the scope of many local variables * lib/dfa.c: Now that we are no longer constrained to c89, move declarations

Re: [PATCH] dfa: narrow the scope of many local variables

2017-01-01 Thread Bruno Haible
Hi Jim, > move declarations of many variables (often indices) "down" into the > scope(s) where used or to the point of definition. Thanks! It does make the code a little more penetrable. Bruno

suggested improvements to parse-datetime's debug messages ('date --debug')

2017-01-01 Thread Assaf Gordon
Hello, Attached are four small bug fixes and two additions to the debug messages in parse-datetime.y (used in 'date --debug'). The commit message for each commit gives a detail example of how/when it is used. There are no changes to the parsing, only to the debug messages. Comments and suggesti

Re: [PATCH] dfa: narrow the scope of many local variables

2017-01-01 Thread Paul Eggert
Thanks. I found some more local vars whose scope could be narrowed, and installed the attached followup patch. >From 359f0b1fcf904bb6f8ece929e27cf892ac4aa04d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 1 Jan 2017 20:51:46 -0800 Subject: [PATCH] dfa: narrow more local var scopes * lib/d

[PATCH 2/2] dfa: simplify constraint-dependency checking

2017-01-01 Thread Paul Eggert
* lib/dfa.c (prev_newline_constraint, prev_letter_constraint) (prev_other_constraint): Remove. (prev_newline_dependent, prev_letter_dependent): Simplify, to avoid an unnecessary bitwise AND operation. --- ChangeLog | 6 ++ lib/dfa.c | 22 ++ 2 files changed, 8 insertions(+

[PATCH 1/2] dfa: prefer functions and constants to macros

2017-01-01 Thread Paul Eggert
* lib/dfa.c: Prefer constants to macros where either will do. (streq, isasciidigit, newline_constraint) (letter_constraint, other_constraint, succeeds_in_context) (prev_newline_constraint, prev_letter_constraint) (prev_other_constraint, prev_newline_dependent) (prev_letter_dependent, accepting, acc