return JIM_ERR;
}
-int Jim_GetOpt_String(Jim_GetOptInfo *goi, char **puthere, int *len)
+int Jim_GetOpt_String(Jim_GetOptInfo *goi, const char **puthere, int *len)
{
int r;
Jim_Obj *o;
if (r == JIM_OK) {
cp = Jim_GetString(o, len);
if (puthere) {
- /* remove const */
- *puthere = (char *)(cp);
+ *puthere = cp;
}
}
return r;
* \param puthere - where param is put
* \param len - return its length
*/
-int Jim_GetOpt_String(Jim_GetOptInfo *goi, char **puthere, int *len);
+int Jim_GetOpt_String(Jim_GetOptInfo *goi, const char **puthere, int *len);
/** Remove argv[0] as double.
*
free(pTap);
return JIM_ERR;
}
- Jim_GetOpt_String(goi, &cp, NULL);
- pTap->chip = strdup(cp);
- Jim_GetOpt_String(goi, &cp, NULL);
- pTap->tapname = strdup(cp);
+ const char *tmp;
+ Jim_GetOpt_String(goi, &tmp, NULL);
+ pTap->chip = strdup(tmp);
+
+ Jim_GetOpt_String(goi, &tmp, NULL);
+ pTap->tapname = strdup(tmp);
/* name + dot + name + null */
x = strlen(pTap->chip) + 1 + strlen(pTap->tapname) + 1;
free(pTap);
return JIM_ERR;
}
- Jim_GetOpt_String(goi, &cp, NULL);
- pTap->chip = strdup(cp);
- Jim_GetOpt_String(goi, &cp, NULL);
- pTap->tapname = strdup(cp);
+ const char *tmp;
+ Jim_GetOpt_String(goi, &tmp, NULL);
+ pTap->chip = strdup(tmp);
+
+ Jim_GetOpt_String(goi, &tmp, NULL);
+ pTap->tapname = strdup(tmp);
/* name + dot + name + null */
x = strlen(pTap->chip) + 1 + strlen(pTap->tapname) + 1;
free(pTap);
return JIM_ERR;
}
- Jim_GetOpt_String(goi, &cp, NULL);
- pTap->chip = strdup(cp);
- Jim_GetOpt_String(goi, &cp, NULL);
- pTap->tapname = strdup(cp);
+ const char *tmp;
+ Jim_GetOpt_String(goi, &tmp, NULL);
+ pTap->chip = strdup(tmp);
+
+ Jim_GetOpt_String(goi, &tmp, NULL);
+ pTap->tapname = strdup(tmp);
/* name + dot + name + null */
x = strlen(pTap->chip) + 1 + strlen(pTap->tapname) + 1;
int rtos_create(Jim_GetOptInfo *goi, struct target *target)
{
int x;
- char *cp;
+ const char *cp;
struct Jim_Obj *res;
if (!goi->isconfigure && goi->argc != 0) {
}
int e;
- char *edm_sr_name;
+ const char *edm_sr_name;
int edm_sr_name_len;
e = Jim_GetOpt_String(&goi, &edm_sr_name, &edm_sr_name_len);
if (e != JIM_OK)
}
int e;
- char *edm_sr_name;
+ const char *edm_sr_name;
int edm_sr_name_len;
e = Jim_GetOpt_String(&goi, &edm_sr_name, &edm_sr_name_len);
if (e != JIM_OK)
Jim_Obj *new_cmd;
Jim_Cmd *cmd;
const char *cp;
- char *cp2;
int e;
int x;
struct target *target;
}
/* TYPE */
- e = Jim_GetOpt_String(goi, &cp2, NULL);
+ e = Jim_GetOpt_String(goi, &cp, NULL);
if (e != JIM_OK)
return e;
- cp = cp2;
struct transport *tr = get_current_transport();
if (tr->override_target) {
e = tr->override_target(&cp);