Update of /cvsroot/playerstage/code/player/utils/pmap
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2312
Modified Files:
logfile.cpp pmap_test.cpp
Log Message:
fixed logfile parser to really skip irrelevant lines
Index: pmap_test.cpp
===================================================================
RCS file: /cvsroot/playerstage/code/player/utils/pmap/pmap_test.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pmap_test.cpp 25 Apr 2006 19:24:41 -0000 1.1
--- pmap_test.cpp 24 Jan 2007 18:22:55 -0000 1.2
***************
*** 427,435 ****
while (1)
{
! if (logfile_read(logfile) != 0)
{
fprintf(stderr, "\n");
return -1;
}
if (start_time == 0.0 && logfile->dtime > 0.0)
--- 427,438 ----
while (1)
{
! int logresult = logfile_read(logfile);
! if (logresult < 0)
{
fprintf(stderr, "\n");
return -1;
}
+ else if(logresult > 0)
+ continue;
if (start_time == 0.0 && logfile->dtime > 0.0)
Index: logfile.cpp
===================================================================
RCS file: /cvsroot/playerstage/code/player/utils/pmap/logfile.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** logfile.cpp 12 Jul 2006 00:06:05 -0000 1.2
--- logfile.cpp 24 Jan 2007 18:22:55 -0000 1.3
***************
*** 78,86 ****
// Skip blank lines
if (self->token_count == 0)
! return 0;
// Discard comments
if (strcmp(self->tokens[0], "#") == 0 || strcmp(self->tokens[0], "##") == 0)
! return 0;
assert(self->token_count >= 3);
--- 78,86 ----
// Skip blank lines
if (self->token_count == 0)
! return 1;
// Discard comments
if (strcmp(self->tokens[0], "#") == 0 || strcmp(self->tokens[0], "##") == 0)
! return 1;
assert(self->token_count >= 3);
***************
*** 89,93 ****
// Skip sync packets
if (strcmp(self->interface, "sync") == 0)
! return 0;
assert(self->token_count >= 5);
--- 89,93 ----
// Skip sync packets
if (strcmp(self->interface, "sync") == 0)
! return 1;
assert(self->token_count >= 5);
***************
*** 107,111 ****
// Ignore anything but PLAYER_POSITION2D_DATA_STATE messages
if (atoi(self->tokens[5]) != 1 || atoi(self->tokens[6]) != 1)
! return 0;
assert(self->token_count >= 14);
self->position_pose[0] = atof(self->tokens[7]);
--- 107,111 ----
// Ignore anything but PLAYER_POSITION2D_DATA_STATE messages
if (atoi(self->tokens[5]) != 1 || atoi(self->tokens[6]) != 1)
! return 1;
assert(self->token_count >= 14);
self->position_pose[0] = atof(self->tokens[7]);
***************
*** 123,127 ****
// Ignore anything but PLAYER_LASER_DATA_SCAN messages
if (atoi(self->tokens[5]) != 1 || atoi(self->tokens[6]) != 1)
! return 0;
assert(self->token_count >= 13);
self->laser_range_count = atoi(self->tokens[12]);
--- 123,127 ----
// Ignore anything but PLAYER_LASER_DATA_SCAN messages
if (atoi(self->tokens[5]) != 1 || atoi(self->tokens[6]) != 1)
! return 1;
assert(self->token_count >= 13);
self->laser_range_count = atoi(self->tokens[12]);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit