Patches by Stefan Huehner: "code cleanup: void 5, static 4" and a slightly modified "doxy 1"

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@717 4a71c877-e1ca-e34f-864e-861f7616d084
master
Dennis Schridde 2006-09-16 17:41:40 +00:00
parent a88bbc0c37
commit 75af155bbf
5 changed files with 38 additions and 35 deletions

View File

@ -21,7 +21,6 @@ static SDWORD cLine;
static char *pCFile;
static char pCFileNone[] = "None";
/* Store the location in C code at which a call to the heap was made */
void treapSetCallPos(const char *pFileName, SDWORD lineNumber)
{
cLine = lineNumber;
@ -67,11 +66,6 @@ SDWORD treapStringCmp(UDWORD key1, UDWORD key2)
}
/* Function to create a treap
* Pass in key comparison function,
* initial number of nodes to allocate,
* number of additional nodes to allocate when extending.
*/
BOOL treapCreate(TREAP **ppsTreap, TREAP_CMP cmp, UDWORD init, UDWORD ext)
{
*ppsTreap = (TREAP*)MALLOC(sizeof(TREAP));

View File

@ -77,16 +77,25 @@ typedef struct _treap
/* These should not be called directly - use the macros below */
/* Store the location in C code at which a call to the heap was made */
/**
* Store the location in C code at which a call to the heap was made
*
* \param pFileName source filename
* \param lineNumber source file line number
*/
extern void treapSetCallPos(const char *pFileName, SDWORD lineNumber);
/* Function type for object equality */
//typedef BOOL (*TREAP_EQUAL)(void *pObj1, void *pObj2);
/* Function to create a treap
* Pass in key comparison function
* Initial number of nodes to allocate
* Number of additional nodes to allocate when extending
/**
* Function to create a treap
*
* \param ppsTreap out-parameter which holds the created treap
* \param cmp comparison function to use
* \param init initial number of nodes to allocate
* \param ext number of additional nodes to allocate when extending
* \return true, if the treap creation was successfull
*/
extern BOOL treapCreate(TREAP **ppsTreap, TREAP_CMP cmp, UDWORD init, UDWORD ext);

View File

@ -14,7 +14,7 @@
static PHYSFS_file *pFileHandle;
BOOL NETstartLogging()
BOOL NETstartLogging(void)
{
time_t aclock;
struct tm *newtime;
@ -33,7 +33,7 @@ BOOL NETstartLogging()
return TRUE;
}
BOOL NETstopLogging()
BOOL NETstopLogging(void)
{
if (!PHYSFS_close(pFileHandle))
{

View File

@ -1,3 +1,3 @@
BOOL NETstartLogging();
BOOL NETstopLogging();
BOOL NETstartLogging(void);
BOOL NETstopLogging(void);
BOOL NETlogEntry( CHAR *str, UDWORD a, UDWORD b );

View File

@ -669,7 +669,7 @@ static UDWORD _baseOffset;
/* Generate the code for a function call, checking the parameter
* types match.
*/
CODE_ERROR scriptCodeFunction(FUNC_SYMBOL *psFSymbol, // The function being called
static CODE_ERROR scriptCodeFunction(FUNC_SYMBOL *psFSymbol, // The function being called
PARAM_BLOCK *psPBlock, // The functions parameters
BOOL expContext, // Whether the function is being
// called in an expression context
@ -765,7 +765,7 @@ CODE_ERROR scriptCodeFunction(FUNC_SYMBOL *psFSymbol, // The function being ca
/* Function call: Check the parameter types match, assumes param count matched */
UDWORD checkFuncParamTypes(EVENT_SYMBOL *psFSymbol, // The function being called
static UDWORD checkFuncParamTypes(EVENT_SYMBOL *psFSymbol, // The function being called
PARAM_BLOCK *psPBlock) // The generated code block
{
UDWORD size, i, *ip;
@ -796,7 +796,7 @@ UDWORD checkFuncParamTypes(EVENT_SYMBOL *psFSymbol, // The function being call
/*
* function call
*/
CODE_ERROR scriptCodeCallFunction(FUNC_SYMBOL *psFSymbol, // The function being called
static CODE_ERROR scriptCodeCallFunction(FUNC_SYMBOL *psFSymbol, // The function being called
PARAM_BLOCK *psPBlock, // The functions parameters
CODE_BLOCK **ppsCBlock) // The generated code block
{
@ -838,7 +838,7 @@ CODE_ERROR scriptCodeCallFunction(FUNC_SYMBOL *psFSymbol, // The function being
/* Generate the code for a parameter callback, checking the parameter
* types match.
*/
CODE_ERROR scriptCodeCallbackParams(
static CODE_ERROR scriptCodeCallbackParams(
CALLBACK_SYMBOL *psCBSymbol, // The callback being called
PARAM_BLOCK *psPBlock, // The callbacks parameters
TRIGGER_DECL **ppsTDecl) // The generated code block
@ -907,7 +907,7 @@ CODE_ERROR scriptCodeCallbackParams(
/* Generate code for assigning a value to a variable */
CODE_ERROR scriptCodeAssignment(VAR_SYMBOL *psVariable, // The variable to assign to
static CODE_ERROR scriptCodeAssignment(VAR_SYMBOL *psVariable, // The variable to assign to
CODE_BLOCK *psValue, // The code for the value to
// assign
CODE_BLOCK **ppsBlock) // Generated code
@ -970,7 +970,7 @@ CODE_ERROR scriptCodeAssignment(VAR_SYMBOL *psVariable, // The variable to assig
/* Generate code for assigning a value to an object variable */
CODE_ERROR scriptCodeObjAssignment(OBJVAR_BLOCK *psVariable,// The variable to assign to
static CODE_ERROR scriptCodeObjAssignment(OBJVAR_BLOCK *psVariable,// The variable to assign to
CODE_BLOCK *psValue, // The code for the value to
// assign
CODE_BLOCK **ppsBlock) // Generated code
@ -1018,7 +1018,7 @@ CODE_ERROR scriptCodeObjAssignment(OBJVAR_BLOCK *psVariable,// The variable to a
/* Generate code for getting a value from an object variable */
CODE_ERROR scriptCodeObjGet(OBJVAR_BLOCK *psVariable,// The variable to get from
static CODE_ERROR scriptCodeObjGet(OBJVAR_BLOCK *psVariable,// The variable to get from
CODE_BLOCK **ppsBlock) // Generated code
{
ASSERT( PTRVALID(psVariable, sizeof(OBJVAR_BLOCK)),
@ -1057,7 +1057,7 @@ CODE_ERROR scriptCodeObjGet(OBJVAR_BLOCK *psVariable,// The variable to get from
/* Generate code for assigning a value to an array variable */
CODE_ERROR scriptCodeArrayAssignment(ARRAY_BLOCK *psVariable,// The variable to assign to
static CODE_ERROR scriptCodeArrayAssignment(ARRAY_BLOCK *psVariable,// The variable to assign to
CODE_BLOCK *psValue, // The code for the value to
// assign
CODE_BLOCK **ppsBlock) // Generated code
@ -1120,7 +1120,7 @@ CODE_ERROR scriptCodeArrayAssignment(ARRAY_BLOCK *psVariable,// The variable to
/* Generate code for getting a value from an array variable */
CODE_ERROR scriptCodeArrayGet(ARRAY_BLOCK *psVariable,// The variable to get from
static CODE_ERROR scriptCodeArrayGet(ARRAY_BLOCK *psVariable,// The variable to get from
CODE_BLOCK **ppsBlock) // Generated code
{
// SDWORD elementDWords, i;
@ -1174,7 +1174,7 @@ CODE_ERROR scriptCodeArrayGet(ARRAY_BLOCK *psVariable,// The variable to get fro
/* Generate the final code block for conditional statements */
CODE_ERROR scriptCodeConditional(
static CODE_ERROR scriptCodeConditional(
COND_BLOCK *psCondBlock, // The intermediate conditional code
CODE_BLOCK **ppsBlock) // The final conditional code
{
@ -1214,7 +1214,7 @@ CODE_ERROR scriptCodeConditional(
}
/* Generate code for function parameters */
CODE_ERROR scriptCodeParameter(CODE_BLOCK *psParam, // Code for the parameter
static CODE_ERROR scriptCodeParameter(CODE_BLOCK *psParam, // Code for the parameter
INTERP_TYPE type, // Parameter type
PARAM_BLOCK **ppsBlock) // Generated code
{
@ -1239,7 +1239,7 @@ CODE_ERROR scriptCodeParameter(CODE_BLOCK *psParam, // Code for the parameter
/* Generate code for binary operators (e.g. 2 + 2) */
CODE_ERROR scriptCodeBinaryOperator(CODE_BLOCK *psFirst, // Code for first parameter
static CODE_ERROR scriptCodeBinaryOperator(CODE_BLOCK *psFirst, // Code for first parameter
CODE_BLOCK *psSecond, // Code for second parameter
OPCODE opcode, // Operator function
CODE_BLOCK **ppsBlock) // Generated code
@ -1263,7 +1263,7 @@ CODE_ERROR scriptCodeBinaryOperator(CODE_BLOCK *psFirst, // Code for first param
/* check if the arguments in the function definition body match the argument types
and names from function declaration (if there was any) */
BOOL checkFuncParamType(SDWORD argIndex, SDWORD argType)
static BOOL checkFuncParamType(SDWORD argIndex, SDWORD argType)
{
VAR_SYMBOL *psCurr;
SDWORD i,j;
@ -1311,7 +1311,7 @@ BOOL checkFuncParamType(SDWORD argIndex, SDWORD argType)
* stored with the code for the object value so that this block can be used for
* both setting and retrieving an object value.
*/
CODE_ERROR scriptCodeObjectVariable(CODE_BLOCK *psObjCode, // Code for the object value
static CODE_ERROR scriptCodeObjectVariable(CODE_BLOCK *psObjCode, // Code for the object value
VAR_SYMBOL *psVar, // The object variable symbol
OBJVAR_BLOCK **ppsBlock) // Generated code
{
@ -1346,7 +1346,7 @@ CODE_ERROR scriptCodeObjectVariable(CODE_BLOCK *psObjCode, // Code for the objec
* stored with the code for the object value so that this block can be used for
* both setting and retrieving an array value.
*/
CODE_ERROR scriptCodeArrayVariable(ARRAY_BLOCK *psArrayCode, // Code for the array index
static CODE_ERROR scriptCodeArrayVariable(ARRAY_BLOCK *psArrayCode, // Code for the array index
VAR_SYMBOL *psVar, // The array variable symbol
ARRAY_BLOCK **ppsBlock) // Generated code
{
@ -1381,7 +1381,7 @@ CODE_ERROR scriptCodeArrayVariable(ARRAY_BLOCK *psArrayCode, // Code for the arr
/* Generate code for a constant */
CODE_ERROR scriptCodeConstant(CONST_SYMBOL *psConst, // The object variable symbol
static CODE_ERROR scriptCodeConstant(CONST_SYMBOL *psConst, // The object variable symbol
CODE_BLOCK **ppsBlock) // Generated code
{
ASSERT( psConst != NULL,
@ -1419,7 +1419,7 @@ CODE_ERROR scriptCodeConstant(CONST_SYMBOL *psConst, // The object variable symb
/* Generate code for getting a variables value */
CODE_ERROR scriptCodeVarGet(VAR_SYMBOL *psVariable, // The object variable symbol
static CODE_ERROR scriptCodeVarGet(VAR_SYMBOL *psVariable, // The object variable symbol
CODE_BLOCK **ppsBlock) // Generated code
{
SDWORD size;
@ -1470,7 +1470,7 @@ CODE_ERROR scriptCodeVarGet(VAR_SYMBOL *psVariable, // The object variable symb
/* Generate code for getting a variables value */
CODE_ERROR scriptCodeVarRef(VAR_SYMBOL *psVariable, // The object variable symbol
static CODE_ERROR scriptCodeVarRef(VAR_SYMBOL *psVariable, // The object variable symbol
PARAM_BLOCK **ppsBlock) // Generated code
{
SDWORD size;
@ -1514,7 +1514,7 @@ CODE_ERROR scriptCodeVarRef(VAR_SYMBOL *psVariable, // The object variable symb
/* Generate the code for a trigger and store it in the trigger list */
CODE_ERROR scriptCodeTrigger(STRING *pIdent, CODE_BLOCK *psCode)
static CODE_ERROR scriptCodeTrigger(STRING *pIdent, CODE_BLOCK *psCode)
{
CODE_BLOCK *psNewBlock;
UDWORD line;
@ -1553,7 +1553,7 @@ CODE_ERROR scriptCodeTrigger(STRING *pIdent, CODE_BLOCK *psCode)
/* Generate the code for an event and store it in the event list */
CODE_ERROR scriptCodeEvent(EVENT_SYMBOL *psEvent, TRIGGER_SYMBOL *psTrig, CODE_BLOCK *psCode)
static CODE_ERROR scriptCodeEvent(EVENT_SYMBOL *psEvent, TRIGGER_SYMBOL *psTrig, CODE_BLOCK *psCode)
{
CODE_BLOCK *psNewBlock;
UDWORD line;