[Olsr-cvs] olsrd-current/src interfaces.c, 1.34, 1.35 interfaces.h, 1.42, 1.43
Bernd Petrovitsch
(spam-protected)
Sat Oct 13 14:09:13 CEST 2007
Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26478/src
Modified Files:
interfaces.c interfaces.h
Log Message:
* cleanup: const'ified parameters and reduced duplicated code
Index: interfaces.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** interfaces.c 5 Sep 2007 16:17:36 -0000 1.34
--- interfaces.c 13 Oct 2007 12:09:11 -0000 1.35
***************
*** 319,323 ****
*/
struct interface *
! if_ifwithindex(int if_index)
{
struct interface *ifp = ifnet;
--- 319,323 ----
*/
struct interface *
! if_ifwithindex(const int if_index)
{
struct interface *ifp = ifnet;
***************
*** 339,353 ****
*@return "" or interface name.
*/
! char *
! if_ifwithindex_name(int if_index)
{
! struct interface *ifp = ifnet;
! while (ifp)
! {
! if (ifp->if_index == if_index)
! return ifp->int_name;
! ifp = ifp->int_next;
! }
! return "void";
}
--- 339,347 ----
*@return "" or interface name.
*/
! const char *
! if_ifwithindex_name(const int if_index)
{
! const struct interface * const ifp = if_ifwithindex(if_index);
! return ifp == NULL ? "void" : ifp->int_name;
}
Index: interfaces.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** interfaces.h 5 Sep 2007 16:17:36 -0000 1.42
--- interfaces.h 13 Oct 2007 12:09:11 -0000 1.43
***************
*** 213,220 ****
struct interface *
! if_ifwithindex(int if_index);
! char *
! if_ifwithindex_name(int if_index);
struct olsr_if *
--- 213,220 ----
struct interface *
! if_ifwithindex(const int if_index);
! const char *
! if_ifwithindex_name(const int if_index);
struct olsr_if *
More information about the Olsr-cvs
mailing list