The branch, master has been updated
       via  85706c4 s3: Fix a few "warning: ISO C90 forbids mixed declarations 
and code"
      from  2eb606b s3:build fix autoconf build on RHEL5

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 85706c4e168d90f329372b7411223cb2291ec9f6
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Aug 31 14:10:02 2012 +0200

    s3: Fix a few "warning: ISO C90 forbids mixed declarations and code"
    
    Autobuild-User(master): Björn Jacke <b...@sernet.de>
    Autobuild-Date(master): Fri Aug 31 19:24:47 CEST 2012 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/vfs_media_harmony.c |  388 +++++++++++++++++++++--------------
 1 files changed, 234 insertions(+), 154 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_media_harmony.c 
b/source3/modules/vfs_media_harmony.c
index 53cb176..e1de153 100644
--- a/source3/modules/vfs_media_harmony.c
+++ b/source3/modules/vfs_media_harmony.c
@@ -132,11 +132,11 @@ typedef struct mh_dirinfo_struct
 static int alloc_append_client_suffix(vfs_handle_struct *handle,
                char **path)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with *path '%s'\n", *path));
-
        int status = 0;
        char *raddr = NULL;
 
+       DEBUG(MH_INFO_DEBUG, ("Entering with *path '%s'\n", *path));
+
        raddr = tsocket_address_inet_addr_string(
                        handle->conn->sconn->remote_address, talloc_tos());
        if (raddr == NULL)
@@ -172,10 +172,10 @@ err:
  */
 static bool is_apple_double(const char* fname)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with fname '%s'\n", fname));
-
        bool ret = False;
 
+       DEBUG(MH_INFO_DEBUG, ("Entering with fname '%s'\n", fname));
+
        if (strncmp(APPLE_DOUBLE_PREFIX, fname, APPLE_DOUBLE_PREFIX_LEN)
                        == 0)
        {
@@ -189,12 +189,12 @@ static bool is_apple_double(const char* fname)
 static bool starts_with_media_dir(const char* media_dirname,
                size_t media_dirname_len, const char* path)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with media_dirname '%s' "
-                               "path '%s'\n", media_dirname, path));
-
        bool ret = False;
        char* path_start;
 
+       DEBUG(MH_INFO_DEBUG, ("Entering with media_dirname '%s' "
+                             "path '%s'\n", media_dirname, path));
+
        /* Sometimes Samba gives us "./OMFI MediaFiles". */
        if (strncmp(path, "./", 2) == 0)
        {
@@ -230,10 +230,10 @@ static bool starts_with_media_dir(const char* 
media_dirname,
  */
 static bool is_in_media_files(const char* path)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
-
        bool ret = False;
 
+       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
+
        if (
                starts_with_media_dir(AVID_MEDIAFILES_DIRNAME,
                                AVID_MEDIAFILES_DIRNAME_LEN, path)
@@ -264,12 +264,13 @@ static bool is_in_media_files(const char* path)
 static int depth_from_media_dir(const char* media_dirname,
                size_t media_dirname_len, const char* path)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with media_dirname '%s' "
-                               "path '%s'\n", media_dirname, path));
        int transition_count = 0;
        char* path_start;
        char* pathPtr;
 
+       DEBUG(MH_INFO_DEBUG, ("Entering with media_dirname '%s' "
+                             "path '%s'\n", media_dirname, path));
+
        /* Sometimes Samba gives us "./OMFI MediaFiles". */
        if (strncmp(path, "./", 2) == 0)
        {
@@ -336,15 +337,15 @@ static bool is_avid_database(
                const char *avid_db_filename,
                const size_t avid_db_filename_len)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s', "
-                               "avid_db_filename '%s', "
-                               "path_len '%i', "
-                               "avid_db_filename_len '%i'\n",
-                               path, avid_db_filename,
-                               path_len, avid_db_filename_len));
-
        bool ret = False;
 
+       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s', "
+                             "avid_db_filename '%s', "
+                             "path_len '%i', "
+                             "avid_db_filename_len '%i'\n",
+                             path, avid_db_filename,
+                             path_len, avid_db_filename_len));
+
        if (
                path_len > avid_db_filename_len
                        &&
@@ -387,14 +388,16 @@ static int alloc_get_client_path(vfs_handle_struct 
*handle,
                const char *path,
                char **newPath)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
-
        /* replace /CREATING_DIRNAME/ or /._CREATING_DIRNAME/
         * directory in path - potentially in middle of path
         * - with suffixed name.
         */
        int status = 0;
        char* pathPtr;
+       size_t intermPathLen;
+
+       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
+
        *newPath = talloc_strdup(ctx, path);
        if (*newPath == NULL)
        {
@@ -452,7 +455,7 @@ static int alloc_get_client_path(vfs_handle_struct *handle,
        /* replace /MDB_FILENAME or /PMR_FILENAME or /._MDB_FILENAME
         * or /._PMR_FILENAME at newPath end with suffixed name.
         */
-       size_t intermPathLen = strlen(*newPath);
+       intermPathLen = strlen(*newPath);
        if (
                is_avid_database(*newPath, intermPathLen,
                        MDB_FILENAME, MDB_FILENAME_LEN)
@@ -483,12 +486,12 @@ static int alloc_get_client_smb_fname(struct 
vfs_handle_struct *handle,
                const struct smb_filename *smb_fname,
                struct smb_filename **clientFname)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with smb_fname->base_name '%s'\n",
-                               smb_fname->base_name));
-
        int status = 0;
        NTSTATUS copystatus;
 
+       DEBUG(MH_INFO_DEBUG, ("Entering with smb_fname->base_name '%s'\n",
+                             smb_fname->base_name));
+
        copystatus = copy_smb_filename(ctx, smb_fname, clientFname);
        if (!NT_STATUS_IS_OK(copystatus))
        {
@@ -520,11 +523,11 @@ static int alloc_set_client_dirinfo_path(struct 
vfs_handle_struct *handle,
                char **path,
                const char *avid_db_filename)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with avid_db_filename '%s'\n",
-                               avid_db_filename));
-
        int status = 0;
 
+       DEBUG(MH_INFO_DEBUG, ("Entering with avid_db_filename '%s'\n",
+                             avid_db_filename));
+
        if ((*path = talloc_strdup(ctx, avid_db_filename)) == NULL)
        {
                DEBUG(MH_ERR_DEBUG, ("alloc_set_client_dirinfo_path "
@@ -554,12 +557,15 @@ static int set_fake_mtime(vfs_handle_struct *handle,
                struct smb_filename **clientFname,
                int (*statFn)(const char *, SMB_STRUCT_STAT *, bool))
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with (*clientFname)->base_name "
-                       "'%s', (*clientFname)->st.st_ex_mtime %s",
-                       (*clientFname)->base_name,
-                       ctime(&((*clientFname)->st.st_ex_mtime.tv_sec))));
-
        int status = 0;
+       char *statPath;
+       SMB_STRUCT_STAT fakeStat;
+       int copy_len;
+
+       DEBUG(MH_INFO_DEBUG, ("Entering with (*clientFname)->base_name "
+                             "'%s', (*clientFname)->st.st_ex_mtime %s",
+                             (*clientFname)->base_name,
+                             ctime(&((*clientFname)->st.st_ex_mtime.tv_sec))));
 
        if (
                depth_from_media_dir(AVID_MXF_DIRNAME,
@@ -576,9 +582,7 @@ static int set_fake_mtime(vfs_handle_struct *handle,
                goto out;
        }
 
-       char *statPath;
-       SMB_STRUCT_STAT fakeStat;
-       int copy_len = strlen((*clientFname)->base_name);
+       copy_len = strlen((*clientFname)->base_name);
 
        /* Hack to deal with occasional "Avid MediaFiles/MXF/1/." paths.
         * We know we're under a media dir, so paths are at least 2 chars
@@ -634,9 +638,11 @@ static int mh_statvfs(struct vfs_handle_struct *handle,
                const char *path,
                struct vfs_statvfs_struct *statbuf)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
-
        int status;
+       char *clientPath;
+       TALLOC_CTX *ctx;
+
+       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
 
        if (!is_in_media_files(path))
        {
@@ -644,8 +650,8 @@ static int mh_statvfs(struct vfs_handle_struct *handle,
                goto out;
        }
 
-       char *clientPath = NULL;
-       TALLOC_CTX *ctx = talloc_tos();
+       clientPath = NULL;
+       ctx = talloc_tos();
 
        if ((status = alloc_get_client_path(handle, ctx,
                                path,
@@ -666,9 +672,11 @@ static int alloc_set_client_dirinfo(vfs_handle_struct 
*handle,
                const char *fname,
                struct mh_dirinfo_struct **dirInfo)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with fname '%s'\n", fname));
-
        int status = 0;
+       char *clientPath;
+       TALLOC_CTX *ctx;
+
+       DEBUG(MH_INFO_DEBUG, ("Entering with fname '%s'\n", fname));
 
        *dirInfo = talloc(NULL, struct mh_dirinfo_struct);
        if (*dirInfo == NULL)
@@ -718,8 +726,8 @@ static int alloc_set_client_dirinfo(vfs_handle_struct 
*handle,
                goto err;
        }
 
-       char *clientPath = NULL;
-       TALLOC_CTX *ctx = talloc_tos();
+       clientPath = NULL;
+       ctx = talloc_tos();
 
        if (alloc_get_client_path(handle, ctx,
                                fname,
@@ -759,10 +767,10 @@ static DIR *mh_opendir(vfs_handle_struct *handle,
                const char *mask,
                uint32 attr)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with fname '%s'\n", fname));
-
        struct mh_dirinfo_struct *dirInfo;
 
+       DEBUG(MH_INFO_DEBUG, ("Entering with fname '%s'\n", fname));
+
        if (alloc_set_client_dirinfo(handle, fname, &dirInfo))
        {
                goto err;
@@ -800,12 +808,12 @@ static DIR *mh_fdopendir(vfs_handle_struct *handle,
                const char *mask,
                uint32 attr)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with fsp->fsp_name->base_name '%s'\n",
-                       fsp->fsp_name->base_name));
-
        struct mh_dirinfo_struct *dirInfo;
        DIR *dirstream;
 
+       DEBUG(MH_INFO_DEBUG, ("Entering with fsp->fsp_name->base_name '%s'\n",
+                             fsp->fsp_name->base_name));
+
        dirstream = SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
        if (!dirstream)
        {
@@ -861,24 +869,24 @@ static struct dirent *mh_readdir(vfs_handle_struct 
*handle,
                DIR *dirp,
                SMB_STRUCT_STAT *sbuf)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering mh_readdir\n"));
-
        mh_dirinfo_struct* dirInfo = (mh_dirinfo_struct*)dirp;
+       struct dirent *d = NULL;
+       int skip;
 
-       DEBUG(MH_INFO_DEBUG, ("dirInfo->dirpath '%s', "
-                               "dirInfo->clientPath '%s', "
-                               "dirInfo->isInMediaFiles '%s', "
-                               "dirInfo->clientMDBFilename '%s', "
-                               "dirInfo->clientPMRFilename '%s', "
-                               "dirInfo->clientCreatingDirname '%s'\n",
-                               dirInfo->dirpath,
-                               dirInfo->clientPath,
-                               dirInfo->isInMediaFiles ? "True" : "False",
-                               dirInfo->clientMDBFilename,
-                               dirInfo->clientPMRFilename,
-                               dirInfo->clientCreatingDirname));
+       DEBUG(MH_INFO_DEBUG, ("Entering mh_readdir\n"));
 
-       struct dirent *d = NULL;
+       DEBUG(MH_INFO_DEBUG, ("dirInfo->dirpath '%s', "
+                             "dirInfo->clientPath '%s', "
+                             "dirInfo->isInMediaFiles '%s', "
+                             "dirInfo->clientMDBFilename '%s', "
+                             "dirInfo->clientPMRFilename '%s', "
+                             "dirInfo->clientCreatingDirname '%s'\n",
+                             dirInfo->dirpath,
+                             dirInfo->clientPath,
+                             dirInfo->isInMediaFiles ? "True" : "False",
+                             dirInfo->clientMDBFilename,
+                             dirInfo->clientPMRFilename,
+                             dirInfo->clientCreatingDirname));
 
        if (! dirInfo->isInMediaFiles)
        {
@@ -886,9 +894,11 @@ static struct dirent *mh_readdir(vfs_handle_struct *handle,
                goto out;
        }
 
-       int skip;
        do
        {
+               const char* dname;
+               bool isAppleDouble;
+
                skip = False;
                d = SMB_VFS_NEXT_READDIR(handle, dirInfo->dirstream, sbuf);
 
@@ -897,9 +907,6 @@ static struct dirent *mh_readdir(vfs_handle_struct *handle,
                        break;
                }
 
-               const char* dname;
-               bool isAppleDouble;
-
                /* ignore apple double prefix for logic below */
                if (is_apple_double(d->d_name))
                {
@@ -1033,9 +1040,12 @@ static int mh_mkdir(vfs_handle_struct *handle,
                const char *path,
                mode_t mode)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
-
        int status;
+       char *clientPath;
+       TALLOC_CTX *ctx;
+
+
+       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
 
        if (!is_in_media_files(path))
        {
@@ -1043,8 +1053,8 @@ static int mh_mkdir(vfs_handle_struct *handle,
                goto out;
        }
 
-       char *clientPath = NULL;
-       TALLOC_CTX *ctx = talloc_tos();
+       clientPath = NULL;
+       ctx = talloc_tos();
 
        if ((status = alloc_get_client_path(handle, ctx,
                                path,
@@ -1068,9 +1078,12 @@ out:
 static int mh_rmdir(vfs_handle_struct *handle,
                const char *path)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
-
        int status;
+       char *clientPath;
+       TALLOC_CTX *ctx;
+
+
+       DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
 
        if (!is_in_media_files(path))
        {
@@ -1078,8 +1091,8 @@ static int mh_rmdir(vfs_handle_struct *handle,
                goto out;
        }
 
-       char *clientPath = NULL;
-       TALLOC_CTX *ctx = talloc_tos();
+       clientPath = NULL;
+       ctx = talloc_tos();
 
        if ((status = alloc_get_client_path(handle, ctx,
                                path,
@@ -1103,8 +1116,9 @@ out:
 static int mh_closedir(vfs_handle_struct *handle,
                DIR *dirp)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering mh_closedir\n"));
        DIR *realdirp = ((mh_dirinfo_struct*)dirp)->dirstream;
+
+       DEBUG(MH_INFO_DEBUG, ("Entering mh_closedir\n"));
        // Will this talloc_free destroy realdirp?
        TALLOC_FREE(dirp);
 
@@ -1134,10 +1148,13 @@ static int mh_open(vfs_handle_struct *handle,
                int flags,
                mode_t mode)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with smb_fname->base_name '%s'\n",
-                               smb_fname->base_name));
-
        int ret;
+       struct smb_filename *clientFname;
+       TALLOC_CTX *ctx;
+
+
+       DEBUG(MH_INFO_DEBUG, ("Entering with smb_fname->base_name '%s'\n",
+                             smb_fname->base_name));
 
        if (!is_in_media_files(smb_fname->base_name))
        {
@@ -1146,8 +1163,8 @@ static int mh_open(vfs_handle_struct *handle,
                goto out;
        }
 
-       struct smb_filename *clientFname = NULL;
-       TALLOC_CTX *ctx = talloc_tos();
+       clientFname = NULL;
+       ctx = talloc_tos();
 
        if(alloc_get_client_smb_fname(handle, ctx,
                                smb_fname,
@@ -1199,6 +1216,9 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle,
                int *pinfo)
 {
        NTSTATUS status;
+       struct smb_filename *clientFname;
+       TALLOC_CTX *ctx;
+
 
        DEBUG(MH_INFO_DEBUG, ("Entering with smb_fname->base_name '%s'\n",
                                smb_fname->base_name));
@@ -1224,8 +1244,8 @@ static NTSTATUS mh_create_file(vfs_handle_struct *handle,
                goto out;
        }
 
-       struct smb_filename *clientFname = NULL;
-       TALLOC_CTX *ctx = talloc_tos();
+       clientFname = NULL;
+       ctx = talloc_tos();
 
        if (alloc_get_client_smb_fname(handle, ctx,
                                smb_fname,
@@ -1279,13 +1299,17 @@ static int mh_rename(vfs_handle_struct *handle,
                const struct smb_filename *smb_fname_src,
                const struct smb_filename *smb_fname_dst)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with "
-                               "smb_fname_src->base_name '%s', "
-                               "smb_fname_dst->base_name '%s'\n",
-                               smb_fname_src->base_name,
-                               smb_fname_dst->base_name));
-
        int status;
+       struct smb_filename *srcClientFname;
+       struct smb_filename *dstClientFname;
+       TALLOC_CTX *ctx;
+
+
+       DEBUG(MH_INFO_DEBUG, ("Entering with "
+                             "smb_fname_src->base_name '%s', "
+                             "smb_fname_dst->base_name '%s'\n",
+                             smb_fname_src->base_name,
+                             smb_fname_dst->base_name));
 
        if (!is_in_media_files(smb_fname_src->base_name)
                                &&
@@ -1296,9 +1320,9 @@ static int mh_rename(vfs_handle_struct *handle,
                goto out;
        }
 
-       struct smb_filename *srcClientFname = NULL;
-       struct smb_filename *dstClientFname = NULL;
-       TALLOC_CTX *ctx = talloc_tos();
+       srcClientFname = NULL;
+       dstClientFname = NULL;
+       ctx = talloc_tos();
 
        if ((status = alloc_get_client_smb_fname(handle, ctx,
                                smb_fname_src,
@@ -1334,10 +1358,13 @@ out:
 static int mh_stat(vfs_handle_struct *handle,
                struct smb_filename *smb_fname)
 {
-       DEBUG(MH_INFO_DEBUG, ("Entering with smb_fname->base_name '%s'\n",
-                               smb_fname->base_name));
-
        int status = 0;
+       struct smb_filename *clientFname;
+       TALLOC_CTX *ctx;
+
+
+       DEBUG(MH_INFO_DEBUG, ("Entering with smb_fname->base_name '%s'\n",
+                             smb_fname->base_name));
 
        if (!is_in_media_files(smb_fname->base_name))
        {
@@ -1345,8 +1372,8 @@ static int mh_stat(vfs_handle_struct *handle,
                goto out;


-- 
Samba Shared Repository

Reply via email to