diff options
author | Jeremy Allison <jra@samba.org> | 2011-05-05 16:19:49 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-05-06 01:44:07 +0200 |
commit | 7d6ebe0de7d99c20854cafb8af50fe8f30ed778a (patch) | |
tree | 718a3cfdae0a8c6db47245d028bd043c4df0c09e /source3/modules | |
parent | 76f5a39c7f165c656cdc9db29bfa0df59514fceb (diff) | |
download | samba-7d6ebe0de7d99c20854cafb8af50fe8f30ed778a.tar.gz samba-7d6ebe0de7d99c20854cafb8af50fe8f30ed778a.tar.bz2 samba-7d6ebe0de7d99c20854cafb8af50fe8f30ed778a.zip |
More const fixes. Remove CONST_DISCARD.
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/vfs_acl_common.c | 10 | ||||
-rw-r--r-- | source3/modules/vfs_fileid.c | 2 | ||||
-rw-r--r-- | source3/modules/vfs_gpfs.c | 10 | ||||
-rw-r--r-- | source3/modules/vfs_hpuxacl.c | 8 | ||||
-rw-r--r-- | source3/modules/vfs_shadow_copy2.c | 4 | ||||
-rw-r--r-- | source3/modules/vfs_smb_traffic_analyzer.c | 6 | ||||
-rw-r--r-- | source3/modules/vfs_streams_xattr.c | 4 | ||||
-rw-r--r-- | source3/modules/vfs_xattr_tdb.c | 2 |
8 files changed, 23 insertions, 23 deletions
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c index 6c57acb13d..a1771464fa 100644 --- a/source3/modules/vfs_acl_common.c +++ b/source3/modules/vfs_acl_common.c @@ -144,7 +144,7 @@ static NTSTATUS create_acl_blob(const struct security_descriptor *psd, xacl.version = 3; xacl.info.sd_hs3 = &sd_hs3; - xacl.info.sd_hs3->sd = CONST_DISCARD(struct security_descriptor *, psd); + xacl.info.sd_hs3->sd = discard_const_p(struct security_descriptor, psd); xacl.info.sd_hs3->hash_type = hash_type; memcpy(&xacl.info.sd_hs3->hash[0], hash, XATTR_SD_HASH_SIZE); @@ -190,7 +190,7 @@ static void add_directory_inheritable_components(vfs_handle_struct *handle, /* Fake a quick smb_filename. */ ZERO_STRUCT(smb_fname); smb_fname.st = *psbuf; - smb_fname.base_name = CONST_DISCARD(char *, name); + smb_fname.base_name = discard_const_p(char, name); dir_mode = unix_mode(conn, FILE_ATTRIBUTE_DIRECTORY, &smb_fname, NULL); @@ -729,7 +729,7 @@ static NTSTATUS fset_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp, DEBUG(10,("fset_nt_acl_xattr: incoming sd for file %s\n", fsp_str_dbg(fsp))); NDR_PRINT_DEBUG(security_descriptor, - CONST_DISCARD(struct security_descriptor *,orig_psd)); + discard_const_p(struct security_descriptor, orig_psd)); } status = get_nt_acl_internal(handle, fsp, @@ -784,7 +784,7 @@ static NTSTATUS fset_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp, DEBUG(10,("fset_nt_acl_xattr: storing xattr sd for file %s\n", fsp_str_dbg(fsp))); NDR_PRINT_DEBUG(security_descriptor, - CONST_DISCARD(struct security_descriptor *,psd)); + discard_const_p(struct security_descriptor, psd)); } create_acl_blob(psd, &blob, XATTR_SD_HASH_TYPE_SHA256, hash); store_acl_blob_fsp(handle, fsp, &blob); @@ -836,7 +836,7 @@ static int acl_common_remove_object(vfs_handle_struct *handle, } ZERO_STRUCT(local_fname); - local_fname.base_name = CONST_DISCARD(char *,final_component); + local_fname.base_name = discard_const_p(char, final_component); /* Must use lstat here. */ ret = SMB_VFS_LSTAT(conn, &local_fname); diff --git a/source3/modules/vfs_fileid.c b/source3/modules/vfs_fileid.c index 4c230a0566..642628082a 100644 --- a/source3/modules/vfs_fileid.c +++ b/source3/modules/vfs_fileid.c @@ -144,7 +144,7 @@ static uint64_t fileid_device_mapping_fsname(struct fileid_handle_data *data, if (!m) return dev; if (m->devid == (uint64_t)-1) { - m->devid = fileid_uint64_hash((uint8_t *)m->mnt_fsname, + m->devid = fileid_uint64_hash((const uint8_t *)m->mnt_fsname, strlen(m->mnt_fsname)); } diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 7d5d199405..d52122c25b 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -998,7 +998,7 @@ static int gpfs_set_xattr(struct vfs_handle_struct *handle, const char *path, } - ret = set_gpfs_winattrs(CONST_DISCARD(char *, path), + ret = set_gpfs_winattrs(discard_const_p(char, path), GPFS_WINATTR_SET_ATTRS, &attrs); if ( ret == -1){ if (errno == ENOSYS) { @@ -1029,7 +1029,7 @@ static ssize_t gpfs_get_xattr(struct vfs_handle_struct *handle, const char *pat return SMB_VFS_NEXT_GETXATTR(handle,path,name,value,size); } - ret = get_gpfs_winattrs(CONST_DISCARD(char *, path), &attrs); + ret = get_gpfs_winattrs(discard_const_p(char, path), &attrs); if ( ret == -1){ if (errno == ENOSYS) { return SMB_VFS_NEXT_GETXATTR(handle, path, name, value, @@ -1083,7 +1083,7 @@ static int vfs_gpfs_stat(struct vfs_handle_struct *handle, errno = map_errno_from_nt_status(status); return -1; } - ret = get_gpfs_winattrs(CONST_DISCARD(char *, fname), &attrs); + ret = get_gpfs_winattrs(discard_const_p(char, fname), &attrs); TALLOC_FREE(fname); if (ret == 0) { smb_fname->st.st_ex_btime.tv_sec = attrs.creationTime.tv_sec; @@ -1131,7 +1131,7 @@ static int vfs_gpfs_lstat(struct vfs_handle_struct *handle, errno = map_errno_from_nt_status(status); return -1; } - ret = get_gpfs_winattrs(CONST_DISCARD(char *, path), &attrs); + ret = get_gpfs_winattrs(discard_const_p(char, path), &attrs); TALLOC_FREE(path); if (ret == 0) { smb_fname->st.st_ex_btime.tv_sec = attrs.creationTime.tv_sec; @@ -1172,7 +1172,7 @@ static int vfs_gpfs_ntimes(struct vfs_handle_struct *handle, attrs.creationTime.tv_sec = ft->create_time.tv_sec; attrs.creationTime.tv_nsec = ft->create_time.tv_nsec; - ret = set_gpfs_winattrs(CONST_DISCARD(char *, path), + ret = set_gpfs_winattrs(discard_const_p(char, path), GPFS_WINATTR_SET_CREATION_TIME, &attrs); if(ret == -1 && errno != ENOSYS){ DEBUG(1,("vfs_gpfs_ntimes: set GPFS ntimes failed %d\n",ret)); diff --git a/source3/modules/vfs_hpuxacl.c b/source3/modules/vfs_hpuxacl.c index 2155945b95..8a57444352 100644 --- a/source3/modules/vfs_hpuxacl.c +++ b/source3/modules/vfs_hpuxacl.c @@ -307,7 +307,7 @@ int hpuxacl_sys_acl_set_file(vfs_handle_struct *handle, } DEBUG(10, ("resulting acl is valid.\n")); - ret = acl(CONST_DISCARD(char *, smb_fname->base_name), ACL_SET, count, + ret = acl(discard_const_p(char, smb_fname->base_name), ACL_SET, count, hpux_acl); if (ret != 0) { DEBUG(0, ("ERROR calling acl: %s\n", strerror(errno))); @@ -394,7 +394,7 @@ int hpuxacl_sys_acl_delete_def_file(vfs_handle_struct *handle, DEBUG(10, ("resulting acl is not valid!\n")); goto done; } - ret = acl(CONST_DISCARD(char *, path), ACL_SET, count, hpux_acl); + ret = acl(discard_const_p(char, path), ACL_SET, count, hpux_acl); if (ret != 0) { DEBUG(10, ("settinge file acl failed!\n")); } @@ -682,7 +682,7 @@ static bool hpux_acl_get_file(const char *name, HPUX_ACL_T *hpux_acl, * instantiated or malloced each time this function is * called). Btw: the count parameter does not seem to matter... */ - *count = acl(CONST_DISCARD(char *, name), ACL_CNT, 0, &dummy_ace); + *count = acl(discard_const_p(char, name), ACL_CNT, 0, &dummy_ace); if (*count < 0) { DEBUG(10, ("acl ACL_CNT failed: %s\n", strerror(errno))); goto done; @@ -692,7 +692,7 @@ static bool hpux_acl_get_file(const char *name, HPUX_ACL_T *hpux_acl, DEBUG(10, ("error allocating memory for hpux acl...\n")); goto done; } - *count = acl(CONST_DISCARD(char *, name), ACL_GET, *count, *hpux_acl); + *count = acl(discard_const_p(char, name), ACL_GET, *count, *hpux_acl); if (*count < 0) { DEBUG(10, ("acl ACL_GET failed: %s\n", strerror(errno))); goto done; diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index df3bde72c9..3613f25b92 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -825,12 +825,12 @@ static int shadow_copy2_chmod_acl(vfs_handle_struct *handle, static int shadow_copy2_label_cmp_asc(const void *x, const void *y) { - return strncmp((char *)x, (char *)y, sizeof(SHADOW_COPY_LABEL)); + return strncmp((const char *)x, (const char *)y, sizeof(SHADOW_COPY_LABEL)); } static int shadow_copy2_label_cmp_desc(const void *x, const void *y) { - return -strncmp((char *)x, (char *)y, sizeof(SHADOW_COPY_LABEL)); + return -strncmp((const char *)x, (const char *)y, sizeof(SHADOW_COPY_LABEL)); } /* diff --git a/source3/modules/vfs_smb_traffic_analyzer.c b/source3/modules/vfs_smb_traffic_analyzer.c index e8aa385d69..d1340c310c 100644 --- a/source3/modules/vfs_smb_traffic_analyzer.c +++ b/source3/modules/vfs_smb_traffic_analyzer.c @@ -174,7 +174,7 @@ static char *smb_traffic_analyzer_encrypt( TALLOC_CTX *ctx, char *output; unsigned char crypted[18]; if (akey == NULL) return NULL; - samba_AES_set_encrypt_key((unsigned char *) akey, 128, &key); + samba_AES_set_encrypt_key((const unsigned char *) akey, 128, &key); s1 = strlen(str) / 16; s2 = strlen(str) % 16; for (h = 0; h < s2; h++) *(filler+h)=*(str+(s1*16)+h); @@ -183,10 +183,10 @@ static char *smb_traffic_analyzer_encrypt( TALLOC_CTX *ctx, output = talloc_array(ctx, char, (s1*16)+17 ); d=0; for (h = 0; h < s1; h++) { - samba_AES_encrypt((unsigned char *) str+(16*h), crypted, &key); + samba_AES_encrypt((const unsigned char *) str+(16*h), crypted, &key); for (d = 0; d<16; d++) output[d+(16*h)]=crypted[d]; } - samba_AES_encrypt( (unsigned char *) str+(16*h), filler, &key ); + samba_AES_encrypt( (const unsigned char *) str+(16*h), filler, &key ); for (d = 0;d < 16; d++) output[d+(16*h)]=*(filler+d); *len = (s1*16)+16; return output; diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index 34e01b0b5f..0a56b55806 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -52,9 +52,9 @@ static SMB_INO_T stream_inode(const SMB_STRUCT_STAT *sbuf, const char *sname) SMB_ASSERT(upper_sname != NULL); MD5Init(&ctx); - MD5Update(&ctx, (unsigned char *)&(sbuf->st_ex_dev), + MD5Update(&ctx, (const unsigned char *)&(sbuf->st_ex_dev), sizeof(sbuf->st_ex_dev)); - MD5Update(&ctx, (unsigned char *)&(sbuf->st_ex_ino), + MD5Update(&ctx, (const unsigned char *)&(sbuf->st_ex_ino), sizeof(sbuf->st_ex_ino)); MD5Update(&ctx, (unsigned char *)upper_sname, talloc_get_size(upper_sname)-1); diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c index 5b62565d62..b8281dda21 100644 --- a/source3/modules/vfs_xattr_tdb.c +++ b/source3/modules/vfs_xattr_tdb.c @@ -314,7 +314,7 @@ static int xattr_tdb_setattr(struct db_context *db_ctx, } attribs->eas[i].name = name; - attribs->eas[i].value.data = CONST_DISCARD(uint8 *, value); + attribs->eas[i].value.data = discard_const_p(uint8, value); attribs->eas[i].value.length = size; status = xattr_tdb_save_attrs(rec, attribs); |