summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2020-10-06 01:17:19 -0400
committerEric S. Raymond <esr@thyrsus.com>2020-10-06 01:17:19 -0400
commit716cb63ff210f082418c96f726a6d165eae565a5 (patch)
tree1f94d8aaa66f69e1bc915a598964cecfaddb21a9 /src/misc.c
parent96e004a296edf2a6f6e0b60b3da6e5d8e09428de (diff)
downloadflex-git-716cb63ff210f082418c96f726a6d165eae565a5.tar.gz
Tweak the indent style of tables with macroexpanded bodies...
...to have an indent style uniform with the rest of the code, and one that makes it easier noy to miss the trailing table delimiters. Not all tables are generated this way yet. I'm working on it. Is isolated in its own commit so the format change can't confuse a reviewer's eyeballs out of noticing real mutations in the table data. #65 in the retargeting patch series
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/misc.c b/src/misc.c
index 120a4e7..a5214fa 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -217,13 +217,13 @@ char *xstrdup(const char *s)
int cclcmp (const void *a, const void *b)
{
- if (!*(const unsigned char *) a)
- return 1;
- else
- if (!*(const unsigned char *) b)
- return - 1;
+ if (!*(const unsigned char *) a)
+ return 1;
else
- return *(const unsigned char *) a - *(const unsigned char *) b;
+ if (!*(const unsigned char *) b)
+ return - 1;
+ else
+ return *(const unsigned char *) a - *(const unsigned char *) b;
}
@@ -254,7 +254,8 @@ void dataflush (void)
if (!gentables)
return;
- outc ('\n');
+ if (datapos > 0)
+ outc ('\n');
if (++dataline >= NUMDATALINES) {
/* Put out a blank line so that the table is grouped into
@@ -432,7 +433,7 @@ void mkdata (int value)
if (datapos == 0)
/* Indent. */
- out (" ");
+ out (" ");
else
outc (',');