[Olsr-cvs] olsrd-current/lib/txtinfo/src olsrd_plugin.c, 1.1, 1.2 olsrd_txtinfo.c, 1.2, 1.3

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


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

Modified Files:
	olsrd_plugin.c olsrd_txtinfo.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: olsrd_txtinfo.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/txtinfo/src/olsrd_txtinfo.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** olsrd_txtinfo.c	27 Mar 2007 03:59:27 -0000	1.2
--- olsrd_txtinfo.c	20 Apr 2007 13:46:04 -0000	1.3
***************
*** 102,120 ****
  ipc_action(int);
  
! static void inline
  ipc_print_neigh_link(void);
  
! static void inline
  ipc_print_routes(void);
  
! static void inline
  ipc_print_topology(void);
  
! static void inline
  ipc_print_hna(void);
  
  #define TXT_IPC_BUFSIZE 256
  static int 
! ipc_sendf(const char* format, ...);
  
  /**
--- 102,120 ----
  ipc_action(int);
  
! static void
  ipc_print_neigh_link(void);
  
! static void
  ipc_print_routes(void);
  
! static void
  ipc_print_topology(void);
  
! static void
  ipc_print_hna(void);
  
  #define TXT_IPC_BUFSIZE 256
  static int 
! ipc_sendf(const char* format, ...) __attribute__((format(printf, 1, 2)));
  
  /**
***************
*** 125,129 ****
   */
  int
! olsrd_plugin_init()
  {
    /* Initial IPC value */
--- 125,129 ----
   */
  int
! olsrd_plugin_init(void)
  {
    /* Initial IPC value */
***************
*** 140,144 ****
   */
  void
! olsr_plugin_exit()
  {
    if(ipc_open)
--- 140,144 ----
   */
  void
! olsr_plugin_exit(void)
  {
    if(ipc_open)
***************
*** 149,153 ****
  
  static int
! plugin_ipc_init()
  {
    struct sockaddr_in sin;
--- 149,153 ----
  
  static int
! plugin_ipc_init(void)
  {
    struct sockaddr_in sin;
***************
*** 281,285 ****
  }
  
! static void inline
  ipc_print_neigh_link(void)
  {
--- 281,285 ----
  }
  
! static void
  ipc_print_neigh_link(void)
  {
***************
*** 340,344 ****
  
  
! static void inline
  ipc_print_routes(void)
  {
--- 340,344 ----
  
  
! static void
  ipc_print_routes(void)
  {
***************
*** 384,388 ****
  }
  
! static void inline
  ipc_print_topology(void)
  {
--- 384,388 ----
  }
  
! static void
  ipc_print_topology(void)
  {
***************
*** 421,425 ****
  }
  
! static void inline
  ipc_print_hna(void)
  {
--- 421,425 ----
  }
  
! static void
  ipc_print_hna(void)
  {

Index: olsrd_plugin.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/txtinfo/src/olsrd_plugin.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** olsrd_plugin.c	31 Jan 2007 12:38:26 -0000	1.1
--- olsrd_plugin.c	20 Apr 2007 13:46:04 -0000	1.2
***************
*** 79,83 ****
   */
  static void
! my_init()
  {
    /* Print plugin info to stdout */
--- 79,83 ----
   */
  static void
! my_init(void)
  {
    /* Print plugin info to stdout */
***************
*** 97,101 ****
   */
  static void
! my_fini()
  {
    /* Calls the destruction function
--- 97,101 ----
   */
  static void
! my_fini(void)
  {
    /* Calls the destruction function
***************
*** 110,114 ****
  
  int 
! olsrd_plugin_interface_version()
  {
    return PLUGIN_INTERFACE_VERSION;
--- 110,114 ----
  
  int 
! olsrd_plugin_interface_version(void)
  {
    return PLUGIN_INTERFACE_VERSION;





More information about the Olsr-cvs mailing list