Add "static" qualifier to private functions.
Function Jim_InterpolateTokens() is private, but has not
been changed to "static".
This function is called only once, so compiler inlines it.
After inline, there is a warning for variable uninitialized.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
-int JimStringCompare(const char *s1, int l1, const char *s2, int l2,
+static int JimStringCompare(const char *s1, int l1, const char *s2, int l2,
int nocase)
{
unsigned char *u1 = (unsigned char*) s1, *u2 = (unsigned char*) s2;
int nocase)
{
unsigned char *u1 = (unsigned char*) s1, *u2 = (unsigned char*) s2;
/* Search 's1' inside 's2', starting to search from char 'index' of 's2'.
* The index of the first occurrence of s1 in s2 is returned.
* If s1 is not found inside s2, -1 is returned. */
/* Search 's1' inside 's2', starting to search from char 'index' of 's2'.
* The index of the first occurrence of s1 in s2 is returned.
* If s1 is not found inside s2, -1 is returned. */
-int JimStringFirst(const char *s1, int l1, const char *s2, int l2, int index_t)
+static int JimStringFirst(const char *s1, int l1, const char *s2, int l2, int index_t)
-int Jim_WideToString(char *buf, jim_wide wideValue)
+static int Jim_WideToString(char *buf, jim_wide wideValue)
{
const char *fmt = "%" JIM_WIDE_MODIFIER;
return sprintf(buf, fmt, wideValue);
}
{
const char *fmt = "%" JIM_WIDE_MODIFIER;
return sprintf(buf, fmt, wideValue);
}
-int Jim_StringToWide(const char *str, jim_wide *widePtr, int base)
+static int Jim_StringToWide(const char *str, jim_wide *widePtr, int base)
-int Jim_StringToIndex(const char *str, int *intPtr)
+static int Jim_StringToIndex(const char *str, int *intPtr)
return JIM_REFERENCE_SPACE;
}
return JIM_REFERENCE_SPACE;
}
-int Jim_DoubleToString(char *buf, double doubleValue)
+static int Jim_DoubleToString(char *buf, double doubleValue)
-int Jim_StringToDouble(const char *str, double *doublePtr)
+static int Jim_StringToDouble(const char *str, double *doublePtr)
-void *Jim_Realloc(void *ptr, int size)
+static void *Jim_Realloc(void *ptr, int size)
{
/* We allocate zero length arrayes, etc. to use a single orthogonal codepath */
if (size == 0)
{
/* We allocate zero length arrayes, etc. to use a single orthogonal codepath */
if (size == 0)
-char *Jim_StrDupLen(const char *s, int l)
+static char *Jim_StrDupLen(const char *s, int l)
{
char *copy = Jim_Alloc(l + 1);
{
char *copy = Jim_Alloc(l + 1);
/* -------------------------- hash functions -------------------------------- */
/* Thomas Wang's 32 bit Mix Function */
/* -------------------------- hash functions -------------------------------- */
/* Thomas Wang's 32 bit Mix Function */
-unsigned int Jim_IntHashFunction(unsigned int key)
+static unsigned int Jim_IntHashFunction(unsigned int key)
{
key += ~(key << 15);
key ^= (key >> 10);
{
key += ~(key << 15);
key ^= (key >> 10);
/* Generic hash function (we are using to multiply by 9 and add the byte
* as Tcl) */
/* Generic hash function (we are using to multiply by 9 and add the byte
* as Tcl) */
-unsigned int Jim_GenHashFunction(const unsigned char *buf, int len)
+static unsigned int Jim_GenHashFunction(const unsigned char *buf, int len)
{
unsigned int h = 0;
while (len--)
{
unsigned int h = 0;
while (len--)
/* Initialize a parser context.
* 'prg' is a pointer to the program text, linenr is the line
* number of the first line contained in the program. */
/* Initialize a parser context.
* 'prg' is a pointer to the program text, linenr is the line
* number of the first line contained in the program. */
-void JimParserInit(struct JimParserCtx *pc, const char *prg,
+static void JimParserInit(struct JimParserCtx *pc, const char *prg,
int len, int linenr)
{
pc->prg = prg;
int len, int linenr)
{
pc->prg = prg;
static int JimParseListSep(struct JimParserCtx *pc);
static int JimParseListStr(struct JimParserCtx *pc);
static int JimParseListSep(struct JimParserCtx *pc);
static int JimParseListStr(struct JimParserCtx *pc);
-int JimParseList(struct JimParserCtx *pc)
+static int JimParseList(struct JimParserCtx *pc)
{
if (pc->len == 0) {
pc->tstart = pc->tend = pc->p;
{
if (pc->len == 0) {
pc->tstart = pc->tend = pc->p;
/* Low-level string append. Use it only against objects
* of type "string". */
/* Low-level string append. Use it only against objects
* of type "string". */
-void StringAppendString(Jim_Obj *objPtr, const char *str, int len)
+static void StringAppendString(Jim_Obj *objPtr, const char *str, int len)
return JimStringMatch(pattern, patternLen, string, stringLen, nocase);
}
return JimStringMatch(pattern, patternLen, string, stringLen, nocase);
}
-int Jim_StringCompareObj(Jim_Obj *firstObjPtr,
+static int Jim_StringCompareObj(Jim_Obj *firstObjPtr,
Jim_Obj *secondObjPtr, int nocase)
{
const char *s1, *s2;
Jim_Obj *secondObjPtr, int nocase)
{
const char *s1, *s2;
-int qsortCompareStringPointers(const void *a, const void *b)
+static int qsortCompareStringPointers(const void *a, const void *b)
{
char * const *sa = (char * const *)a;
char * const *sb = (char * const *)b;
{
char * const *sa = (char * const *)a;
char * const *sb = (char * const *)b;
-ScriptObj *Jim_GetScript(Jim_Interp *interp, Jim_Obj *objPtr)
+static ScriptObj *Jim_GetScript(Jim_Interp *interp, Jim_Obj *objPtr)
{
if (objPtr->typePtr != &scriptObjType) {
SetScriptFromAny(interp, objPtr);
{
if (objPtr->typePtr != &scriptObjType) {
SetScriptFromAny(interp, objPtr);
* object that is *guaranteed* to be in the form VARNAME(INDEX).
* The 'index' part is [subst]ituted, and is used to lookup a key inside
* the [dict]ionary contained in variable VARNAME. */
* object that is *guaranteed* to be in the form VARNAME(INDEX).
* The 'index' part is [subst]ituted, and is used to lookup a key inside
* the [dict]ionary contained in variable VARNAME. */
-Jim_Obj *Jim_ExpandDictSugar(Jim_Interp *interp, Jim_Obj *objPtr)
+static Jim_Obj *Jim_ExpandDictSugar(Jim_Interp *interp, Jim_Obj *objPtr)
{
Jim_Obj *varObjPtr, *keyObjPtr, *dictObjPtr, *resObjPtr;
Jim_Obj *substKeyObjPtr = NULL;
{
Jim_Obj *varObjPtr, *keyObjPtr, *dictObjPtr, *resObjPtr;
Jim_Obj *substKeyObjPtr = NULL;
-unsigned int JimReferencesHTHashFunction(const void *key)
+static unsigned int JimReferencesHTHashFunction(const void *key)
{
/* Only the least significant bits are used. */
const jim_wide *widePtr = key;
{
/* Only the least significant bits are used. */
const jim_wide *widePtr = key;
return intValue; /* identity function. */
}
return intValue; /* identity function. */
}
-const void *JimReferencesHTKeyDup(void *privdata, const void *key)
+static const void *JimReferencesHTKeyDup(void *privdata, const void *key)
{
void *copy = Jim_Alloc(sizeof(jim_wide));
JIM_NOTUSED(privdata);
{
void *copy = Jim_Alloc(sizeof(jim_wide));
JIM_NOTUSED(privdata);
-int JimReferencesHTKeyCompare(void *privdata, const void *key1,
+static int JimReferencesHTKeyCompare(void *privdata, const void *key1,
const void *key2)
{
JIM_NOTUSED(privdata);
const void *key2)
{
JIM_NOTUSED(privdata);
return memcmp(key1, key2, sizeof(jim_wide)) == 0;
}
return memcmp(key1, key2, sizeof(jim_wide)) == 0;
}
-void JimReferencesHTKeyDestructor(void *privdata, const void *key)
+static void JimReferencesHTKeyDestructor(void *privdata, const void *key)
-int SetReferenceFromAny(Jim_Interp *interp, Jim_Obj *objPtr)
+static int SetReferenceFromAny(Jim_Interp *interp, Jim_Obj *objPtr)
{
jim_wide wideValue;
int i, len;
{
jim_wide wideValue;
int i, len;
/* Returns the malloc-ed representation of a string
* using backslash to quote special chars. */
/* Returns the malloc-ed representation of a string
* using backslash to quote special chars. */
-char *BackslashQuoteString(const char *s, int len, int *qlenPtr)
+static char *BackslashQuoteString(const char *s, int len, int *qlenPtr)
{
char *q = Jim_Alloc(len*2 + 1), *p;
{
char *q = Jim_Alloc(len*2 + 1), *p;
*
* NOTE: this function can be called only against objects
* with internal type of List. */
*
* NOTE: this function can be called only against objects
* with internal type of List. */
-void ListInsertElements(Jim_Obj *listPtr, int index_t, int elemc,
+static void ListInsertElements(Jim_Obj *listPtr, int index_t, int elemc,
Jim_Obj *const *elemVec)
{
int currentLen = listPtr->internalRep.listValue.len;
Jim_Obj *const *elemVec)
{
int currentLen = listPtr->internalRep.listValue.len;
/* Appends every element of appendListPtr into listPtr.
* Both have to be of the list type. */
/* Appends every element of appendListPtr into listPtr.
* Both have to be of the list type. */
-void ListAppendList(Jim_Obj *listPtr, Jim_Obj *appendListPtr)
+static void ListAppendList(Jim_Obj *listPtr, Jim_Obj *appendListPtr)
{
int i, oldLen = listPtr->internalRep.listValue.len;
int appendLen = appendListPtr->internalRep.listValue.len;
{
int i, oldLen = listPtr->internalRep.listValue.len;
int appendLen = appendListPtr->internalRep.listValue.len;
/* Returns a list composed of the elements in the specified range.
* first and start are directly accepted as Jim_Objects and
* processed for the end?-index? case. */
/* Returns a list composed of the elements in the specified range.
* first and start are directly accepted as Jim_Objects and
* processed for the end?-index? case. */
-Jim_Obj *Jim_ListRange(Jim_Interp *interp, Jim_Obj *listObjPtr, Jim_Obj *firstObjPtr, Jim_Obj *lastObjPtr)
+static Jim_Obj *Jim_ListRange(Jim_Interp *interp, Jim_Obj *listObjPtr,
+ Jim_Obj *firstObjPtr, Jim_Obj *lastObjPtr)
{
int first, last;
int len, rangeLen;
{
int first, last;
int len, rangeLen;
*
* Keys and Values are Jim objects. */
*
* Keys and Values are Jim objects. */
-unsigned int JimObjectHTHashFunction(const void *key)
+static unsigned int JimObjectHTHashFunction(const void *key)
{
const char *str;
Jim_Obj *objPtr = (Jim_Obj*) key;
{
const char *str;
Jim_Obj *objPtr = (Jim_Obj*) key;
-int JimObjectHTKeyCompare(void *privdata, const void *key1, const void *key2)
+static int JimObjectHTKeyCompare(void *privdata, const void *key1, const void *key2)
/* Add an element, higher-level interface for DictAddElement().
* If valueObjPtr == NULL, the key is removed if it exists. */
/* Add an element, higher-level interface for DictAddElement().
* If valueObjPtr == NULL, the key is removed if it exists. */
-int Jim_DictAddElement(Jim_Interp *interp, Jim_Obj *objPtr,
+static int Jim_DictAddElement(Jim_Interp *interp, Jim_Obj *objPtr,
Jim_Obj *keyObjPtr, Jim_Obj *valueObjPtr)
{
if (Jim_IsShared(objPtr))
Jim_Obj *keyObjPtr, Jim_Obj *valueObjPtr)
{
if (Jim_IsShared(objPtr))
#define JIM_EXPR_OPERATORS_NUM \
(sizeof(Jim_ExprOperators)/sizeof(struct Jim_ExprOperator))
#define JIM_EXPR_OPERATORS_NUM \
(sizeof(Jim_ExprOperators)/sizeof(struct Jim_ExprOperator))
-int JimParseExpression(struct JimParserCtx *pc)
+static int JimParseExpression(struct JimParserCtx *pc)
{
/* Discard spaces and quoted newline */
while (*(pc->p) == ' ' ||
{
/* Discard spaces and quoted newline */
while (*(pc->p) == ' ' ||
-struct Jim_ExprOperator *JimExprOperatorInfo(const char *opname)
+static struct Jim_ExprOperator *JimExprOperatorInfo(const char *opname)
{
int i;
for (i = 0; i < (signed)JIM_EXPR_OPERATORS_NUM; i++)
{
int i;
for (i = 0; i < (signed)JIM_EXPR_OPERATORS_NUM; i++)
-struct Jim_ExprOperator *JimExprOperatorInfoByOpcode(int opcode)
+static struct Jim_ExprOperator *JimExprOperatorInfoByOpcode(int opcode)
{
int i;
for (i = 0; i < (signed)JIM_EXPR_OPERATORS_NUM; i++)
{
int i;
for (i = 0; i < (signed)JIM_EXPR_OPERATORS_NUM; i++)
-ExprByteCode *Jim_GetExpression(Jim_Interp *interp, Jim_Obj *objPtr)
+static ExprByteCode *Jim_GetExpression(Jim_Interp *interp, Jim_Obj *objPtr)
{
if (objPtr->typePtr != &exprObjType) {
if (SetExprFromAny(interp, objPtr) != JIM_OK)
{
if (objPtr->typePtr != &exprObjType) {
if (SetExprFromAny(interp, objPtr) != JIM_OK)
-int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName)
+static int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName)
{
Jim_Obj *libPathObjPtr;
int prefixc, i;
{
Jim_Obj *libPathObjPtr;
int prefixc, i;
return JIM_ERR;
}
#else /* JIM_DYNLIB */
return JIM_ERR;
}
#else /* JIM_DYNLIB */
-int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName)
+static int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName)
{
JIM_NOTUSED(interp);
JIM_NOTUSED(pathName);
{
JIM_NOTUSED(interp);
JIM_NOTUSED(pathName);
* (and increments argc by reference accordingly), performing
* expansion of the list object if 'expand' is non-zero, or
* just adding objPtr to argv if 'expand' is zero. */
* (and increments argc by reference accordingly), performing
* expansion of the list object if 'expand' is non-zero, or
* just adding objPtr to argv if 'expand' is zero. */
-void Jim_ExpandArgument(Jim_Interp *interp, Jim_Obj ***argv,
+static void Jim_ExpandArgument(Jim_Interp *interp, Jim_Obj ***argv,
int *argcPtr, int expand, Jim_Obj *objPtr)
{
if (!expand) {
int *argcPtr, int expand, Jim_Obj *objPtr)
{
if (!expand) {
/* This method takes the string representation of an object
* as a Tcl string where to perform [subst]itution, and generates
* the pre-parsed internal representation. */
/* This method takes the string representation of an object
* as a Tcl string where to perform [subst]itution, and generates
* the pre-parsed internal representation. */
-int SetSubstFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr, int flags)
+static int SetSubstFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr, int flags)
{
int scriptTextLen;
const char *scriptText = Jim_GetString(objPtr, &scriptTextLen);
{
int scriptTextLen;
const char *scriptText = Jim_GetString(objPtr, &scriptTextLen);
-ScriptObj *Jim_GetSubst(Jim_Interp *interp, Jim_Obj *objPtr, int flags)
+static ScriptObj *Jim_GetSubst(Jim_Interp *interp, Jim_Obj *objPtr, int flags)
{
struct ScriptObj *script = Jim_GetIntRepPtr(objPtr);
{
struct ScriptObj *script = Jim_GetIntRepPtr(objPtr);
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)