PUD: fold getNodeIdNumberForOlsrCache into setPositionUpdateNodeInfo
authorFerry Huberts <f.huberts@mindef.nl>
Wed, 26 Oct 2011 11:44:13 +0000 (13:44 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 14 Feb 2012 13:32:57 +0000 (14:32 +0100)
Signed-off-by: Ferry Huberts <f.huberts@mindef.nl>
lib/pud/wireformat/src/wireFormat.c

index d373607..fec5496 100644 (file)
@@ -39,19 +39,6 @@ static unsigned char cachedNodeIdBuffer[PUD_CACHED_NODEID_BUFFER_SIZE];
 /** The number of bytes stored in cachedNodeIdBuffer */
 static unsigned int cachedNodeIdBufferLength = 0;
 
-/**
- @param nodeId
- A pointer to the location in which to store a pointer to the nodeId cache
- buffer
- @param nodeIdSize
- A pointer to the location in which to store the number of bytes in the buffer
- */
-static inline void getNodeIdNumberForOlsrCache(unsigned char ** nodeId,
-               unsigned int * nodeIdSize) {
-       *nodeId = &cachedNodeIdBuffer[0];
-       *nodeIdSize = cachedNodeIdBufferLength;
-}
-
 /**
  Check a nodeId number for validity and if valid set it up in the
  cachedNodeIdBuffer. The valid range for the number is [min, max].
@@ -363,7 +350,8 @@ size_t setPositionUpdateNodeInfo(int ipVersion,
        case PUD_NODEIDTYPE_192:
        case PUD_NODEIDTYPE_193:
        case PUD_NODEIDTYPE_194:
-               getNodeIdNumberForOlsrCache(&buffer, &length);
+               buffer = &cachedNodeIdBuffer[0];
+               length = cachedNodeIdBufferLength;
                setPositionUpdateNodeId(olsrGpsMessage, buffer, length, false);
                break;