PUD: store nodeIdNumber as nodeIdNumberType
authorFerry Huberts <f.huberts@mindef.nl>
Wed, 26 Oct 2011 09:43:26 +0000 (11:43 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 14 Feb 2012 13:32:56 +0000 (14:32 +0100)
Signed-off-by: Ferry Huberts <f.huberts@mindef.nl>
lib/pud/src/configuration.c
lib/pud/src/configuration.h

index af97218..39873ea 100644 (file)
@@ -214,7 +214,7 @@ static size_t nodeIdLength = 0;
 static bool nodeIdSet = false;
 
 /** The nodeId as a nuber */
-static unsigned long long nodeIdNumber = 0;
+static nodeIdNumberType nodeIdNumber;
 
 /** True when the nodeIdNumber is set */
 static bool nodeIdNumberSet = false;
@@ -234,14 +234,15 @@ unsigned char * getNodeId(void) {
  - true on success
  - false otherwise
  */
-bool getNodeIdAsNumber(unsigned long long * value) {
+static bool getNodeIdAsNumber(unsigned long long * value) {
        if (!nodeIdNumberSet) {
-               if (!readULL(PUD_NODE_ID_NAME, (char *) &nodeId[0], &nodeIdNumber)) {
+               if (!readULL(PUD_NODE_ID_NAME, (char *) &nodeId[0],
+                               &nodeIdNumber.val)) {
                        return false;
                }
                nodeIdNumberSet = true;
        }
-       *value = nodeIdNumber;
+       *value = nodeIdNumber.val;
        return true;
 }
 
index 0ed47b0..c02392d 100644 (file)
@@ -32,7 +32,6 @@ int setNodeIdType(const char *value, void *data,
 #define PUD_NODE_ID_NAME                                               "nodeId"
 
 unsigned char * getNodeId(void);
-bool getNodeIdAsNumber(unsigned long long * value);
 unsigned char * getNodeIdWithLength(size_t *length);
 int setNodeId(const char *value, void *data, set_plugin_parameter_addon addon);