Module: kamailio
Branch: master
Commit: 5cc05f9b47eaa829a945aa628d39d78bab7756bf
URL:
https://github.com/kamailio/kamailio/commit/5cc05f9b47eaa829a945aa628d39d78…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-06-02T15:03:56+02:00
benchmark: removed unnecessary casts to int*
- initialize variables to 0 in rpc commands
---
Modified: src/modules/benchmark/benchmark.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5cc05f9b47eaa829a945aa628d39d78…
Patch:
https://github.com/kamailio/kamailio/commit/5cc05f9b47eaa829a945aa628d39d78…
---
diff --git a/src/modules/benchmark/benchmark.c b/src/modules/benchmark/benchmark.c
index 6e397c3db9..61e866bf7f 100644
--- a/src/modules/benchmark/benchmark.c
+++ b/src/modules/benchmark/benchmark.c
@@ -479,8 +479,8 @@ static inline int fixup_bm_timer(void** param, int param_no)
*/
void bm_rpc_enable_global(rpc_t* rpc, void* ctx)
{
- int v1;
- if(rpc->scan(ctx, "d", (int*)(&v1))<1) {
+ int v1=0;
+ if(rpc->scan(ctx, "d", &v1)<1) {
LM_WARN("no parameters\n");
rpc->fault(ctx, 500, "Invalid Parameters");
return;
@@ -499,7 +499,7 @@ void bm_rpc_enable_timer(rpc_t* rpc, void* ctx)
int v2 = 0;
unsigned int id = 0;
- if(rpc->scan(ctx, "sd", &p1, (int*)(&v2))<2) {
+ if(rpc->scan(ctx, "sd", &p1, &v2)<2) {
LM_WARN("invalid parameters\n");
rpc->fault(ctx, 500, "Invalid Parameters");
return;
@@ -518,8 +518,8 @@ void bm_rpc_enable_timer(rpc_t* rpc, void* ctx)
void bm_rpc_granularity(rpc_t* rpc, void* ctx)
{
- int v1;
- if(rpc->scan(ctx, "d", (int*)(&v1))<1) {
+ int v1 = 0;
+ if(rpc->scan(ctx, "d", &v1)<1) {
LM_WARN("no parameters\n");
rpc->fault(ctx, 500, "Invalid Parameters");
return;
@@ -533,8 +533,8 @@ void bm_rpc_granularity(rpc_t* rpc, void* ctx)
void bm_rpc_loglevel(rpc_t* rpc, void* ctx)
{
- int v1;
- if(rpc->scan(ctx, "d", (int*)(&v1))<1) {
+ int v1 = 0;
+ if(rpc->scan(ctx, "d", &v1)<1) {
LM_WARN("no parameters\n");
rpc->fault(ctx, 500, "Invalid Parameters");
return;