rpms/flex/devel flex-2.5.4a2-std.patch, NONE, 1.1 flex-2.5.4a2-warn.patch, NONE, 1.1 flex.spec, 1.17, 1.18
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Fri Jan 13 16:18:11 UTC 2006
Author: pmachata
Update of /cvs/dist/rpms/flex/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv27373
Modified Files:
flex.spec
Added Files:
flex-2.5.4a2-std.patch flex-2.5.4a2-warn.patch
Log Message:
- Adding `std::' prefixes, got rid of `using namespace std'. (#115354)
- Dummy use of `yy_flex_realloc' to silent warnings. (#30943)
- Adding URL of flex home page to spec (#142675)
flex-2.5.4a2-std.patch:
flex.skl | 30 +++++++++++++++---------------
skel.c | 27 +++++++++++++--------------
2 files changed, 28 insertions(+), 29 deletions(-)
--- NEW FILE flex-2.5.4a2-std.patch ---
diff -Burp flex-2.5.4/flex.skl flex-2.5.4-new/flex.skl
--- flex-2.5.4/flex.skl 2006-01-13 16:16:52.000000000 +0100
+++ flex-2.5.4-new/flex.skl 2006-01-13 16:57:50.000000000 +0100
@@ -1,4 +1,4 @@
-/* A lexical scanner generated by flex */
+/* A lexical scanner generated by flex*/
/* Scanner skeleton version:
* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
@@ -26,7 +26,7 @@
#include <stdlib.h>
%+
-class istream;
+#include <iostream>
%*
/* Use prototypes in function declarations. */
@@ -153,7 +153,7 @@ struct yy_buffer_state
%-
FILE *yy_input_file;
%+
- istream* yy_input_file;
+ std::istream* yy_input_file;
%*
char *yy_ch_buf; /* input buffer */
@@ -276,7 +276,7 @@ static void yy_flex_free YY_PROTO(( void
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
-%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
+%% yytext/yyin/yyout/yy_state_type/yylineno etc. def\'s & init go here
%- Standard (non-C++) definition
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
@@ -296,7 +296,7 @@ static void yy_fatal_error YY_PROTO(( yy
%% code to copy yytext_ptr to yytext[] goes here, if %array
yy_c_buf_p = yy_cp;
-%% data tables for the DFA and the user's section 1 definitions go here
+%% data tables for the DFA and the user\'s section 1 definitions go here
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -449,10 +449,10 @@ YY_MALLOC_DECL
YY_DECL
{
register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
+ register char *yy_cp = NULL, *yy_bp = NULL;
register int yy_act;
-%% user's declarations go here
+%% user\'s declarations go here
if ( yy_init )
{
@@ -469,14 +469,14 @@ YY_DECL
%-
yyin = stdin;
%+
- yyin = &cin;
+ yyin = &std::cin;
%*
if ( ! yyout )
%-
yyout = stdout;
%+
- yyout = &cout;
+ yyout = &std::cout;
%*
if ( ! yy_current_buffer )
@@ -646,7 +646,7 @@ do_action: /* This label is used only to
} /* end of yylex */
%+
-yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
+yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
{
yyin = arg_yyin;
yyout = arg_yyout;
@@ -681,7 +681,7 @@ yyFlexLexer::~yyFlexLexer()
yy_delete_buffer( yy_current_buffer );
}
-void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
+void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
{
if ( new_in )
{
@@ -1058,7 +1058,7 @@ void yyrestart( input_file )
FILE *input_file;
#endif
%+
-void yyFlexLexer::yyrestart( istream* input_file )
+void yyFlexLexer::yyrestart( std::istream* input_file )
%*
{
if ( ! yy_current_buffer )
@@ -1129,7 +1129,7 @@ FILE *file;
int size;
#endif
%+
-YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
+YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
%*
{
YY_BUFFER_STATE b;
@@ -1190,7 +1190,7 @@ FILE *file;
#endif
%+
-void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
+void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
%*
{
@@ -1434,7 +1434,7 @@ char msg[];
void yyFlexLexer::LexerError( yyconst char msg[] )
{
- cerr << msg << '\n';
+ std::cerr << msg << '\n';
exit( YY_EXIT_FAILURE );
}
%*
diff -Burp flex-2.5.4/skel.c flex-2.5.4-new/skel.c
--- flex-2.5.4/skel.c 2006-01-13 16:16:52.000000000 +0100
+++ flex-2.5.4-new/skel.c 2006-01-13 16:58:53.000000000 +0100
@@ -3,7 +3,7 @@
#include "flexdef.h"
const char *skel[] = {
- "/* A lexical scanner generated by flex */",
+ "/* A lexical scanner generated by flex*/",
"",
"/* Scanner skeleton version:",
" * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $",
@@ -32,7 +32,6 @@ const char *skel[] = {
"#include <stdlib.h>",
"%+",
"#include <iostream>",
- "using namespace std;",
"%*",
"",
"/* Use prototypes in function declarations. */",
@@ -159,7 +158,7 @@ const char *skel[] = {
"%-",
" FILE *yy_input_file;",
"%+",
- " istream* yy_input_file;",
+ " std::istream* yy_input_file;",
"%*",
"",
" char *yy_ch_buf; /* input buffer */",
@@ -282,7 +281,7 @@ const char *skel[] = {
"",
"#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)",
"",
- "%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here",
+ "%% yytext/yyin/yyout/yy_state_type/yylineno etc. def\\'s & init go here",
"",
"%- Standard (non-C++) definition",
"static yy_state_type yy_get_previous_state YY_PROTO(( void ));",
@@ -302,7 +301,7 @@ const char *skel[] = {
"%% code to copy yytext_ptr to yytext[] goes here, if %array",
" yy_c_buf_p = yy_cp;",
"",
- "%% data tables for the DFA and the user's section 1 definitions go here",
+ "%% data tables for the DFA and the user\\'s section 1 definitions go here",
"",
"/* Macros after this point can all be overridden by user definitions in",
" * section 1.",
@@ -458,7 +457,7 @@ const char *skel[] = {
" register char *yy_cp = NULL, *yy_bp = NULL;",
" register int yy_act;",
"",
- "%% user's declarations go here",
+ "%% user\\'s declarations go here",
"",
" if ( yy_init )",
" {",
@@ -475,14 +474,14 @@ const char *skel[] = {
"%-",
" yyin = stdin;",
"%+",
- " yyin = &cin;",
+ " yyin = &std::cin;",
"%*",
"",
" if ( ! yyout )",
"%-",
" yyout = stdout;",
"%+",
- " yyout = &cout;",
+ " yyout = &std::cout;",
"%*",
"",
" if ( ! yy_current_buffer )",
@@ -652,7 +651,7 @@ const char *skel[] = {
" } /* end of yylex */",
"",
"%+",
- "yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )",
+ "yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )",
" {",
" yyin = arg_yyin;",
" yyout = arg_yyout;",
@@ -687,7 +686,7 @@ const char *skel[] = {
" yy_delete_buffer( yy_current_buffer );",
" }",
"",
- "void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )",
+ "void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )",
" {",
" if ( new_in )",
" {",
@@ -1064,7 +1063,7 @@ const char *skel[] = {
"FILE *input_file;",
"#endif",
"%+",
- "void yyFlexLexer::yyrestart( istream* input_file )",
+ "void yyFlexLexer::yyrestart( std::istream* input_file )",
"%*",
" {",
" if ( ! yy_current_buffer )",
@@ -1135,7 +1134,7 @@ const char *skel[] = {
"int size;",
"#endif",
"%+",
- "YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )",
+ "YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )",
"%*",
" {",
" YY_BUFFER_STATE b;",
@@ -1196,7 +1195,7 @@ const char *skel[] = {
"#endif",
"",
"%+",
- "void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )",
+ "void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )",
"%*",
"",
" {",
@@ -1440,7 +1439,7 @@ const char *skel[] = {
"",
"void yyFlexLexer::LexerError( yyconst char msg[] )",
" {",
- " cerr << msg << '\\n';",
+ " std::cerr << msg << '\\n';",
" exit( YY_EXIT_FAILURE );",
" }",
"%*",
flex-2.5.4a2-warn.patch:
flex.skl | 10 ++++++++++
skel.c | 10 ++++++++++
2 files changed, 20 insertions(+)
--- NEW FILE flex-2.5.4a2-warn.patch ---
diff -Burp flex-2.5.4/flex.skl flex-2.5.4-new/flex.skl
--- flex-2.5.4/flex.skl 2006-01-13 17:00:08.000000000 +0100
+++ flex-2.5.4-new/flex.skl 2006-01-13 17:02:17.000000000 +0100
@@ -1536,3 +1536,13 @@ int main()
return 0;
}
#endif
+
+/* Some people want warning-free code, and under certain #define
+ conditions, gcc will warn for unusedness of some functions. This
+ function is provided merely to silent these warnings. It's not
+ static itself, so it will clutter exports, but it has at least
+ urandom name so that clashes won't occur.*/
+void _yy_dummy_uses_of_static_functions_b2f4_517d_02ff_b30c_3e5a_47d7_aaa3_3b5d_()
+{
+ yy_flex_realloc ((void*)0, 0);
+}
diff -Burp flex-2.5.4/skel.c flex-2.5.4-new/skel.c
--- flex-2.5.4/skel.c 2006-01-13 17:00:08.000000000 +0100
+++ flex-2.5.4-new/skel.c 2006-01-13 17:02:28.000000000 +0100
@@ -1541,5 +1541,15 @@ const char *skel[] = {
" return 0;",
" }",
"#endif",
+ "",
+ "/* Some people want warning-free code, and under certain #define",
+ " conditions, gcc will warn for unusedness of some functions. This",
+ " function is provided merely to silent these warnings. It's not",
+ " static itself, so it will clutter exports, but it has at least",
+ " urandom name so that clashes won't occur.*/",
+ "void _yy_dummy_uses_of_static_functions_b2f4_517d_02ff_b30c_3e5a_47d7_aaa3_3b5d_()",
+ "{",
+ " yy_flex_realloc ((void*)0, 0);",
+ "}",
0
};
Index: flex.spec
===================================================================
RCS file: /cvs/dist/rpms/flex/devel/flex.spec,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- flex.spec 18 Dec 2005 20:38:47 -0000 1.17
+++ flex.spec 13 Jan 2006 16:18:07 -0000 1.18
@@ -1,19 +1,20 @@
Summary: A tool for creating scanners (text pattern recognizers).
Name: flex
Version: 2.5.4a
-Release: 34.3
+Release: 35
License: BSD
Group: Development/Tools
+URL: http://www.gnu.org/software/flex/
BuildRoot: %{_tmppath}/%{name}-root
-
Source: ftp://ftp.gnu.org/non-gnu/flex/flex-2.5.4a.tar.gz
-
Patch0: flex-2.5.4a-skel.patch
Patch1: flex-2.5.4-glibc22.patch
Patch2: flex-2.5.4a-gcc3.patch
Patch3: flex-2.5.4a-gcc31.patch
Patch4: flex-2.5.4a2.patch
Patch5: flex-pic.patch
+Patch6: flex-2.5.4a2-std.patch
+Patch7: flex-2.5.4a2-warn.patch
BuildRequires: autoconf, byacc
%description
@@ -38,6 +39,8 @@
%patch3 -p1 -b .gcc31
%patch4 -p1 -b .yynoinput
%patch5 -p1 -b .pic
+%patch6 -p1 -b .std
+%patch7 -p1 -b .warn
%build
autoconf
@@ -71,8 +74,13 @@
%{_includedir}/FlexLexer.h
%changelog
+* Fri Jan 13 2006 Petr Machata <pmachata at redhat.com> 2.5.4a-35
+- Adding `std::' prefixes, got rid of `using namespace std'. (#115354)
+- Dummy use of `yy_flex_realloc' to silent warnings. (#30943)
+- Adding URL of flex home page to spec (#142675)
+
* Sun Dec 18 2005 Jason Vas Dias<jvdias at redhat.com>
-* rebuild with 'flex-pic.patch' to enable -pie links
+- rebuild with 'flex-pic.patch' to enable -pie links
on x86_64 (patch from Jesse Keating) .
* Fri Dec 09 2005 Jesse Keating <jkeating at redhat.com>
More information about the fedora-cvs-commits
mailing list