Skip to content

Commit 79df67d

Browse files
authored
Merge pull request #3564 from masatake/pull-subtrees
Pull the subtrees (packcc and libreadtags)
2 parents 318e691 + 9c2e153 commit 79df67d

File tree

6 files changed

+40
-8
lines changed

6 files changed

+40
-8
lines changed

libreadtags/.github/workflows/msys2.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ jobs:
5050
- run: make check V=1
5151
- run: cat tests/test-suite.log
5252
if: failure()
53+
- run: for x in tests/*.log; do echo '#' $x; cat $x; done
54+
if: failure()

libreadtags/NEWS.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# Version ???
1+
# Version 0.2.1
2+
3+
- use "m" mode flag of fopen only when compiling with glibc 2.3 or higher.
4+
5+
- LT_VERSION 2:1:1
6+
7+
- no change in public interface
8+
9+
# Version 0.2.0
210

311
- delete debug output automatically printed when DEBUG is defiend in
412
build-time.
@@ -20,6 +28,15 @@
2028
- add a new API function (tagsFindPseudoTag) for finding a pseudo tag for
2129
given name.
2230

31+
- Use mmap(2) when opening a tags file if fopen() supports "m" mode flag.
32+
33+
- LT_VERSION 2:0:1
34+
35+
- extend the API
36+
37+
- add a constant: TagErrnoFileMaybeTooBig
38+
- add a function: tagsFindPseudoTag
39+
2340
# Version 0.1.0
2441

2542
- propagate internal errors to caller

libreadtags/configure.ac

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- Autoconf -*-
2-
AC_INIT(libreadtags, 0.1.0)
2+
AC_INIT(libreadtags, 0.2.1)
33
AC_CONFIG_MACRO_DIR([m4])
44
AC_CONFIG_SRCDIR([readtags.c])
55

@@ -27,8 +27,12 @@ AC_PROG_LIBTOOL
2727
#
2828
# 2:0:1
2929
# introduced TagErrnoFileMayTooBig.
30+
# introduced tagsFindPseudoTag.
3031
#
31-
AC_SUBST(LT_VERSION, [2:0:1])
32+
# 2:1:1
33+
# no change in public interface.
34+
#
35+
AC_SUBST(LT_VERSION, [2:1:1])
3236

3337
AC_ARG_ENABLE([gcov],
3438
[AS_HELP_STRING([--enable-gcov],

libreadtags/readtags.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,16 @@ static tagFile *initialize (const char *const filePath, tagFileInfo *const info)
832832
result->fields.max, sizeof (tagExtensionField));
833833
if (result->fields.list == NULL)
834834
goto mem_error;
835-
result->fp = fopen (filePath, "rb");
835+
836+
#if defined(__GLIBC__) && (__GLIBC__ >= 2) \
837+
&& defined(__GLIBC_MINOR__) && (__GLIBC_MINOR__ >= 3)
838+
result->fp = fopen (filePath, "rbm");
839+
#endif
840+
if (result->fp == NULL)
841+
{
842+
errno = 0;
843+
result->fp = fopen (filePath, "rb");
844+
}
836845
if (result->fp == NULL)
837846
{
838847
info->status.error_number = errno;

misc/packcc/src/packcc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@ static void dump_node(context_t *ctx, const node_t *node, const int indent) {
16811681
fprintf(stdout, "')\n");
16821682
break;
16831683
case NODE_QUANTITY:
1684-
fprintf(stdout, "%*sQuantity(min:%d, max%d) {\n", indent, "", node->data.quantity.min, node->data.quantity.max);
1684+
fprintf(stdout, "%*sQuantity(min:%d, max:%d) {\n", indent, "", node->data.quantity.min, node->data.quantity.max);
16851685
dump_node(ctx, node->data.quantity.expr, indent + 2);
16861686
fprintf(stdout, "%*s}\n", indent, "");
16871687
break;

misc/packcc/tests/dump.d/expected.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Rule(name:'statement', ref:0, vars.len:1, capts.len:0, codes.len:2) {
1010
)
1111
}
1212
Sequence(max:4, len:3) {
13-
Quantity(min:0, max-1) {
13+
Quantity(min:0, max:-1) {
1414
Sequence(max:2, len:2) {
1515
Predicate(neg:1) {
1616
Reference(var:'(null)', index:void, name:'EOL', rule:'EOL')
@@ -125,7 +125,7 @@ Rule(name:'primary', ref:1, vars.len:1, capts.len:1, codes.len:2) {
125125
Alternate(max:2, len:2) {
126126
Sequence(max:2, len:2) {
127127
Capture(index:0) {
128-
Quantity(min:1, max-1) {
128+
Quantity(min:1, max:-1) {
129129
Charclass(value:'0-9')
130130
}
131131
}
@@ -146,7 +146,7 @@ Rule(name:'primary', ref:1, vars.len:1, capts.len:1, codes.len:2) {
146146
}
147147
}
148148
Rule(name:'_', ref:14, vars.len:0, capts.len:0, codes.len:0) {
149-
Quantity(min:0, max-1) {
149+
Quantity(min:0, max:-1) {
150150
Charclass(value:' \t')
151151
}
152152
}

0 commit comments

Comments
 (0)