Module: kamailio
Branch: master
Commit: 6a152024a40abdb89842aaee418088fe3fb23ae2
URL:
https://github.com/kamailio/kamailio/commit/6a152024a40abdb89842aaee418088f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-05-07T08:55:46+02:00
db_perlvdb: added const specifiers to get rid of warnings
---
Modified: src/modules/db_perlvdb/perlvdb_conv.c
Modified: src/modules/db_perlvdb/perlvdb_conv.h
Modified: src/modules/db_perlvdb/perlvdbfunc.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6a152024a40abdb89842aaee418088f…
Patch:
https://github.com/kamailio/kamailio/commit/6a152024a40abdb89842aaee418088f…
---
diff --git a/src/modules/db_perlvdb/perlvdb_conv.c
b/src/modules/db_perlvdb/perlvdb_conv.c
index c3f1e6800b..5c1c33ddfd 100644
--- a/src/modules/db_perlvdb/perlvdb_conv.c
+++ b/src/modules/db_perlvdb/perlvdb_conv.c
@@ -33,7 +33,7 @@
/* Converts a set of pairs to perl SVs.
* For insert, and update (second half)
*/
-AV *pairs2perlarray(db_key_t* keys, db_val_t* vals, int n) {
+AV *pairs2perlarray(const db_key_t* keys, const db_val_t* vals, const int n) {
AV *array = newAV();
SV *element;
@@ -50,7 +50,7 @@ AV *pairs2perlarray(db_key_t* keys, db_val_t* vals, int n) {
/* Converts a set of cond's to perl SVs.
* For delete, update (first half), query
*/
-AV *conds2perlarray(db_key_t* keys, db_op_t* ops, db_val_t* vals, int n) {
+AV *conds2perlarray(const db_key_t* keys, const db_op_t* ops, const db_val_t* vals, const
int n) {
AV *array = newAV();
SV *element = NULL;
int i = 0;
@@ -80,7 +80,7 @@ AV *conds2perlarray(db_key_t* keys, db_op_t* ops, db_val_t* vals, int n)
{
/* Converts a set of key names to a perl array.
* Needed in query.
*/
-AV *keys2perlarray(db_key_t* keys, int n) {
+AV *keys2perlarray(const db_key_t* keys, const int n) {
AV *array = newAV();
SV *element;
int i;
@@ -92,7 +92,7 @@ AV *keys2perlarray(db_key_t* keys, int n) {
return array;
}
-SV *valdata(db_val_t* val) {
+SV *valdata(const db_val_t* val) {
SV *data = &PL_sv_undef;
const char* stringval;
@@ -167,7 +167,7 @@ SV *val2perlval(db_val_t* val) {
}
-SV *pair2perlpair(db_key_t key, db_val_t* val) {
+SV *pair2perlpair(db_key_t key, const db_val_t* val) {
SV* retval;
SV *class;
@@ -190,7 +190,7 @@ SV *pair2perlpair(db_key_t key, db_val_t* val) {
}
-SV *cond2perlcond(db_key_t key, db_op_t op, db_val_t* val) {
+SV *cond2perlcond(const db_key_t key, const db_op_t op, const db_val_t* val) {
SV* retval;
SV *class;
diff --git a/src/modules/db_perlvdb/perlvdb_conv.h
b/src/modules/db_perlvdb/perlvdb_conv.h
index 9018305a22..96666f90c5 100644
--- a/src/modules/db_perlvdb/perlvdb_conv.h
+++ b/src/modules/db_perlvdb/perlvdb_conv.h
@@ -44,21 +44,21 @@
/* Converts a set of pairs to perl SVs.
* For insert, and update (second half)
*/
-AV *pairs2perlarray(db_key_t* keys, db_val_t* vals, int n);
+AV *pairs2perlarray(const db_key_t* keys, const db_val_t* vals, const int n);
/* Converts a set of cond's to perl SVs.
* For delete, update (first half), query
*/
-AV *conds2perlarray(db_key_t* keys, db_op_t* ops, db_val_t* vals, int n);
+AV *conds2perlarray(const db_key_t* keys, const db_op_t* ops, const db_val_t* vals, const
int n);
/* Converts a set of key names to a perl array.
* Needed in query.
*/
-AV *keys2perlarray(db_key_t* keys, int n);
+AV *keys2perlarray(const db_key_t* keys, const int n);
SV *val2perlval(db_val_t* val);
-SV *pair2perlpair(db_key_t key, db_val_t* val);
-SV *cond2perlcond(db_key_t key, db_op_t op, db_val_t* val);
+SV *pair2perlpair(db_key_t key, const db_val_t* val);
+SV *cond2perlcond(const db_key_t key, const db_op_t op, const db_val_t* val);
int perlresult2dbres(SV *perlres, db1_res_t **r);
diff --git a/src/modules/db_perlvdb/perlvdbfunc.c b/src/modules/db_perlvdb/perlvdbfunc.c
index 73a7b1c9dd..7518fcdac5 100644
--- a/src/modules/db_perlvdb/perlvdbfunc.c
+++ b/src/modules/db_perlvdb/perlvdbfunc.c
@@ -76,7 +76,7 @@ SV *newvdbobj(const char* cn) {
return obj;
}
-SV *getobj(db1_con_t *con) {
+SV *getobj(const db1_con_t *con) {
return ((SV*)CON_TAIL(con));
}
@@ -179,8 +179,8 @@ void perlvdb_db_close(db1_con_t* h) {
* v: values of the keys
* n: number of key=value pairs
*/
-int perlvdb_db_insertreplace(db1_con_t* h, db_key_t* k, db_val_t* v,
- int n, char *insertreplace) {
+int perlvdb_db_insertreplace(const db1_con_t* h, const db_key_t* k, const db_val_t* v,
+ const int n, char *insertreplace) {
AV *arr;
SV *arrref;
SV *ret;