mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 06:28:55 +02:00
101 lines
3.5 KiB
Plaintext
101 lines
3.5 KiB
Plaintext
From 9a1dd934ea2f8fd0f05cb9bb0c647514810342c4 Mon Sep 17 00:00:00 2001
|
|
From: Jerome Duval <jerome.duval@gmail.com>
|
|
Date: Mon, 4 Aug 2014 19:41:40 +0000
|
|
Subject: c89 patch
|
|
|
|
|
|
diff --git a/src/AnnotationList.c b/src/AnnotationList.c
|
|
index 4c1e0ae..97f35f6 100644
|
|
--- a/src/AnnotationList.c
|
|
+++ b/src/AnnotationList.c
|
|
@@ -233,9 +233,10 @@ AnnotationList__computePredecessorAnnotations (AnnotationList *self, state *s,
|
|
AnnotationList *annotation_node =
|
|
AnnotationList__alloc_on_obstack (
|
|
self->inadequacyNode->contributionCount, annotations_obstackp);
|
|
- annotation_node->inadequacyNode = self->inadequacyNode;
|
|
bool potential_contribution = false;
|
|
bitset *lookaheads = NULL;
|
|
+ annotation_node->inadequacyNode = self->inadequacyNode;
|
|
+
|
|
{
|
|
ContributionIndex ci;
|
|
for (ci = 0; ci < self->inadequacyNode->contributionCount; ++ci)
|
|
diff --git a/src/getargs.c b/src/getargs.c
|
|
index 6490569..bbf1845 100644
|
|
--- a/src/getargs.c
|
|
+++ b/src/getargs.c
|
|
@@ -267,6 +267,7 @@ static void usage (int) ATTRIBUTE_NORETURN;
|
|
static void
|
|
usage (int status)
|
|
{
|
|
+ const char *lc_messages = setlocale (LC_MESSAGES, NULL);
|
|
if (status != 0)
|
|
fprintf (stderr, _("Try `%s --help' for more information.\n"),
|
|
program_name);
|
|
@@ -370,7 +371,6 @@ THINGS is a list of comma separated words that can include:\n\
|
|
/* Don't output this redundant message for English locales.
|
|
Note we still output for 'C' so that it gets included in the
|
|
man page. */
|
|
- const char *lc_messages = setlocale (LC_MESSAGES, NULL);
|
|
if (lc_messages && strcmp (lc_messages, "en_"))
|
|
/* TRANSLATORS: Replace LANG_CODE in this URL with your language
|
|
code <http://translationproject.org/team/LANG_CODE.html> to
|
|
diff --git a/src/ielr.c b/src/ielr.c
|
|
index cde2baa..ce437e3 100644
|
|
--- a/src/ielr.c
|
|
+++ b/src/ielr.c
|
|
@@ -1032,9 +1032,9 @@ ielr_split_states (bitsetv follow_kernel_items, bitsetv always_follows,
|
|
lookahead sets. */
|
|
if (!annotation_lists)
|
|
{
|
|
+ state_list *node;
|
|
timevar_push (TV_IELR_PHASE4);
|
|
initialize_LA ();
|
|
- state_list *node;
|
|
for (node = first_state; node; node = node->next)
|
|
if (!node->state->consistent)
|
|
{
|
|
diff --git a/src/scan-code.l b/src/scan-code.l
|
|
index fa593be..54f2921 100644
|
|
--- a/src/scan-code.l
|
|
+++ b/src/scan-code.l
|
|
@@ -611,12 +611,12 @@ parse_ref (char *cp, symbol_list *rule, int rule_length,
|
|
indent += SUB_INDENT;
|
|
if (len == 0)
|
|
{
|
|
- location sym_loc = text_loc;
|
|
- sym_loc.start.column += 1;
|
|
- sym_loc.end = sym_loc.start;
|
|
const char *format =
|
|
_("syntax error after '%c', expecting integer, letter,"
|
|
" '_', '[', or '$'");
|
|
+ location sym_loc = text_loc;
|
|
+ sym_loc.start.column += 1;
|
|
+ sym_loc.end = sym_loc.start;
|
|
complain_at_indent (sym_loc, &indent, format, dollar_or_at);
|
|
}
|
|
else if (midrule_rhs_index)
|
|
diff --git a/src/uniqstr.c b/src/uniqstr.c
|
|
index 62d09ca..4d5f0a7 100644
|
|
--- a/src/uniqstr.c
|
|
+++ b/src/uniqstr.c
|
|
@@ -62,13 +62,14 @@ uniqstr_vsprintf (char const *format, ...)
|
|
va_start (args, format);
|
|
length = vsnprintf (NULL, 0, format, args);
|
|
va_end (args);
|
|
-
|
|
+{
|
|
char res[length + 1];
|
|
va_start (args, format);
|
|
vsprintf (res, format, args);
|
|
va_end (args);
|
|
return uniqstr_new (res);
|
|
}
|
|
+}
|
|
|
|
/*------------------------------.
|
|
| Abort if S is not a uniqstr. |
|
|
--
|
|
1.8.3.4
|
|
|