summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaycox <jaycox@src.gnome.org>1998-11-09 00:33:11 +0000
committerjaycox <jaycox@src.gnome.org>1998-11-09 00:33:11 +0000
commit9f037ee245d470ef52f3d829da8f220a7fd9d766 (patch)
treef62b0c31665e70233d35715042e1eb8b6a4a78f8
parent886a0ae3415657b01898d8e9337e52230af64b68 (diff)
downloadgnome-common-9f037ee245d470ef52f3d829da8f220a7fd9d766.tar.gz
Included alloca where necesary. Fixed some void pointer arithmetic. Fixed
Included alloca where necesary. Fixed some void pointer arithmetic. Fixed some variable used as initializer errors. replaced gint foo:1; with guint foo:1; Everything but zvt now compiles on irix 6.5 with sgi's compiler. svn path=/trunk/; revision=467
-rw-r--r--support/argp-help.c13
-rw-r--r--support/argp-parse.c13
-rw-r--r--support/gnome-argp.h2
3 files changed, 22 insertions, 6 deletions
diff --git a/support/argp-help.c b/support/argp-help.c
index 8ac3540..6c7f571 100644
--- a/support/argp-help.c
+++ b/support/argp-help.c
@@ -29,6 +29,10 @@
#include <stdarg.h>
#include <ctype.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+
#ifndef _
/* This is for other GNU distributions with internationalized messages.
When compiling libc, the _ macro is predefined. */
@@ -1017,7 +1021,14 @@ hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
int old_wm = __argp_fmtstream_wmargin (stream);
/* PEST is a state block holding some of our variables that we'd like to
share with helper functions. */
- struct pentry_state pest = { entry, stream, hhstate, 1, state };
+ struct pentry_state pest;
+
+ pest.entry = entry;
+ pest.stream = stream;
+ pest.hhstate = hhstate;
+ pest.first = 1;
+ pest.state = state;
+
if (! odoc (real))
for (opt = real, num = entry->num; num > 0; opt++, num--)
diff --git a/support/argp-parse.c b/support/argp-parse.c
index b6d4256..545e040 100644
--- a/support/argp-parse.c
+++ b/support/argp-parse.c
@@ -28,6 +28,10 @@
#include <limits.h>
#include <getopt.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
+
#ifndef _
/* This is for other GNU distributions with internationalized messages.
When compiling libc, the _ macro is predefined. */
@@ -38,6 +42,7 @@
# define gettext(msgid) (msgid)
#endif
#define N_(msgid) (msgid)
+#define _(msgid) msgid
#endif
#if _LIBC - 0
@@ -522,9 +527,9 @@ parser_init (struct parser *parser, const struct argp *argp,
return ENOMEM;
parser->groups = parser->storage;
- parser->child_inputs = parser->storage + GLEN;
- parser->long_opts = parser->storage + GLEN + CLEN;
- parser->short_opts = parser->storage + GLEN + CLEN + LLEN;
+ parser->child_inputs = (void **)((char *)parser->storage + GLEN);
+ parser->long_opts = (struct option *)((char *)parser->storage + GLEN + CLEN);
+ parser->short_opts = (char *)parser->storage + GLEN + CLEN + LLEN;
memset (parser->child_inputs, 0, szs.num_child_inputs * sizeof (void *));
parser_convert (parser, argp, flags);
@@ -777,7 +782,7 @@ parser_parse_opt (struct parser *parser, int opt, char *val)
with each option. */
{
static const char bad_key_err[] =
- N_("(PROGRAM ERROR) Option should have been recognized!?");
+ _("(PROGRAM ERROR) Option should have been recognized!?");
if (group_key == 0)
__argp_error (&parser->state, "-%c: %s", opt,
dgettext (parser->argp->argp_domain, bad_key_err));
diff --git a/support/gnome-argp.h b/support/gnome-argp.h
index e3748b3..fc18a87 100644
--- a/support/gnome-argp.h
+++ b/support/gnome-argp.h
@@ -14,6 +14,6 @@ extern char *strndup (const char *s, size_t n);
extern char *program_invocation_short_name;
extern char *program_invocation_name;
-#define __mempcpy(To,From,Len) (memcpy ((To), (From), (Len)) + (Len))
+#define __mempcpy(To,From,Len) ((char *)memcpy ((To), (From), (Len)) + (Len))
#endif /* __GNOME_ARGP_H__ */