[Olsr-cvs] olsrd-current/lib/bmf/src Address.c, 1.2, 1.3 Bmf.c, 1.2, 1.3 NetworkInterfaces.c, 1.3, 1.4 PacketHistory.c, 1.2, 1.3 olsrd_plugin.c, 1.2, 1.3

Bernd Petrovitsch (spam-protected)
Fri Apr 20 16:06:20 CEST 2007


Update of /cvsroot/olsrd/olsrd-current/lib/bmf/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7046/lib/bmf/src

Modified Files:
	Address.c Bmf.c NetworkInterfaces.c PacketHistory.c 
	olsrd_plugin.c 
Log Message:
cleanup, 1. step (to get some local changes away):
* killed lots of warnings
* added __attribure__((unused)) and __attribure__((format(printf, ..., ...)))
* added "const"
* moved declarations of static functions into .c files
* added "static" declarations
* removed all "inline" declarations. Usually the compiler knows better anyways.
* removed emtpy "return" statements at the end of functions
* localized declarations
* avoided unnecessary data copies
* removed lots of empty lines
There is much more to do.



Index: Address.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/bmf/src/Address.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Address.c	10 Feb 2007 17:05:55 -0000	1.2
--- Address.c	20 Apr 2007 14:06:17 -0000	1.3
***************
*** 129,133 ****
   * Assumption : len >= IP_HDR_OFFSET + GetIpHeaderLength(ethPkt)
   * ------------------------------------------------------------------------- */
! int IsOlsrOrBmfPacket(struct TBmfInterface* intf, unsigned char* ethPkt, size_t len)
  {
    struct ip* ipData;
--- 129,133 ----
   * Assumption : len >= IP_HDR_OFFSET + GetIpHeaderLength(ethPkt)
   * ------------------------------------------------------------------------- */
! int IsOlsrOrBmfPacket(struct TBmfInterface* intf __attribute__((unused)), unsigned char* ethPkt, size_t len)
  {
    struct ip* ipData;

Index: Bmf.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/bmf/src/Bmf.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Bmf.c	10 Feb 2007 17:05:55 -0000	1.2
--- Bmf.c	20 Apr 2007 14:06:17 -0000	1.3
***************
*** 1184,1188 ****
   * Data Used  : BmfThreadRunning
   * ------------------------------------------------------------------------- */
! static void BmfSignalHandler(int signo)
  {
    BmfThreadRunning = 0;
--- 1184,1188 ----
   * Data Used  : BmfThreadRunning
   * ------------------------------------------------------------------------- */
! static void BmfSignalHandler(int signo __attribute__((unused)))
  {
    BmfThreadRunning = 0;
***************
*** 1199,1203 ****
   *              a SIGALRM signal.
   * ------------------------------------------------------------------------- */
! static void* BmfRun(void* useless)
  {
    /* Mask all signals except SIGALRM */
--- 1199,1203 ----
   *              a SIGALRM signal.
   * ------------------------------------------------------------------------- */
! static void* BmfRun(void* useless __attribute__((unused)))
  {
    /* Mask all signals except SIGALRM */
***************
*** 1307,1311 ****
   * Data Used  : BmfThreadRunning, BmfThread
   * ------------------------------------------------------------------------- */
! void CloseBmf()
  {
    /* Signal BmfThread to exit */
--- 1307,1311 ----
   * Data Used  : BmfThreadRunning, BmfThread
   * ------------------------------------------------------------------------- */
! void CloseBmf(void)
  {
    /* Signal BmfThread to exit */

Index: NetworkInterfaces.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/bmf/src/NetworkInterfaces.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** NetworkInterfaces.c	11 Feb 2007 11:51:56 -0000	1.3
--- NetworkInterfaces.c	20 Apr 2007 14:06:17 -0000	1.4
***************
*** 1075,1079 ****
   * ------------------------------------------------------------------------- */
  
! void CloseBmfNetworkInterfaces()
  {
    int nClosed = 0;
--- 1075,1079 ----
   * ------------------------------------------------------------------------- */
  
! void CloseBmfNetworkInterfaces(void)
  {
    int nClosed = 0;

Index: PacketHistory.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/bmf/src/PacketHistory.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PacketHistory.c	10 Feb 2007 17:05:56 -0000	1.2
--- PacketHistory.c	20 Apr 2007 14:06:18 -0000	1.3
***************
*** 210,214 ****
   * Data Used  : PacketHistory
   * ------------------------------------------------------------------------- */
! void InitPacketHistory()
  {
    memset(PacketHistory, 0, sizeof(PacketHistory));
--- 210,214 ----
   * Data Used  : PacketHistory
   * ------------------------------------------------------------------------- */
! void InitPacketHistory(void)
  {
    memset(PacketHistory, 0, sizeof(PacketHistory));
***************
*** 278,282 ****
   * Data Used  : PacketHistory
   * ------------------------------------------------------------------------- */
! void PrunePacketHistory(void* useless)
  {
    uint i;
--- 278,282 ----
   * Data Used  : PacketHistory
   * ------------------------------------------------------------------------- */
! void PrunePacketHistory(void* useless __attribute__((unused)))
  {
    uint i;

Index: olsrd_plugin.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/bmf/src/olsrd_plugin.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** olsrd_plugin.c	10 Feb 2007 17:05:56 -0000	1.2
--- olsrd_plugin.c	20 Apr 2007 14:06:18 -0000	1.3
***************
*** 67,71 ****
   *              version
   * ------------------------------------------------------------------------- */
! int olsrd_plugin_interface_version()
  {
    return OLSRD_PLUGIN_INTERFACE_VERSION;
--- 67,71 ----
   *              version
   * ------------------------------------------------------------------------- */
! int olsrd_plugin_interface_version(void)
  {
    return OLSRD_PLUGIN_INTERFACE_VERSION;
***************
*** 81,85 ****
   * Notes      : Called by main OLSRD (init_olsr_plugin) to initialize plugin
   * ------------------------------------------------------------------------- */
! int olsrd_plugin_init()
  {
    /* Check validity */
--- 81,85 ----
   * Notes      : Called by main OLSRD (init_olsr_plugin) to initialize plugin
   * ------------------------------------------------------------------------- */
! int olsrd_plugin_init(void)
  {
    /* Check validity */
***************
*** 111,115 ****
   * Notes      : Called by my_fini() at unload of shared object
   * ------------------------------------------------------------------------- */
! void olsr_plugin_exit()
  {
    CloseBmf();
--- 111,115 ----
   * Notes      : Called by my_fini() at unload of shared object
   * ------------------------------------------------------------------------- */
! void olsr_plugin_exit(void)
  {
    CloseBmf();
***************
*** 142,146 ****
   * Notes      : Called at load of shared object
   * ------------------------------------------------------------------------- */
! static void my_init()
  {
    /* Print plugin info to stdout */
--- 142,146 ----
   * Notes      : Called at load of shared object
   * ------------------------------------------------------------------------- */
! static void my_init(void)
  {
    /* Print plugin info to stdout */
***************
*** 159,163 ****
   * Notes      : Called at unload of shared object
   * ------------------------------------------------------------------------- */
! static void my_fini()
  {
    olsr_plugin_exit();
--- 159,163 ----
   * Notes      : Called at unload of shared object
   * ------------------------------------------------------------------------- */
! static void my_fini(void)
  {
    olsr_plugin_exit();





More information about the Olsr-cvs mailing list