Fixed Makefile, Fixed Broken Inclusions, etc.
+- GeneralUtility.c +- HashUtility.c +- StateDataUtility.c +- Makefile for PA10
This commit is contained in:
parent
798858cf4e
commit
6969f405e3
4 changed files with 34 additions and 18 deletions
|
|
@ -1,5 +1,7 @@
|
|||
// header files
|
||||
#include "GeneralUtility.h"
|
||||
#include "StateDataUtility.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/* Data Structures
|
||||
typedef struct StateStruct
|
||||
|
|
@ -30,6 +32,13 @@ Dependencies: privateCopyString
|
|||
void setDataNodeFromData( StateDataType *nodePtr, const char *name,
|
||||
double avgTemp, double lowTemp, double highTemp, bool nodeState )
|
||||
{
|
||||
// copy the string into the node
|
||||
privateCopyString(nodePtr->name, name);
|
||||
// copy the rest of the data into the node
|
||||
nodePtr->averageTemp = avgTemp;
|
||||
nodePtr->highestTemp = highTemp;
|
||||
nodePtr->lowestTemp = lowTemp;
|
||||
nodePtr->inUse = nodeState;
|
||||
// no return, void.
|
||||
}
|
||||
|
||||
|
|
@ -48,6 +57,8 @@ Dependencies: setDataNodeFromData
|
|||
void setDataNodeFromStruct( StateDataType *nodePtr,
|
||||
const StateDataType source )
|
||||
{
|
||||
setDataNodeFromData(nodePtr, source.name, source.averageTemp,
|
||||
source.lowestTemp, source.highestTemp, source.inUse);
|
||||
// no return, void.
|
||||
}
|
||||
|
||||
|
|
@ -63,6 +74,9 @@ Dependencies: sprintf, or other options
|
|||
*/
|
||||
void stateDataToString( char *outStr, const StateDataType state )
|
||||
{
|
||||
// get the data out using sprintf
|
||||
sprintf(outStr, "%s, Avg: %0.2f, Low: %0.2f, High: %0.2f,", state.name,
|
||||
state.averageTemp, state.lowestTemp, state.highestTemp);
|
||||
// no return, void.
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue