There are also more duplicate timer calc macros:

from include/net-snmp/library/tools.h

#define NETSNMP_TIMERADD(a, b, res)                  \
{                                                    \
     (res)->tv_sec  = (a)->tv_sec  + (b)->tv_sec;     \
     (res)->tv_usec = (a)->tv_usec + (b)->tv_usec;    \
     if ((res)->tv_usec >= 1000000L) {                \
         (res)->tv_usec -= 1000000L;                  \
         (res)->tv_sec++;                             \
     }                                                \
}

#define NETSNMP_TIMERSUB(a, b, res)                             \
{                                                               \
     (res)->tv_sec  = (a)->tv_sec  - (b)->tv_sec - 1;            \
     (res)->tv_usec = (a)->tv_usec - (b)->tv_usec + 1000000L;    \
     if ((res)->tv_usec >= 1000000L) {                           \
         (res)->tv_usec -= 1000000L;                             \
         (res)->tv_sec++;                                        \
     }                                                           \
}


On 22.01.2013, at 20:00, Claus Klein wrote:

> IMO these macros should be at a single header file only ones defined.
>
> claus-kleins-macbook-pro:net-snmp clausklein$ egrep 'timer[acis]\w+'  
> tags
> timeradd      perl/SNMP/perlsnmp.h    /^#define       timeradd(/;"    d
> timeradd      python/netsnmp/client_intf.c    /^#define       timeradd(/;"    
> d       file:
> timerclear    snmplib/snmp_api.c      /^#define       timerclear(/;"  d       
> file:
> timercmp      snmplib/snmp_api.c      /^#define       timercmp(/;"    d       
> file:
> timerisset    snmplib/snmp_api.c      /^#define       timerisset(/;"  d       
> file:
> timersub      perl/SNMP/perlsnmp.h    /^#define       timersub(/;"    d
> timersub      python/netsnmp/client_intf.c    /^#define       timersub(/;"    
> d       file:
> claus-kleins-macbook-pro:net-snmp clausklein$
>


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to