- update to 3.1

This commit is contained in:
Dirk Meyer 2020-01-01 20:53:40 +00:00
parent cb24bd26f8
commit 1421cc1eaf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=521771
15 changed files with 19 additions and 334 deletions

View File

@ -1,21 +1,18 @@
# $FreeBSD$
PORTNAME= gperf
PORTVERSION= 3.0.3
PORTREVISION= 2
PORTVERSION= 3.1
CATEGORIES= devel
MASTER_SITES= GNU
MAINTAINER= dinoex@FreeBSD.org
COMMENT= Generates perfect hash functions for sets of keywords
LICENSE= GPLv2
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/COPYING
CONFLICTS= ace+tao-[0-9]*
MAKE_JOBS_UNSAFE= yes
# avoid GPLv3 in generated code
PORTSCOUT= ignore
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --docdir=${DOCSDIR}

View File

@ -1,2 +1,3 @@
SHA256 (gperf-3.0.3.tar.gz) = 63287527c8d9e27e801cf0804436f3494bd569db05d49dcdd2a942ae72fa9055
SIZE (gperf-3.0.3.tar.gz) = 865088
TIMESTAMP = 1484078517
SHA256 (gperf-3.1.tar.gz) = 588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2
SIZE (gperf-3.1.tar.gz) = 1215925

View File

@ -1,26 +0,0 @@
--- src/output.cc 2007-03-31 15:16:05 UTC
+++ src/output.cc
@@ -1106,9 +1106,7 @@ output_keyword_entry (KeywordExt *temp,
if (option[TYPE])
printf ("{");
if (option[SHAREDLIB])
- printf ("(int)(long)&((struct %s_t *)0)->%s_str%d",
- option.get_stringpool_name (), option.get_stringpool_name (),
- stringpool_index);
+ printf("offsetof(struct %s_t, %s_str%d)", option.get_stringpool_name (), option.get_stringpool_name (), stringpool_index);
else
output_string (temp->_allchars, temp->_allchars_length);
if (option[TYPE])
@@ -2035,8 +2033,11 @@ Output::output ()
printf ("%s\n", _struct_decl);
}
- if (option[INCLUDE])
+ if (option[INCLUDE]) {
printf ("#include <string.h>\n"); /* Declare strlen(), strcmp(), strncmp(). */
+ if (option[SHAREDLIB])
+ printf("#include <stddef.h>\n"); /* Declare offsetof() */
+ }
if (!option[ENUM])
{

View File

@ -1,288 +0,0 @@
--- ./doc/gperf.1 2007-05-02 16:01:25 UTC
+++ ./doc/gperf.1
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.23.
-.TH GPERF "1" "May 2007" "GNU gperf 3.0.3" FSF
+.TH GPERF "1" "October 2011" "GNU gperf 3.0.3" FSF
.SH NAME
gperf \- generate a perfect hash function from a key set
.SH SYNOPSIS
@@ -129,6 +129,10 @@ binary search.
Prevents the transfer of the type declaration to the
output file. Use this option if the type is already
defined elsewhere.
+.TP
+\fB\-\-size\-type\fR=\fITYPE\fR
+Specify the type for length parameters. Default type is
+\&'unsigned int'.
.SS "Algorithm employed by gperf:"
.TP
\fB\-k\fR, \fB\-\-key\-positions\fR=\fIKEYS\fR
--- ./src/options.cc 2007-03-31 15:22:16 UTC
+++ ./src/options.cc
@@ -67,6 +67,8 @@ static const char *const DEFAULT_STRINGP
/* Default delimiters that separate keywords from their attributes. */
static const char *const DEFAULT_DELIMITERS = ",";
+static const char *const DEFAULT_SIZE_TYPE = "unsigned int";
+
/* Prints program usage to given stream. */
void
@@ -202,6 +204,9 @@ Options::long_usage (FILE * stream)
" Prevents the transfer of the type declaration to the\n"
" output file. Use this option if the type is already\n"
" defined elsewhere.\n");
+ fprintf (stream,
+ " --size-type=TYPE Specify the type for length parameters. Default type is\n"
+ " 'unsigned int'.\n");
fprintf (stream, "\n");
fprintf (stream,
"Algorithm employed by gperf:\n");
@@ -468,6 +473,7 @@ Options::Options ()
_lengthtable_name (DEFAULT_LENGTHTABLE_NAME),
_stringpool_name (DEFAULT_STRINGPOOL_NAME),
_delimiters (DEFAULT_DELIMITERS),
+ _size_type (DEFAULT_SIZE_TYPE),
_key_positions ()
{
}
@@ -512,6 +518,7 @@ Options::~Options ()
"\nhash table size multiplier = %g"
"\ninitial associated value = %d"
"\ndelimiters = %s"
+ "\nsize type = %s"
"\nnumber of switch statements = %d\n",
_option_word & TYPE ? "enabled" : "disabled",
_option_word & UPPERLOWER ? "enabled" : "disabled",
@@ -537,7 +544,7 @@ Options::~Options ()
_function_name, _hash_name, _wordlist_name, _lengthtable_name,
_stringpool_name, _slot_name, _initializer_suffix,
_asso_iterations, _jump, _size_multiple, _initial_asso_value,
- _delimiters, _total_switches);
+ _delimiters, _size_type, _total_switches);
if (_key_positions.is_useall())
fprintf (stderr, "all characters are used in the hash function\n");
else
@@ -666,6 +673,12 @@ Options::set_delimiters (const char *del
_delimiters = delimiters;
}
+void
+Options::set_size_type (const char *size_type)
+{
+ if (_size_type == DEFAULT_SIZE_TYPE)
+ _size_type = size_type;
+}
/* Parses the command line Options and sets appropriate flags in option_word. */
@@ -691,6 +704,7 @@ static const struct option long_options[
{ "global-table", no_argument, NULL, 'G' },
{ "word-array-name", required_argument, NULL, 'W' },
{ "length-table-name", required_argument, NULL, CHAR_MAX + 4 },
+ { "size-type", required_argument, NULL, CHAR_MAX + 5 },
{ "switch", required_argument, NULL, 'S' },
{ "omit-struct-type", no_argument, NULL, 'T' },
{ "key-positions", required_argument, NULL, 'k' },
@@ -1044,6 +1058,11 @@ warranty; not even for MERCHANTABILITY o
_lengthtable_name = /*getopt*/optarg;
break;
}
+ case CHAR_MAX + 5: /* Sets the name for the length table array. */
+ {
+ _size_type = /*getopt*/optarg;
+ break;
+ }
default:
short_usage (stderr);
exit (1);
--- ./src/options.h 2005-05-14 14:22:36 UTC
+++ ./src/options.h
@@ -209,6 +209,9 @@ public:
/* Sets the delimiters string, if not already set. */
void set_delimiters (const char *delimiters);
+ const char * get_size_type() const;
+ void set_size_type(const char*);
+
/* Returns key positions. */
const Positions& get_key_positions () const;
@@ -279,6 +282,8 @@ private:
/* Separates keywords from other attributes. */
const char * _delimiters;
+ const char * _size_type;
+
/* Contains user-specified key choices. */
Positions _key_positions;
};
--- ./src/options.icc 2005-05-14 14:22:36 UTC
+++ ./src/options.icc
@@ -155,3 +155,9 @@ Options::get_key_positions () const
{
return _key_positions;
}
+
+INLINE const char *
+Options::get_size_type() const
+{
+ return _size_type;
+}
--- ./src/output.cc 2007-03-31 15:16:05 UTC
+++ ./src/output.cc
@@ -772,14 +772,14 @@ Output::output_hash_function () const
printf (option[KRC] ?
"(str, len)\n"
" register char *str;\n"
- " register unsigned int len;\n" :
+ " register %s len;\n" :
option[C] ?
"(str, len)\n"
" register const char *str;\n"
- " register unsigned int len;\n" :
+ " register %s len;\n" :
option[ANSIC] | option[CPLUSPLUS] ?
- "(register const char *str, register unsigned int len)\n" :
- "");
+ "(register const char *str, register %s len)\n" :
+ "", option.get_size_type());
/* Note that when the hash function is called, it has already been verified
that min_key_len <= len <= max_key_len. */
@@ -875,7 +875,7 @@ Output::output_hash_function () const
" switch (%s)\n"
" {\n"
" default:\n",
- option[NOLENGTH] ? "0" : "len",
+ option[NOLENGTH] ? "0" : "(int)len",
option[NOLENGTH] ? "len" : "hval");
while (key_pos != Positions::LASTCHAR && key_pos >= _max_key_len)
@@ -1900,14 +1900,14 @@ Output::output_lookup_function () const
printf (option[KRC] ?
"(str, len)\n"
" register char *str;\n"
- " register unsigned int len;\n" :
+ " register %s len;\n" :
option[C] ?
"(str, len)\n"
" register const char *str;\n"
- " register unsigned int len;\n" :
+ " register %s len;\n" :
option[ANSIC] | option[CPLUSPLUS] ?
- "(register const char *str, register unsigned int len)\n" :
- "");
+ "(register const char *str, register %s len)\n" :
+ "", option.get_size_type());
/* Output the function's body. */
printf ("{\n");
@@ -2074,13 +2073,14 @@ Output::output ()
printf ("class %s\n"
"{\n"
"private:\n"
- " static inline unsigned int %s (const char *str, unsigned int len);\n"
+ " static inline unsigned int %s (const char *str, %s len);\n"
"public:\n"
- " static %s%s%s (const char *str, unsigned int len);\n"
+ " static %s%s%s (const char *str, %s len);\n"
"};\n"
"\n",
- option.get_class_name (), option.get_hash_name (),
- const_for_struct, _return_type, option.get_function_name ());
+ option.get_class_name (), option.get_hash_name (), option.get_size_type(),
+ const_for_struct, _return_type, option.get_function_name (),
+ option.get_size_type());
output_hash_function ();
--- ./tests/c-parse.exp 2007-04-06 15:38:50 UTC
+++ ./tests/c-parse.exp
@@ -80,7 +80,7 @@ hash (str, len)
126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
126, 126, 126, 126, 126, 126
};
- register int hval = len;
+ register int hval = (int)len;
switch (hval)
{
--- ./tests/charsets.exp 2007-04-19 11:13:42 UTC
+++ ./tests/charsets.exp
@@ -89,7 +90,7 @@ hash (str, len)
5046, 5046, 5046, 5046, 5046, 5046, 5046, 5046, 5046, 5046,
5046, 5046, 5046, 5046, 5046, 5046, 5046, 5046, 5046
};
- register int hval = len;
+ register int hval = (int)len;
switch (hval)
{
--- ./tests/chill.exp 2007-04-19 11:13:42 UTC
+++ ./tests/chill.exp
@@ -78,7 +78,7 @@ hash (str, len)
1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050,
1050, 1050, 1050, 1050, 1050, 1050, 1050
};
- register int hval = len;
+ register int hval = (int)len;
switch (hval)
{
--- ./tests/cplusplus.exp 2007-04-19 10:16:41 UTC
+++ ./tests/cplusplus.exp
@@ -80,7 +80,7 @@ hash (str, len)
164, 164, 164, 164, 164, 164, 164, 164, 164, 164,
164, 164, 164, 164, 164, 164
};
- register int hval = len;
+ register int hval = (int)len;
switch (hval)
{
--- ./tests/java.exp 2007-04-19 10:16:41 UTC
+++ ./tests/java.exp
@@ -104,7 +104,7 @@ hash (str, len)
77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
77, 77, 77, 77, 77, 77
};
- register int hval = len;
+ register int hval = (int)len;
switch (hval)
{
--- ./tests/languages.exp 2007-04-19 10:16:41 UTC
+++ ./tests/languages.exp
@@ -93,7 +94,7 @@ hash (str, len)
3861, 3861, 3861, 3861, 3861, 3861, 3861, 3861, 3861, 3861,
3861, 3861, 3861, 3861, 3861
};
- register int hval = len;
+ register int hval = (int)len;
switch (hval)
{
--- ./tests/objc.exp 2007-04-19 10:16:41 UTC
+++ ./tests/objc.exp
@@ -80,7 +80,7 @@ hash (str, len)
96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
96, 96, 96, 96, 96, 96
};
- register int hval = len;
+ register int hval = (int)len;
switch (hval)
{
--- tests/test-6.exp 2004-08-22 16:04:17 UTC
+++ tests/test-6.out
@@ -88,6 +88,8 @@ Details in the output code:
Prevents the transfer of the type declaration to the
output file. Use this option if the type is already
defined elsewhere.
+ --size-type=TYPE Specify the type for length parameters. Default type is
+ 'unsigned int'.
Algorithm employed by gperf:
-k, --key-positions=KEYS

View File

@ -19,6 +19,6 @@ Output from the GPERF program is used to recognize reserved words in
the GNU C, GNU C++, and GNU Pascal compilers, as well as with the GNU
indent program.
LICENSE: GPL2 or later
LICENSE: GPLv3 or later
WWW: http://www.gnu.org/software/gperf/

View File

@ -30,8 +30,8 @@ LIB_DEPENDS= libpng.so:graphics/png \
libgnutls.so:security/gnutls
RESTRICTED= ROMs are copyrighted by Commodore Business Machines
USES= compiler:c++11-lang gettext gmake iconv:wchar_t jpeg \
localbase:ldflags makeinfo pkgconfig readline xorg
USES= compiler:c++11-lang pkgconfig makeinfo localbase:ldflags \
gmake iconv:wchar_t jpeg readline gettext xorg
USE_XORG= xpm ice sm xext xv xt x11 xmu xxf86vm
USE_XORG+= xrender xinerama xi xrandr xcursor xcomposite xdamage xfixes
HAS_CONFIGURE= yes

View File

@ -13,7 +13,7 @@ LICENSE= GPLv2+
LIB_DEPENDS= libpoppler-qt5.so:graphics/poppler-qt5
USES= compiler:c++11-lang gl qmake qt:5
USES= compiler:c++11-lang qmake qt:5 gl
USE_GL= gl
USE_QT= buildtools linguist_build core gui printsupport widgets

View File

@ -26,8 +26,8 @@ LIB_DEPENDS= libltdl.so:devel/libltdl \
CONFLICTS= gnash-devel-[0-9]*
USES= cpe tar:bzip2 compiler:c++11-lang autoreconf gl gmake gnome \
libtool pkgconfig jpeg gnome gl desktop-file-utils xorg
USES= cpe tar:bzip2 compiler:c++11-lang autoreconf gmake libtool \
pkgconfig jpeg gnome gl desktop-file-utils xorg
CPE_VENDOR= gnu
GNU_CONFIGURE= yes
WANT_GSTREAMER= yes

View File

@ -114,6 +114,7 @@ PHP_LIB_DEPENDS= libpcre.so:devel/pcre \
GHOSTSCRIPT_LIB_DEPENDS= libgs.so:print/${_GS_PORT}
XPM_CONFIGURE_WITH= x
XPM_CONFIGURE_ENV= ac_cv_header_sys_inotify_h=no
DIGCOLA_CONFIGURE_WITH= digcola
IPSEPCOLA_CONFIGURE_WITH= ipsepcola
IPSEPCOLA_IMPLIES= DIGCOLA

View File

@ -19,7 +19,7 @@ LIB_DEPENDS= libt1.so:devel/t1lib \
libfreetype.so:print/freetype2 \
libfontconfig.so:x11-fonts/fontconfig
USES= gl gmake pkgconfig jpeg
USES= gmake pkgconfig jpeg gl
USE_GL= glut
GNU_CONFIGURE= yes
CONFIGURE_ENV= ac_cv_lib_zzip_zzip_file_open=no

View File

@ -480,8 +480,8 @@
- commentsize += strlen(info_ptr->text[i].key) + 1 +
- info_ptr->text[i].text_length + 2;
+ for (i = 0; i < _num_text; i++)
+ commentsize += strlen(_text[i].key) + 1 +
+ _text[i].text_length + 2;
+ commentsize += strlen(_text[i].key) + 2 +
+ _text[i].text_length + _text[i].itxt_length + 1;
if ((pinfo->comment = malloc(commentsize)) == NULL) {
png_warning(png_ptr,"can't allocate comment string");

View File

@ -16,7 +16,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= hexchat:irc/hexchat
RUN_DEPENDS= hexchat:irc/hexchat
USES= gnome pkgconfig ssl tar:bz2
USES= tar:bz2 pkgconfig ssl gnome
USE_GNOME= glib20
CFLAGS+= -I${LOCALBASE}/include/glib-2.0

View File

@ -17,7 +17,7 @@ NOT_FOR_ARCHS_REASON= fails to compile: error: Unsupported word size
USE_GITHUB= yes
GH_ACCOUNT= vstakhov
USES= bison cmake compiler:c11 gnome pkgconfig ssl
USES= compiler:c11 cmake pkgconfig bison ssl gnome
USE_GNOME= glib20
USERS= _rmilter

View File

@ -13,7 +13,7 @@ LICENSE= GPLv2
LIB_DEPENDS= libsndfile.so:audio/libsndfile
USES= compiler:c++11-lang gmake gnome iconv pkgconfig sdl tar:bzip2
USES= tar:bzip2 compiler:c++11-lang gmake pkgconfig iconv sdl gnome
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --without-ffmpeg

View File

@ -15,7 +15,7 @@ LICENSE= BSD2CLAUSE
CONFLICTS= asclock-gtk-[0-9]* asclock-xlib-[0-9]*
USES= imake tar:tgz xorg
USES= tar:tgz imake xorg
USE_XORG= xpm xext x11
PLIST_FILES= bin/asclock man/man1/asclock.1.gz