diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-09-24 11:30:58 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-10-02 15:30:29 +0200 |
commit | 615ed46a6ab25f71a7ab0d8201d33b4dbf8fc5b0 (patch) | |
tree | 1e8dadaa08ce45c3fd64c3019288260e11a8ded8 /openbsc/src/libbsc/bsc_vty.c | |
parent | 11cb7a9fd9d853aaf5ff3d34c179fa3afc9a80a4 (diff) |
amr: Instead of putting ms/bts into the same struct.. use it twice
This way a lot of if/else can just be killed by the caller deciding
which of the two instances to use.
I have copied both branches to new files, replace bts for ms in one
of them and ran diff on it. There is no difference.
Diffstat (limited to 'openbsc/src/libbsc/bsc_vty.c')
-rw-r--r-- | openbsc/src/libbsc/bsc_vty.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 9b0f020f3..d94062412 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -505,22 +505,22 @@ static void config_write_bts_amr(struct vty *vty, struct gsm_bts *bts, if (num > 1) { vty_out(vty, " %s threshold ms", prefix); for (i = 0; i < num - 1; i++) { - vty_out(vty, " %d", mr->mode[i].threshold_ms); + vty_out(vty, " %d", mr->ms_mode[i].threshold); } vty_out(vty, "%s", VTY_NEWLINE); vty_out(vty, " %s hysteresis ms", prefix); for (i = 0; i < num - 1; i++) { - vty_out(vty, " %d", mr->mode[i].hysteresis_ms); + vty_out(vty, " %d", mr->ms_mode[i].hysteresis); } vty_out(vty, "%s", VTY_NEWLINE); vty_out(vty, " %s threshold bts", prefix); for (i = 0; i < num - 1; i++) { - vty_out(vty, " %d", mr->mode[i].threshold_bts); + vty_out(vty, " %d", mr->bts_mode[i].threshold); } vty_out(vty, "%s", VTY_NEWLINE); vty_out(vty, " %s hysteresis bts", prefix); for (i = 0; i < num - 1; i++) { - vty_out(vty, " %d", mr->mode[i].hysteresis_bts); + vty_out(vty, " %d", mr->bts_mode[i].hysteresis); } vty_out(vty, "%s", VTY_NEWLINE); } @@ -2957,10 +2957,10 @@ static void get_amr_th_from_arg(struct vty *vty, int argc, const char *argv[], i if (argv[0][0]=='m') { for (i = 0; i < argc - 1; i++) - mr->mode[i].threshold_ms = atoi(argv[i + 1]); + mr->ms_mode[i].threshold = atoi(argv[i + 1]); } else { for (i = 0; i < argc - 1; i++) - mr->mode[i].threshold_bts = atoi(argv[i + 1]); + mr->bts_mode[i].threshold = atoi(argv[i + 1]); } } @@ -2972,10 +2972,10 @@ static void get_amr_hy_from_arg(struct vty *vty, int argc, const char *argv[], i if (argv[0][0]=='m') { for (i = 0; i < argc - 1; i++) - mr->mode[i].hysteresis_ms = atoi(argv[i + 1]); + mr->ms_mode[i].hysteresis = atoi(argv[i + 1]); } else { for (i = 0; i < argc - 1; i++) - mr->mode[i].hysteresis_bts = atoi(argv[i + 1]); + mr->bts_mode[i].hysteresis = atoi(argv[i + 1]); } } |