mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 01:27:51 +00:00
Merge pull request #7923 from donaldsharp/gcc10-cleanups
Gcc10 cleanups
This commit is contained in:
commit
ff6fd1cc8a
11
lib/frrlua.h
11
lib/frrlua.h
@ -34,6 +34,17 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* gcc-10 is complaining about the wrapper function
|
||||||
|
* not being compatible with lua_pushstring returning
|
||||||
|
* a char *. Let's wrapper it here to make our life
|
||||||
|
* easier
|
||||||
|
*/
|
||||||
|
static inline void lua_pushstring_wrapper(lua_State *L, const char *str)
|
||||||
|
{
|
||||||
|
(void)lua_pushstring(L, str);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Converts a prefix to a Lua value and pushes it on the stack.
|
* Converts a prefix to a Lua value and pushes it on the stack.
|
||||||
*/
|
*/
|
||||||
|
@ -39,7 +39,7 @@ struct frrscript_codec frrscript_codecs_lib[] = {
|
|||||||
.encoder = (encoder_func)lua_pushintegerp,
|
.encoder = (encoder_func)lua_pushintegerp,
|
||||||
.decoder = lua_tointegerp},
|
.decoder = lua_tointegerp},
|
||||||
{.typename = "string",
|
{.typename = "string",
|
||||||
.encoder = (encoder_func)lua_pushstring,
|
.encoder = (encoder_func)lua_pushstring_wrapper,
|
||||||
.decoder = lua_tostringp},
|
.decoder = lua_tostringp},
|
||||||
{.typename = "prefix",
|
{.typename = "prefix",
|
||||||
.encoder = (encoder_func)lua_pushprefix,
|
.encoder = (encoder_func)lua_pushprefix,
|
||||||
@ -208,7 +208,7 @@ struct frrscript *frrscript_load(const char *name,
|
|||||||
fs->L = luaL_newstate();
|
fs->L = luaL_newstate();
|
||||||
frrlua_export_logging(fs->L);
|
frrlua_export_logging(fs->L);
|
||||||
|
|
||||||
char fname[MAXPATHLEN];
|
char fname[MAXPATHLEN * 2];
|
||||||
snprintf(fname, sizeof(fname), "%s/%s.lua", scriptdir, fs->name);
|
snprintf(fname, sizeof(fname), "%s/%s.lua", scriptdir, fs->name);
|
||||||
|
|
||||||
int ret = luaL_loadfile(fs->L, fname);
|
int ret = luaL_loadfile(fs->L, fname);
|
||||||
|
@ -1439,8 +1439,7 @@ static void ospf6_redistribute_show_config(struct vty *vty, struct ospf6 *ospf6,
|
|||||||
struct ospf6_redist *red;
|
struct ospf6_redist *red;
|
||||||
|
|
||||||
total = 0;
|
total = 0;
|
||||||
for (type = 0; type < ZEBRA_ROUTE_MAX; type++)
|
memset(nroute, 0, sizeof(nroute));
|
||||||
nroute[type] = 0;
|
|
||||||
for (route = ospf6_route_head(ospf6->external_table); route;
|
for (route = ospf6_route_head(ospf6->external_table); route;
|
||||||
route = ospf6_route_next(route)) {
|
route = ospf6_route_next(route)) {
|
||||||
info = route->route_option;
|
info = route->route_option;
|
||||||
@ -1448,12 +1447,11 @@ static void ospf6_redistribute_show_config(struct vty *vty, struct ospf6 *ospf6,
|
|||||||
total++;
|
total++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_json)
|
if (!use_json)
|
||||||
json_route = json_object_new_object();
|
|
||||||
else
|
|
||||||
vty_out(vty, "Redistributing External Routes from:\n");
|
vty_out(vty, "Redistributing External Routes from:\n");
|
||||||
|
|
||||||
for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {
|
for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {
|
||||||
|
|
||||||
red = ospf6_redist_lookup(ospf6, type, 0);
|
red = ospf6_redist_lookup(ospf6, type, 0);
|
||||||
|
|
||||||
if (!red)
|
if (!red)
|
||||||
@ -1462,6 +1460,7 @@ static void ospf6_redistribute_show_config(struct vty *vty, struct ospf6 *ospf6,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (use_json) {
|
if (use_json) {
|
||||||
|
json_route = json_object_new_object();
|
||||||
json_object_string_add(json_route, "routeType",
|
json_object_string_add(json_route, "routeType",
|
||||||
ZROUTE_NAME(type));
|
ZROUTE_NAME(type));
|
||||||
json_object_int_add(json_route, "numberOfRoutes",
|
json_object_int_add(json_route, "numberOfRoutes",
|
||||||
|
Loading…
Reference in New Issue
Block a user