[asterisk-commits] seanbright: branch group/asterisk-cpp r168431 - /team/group/asterisk-cpp/main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Jan 10 22:15:54 CST 2009
Author: seanbright
Date: Sat Jan 10 22:15:54 2009
New Revision: 168431
URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168431
Log:
One more down, db.c compiles.
Modified:
team/group/asterisk-cpp/main/db.c
Modified: team/group/asterisk-cpp/main/db.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/db.c?view=diff&rev=168431&r1=168430&r2=168431
==============================================================================
--- team/group/asterisk-cpp/main/db.c (original)
+++ team/group/asterisk-cpp/main/db.c Sat Jan 10 22:15:54 2009
@@ -63,7 +63,7 @@
static inline int keymatch(const char *key, const char *prefix)
{
- int preflen = strlen(prefix);
+ size_t preflen = strlen(prefix);
if (!preflen)
return 1;
if (!strcasecmp(key, prefix))
@@ -120,10 +120,10 @@
pass = 0;
while (!(res = astdb->seq(astdb, &key, &data, pass++ ? R_NEXT : R_FIRST))) {
if (key.size) {
- keys = key.data;
+ keys = (char *) key.data;
keys[key.size - 1] = '\0';
} else {
- keys = "<bad key>";
+ keys = (char *) "<bad key>";
}
if (keymatch(keys, prefix)) {
astdb->del(astdb, &key, 0);
@@ -162,7 +162,7 @@
return res;
}
-int ast_db_get(const char *family, const char *keys, char *value, int valuelen)
+int ast_db_get(const char *family, const char *keys, char *value, size_t valuelen)
{
char fullkey[256] = "";
DBT key, data;
@@ -195,7 +195,7 @@
if (data.size) {
((char *)data.data)[data.size - 1] = '\0';
/* Make sure that we don't write too much to the dst pointer or we don't read too much from the source pointer */
- ast_copy_string(value, data.data, (valuelen > data.size) ? data.size : valuelen);
+ ast_copy_string(value, (char *) data.data, (valuelen > data.size) ? data.size : valuelen);
} else {
ast_log(LOG_NOTICE, "Strange, empty value for /%s/%s\n", family, keys);
}
@@ -388,16 +388,16 @@
pass = 0;
while (!(res = astdb->seq(astdb, &key, &data, pass++ ? R_NEXT : R_FIRST))) {
if (key.size) {
- keys = key.data;
+ keys = (char *) key.data;
keys[key.size - 1] = '\0';
} else {
- keys = "<bad key>";
+ keys = (char *) "<bad key>";
}
if (data.size) {
- values = data.data;
+ values = (char *) data.data;
values[data.size - 1]='\0';
} else {
- values = "<bad value>";
+ values = (char *) "<bad value>";
}
if (keymatch(keys, prefix)) {
ast_cli(a->fd, "%-50s: %-25s\n", keys, values);
@@ -446,16 +446,16 @@
pass = 0;
while (!(res = astdb->seq(astdb, &key, &data, pass++ ? R_NEXT : R_FIRST))) {
if (key.size) {
- keys = key.data;
+ keys = (char *) key.data;
keys[key.size - 1] = '\0';
} else {
- keys = "<bad key>";
+ keys = (char *) "<bad key>";
}
if (data.size) {
- values = data.data;
+ values = (char *) data.data;
values[data.size - 1]='\0';
} else {
- values = "<bad value>";
+ values = (char *) "<bad value>";
}
if (subkeymatch(keys, suffix)) {
ast_cli(a->fd, "%-50s: %-25s\n", keys, values);
@@ -500,19 +500,19 @@
pass = 0;
while (!(res = astdb->seq(astdb, &key, &data, pass++ ? R_NEXT : R_FIRST))) {
if (key.size) {
- keys = key.data;
+ keys = (char *) key.data;
keys[key.size - 1] = '\0';
} else {
- keys = "<bad key>";
+ keys = (char *) "<bad key>";
}
if (data.size) {
- values = data.data;
+ values = (char *) data.data;
values[data.size - 1] = '\0';
} else {
- values = "<bad value>";
+ values = (char *) "<bad value>";
}
values_len = strlen(values) + 1;
- if (keymatch(keys, prefix) && (cur = ast_malloc(sizeof(*cur) + strlen(keys) + 1 + values_len))) {
+ if (keymatch(keys, prefix) && (cur = (struct ast_db_entry *) ast_malloc(sizeof(*cur) + strlen(keys) + 1 + values_len))) {
cur->next = NULL;
cur->key = cur->data + values_len;
strcpy(cur->data, values);
More information about the asterisk-commits
mailing list