[asterisk-commits] ivaxer: branch ivaxer/ast_storage r275772 - in /team/ivaxer/ast_storage: incl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 12 15:07:41 CDT 2010


Author: ivaxer
Date: Mon Jul 12 15:07:38 2010
New Revision: 275772

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=275772
Log:
fixes in the review process:
- added braces
- removed the mode argument in the open() function
- fixed the seek/tell functions prototype

Modified:
    team/ivaxer/ast_storage/include/asterisk/storage.h
    team/ivaxer/ast_storage/main/file.c
    team/ivaxer/ast_storage/main/storage.c
    team/ivaxer/ast_storage/res/res_storage_odbc.c

Modified: team/ivaxer/ast_storage/include/asterisk/storage.h
URL: http://svnview.digium.com/svn/asterisk/team/ivaxer/ast_storage/include/asterisk/storage.h?view=diff&rev=275772&r1=275771&r2=275772
==============================================================================
--- team/ivaxer/ast_storage/include/asterisk/storage.h (original)
+++ team/ivaxer/ast_storage/include/asterisk/storage.h Mon Jul 12 15:07:38 2010
@@ -60,8 +60,8 @@
 	ssize_t (*read)(struct ast_storage *st, struct ast_storage_fileinst *fi, void *buf, size_t count);
 	ssize_t (*write)(struct ast_storage *st, struct ast_storage_fileinst *fi, void *buf, size_t count);
 	struct ast_storage_dirobject *(*listdir)(struct ast_storage *st, const char *objectpath);
-	unsigned long (*tell)(struct ast_storage *st, struct ast_storage_fileinst *fi);
-	int (*seek)(struct ast_storage *st, struct ast_storage_fileinst *fi);
+	off_t (*tell)(struct ast_storage *st, struct ast_storage_fileinst *fi);
+	off_t (*seek)(struct ast_storage *st, struct ast_storage_fileinst *fi, off_t offset, int whence);
 	int (*copy)(struct ast_storage *st, struct ast_storage_fileobject *from, struct ast_storage_fileobject *to);
 	AST_RWLIST_ENTRY(ast_storage_be) list;
 	struct ast_module *module;
@@ -119,14 +119,14 @@
  */
 struct ast_storage_dirobject *ast_storage_listdir(struct ast_storage *st, const char *pathname);
 
-unsigned long ast_storage_tell(struct ast_storage *st, struct ast_storage_fileinst *fi);
-int ast_storage_seek(struct ast_storage *st, struct ast_storage_fileinst *fi);
+off_t ast_storage_tell(struct ast_storage *st, struct ast_storage_fileinst *fi);
+int ast_storage_seek(struct ast_storage *st, struct ast_storage_fileinst *fi, off_t offset, int whence);
 
 void ast_storage_fileobject_release(struct ast_storage_fileobject *fo);
 void ast_storage_fileinst_release(struct ast_storage_fileinst *fi);
 void ast_storage_dirobject_release(struct ast_storage_dirobject *dobj);
 
-int ast_storage_open(struct ast_storage_fileinst *fi, mode_t mode);
+int ast_storage_open(struct ast_storage_fileinst *fi);
 int ast_storage_close(struct ast_storage_fileinst *fi);
 
 /*! \brief Get storage engine by name

Modified: team/ivaxer/ast_storage/main/file.c
URL: http://svnview.digium.com/svn/asterisk/team/ivaxer/ast_storage/main/file.c?view=diff&rev=275772&r1=275771&r2=275772
==============================================================================
--- team/ivaxer/ast_storage/main/file.c (original)
+++ team/ivaxer/ast_storage/main/file.c Mon Jul 12 15:07:38 2010
@@ -216,8 +216,9 @@
 
 	ast_copy_string(tmp, exts, sizeof(tmp));
 	while ((ext = strsep(&stringp, "|"))) {
-		if (!strcmp(ext, type))
+		if (!strcmp(ext, type)) {
 			return 1;
+		}
 	}
 
 	return 0;

Modified: team/ivaxer/ast_storage/main/storage.c
URL: http://svnview.digium.com/svn/asterisk/team/ivaxer/ast_storage/main/storage.c?view=diff&rev=275772&r1=275771&r2=275772
==============================================================================
--- team/ivaxer/ast_storage/main/storage.c (original)
+++ team/ivaxer/ast_storage/main/storage.c Mon Jul 12 15:07:38 2010
@@ -90,8 +90,9 @@
 
 	if (!res) {
 		ast_verb(2, "Unregistered storage engine '%s'\n", name);
-	} else
+	} else {
 		ast_log(LOG_WARNING, "Tried to unregister storage engine '%s', already unregistered\n", name);
+	}
 
 	return res;
 }
@@ -105,8 +106,9 @@
 	}
 
 	AST_RWLIST_TRAVERSE(&storage_engines, be, list) {
-		if (!strcasecmp(name, be->name))
+		if (!strcasecmp(name, be->name)) {
 			break;
+		}
 	}
 	AST_RWLIST_UNLOCK(&storage_engines);
 	return be;
@@ -127,8 +129,9 @@
 	}
 	sename = tmp;
 
-	if (!(be = ast_storage_getbyname(sename)))
-		return NULL;
+	if (!(be = ast_storage_getbyname(sename))) {
+		return NULL;
+	}
 
 	st = be->create(S_OR(dir, ""));
 	return st;

Modified: team/ivaxer/ast_storage/res/res_storage_odbc.c
URL: http://svnview.digium.com/svn/asterisk/team/ivaxer/ast_storage/res/res_storage_odbc.c?view=diff&rev=275772&r1=275771&r2=275772
==============================================================================
--- team/ivaxer/ast_storage/res/res_storage_odbc.c (original)
+++ team/ivaxer/ast_storage/res/res_storage_odbc.c Mon Jul 12 15:07:38 2010
@@ -558,11 +558,11 @@
 	return -1;
 }
 
-static unsigned long se_tell(struct ast_storage *st, struct ast_storage_fileinst *fi) {
+static off_t se_tell(struct ast_storage *st, struct ast_storage_fileinst *fi) {
 	return 0;
 }
 
-static int se_seek(struct ast_storage *st, struct ast_storage_fileinst *fi) {
+static off_t se_seek(struct ast_storage *st, struct ast_storage_fileinst *fi, off_t offset, int whence) {
 	return -1;
 }
 




More information about the asterisk-commits mailing list