aboutsummaryrefslogtreecommitdiff
path: root/src/helper
diff options
context:
space:
mode:
authorzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-23 22:42:03 +0000
committerzwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-06-23 22:42:03 +0000
commit3813fda44adcea486b7308423a699f63d79273ee (patch)
treef515b454cfaea4806d0d307c1d19f1e3081482d1 /src/helper
parentaea6815462d3302f7f8b6576f59320d5f5985642 (diff)
- Fixes '==' whitespace
- Replace ')\(==\)\(\w\)' with ') \1 \2'. - Replace '\(\w\)\(==\)\(\w\)' with '\1 \2 \3'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2371 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper')
-rw-r--r--src/helper/binarybuffer.h4
-rw-r--r--src/helper/command.c16
-rw-r--r--src/helper/configuration.c2
-rw-r--r--src/helper/ioutil.c12
-rw-r--r--src/helper/jim.c12
-rw-r--r--src/helper/jim.h2
6 files changed, 24 insertions, 24 deletions
diff --git a/src/helper/binarybuffer.h b/src/helper/binarybuffer.h
index d1fcd8b9..d07a15a1 100644
--- a/src/helper/binarybuffer.h
+++ b/src/helper/binarybuffer.h
@@ -32,7 +32,7 @@
/* inlining this will help show what fn that is taking time during profiling. */
static inline void buf_set_u32(uint8_t* buffer, unsigned int first, unsigned int num, uint32_t value)
{
- if ((num==32) && (first==0))
+ if ((num == 32) && (first == 0))
{
buffer[3]=(value >> 24)&0xff;
buffer[2]=(value >> 16)&0xff;
@@ -53,7 +53,7 @@ static inline void buf_set_u32(uint8_t* buffer, unsigned int first, unsigned int
}
static inline uint32_t buf_get_u32(const uint8_t* buffer, unsigned int first, unsigned int num)
{
- if ((num==32) && (first==0))
+ if ((num == 32) && (first == 0))
{
return (((uint32_t)buffer[3]) << 24)|(((uint32_t)buffer[2]) << 16)|(((uint32_t)buffer[1]) << 8)|(((uint32_t)buffer[0]) << 0);
} else
diff --git a/src/helper/command.c b/src/helper/command.c
index f474756a..e8391054 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -94,9 +94,9 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
* to the fn and fish it out manually.
*/
c = interp->cmdPrivData;
- if (c==NULL)
+ if (c == NULL)
{
- LOG_ERROR("BUG: interp->cmdPrivData==NULL");
+ LOG_ERROR("BUG: interp->cmdPrivData == NULL");
return JIM_ERR;
}
target_call_timer_callbacks_now();
@@ -157,7 +157,7 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
*return_retval = retval;
}
- return (retval==ERROR_OK)?JIM_OK:JIM_ERR;
+ return (retval == ERROR_OK)?JIM_OK:JIM_ERR;
}
/* nice short description of source file */
@@ -212,7 +212,7 @@ command_t* register_command(command_context_t *context, command_t *parent, char
}
/* just a placeholder, no handler */
- if (c->handler==NULL)
+ if (c->handler == NULL)
return c;
/* If this is a two level command, e.g. "flash banks", then the
@@ -478,7 +478,7 @@ int command_run_line(command_context_t *context, char *line)
/* We do not print the connection closed error message */
Jim_PrintErrorMessage(interp);
}
- if (retval==ERROR_OK)
+ if (retval == ERROR_OK)
{
/* It wasn't a low level OpenOCD command that failed */
return ERROR_FAIL;
@@ -745,7 +745,7 @@ command_context_t* command_init()
#if !BUILD_ECOSBOARD
Jim_EventLoopOnLoad(interp);
#endif
- if (Jim_Eval_Named(interp, startup_tcl, "embedded:startup.tcl",1)==JIM_ERR)
+ if (Jim_Eval_Named(interp, startup_tcl, "embedded:startup.tcl",1) == JIM_ERR)
{
LOG_ERROR("Failed to run startup.tcl (embedded into OpenOCD compile time)");
Jim_PrintErrorMessage(interp);
@@ -812,7 +812,7 @@ int handle_fast_command(struct command_context_s *cmd_ctx, char *cmd, char **arg
if (argc != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
- fast_and_dangerous = strcmp("enable", args[0])==0;
+ fast_and_dangerous = strcmp("enable", args[0]) == 0;
return ERROR_OK;
}
@@ -856,7 +856,7 @@ long jim_global_long(const char *variable)
{
Jim_Obj *objPtr=Jim_GetGlobalVariableStr(interp, variable, JIM_ERRMSG);
long t;
- if (Jim_GetLong(interp, objPtr, &t)==JIM_OK)
+ if (Jim_GetLong(interp, objPtr, &t) == JIM_OK)
{
return t;
}
diff --git a/src/helper/configuration.c b/src/helper/configuration.c
index 2f9d8066..95b4c7e0 100644
--- a/src/helper/configuration.c
+++ b/src/helper/configuration.c
@@ -94,7 +94,7 @@ FILE *open_file_from_path (char *file, char *mode)
} else
{
char *full_path=find_file(file);
- if (full_path==NULL)
+ if (full_path == NULL)
return NULL;
FILE *fp = NULL;
fp = fopen(full_path, mode);
diff --git a/src/helper/ioutil.c b/src/helper/ioutil.c
index 4c09b779..8f02e2eb 100644
--- a/src/helper/ioutil.c
+++ b/src/helper/ioutil.c
@@ -84,7 +84,7 @@ int loadFile(const char *fileName, void **data, size_t *len)
FILE * pFile;
pFile = fopen(fileName,"rb");
- if (pFile==NULL)
+ if (pFile == NULL)
{
LOG_ERROR("Can't open %s\n", fileName);
return ERROR_FAIL;
@@ -111,7 +111,7 @@ int loadFile(const char *fileName, void **data, size_t *len)
return ERROR_FAIL;
}
*data = malloc(*len + 1);
- if (*data==NULL)
+ if (*data == NULL)
{
LOG_ERROR("Can't open %s\n", fileName);
fclose(pFile);
@@ -233,7 +233,7 @@ int handle_append_command(struct command_context_s *cmd_ctx, char *cmd,
break;
}
}
- if ((i==argc) && (fwrite("\n", 1, 1, config_file)==1))
+ if ((i == argc) && (fwrite("\n", 1, 1, config_file) == 1))
{
retval=ERROR_OK;
}
@@ -274,7 +274,7 @@ int handle_cp_command(struct command_context_s *cmd_ctx, char *cmd, char **args,
chunk = maxChunk;
}
- if ((retval==ERROR_OK) && (fwrite(((char *)data)+pos, 1, chunk, f) != chunk))
+ if ((retval == ERROR_OK) && (fwrite(((char *)data)+pos, 1, chunk, f) != chunk))
retval = ERROR_INVALID_ARGUMENTS;
if (retval != ERROR_OK)
@@ -363,7 +363,7 @@ void copydir(char *name, char *destdir)
DIR *dirp;
dirp = opendir(destdir);
- if (dirp==NULL)
+ if (dirp == NULL)
{
mkdir(destdir, 0777);
} else
@@ -477,7 +477,7 @@ zylinjtag_Jim_Command_ls(Jim_Interp *interp,
if (entry == NULL)
break;
- if ((strcmp(".", entry->d_name)==0)||(strcmp("..", entry->d_name)==0))
+ if ((strcmp(".", entry->d_name) == 0)||(strcmp("..", entry->d_name) == 0))
continue;
Jim_ListAppendElement(interp, objPtr, Jim_NewStringObj(interp, entry->d_name, strlen(entry->d_name)));
diff --git a/src/helper/jim.c b/src/helper/jim.c
index 9c862150..8e063608 100644
--- a/src/helper/jim.c
+++ b/src/helper/jim.c
@@ -198,7 +198,7 @@ static jim_wide JimStrtoll(const char *nptr, char **endptr, register int base)
* digit. For instance, if the range for quads is
* [-9223372036854775808..9223372036854775807] and the input base
* is 10, cutoff will be set to 922337203685477580 and cutlim to
- * either 7 (neg==0) or 8 (neg==1), meaning that if we have
+ * either 7 (neg == 0) or 8 (neg == 1), meaning that if we have
* accumulated a value > 922337203685477580, or equal but the
* next digit is > 7 (or 8), the number is too big, and we will
* return a range error.
@@ -503,7 +503,7 @@ int Jim_StringToDouble(const char *str, double *doublePtr)
static jim_wide JimPowWide(jim_wide b, jim_wide e)
{
jim_wide i, res = 1;
- if ((b==0 && e != 0) || (e<0)) return 0;
+ if ((b == 0 && e != 0) || (e<0)) return 0;
for (i=0; i<e; i++) {res *= b;}
return res;
}
@@ -568,7 +568,7 @@ void Jim_Panic(Jim_Interp *interp, const char *fmt, ...)
void *Jim_Alloc(int size)
{
/* We allocate zero length arrayes, etc. to use a single orthogonal codepath */
- if (size==0)
+ if (size == 0)
size=1;
void *p = malloc(size);
if (p == NULL)
@@ -583,7 +583,7 @@ void Jim_Free(void *ptr) {
void *Jim_Realloc(void *ptr, int size)
{
/* We allocate zero length arrayes, etc. to use a single orthogonal codepath */
- if (size==0)
+ if (size == 0)
size=1;
void *p = realloc(ptr, size);
if (p == NULL)
@@ -6959,7 +6959,7 @@ int Jim_EvalExpression(Jim_Interp *interp, Jim_Obj *exprObjPtr,
case JIM_EXPROP_GTE: wC = wA >= wB; break;
case JIM_EXPROP_LSHIFT: wC = wA << wB; break;
case JIM_EXPROP_RSHIFT: wC = wA >> wB; break;
- case JIM_EXPROP_NUMEQ: wC = wA==wB; break;
+ case JIM_EXPROP_NUMEQ: wC = wA == wB; break;
case JIM_EXPROP_NUMNE: wC = wA != wB; break;
case JIM_EXPROP_BITAND: wC = wA&wB; break;
case JIM_EXPROP_BITXOR: wC = wA^wB; break;
@@ -7062,7 +7062,7 @@ trydouble:
case JIM_EXPROP_GT: dC = dA>dB; break;
case JIM_EXPROP_LTE: dC = dA <= dB; break;
case JIM_EXPROP_GTE: dC = dA >= dB; break;
- case JIM_EXPROP_NUMEQ: dC = dA==dB; break;
+ case JIM_EXPROP_NUMEQ: dC = dA == dB; break;
case JIM_EXPROP_NUMNE: dC = dA != dB; break;
case JIM_EXPROP_LOGICAND_LEFT:
if (dA == 0) {
diff --git a/src/helper/jim.h b/src/helper/jim.h
index b7fae59c..3d3346c2 100644
--- a/src/helper/jim.h
+++ b/src/helper/jim.h
@@ -578,7 +578,7 @@ typedef struct Jim_Reference {
* An NVP Table is terminated with ".name=NULL".
*
* During the 'name2value' operation, if no matching string is found
- * the pointer to the terminal element (with p->name==NULL) is returned.
+ * the pointer to the terminal element (with p->name == NULL) is returned.
*
* Example:
* \code