Update of /cvsroot/playerstage/code/player/server/drivers/wifi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10946/server/drivers/wifi

Modified Files:
        .cvsignore aodv.cc linuxwifi.cc 
Log Message:
applied Toby's patch to replace fixed-size arrays

Index: .cvsignore
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/wifi/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** .cvsignore  17 Sep 2007 02:18:57 -0000      1.2
--- .cvsignore  1 Nov 2007 22:16:23 -0000       1.3
***************
*** 4,5 ****
--- 4,7 ----
  *.la
  *.a
+ .libs
+ *.lo

Index: aodv.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/wifi/aodv.cc,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** aodv.cc     23 Aug 2007 19:58:48 -0000      1.11
--- aodv.cc     1 Nov 2007 22:16:23 -0000       1.12
***************
*** 95,98 ****
--- 95,99 ----
    // File handle for the /proc file system entry
    protected: FILE *file;
+   player_wifi_data_t data;
  };
  
***************
*** 132,135 ****
--- 133,137 ----
      return -1;
    }
+   memset(&data, 0, sizeof(data));
    return 0;
  }
***************
*** 140,143 ****
--- 142,146 ----
  {
    fclose(this->file);
+   free(data.links);
    return 0;
  }
***************
*** 149,153 ****
    int n, link_count;
    player_wifi_link_t *link;
-   player_wifi_data_t data;
    char ip[16], next_ip[16];
    int seq, hop;
--- 152,155 ----
***************
*** 178,182 ****
      printf("aodv %s : %d\n", ip, level);
  
!     link = data.links + link_count++;
      strncpy((char*)link->ip, ip, sizeof(link->ip));
      //link->qual_type = PLAYER_WIFI_QUAL_UNKNOWN;
--- 180,192 ----
      printf("aodv %s : %d\n", ip, level);
  
!     if (link_count > data.links_count)
!     {
!       data.links = (player_wifi_link_t*)realloc(data.links, 
sizeof(data.links[0])*link_count);
!       data.links_count++;
!     }
!     assert(data.links);
!     link = &data.links[link_count];
!     link_count++;
! 
      strncpy((char*)link->ip, ip, sizeof(link->ip));
      //link->qual_type = PLAYER_WIFI_QUAL_UNKNOWN;
***************
*** 184,191 ****
      link->noise = (noise);
    }
-   data.links_count = (link_count);
  
    // Copy data to the server's buffer
!   Publish(device_addr, PLAYER_MSGTYPE_DATA, PLAYER_WIFI_DATA_STATE, &data, 
sizeof(data), NULL);
  
  
--- 194,200 ----
      link->noise = (noise);
    }
  
    // Copy data to the server's buffer
!   Publish(device_addr, PLAYER_MSGTYPE_DATA, PLAYER_WIFI_DATA_STATE, &data);
  
  

Index: linuxwifi.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/wifi/linuxwifi.cc,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** linuxwifi.cc        23 Aug 2007 19:58:48 -0000      1.18
--- linuxwifi.cc        1 Nov 2007 22:16:23 -0000       1.19
***************
*** 298,301 ****
--- 298,302 ----
    uint8_t mode = 0;
    player_wifi_data_t wifi_data;
+   player_wifi_link_t wifi_link;
    
    struct timeval curr;
***************
*** 424,427 ****
--- 425,429 ----
      
    wifi_data.links_count = 1;
+   wifi_data.links = &wifi_link;
    strncpy((char*)wifi_data.links[0].ip, "0.0.0.0", 
sizeof(wifi_data.links[0].ip));
    wifi_data.links[0].ip_count = sizeof(wifi_data.links[0].ip);


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to