This commit is contained in:
Olof hagsand 2019-12-31 13:30:52 +01:00
commit 50420cb262
9 changed files with 11 additions and 11 deletions

View file

@ -767,7 +767,7 @@ main(int argc,
goto done; goto done;
/* Startup mode needs to be defined, */ /* Startup mode needs to be defined, */
startup_mode = clicon_startup_mode(h); startup_mode = clicon_startup_mode(h);
if (startup_mode == -1){ if ((int)startup_mode == -1){
clicon_log(LOG_ERR, "Startup mode undefined. Specify option CLICON_STARTUP_MODE or specify -s option to clicon_backend."); clicon_log(LOG_ERR, "Startup mode undefined. Specify option CLICON_STARTUP_MODE or specify -s option to clicon_backend.");
goto done; goto done;
} }

View file

@ -454,7 +454,7 @@ cli_show_config1(clicon_handle h,
db = cv_string_get(cvec_i(argv, 0)); db = cv_string_get(cvec_i(argv, 0));
/* Second argv argument: Format */ /* Second argv argument: Format */
formatstr = cv_string_get(cvec_i(argv, 1)); formatstr = cv_string_get(cvec_i(argv, 1));
if ((format = format_str2int(formatstr)) < 0){ if ((int)(format = format_str2int(formatstr)) < 0){
clicon_err(OE_PLUGIN, 0, "Not valid format: %s", formatstr); clicon_err(OE_PLUGIN, 0, "Not valid format: %s", formatstr);
goto done; goto done;
} }
@ -705,7 +705,7 @@ cli_show_auto1(clicon_handle h,
db = cv_string_get(cvec_i(argv, 1)); db = cv_string_get(cvec_i(argv, 1));
/* Third format: output format */ /* Third format: output format */
formatstr = cv_string_get(cvec_i(argv, 2)); formatstr = cv_string_get(cvec_i(argv, 2));
if ((format = format_str2int(formatstr)) < 0){ if ((int)(format = format_str2int(formatstr)) < 0){
clicon_err(OE_PLUGIN, 0, "Not valid format: %s", formatstr); clicon_err(OE_PLUGIN, 0, "Not valid format: %s", formatstr);
goto done; goto done;
} }

View file

@ -193,7 +193,7 @@ restconf_content_type(FCGX_Request *r)
if ((str = FCGX_GetParam("HTTP_CONTENT_TYPE", r->envp)) == NULL) if ((str = FCGX_GetParam("HTTP_CONTENT_TYPE", r->envp)) == NULL)
return -1; return -1;
if ((m = restconf_media_str2int(str)) == -1) if ((int)(m = restconf_media_str2int(str)) == -1)
return -1; return -1;
return m; return m;
} }

View file

@ -355,7 +355,7 @@ api_restconf(clicon_handle h,
// retval = restconf_unsupported_media(r); // retval = restconf_unsupported_media(r);
// goto done; // goto done;
} }
else if ((media_out = restconf_media_str2int(media_str)) == -1){ else if ((int)(media_out = restconf_media_str2int(media_str)) == -1){
if (strcmp(media_str, "*/*") == 0) /* catch-all */ if (strcmp(media_str, "*/*") == 0) /* catch-all */
media_out = YANG_DATA_JSON; media_out = YANG_DATA_JSON;
else{ else{

View file

@ -125,7 +125,7 @@ api_data_get2(clicon_handle h,
/* Check for content attribute */ /* Check for content attribute */
if ((attr = cvec_find_str(qvec, "content")) != NULL){ if ((attr = cvec_find_str(qvec, "content")) != NULL){
clicon_debug(1, "%s content=%s", __FUNCTION__, attr); clicon_debug(1, "%s content=%s", __FUNCTION__, attr);
if ((content = netconf_content_str2int(attr)) == -1){ if ((int)(content = netconf_content_str2int(attr)) == -1){
if (netconf_bad_attribute_xml(&xerr, "application", if (netconf_bad_attribute_xml(&xerr, "application",
"<bad-attribute>content</bad-attribute>", "Unrecognized value of content attribute") < 0) "<bad-attribute>content</bad-attribute>", "Unrecognized value of content attribute") < 0)
goto done; goto done;

View file

@ -388,7 +388,7 @@ xml2buf(FILE *f,
goto done; goto done;
} }
memcpy(buf0, hdr, sizeof(hdr)); memcpy(buf0, hdr, sizeof(hdr));
if (fwrite(buf0, sizeof(char), len, f) < 0){ if (fwrite(buf0, sizeof(char), len, f) == 0){
clicon_err(OE_XML, errno, "fwrite"); clicon_err(OE_XML, errno, "fwrite");
goto done; goto done;
} }

View file

@ -377,7 +377,7 @@ clicon_msg_rcv(int s,
goto done; goto done;
} }
memcpy(*msg, &hdr, hlen); memcpy(*msg, &hdr, hlen);
if ((len2 = atomicio(read, s, (*msg)->op_body, mlen - sizeof(hdr))) < 0){ if ((len2 = atomicio(read, s, (*msg)->op_body, mlen - sizeof(hdr))) == 0){
clicon_err(OE_CFG, errno, "read"); clicon_err(OE_CFG, errno, "read");
goto done; goto done;
} }

View file

@ -631,7 +631,7 @@ clicon_rpc_get(clicon_handle h,
NETCONF_BASE_PREFIX, NETCONF_BASE_NAMESPACE); NETCONF_BASE_PREFIX, NETCONF_BASE_NAMESPACE);
cprintf(cb, "><get"); cprintf(cb, "><get");
/* Clixon extension, content=all,config, or nonconfig */ /* Clixon extension, content=all,config, or nonconfig */
if (content != -1) if ((int)content != -1)
cprintf(cb, " content=\"%s\"", netconf_content_int2str(content)); cprintf(cb, " content=\"%s\"", netconf_content_int2str(content));
/* Clixon extension, depth=<level> */ /* Clixon extension, depth=<level> */
if (depth != -1) if (depth != -1)

View file

@ -3180,7 +3180,7 @@ yang_apply(yang_stmt *yn,
for (i=0; i<yn->ys_len; i++){ for (i=0; i<yn->ys_len; i++){
ys = yn->ys_stmt[i]; ys = yn->ys_stmt[i];
if (keyword == -1 || keyword == ys->ys_keyword){ if ((int)keyword == -1 || keyword == ys->ys_keyword){
if ((ret = fn(ys, arg)) < 0) if ((ret = fn(ys, arg)) < 0)
goto done; goto done;
if (ret > 0){ if (ret > 0){
@ -3265,7 +3265,7 @@ schema_nodeid_vec(yang_stmt *yn,
ys = yn->ys_stmt[i]; ys = yn->ys_stmt[i];
if (!yang_schemanode(ys)) if (!yang_schemanode(ys))
continue; continue;
if (keyword != -1 && keyword != ys->ys_keyword) if ((int)keyword != -1 && keyword != ys->ys_keyword)
continue; continue;
/* some keys dont have arguments, match on key */ /* some keys dont have arguments, match on key */
if (ys->ys_keyword == Y_INPUT || ys->ys_keyword == Y_OUTPUT){ if (ys->ys_keyword == Y_INPUT || ys->ys_keyword == Y_OUTPUT){