[Olsr-cvs] olsrd-current/lib/tas/src glua.c, 1.3, 1.4 lib.h, 1.2, 1.3 plugin.c, 1.7, 1.8

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


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

Modified Files:
	glua.c lib.h 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: glua.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/tas/src/glua.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** glua.c	15 Nov 2005 23:46:19 -0000	1.3
--- glua.c	20 Apr 2007 13:46:03 -0000	1.4
***************
*** 230,234 ****
  }
  
! static int luaWriter(lua_State *lua, const void *buff, int len, FILE *file)
  {
    return fwrite(buff, len, 1, file) == 1;
--- 230,234 ----
  }
  
! static int luaWriter(lua_State *lua __attribute__((unused)), const void *buff, int len, FILE *file)
  {
    return fwrite(buff, len, 1, file) == 1;

Index: plugin.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/tas/src/plugin.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** plugin.c	7 Jan 2006 08:17:45 -0000	1.7
--- plugin.c	20 Apr 2007 13:46:03 -0000	1.8
***************
*** 466,470 ****
  }
  
! int olsrd_plugin_init()
  {
    ipAddrLen = olsr_cnf->ipsize;
--- 466,470 ----
  }
  
! int olsrd_plugin_init(void)
  {
    ipAddrLen = olsr_cnf->ipsize;

Index: lib.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/tas/src/lib.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** lib.h	12 Apr 2005 19:57:26 -0000	1.2
--- lib.h	20 Apr 2007 13:46:03 -0000	1.3
***************
*** 41,44 ****
--- 41,47 ----
   */
  
+ #ifndef _OLSRD_TAS_LIB_H
+ #define _OLSRD_TAS_LIB_H
+ 
  #define DEBUG_MESSAGE 1
  #define DEBUG_SESSION 2
***************
*** 48,53 ****
  #define DEBUG_QUANTUM 32
  
! extern void error(char *form, ...);
! extern void debug(int facility, char *form, ...);
  extern char *strdupAdd(const char *string, int add);
  extern char *myStrdup(const char *string);
--- 51,56 ----
  #define DEBUG_QUANTUM 32
  
! extern void error(char *form, ...) __attribute__((format(printf,1,2)));
! extern void debug(int facility, char *form, ...) __attribute__((format(printf,2,3)));
  extern char *strdupAdd(const char *string, int add);
  extern char *myStrdup(const char *string);
***************
*** 55,56 ****
--- 58,61 ----
  extern char *intToString(char *buff, unsigned int val);
  extern int stringToInt(unsigned int *val, const char *buff);
+ 
+ #endif





More information about the Olsr-cvs mailing list