Skip to content

Commit

Permalink
fix a build problem on ubuntu 20.04 (#57)
Browse files Browse the repository at this point in the history
* Fix the issue of the length of half time caused by slow_down_factor.

* update a point version number. official release 16.0.1

* fix a build problem on ubuntu 20.04 (#56)

* fix compiler warinigs related to the buffer size.

* fix compiler warnings caused by newer flex.

* fix a build problem caused by an illegal LDADD value.
  • Loading branch information
hidehisaakiyama authored Dec 1, 2021
1 parent dfd4209 commit e134e79
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ rcssserver_LDFLAGS = \
-L$(top_builddir)/rcssbase/gzip

rcssserver_LDADD = \
-lrcssclangparser \
librcssclangparser.la \
-lrcssconfparser \
-lrcssnet \
-lrcssgz \
Expand Down
4 changes: 3 additions & 1 deletion src/coach_lang_parser.ypp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ namespace
%}

/* BISON DECLARATIONS */
%pure-parser
/*%pure-parser*/
%define api.pure

%parse-param {rcss::clang::Parser::Param &param}
%lex-param {rcss::clang::Parser::Param &param}
Expand Down Expand Up @@ -985,6 +986,7 @@ void yyerror (rcss::clang::Parser::Param & /*param*/, const char*)

int yyerror (rcss::clang::Parser::Param &param, char* s)
{

yyerror ( param, (const char*)s );
return 0;
}
4 changes: 2 additions & 2 deletions src/dispsender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ DispSenderMonitorV1::sendMsg( const BoardType board,
dispinfo_t minfo;
minfo.mode = htons( MSG_MODE );
minfo.body.msg.board = htons( board );
std::strncpy( minfo.body.msg.message, msg, max_message_length_for_display );
std::strncpy( minfo.body.msg.message, msg, max_message_length_for_display - 1 );

transport().write( reinterpret_cast< const char * >( &minfo ),
sizeof( dispinfo_t ) );
Expand Down Expand Up @@ -411,7 +411,7 @@ DispSenderMonitorV2::sendMsg( const BoardType board,
dispinfo_t2 minfo;
minfo.mode = htons( MSG_MODE );
minfo.body.msg.board = htons( board );
std::strncpy( minfo.body.msg.message, msg, max_message_length_for_display );
std::strncpy( minfo.body.msg.message, msg, max_message_length_for_display - 1 );

transport().write( reinterpret_cast< char * >( &minfo ),
sizeof( dispinfo_t2 ) );
Expand Down
8 changes: 4 additions & 4 deletions src/monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,10 @@ Monitor::coach_check_ball()
bool
Monitor::coach_change_player_type( const char * command )
{
char teamname[128];
char teamname[16];
int unum, player_type;
if ( std::sscanf( command,
" ( change_player_type %127s %d %d ) ",
" ( change_player_type %15s %d %d ) ",
teamname, &unum, &player_type ) != 3 )
{
sendMsg( MSG_BOARD, "(error illegal_command_form)" );
Expand Down Expand Up @@ -766,8 +766,8 @@ Monitor::coach_change_player_type( const char * command )

M_stadium.substitute( player, player_type );

char buf[64];
snprintf( buf, 64,
char buf[128];
snprintf( buf, 127,
"(ok change_player_type %s %d %d)",
teamname, unum, player_type );

Expand Down
5 changes: 3 additions & 2 deletions src/player_command_parser.ypp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ namespace
%}

/* BISON DECLARATIONS */
%pure-parser
/*%pure-parser*/
%define api.pure

%parse-param {rcss::pcom::Parser::Param& param}
%lex-param {rcss::pcom::Parser::Param& param}
Expand Down Expand Up @@ -412,7 +413,7 @@ floating_point_number : RCSS_PCOM_INT
%%


void yyerror (rcss::pcom::Parser::Param& param, const char* s)
void yyerror (rcss::pcom::Parser::Param& /*param*/, const char* s)
{
std::cerr << s << std::endl;
//do nothing
Expand Down

0 comments on commit e134e79

Please sign in to comment.