From: Bruno Haible Date: Wed, 31 Oct 2001 20:52:50 +0000 (+0000) Subject: Portability to SunOS4. X-Git-Tag: v0.11~359 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98b10222ade7490c1442ffaad78b950336690992;p=thirdparty%2Fgettext.git Portability to SunOS4. --- diff --git a/src/ChangeLog b/src/ChangeLog index 5451d99ef..9f86e5768 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2001-10-31 Bruno Haible + + * Makefile.am (noinst_HEADERS): Add read-java.h, write-java.h, + format.h, msgunfmt.h. + * message.h (NFORMATS): Define via #define, not via an enum value. + * format.h (struct formatstring_parser): Use PARAMS. + * format-c.c (FAT_SIZE_MASK): Remove extraneous backslashes. + * po-charset.c (po_lex_charset_set): Fix syntax error. + * write-java.c (write_java_string): Drop hexdigit[] size. + * x-java.l (add_object): Remove C++ style comment. + 2001-10-28 Bruno Haible * hostname.c: Include "progname.h". diff --git a/src/Makefile.am b/src/Makefile.am index 19e2fe7f6..b19914d2a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,8 +30,9 @@ lib_LTLIBRARIES = libgettextsrc.la noinst_HEADERS = pos.h message.h po-gram.h po-hash.h po-charset.h po-lex.h \ po.h open-po.h read-po.h str-list.h write-po.h dir-list.h file-list.h \ po-gram-gen.h po-hash-gen.h msgl-charset.h msgl-equal.h msgl-iconv.h \ -msgl-ascii.h msgl-cat.h msgl-english.h msgfmt.h read-mo.h write-mo.h \ -po-time.h xgettext.h x-c.h x-po.h x-java.h x-ycp.h x-rst.h +msgl-ascii.h msgl-cat.h msgl-english.h msgfmt.h msgunfmt.h read-mo.h \ +write-mo.h read-java.h write-java.h po-time.h format.h xgettext.h x-c.h \ +x-po.h x-java.h x-ycp.h x-rst.h EXTRA_DIST = FILES diff --git a/src/format-c.c b/src/format-c.c index 733335afc..926a19243 100644 --- a/src/format-c.c +++ b/src/format-c.c @@ -102,9 +102,9 @@ enum format_arg_type FAT_COUNT_LONGLONGINT_POINTER = FAT_COUNT_POINTER | FAT_SIZE_LONGLONG, */ /* Bitmasks */ - FAT_SIZE_MASK = (FAT_SIZE_SHORT | FAT_SIZE_CHAR \ - | FAT_SIZE_LONG | FAT_SIZE_LONGLONG \ - | FAT_SIZE_INTMAX_T | FAT_SIZE_SIZE_T \ + FAT_SIZE_MASK = (FAT_SIZE_SHORT | FAT_SIZE_CHAR + | FAT_SIZE_LONG | FAT_SIZE_LONGLONG + | FAT_SIZE_INTMAX_T | FAT_SIZE_SIZE_T | FAT_SIZE_PTRDIFF_T) }; diff --git a/src/format.h b/src/format.h index 9b013976f..2d338534a 100644 --- a/src/format.h +++ b/src/format.h @@ -30,14 +30,14 @@ struct formatstring_parser 1. the argument types/names needed for the format string, 2. the total number of format directives. Return NULL if the string is not a valid format string. */ - void * (*parse) (const char *string); + void * (*parse) PARAMS ((const char *string)); /* Free a format string descriptor, returned by parse(). */ - void (*free) (void *descr); + void (*free) PARAMS ((void *descr)); /* Return the number of format directives. A string that can be output literally has 0 format directives. */ - int (*get_number_of_directives) (void *descr); + int (*get_number_of_directives) PARAMS ((void *descr)); /* Verify that the argument types/names in msgid_descr and those in msgstr_descr are the same. If not, signal an error using @@ -45,7 +45,7 @@ struct formatstring_parser error_at_line (0, 0, pos->file_name, pos->line_number, ...); error_with_progname = true; and return true. Otherwise return false. */ - bool (*check) (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr); + bool (*check) PARAMS ((const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr)); }; /* Format string parsers, each defined in its own file. */ diff --git a/src/message.h b/src/message.h index 9a63bc344..432cd17ee 100644 --- a/src/message.h +++ b/src/message.h @@ -38,9 +38,9 @@ enum format_type format_lisp, format_java, format_pascal, - format_ycp, - NFORMATS + format_ycp }; +#define NFORMATS 6 /* Number of format_type enum values. */ extern const char *const format_language[NFORMATS]; extern const char *const format_language_pretty[NFORMATS]; diff --git a/src/po-charset.c b/src/po-charset.c index 9a00be0e8..fc3608d8e 100644 --- a/src/po-charset.c +++ b/src/po-charset.c @@ -255,6 +255,8 @@ would fix this problem.\n"))); multiline_warning (NULL, xasprintf (_("%s\n"), note)); } #else + size_t i; + for (i = 0; i < SIZEOF (weird_charsets); i++) if (strcmp (po_lex_charset, weird_charsets[i]) == 0) break; diff --git a/src/write-java.c b/src/write-java.c index c65f2e638..57a33ad63 100644 --- a/src/write-java.c +++ b/src/write-java.c @@ -369,7 +369,7 @@ write_java_string (stream, str) FILE *stream; const char *str; { - static const char hexdigit[16] = "0123456789abcdef"; + static const char hexdigit[] = "0123456789abcdef"; const char *str_limit = str + strlen (str); fprintf (stream, "\""); diff --git a/src/x-java.l b/src/x-java.l index 380ad13cf..237b4f099 100644 --- a/src/x-java.l +++ b/src/x-java.l @@ -334,7 +334,6 @@ add_object (list, object) { if (list->num_obj + 1 >= list->max_num_obj) { - // resize list->max_num_obj += OBJECT_LIST_GROWTH; list->objects = xrealloc (list->objects, list->max_num_obj * sizeof (void *));