summaryrefslogtreecommitdiff
path: root/lib/execute.c
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2006-08-29 18:04:11 +0000
committerStef Walter <stef@thewalter.net>2006-08-29 18:04:11 +0000
commitfd2e875c5fb0c7aa5e550d41dad4a6794df8d078 (patch)
tree2e20f50eb11d11ac72500c9d3897e8f8b602cc78 /lib/execute.c
parent9a41a6510a2aad8e0d07097c81f54c968b0fd99b (diff)
compiler warnings when compiling rep
Diffstat (limited to 'lib/execute.c')
-rw-r--r--lib/execute.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/execute.c b/lib/execute.c
index 0662849..5e67b5b 100644
--- a/lib/execute.c
+++ b/lib/execute.c
@@ -236,7 +236,7 @@ void* dataGetValue(data* dat, void* key)
struct dat* d;
ASSERT_PTR(dat);
- if(d = _dataFind(dat, key))
+ if((d = _dataFind(dat, key)))
return d->value;
return NULL;
@@ -252,7 +252,7 @@ bool dataSetValue(data* dat, void* key, void* value)
if(!_dataAllocate(dat))
return false;
- if(d = _dataFind(dat, key))
+ if((d = _dataFind(dat, key)))
{
d->value = value;
}
@@ -374,7 +374,7 @@ struct vari* _variablesFind(variables* vars, const char* name)
}
/* If not found then look up in the Environment */
- if(val = getenv(name))
+ if((val = getenv(name)))
return _variablesNew(vars, name, val, strlen(val));
return NULL;
@@ -442,7 +442,7 @@ bool variablesClear(variables* vars, const char* name)
{
struct vari* v;
ASSERT_PTR(vars);
- if(v = _variablesFind(vars, name))
+ if((v = _variablesFind(vars, name)))
starclr(v->value);
return true;
@@ -485,7 +485,7 @@ static char* _escapeString(const char* string)
while((pos += strcspn(string + pos, kSpecialChars)) < len)
cnt++, pos++;
- if(buff = (char*)malloc(sizeof(char) * (len + cnt + 1)))
+ if((buff = (char*)malloc(sizeof(char) * (len + cnt + 1))))
{
pos = 0;
strcpy(buff, string);
@@ -502,7 +502,6 @@ static char* _escapeString(const char* string)
int variablesSubstitute(variables* vars, r_stream* stream, r_script* script,
char** pstr, bool mode)
{
- size_t len = strlen(*pstr);
char* next = *pstr;
struct internal_state* state = stream->state;
@@ -584,7 +583,7 @@ int variablesSubstitute(variables* vars, r_stream* stream, r_script* script,
next[len] = 0;
/* Do we have this variable? */
- if(v = _variablesFind(vars, next + 1))
+ if((v = _variablesFind(vars, next + 1)))
value = v->value;
else
value = "\0\0";
@@ -638,7 +637,7 @@ int variablesSubstitute(variables* vars, r_stream* stream, r_script* script,
next = strrep(next, 0, starnext(value) ? "|" : "");
}
- while(value = starnext(value));
+ while((value = starnext(value)));
/* Add closing parentheses if needed */
next = strrep(next, 0, multi ? ")" : "");
@@ -683,7 +682,7 @@ bool variablesHasVars(const char* string)
{
const char* cur = string;
- if(cur = strchr(cur, '%'))
+ if((cur = strchr(cur, '%')))
{
if(!isEscaped(string, cur))
return true;
@@ -1109,7 +1108,6 @@ int vmExecute(r_stream* stream, r_script* script)
/* These are the registers passed to PCRE */
int pcreregs[MAX_REGS * 3];
- int num_regs = 0;
/* And over here we have the stack */
uint* vmStack = NULL;
@@ -1268,7 +1266,7 @@ int vmExecute(r_stream* stream, r_script* script)
* - We use the op header pointer as key to the pcre struct
* - And the pcre struct pointer as the key to the pcre_extra struct
*/
- if(re = (pcre*)dataGetValue(&(state->working), header))
+ if((re = (pcre*)dataGetValue(&(state->working), header)))
{
/* This prevents the freeing of stuff below */
cache = true;