Module Name: src
Committed By: christos
Date: Wed Jan 20 15:13:33 UTC 2016
Modified Files:
src/external/gpl3/gcc/dist/gcc: final.c regsub.c
Log Message:
sync with gcc.old (catch up with __RCSID removal and libc sync)
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl3/gcc/dist/gcc/final.c
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/regsub.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/gpl3/gcc/dist/gcc/final.c
diff -u src/external/gpl3/gcc/dist/gcc/final.c:1.3 src/external/gpl3/gcc/dist/gcc/final.c:1.4
--- src/external/gpl3/gcc/dist/gcc/final.c:1.3 Fri Jan 8 21:05:00 2016
+++ src/external/gpl3/gcc/dist/gcc/final.c Wed Jan 20 10:13:33 2016
@@ -1608,7 +1608,7 @@ add_debug_regex_map (const char *arg)
debug_regex_maps = map;
}
-extern ssize_t aregsub(char **, const char *,
+extern ssize_t regasub(char **, const char *,
const regmatch_t *rm, const char *);
/* Perform user-specified mapping of debug filename regular expressions. Return
@@ -1623,7 +1623,7 @@ remap_debug_regex_filename (const char *
for (map = debug_regex_maps; map; map = map->next)
if (regexec (&map->re, filename, 10, rm, 0) == 0
- && aregsub (&s, map->sub, rm, filename) >= 0)
+ && regasub (&s, map->sub, rm, filename) >= 0)
{
const char *name = ggc_strdup(s);
free(s);
Index: src/external/gpl3/gcc/dist/gcc/regsub.c
diff -u src/external/gpl3/gcc/dist/gcc/regsub.c:1.2 src/external/gpl3/gcc/dist/gcc/regsub.c:1.3
--- src/external/gpl3/gcc/dist/gcc/regsub.c:1.2 Sat Jan 16 14:28:36 2016
+++ src/external/gpl3/gcc/dist/gcc/regsub.c Wed Jan 20 10:13:33 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: regsub.c,v 1.2 2016/01/16 19:28:36 christos Exp $ */
+/* $NetBSD: regsub.c,v 1.3 2016/01/20 15:13:33 christos Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -28,13 +28,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#ifdef __RCSID
-__RCSID("$NetBSD: regsub.c,v 1.2 2016/01/16 19:28:36 christos Exp $");
-#endif
-
#include <sys/param.h>
-
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
@@ -47,6 +41,8 @@ struct str {
int s_fixed;
};
+#define REINCR 64
+
static int
addspace(struct str *s, size_t len)
{
@@ -58,7 +54,7 @@ addspace(struct str *s, size_t len)
if (s->s_fixed)
return -1;
- s->s_max += MAX(len, 64);
+ s->s_max += len + REINCR;
v = realloc(s->s_ptr, s->s_max);
if (v == NULL)
@@ -93,7 +89,7 @@ static int
initstr(struct str *s, char *buf, size_t len)
{
s->s_max = len;
- s->s_ptr = buf == NULL ? (char *)malloc(len) : buf;
+ s->s_ptr = (char *)(buf == NULL ? malloc(len) : buf);
s->s_fixed = buf != NULL;
s->s_len = 0;
return s->s_ptr == NULL ? -1 : 0;
@@ -103,7 +99,7 @@ static ssize_t
regsub1(char **buf, size_t len, const char *sub,
const regmatch_t *rm, const char *str)
{
- ssize_t i;
+ ssize_t i;
char c;
struct str s;
@@ -149,15 +145,15 @@ regsub1(char **buf, size_t len, const ch
}
ssize_t
-regsub(char *buf, size_t len, const char *sub, const regmatch_t *rm,
+regnsub(char *buf, size_t len, const char *sub, const regmatch_t *rm,
const char *str)
{
return regsub1(&buf, len, sub, rm, str);
}
ssize_t
-aregsub(char **buf, const char *sub, const regmatch_t *rm, const char *str)
+regasub(char **buf, const char *sub, const regmatch_t *rm, const char *str)
{
*buf = NULL;
- return regsub1(buf, 64, sub, rm, str);
+ return regsub1(buf, REINCR, sub, rm, str);
}