summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-07-31 03:53:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:26 -0500
commit02eea79624c85fb5ce6c3ffefe2d27e40c5ff97f (patch)
treea3fb9be7bfad975ba13651718a011bbad36597ca /source3/libsmb
parente23781b3b304d1e69ad80af5ae9c0ed8d02cf996 (diff)
downloadsamba-02eea79624c85fb5ce6c3ffefe2d27e40c5ff97f.tar.gz
samba-02eea79624c85fb5ce6c3ffefe2d27e40c5ff97f.tar.bz2
samba-02eea79624c85fb5ce6c3ffefe2d27e40c5ff97f.zip
r17333: Some C++ warnings
(This used to be commit be9aaffdaccae06c8c035eaf31862e34b7cfbe38)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clifile.c4
-rw-r--r--source3/libsmb/clilist.c5
-rw-r--r--source3/libsmb/clirap.c2
-rw-r--r--source3/libsmb/clireadwrite.c4
-rw-r--r--source3/libsmb/clistr.c4
-rw-r--r--source3/libsmb/clitrans.c8
-rw-r--r--source3/libsmb/libsmbclient.c8
-rw-r--r--source3/libsmb/smb_signing.c15
8 files changed, 28 insertions, 22 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 46ff8af6d5..9beafc55fb 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -1509,7 +1509,7 @@ static BOOL cli_set_ea(struct cli_state *cli, uint16 setup, char *param, unsigne
if (ea_namelen == 0 && ea_len == 0) {
data_len = 4;
- data = SMB_MALLOC(data_len);
+ data = (char *)SMB_MALLOC(data_len);
if (!data) {
return False;
}
@@ -1517,7 +1517,7 @@ static BOOL cli_set_ea(struct cli_state *cli, uint16 setup, char *param, unsigne
SIVAL(p,0,data_len);
} else {
data_len = 4 + 4 + ea_namelen + 1 + ea_len;
- data = SMB_MALLOC(data_len);
+ data = (char *)SMB_MALLOC(data_len);
if (!data) {
return False;
}
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index e18bb185d5..a006c47ae0 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -335,7 +335,7 @@ int cli_list_new(struct cli_state *cli,const char *Mask,uint16 attribute,
/* grab the data for later use */
/* and add them to the dirlist pool */
- dirlist = SMB_REALLOC(dirlist,dirlist_len + data_len);
+ dirlist = (char *)SMB_REALLOC(dirlist,dirlist_len + data_len);
if (!dirlist) {
DEBUG(0,("cli_list_new: Failed to expand dirlist\n"));
@@ -461,7 +461,8 @@ int cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute,
first = False;
- dirlist = SMB_REALLOC(dirlist,(num_received + received)*DIR_STRUCT_SIZE);
+ dirlist = (char *)SMB_REALLOC(
+ dirlist,(num_received + received)*DIR_STRUCT_SIZE);
if (!dirlist) {
DEBUG(0,("cli_list_old: failed to expand dirlist"));
return 0;
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index 26f22f2131..a33baed536 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -847,7 +847,7 @@ BOOL cli_qfileinfo_test(struct cli_state *cli, int fnum, int level, char **poutd
return False;
}
- *poutdata = memdup(rdata, data_len);
+ *poutdata = (char *)memdup(rdata, data_len);
if (!*poutdata) {
SAFE_FREE(rdata);
SAFE_FREE(rparam);
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 883bc1260d..02fa804f41 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -265,11 +265,11 @@ static BOOL cli_issue_write(struct cli_state *cli, int fnum, off_t offset,
BOOL large_writex = False;
if (size > cli->bufsize) {
- cli->outbuf = SMB_REALLOC(cli->outbuf, size + 1024);
+ cli->outbuf = (char *)SMB_REALLOC(cli->outbuf, size + 1024);
if (!cli->outbuf) {
return False;
}
- cli->inbuf = SMB_REALLOC(cli->inbuf, size + 1024);
+ cli->inbuf = (char *)SMB_REALLOC(cli->inbuf, size + 1024);
if (cli->inbuf == NULL) {
SAFE_FREE(cli->outbuf);
return False;
diff --git a/source3/libsmb/clistr.c b/source3/libsmb/clistr.c
index c61445c073..6191f99ea9 100644
--- a/source3/libsmb/clistr.c
+++ b/source3/libsmb/clistr.c
@@ -49,10 +49,10 @@ size_t clistr_pull_fn(const char *function, unsigned int line,
size_t clistr_align_out(struct cli_state *cli, const void *p, int flags)
{
- return align_string(cli->outbuf, p, flags);
+ return align_string(cli->outbuf, (const char *)p, flags);
}
size_t clistr_align_in(struct cli_state *cli, const void *p, int flags)
{
- return align_string(cli->inbuf, p, flags);
+ return align_string(cli->inbuf, (const char *)p, flags);
}
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c
index 4f9f21b848..27207e72e2 100644
--- a/source3/libsmb/clitrans.c
+++ b/source3/libsmb/clitrans.c
@@ -207,7 +207,7 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans,
/* allocate it */
if (total_data!=0) {
- *data = SMB_REALLOC(*data,total_data);
+ *data = (char *)SMB_REALLOC(*data,total_data);
if (!(*data)) {
DEBUG(0,("cli_receive_trans: failed to enlarge data buffer\n"));
goto out;
@@ -215,7 +215,7 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans,
}
if (total_param!=0) {
- *param = SMB_REALLOC(*param,total_param);
+ *param = (char *)SMB_REALLOC(*param,total_param);
if (!(*param)) {
DEBUG(0,("cli_receive_trans: failed to enlarge param buffer\n"));
goto out;
@@ -511,7 +511,7 @@ BOOL cli_receive_nt_trans(struct cli_state *cli,
/* allocate it */
if (total_data) {
- *data = SMB_REALLOC(*data,total_data);
+ *data = (char *)SMB_REALLOC(*data,total_data);
if (!(*data)) {
DEBUG(0,("cli_receive_nt_trans: failed to enlarge data buffer to %d\n",total_data));
goto out;
@@ -519,7 +519,7 @@ BOOL cli_receive_nt_trans(struct cli_state *cli,
}
if (total_param) {
- *param = SMB_REALLOC(*param,total_param);
+ *param = (char *)SMB_REALLOC(*param,total_param);
if (!(*param)) {
DEBUG(0,("cli_receive_nt_trans: failed to enlarge param buffer to %d\n", total_param));
goto out;
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index db788f46e9..c64c3dfb39 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -1281,7 +1281,7 @@ smbc_read_ctx(SMBCCTX *context,
}
/*d_printf(">>>fstat: resolved path as %s\n", targetpath);*/
- ret = cli_read(targetcli, file->cli_fd, buf, offset, count);
+ ret = cli_read(targetcli, file->cli_fd, (char *)buf, offset, count);
if (ret < 0) {
@@ -1365,7 +1365,7 @@ smbc_write_ctx(SMBCCTX *context,
/*d_printf(">>>write: resolved path as %s\n", targetpath);*/
- ret = cli_write(targetcli, file->cli_fd, 0, buf, offset, count);
+ ret = cli_write(targetcli, file->cli_fd, 0, (char *)buf, offset, count);
if (ret <= 0) {
@@ -2246,7 +2246,7 @@ add_dirent(SMBCFILE *dir,
size = sizeof(struct smbc_dirent) + name_length + comment_len + 2;
- dirent = SMB_MALLOC(size);
+ dirent = (struct smbc_dirent *)SMB_MALLOC(size);
if (!dirent) {
@@ -6230,7 +6230,7 @@ smbc_init_context(SMBCCTX *context)
* lazy for the moment
*/
pid = sys_getpid();
- context->netbios_name = SMB_MALLOC(17);
+ context->netbios_name = (char *)SMB_MALLOC(17);
if (!context->netbios_name) {
errno = ENOMEM;
return NULL;
diff --git a/source3/libsmb/smb_signing.c b/source3/libsmb/smb_signing.c
index fd5d8bf06f..e000d539b4 100644
--- a/source3/libsmb/smb_signing.c
+++ b/source3/libsmb/smb_signing.c
@@ -323,7 +323,8 @@ static void simple_packet_signature(struct smb_basic_signing_context *data,
static void client_sign_outgoing_message(char *outbuf, struct smb_sign_info *si)
{
unsigned char calc_md5_mac[16];
- struct smb_basic_signing_context *data = si->signing_context;
+ struct smb_basic_signing_context *data =
+ (struct smb_basic_signing_context *)si->signing_context;
if (!si->doing_signing)
return;
@@ -378,7 +379,8 @@ static BOOL client_check_incoming_message(char *inbuf, struct smb_sign_info *si,
unsigned char calc_md5_mac[16];
unsigned char *server_sent_mac;
- struct smb_basic_signing_context *data = si->signing_context;
+ struct smb_basic_signing_context *data =
+ (struct smb_basic_signing_context *)si->signing_context;
if (!si->doing_signing)
return True;
@@ -433,7 +435,8 @@ We were expecting seq %u\n", reply_seq_number+i, reply_seq_number ));
static void simple_free_signing_context(struct smb_sign_info *si)
{
- struct smb_basic_signing_context *data = si->signing_context;
+ struct smb_basic_signing_context *data =
+ (struct smb_basic_signing_context *)si->signing_context;
struct outstanding_packet_lookup *list;
struct outstanding_packet_lookup *next;
@@ -649,7 +652,8 @@ BOOL client_set_trans_sign_state_off(struct cli_state *cli, uint16 mid)
static void srv_sign_outgoing_message(char *outbuf, struct smb_sign_info *si)
{
unsigned char calc_md5_mac[16];
- struct smb_basic_signing_context *data = si->signing_context;
+ struct smb_basic_signing_context *data =
+ (struct smb_basic_signing_context *)si->signing_context;
uint32 send_seq_number = data->send_seq_num-1;
uint16 mid;
@@ -690,7 +694,8 @@ static void srv_sign_outgoing_message(char *outbuf, struct smb_sign_info *si)
static BOOL srv_check_incoming_message(char *inbuf, struct smb_sign_info *si, BOOL must_be_ok)
{
BOOL good;
- struct smb_basic_signing_context *data = si->signing_context;
+ struct smb_basic_signing_context *data =
+ (struct smb_basic_signing_context *)si->signing_context;
uint32 reply_seq_number = data->send_seq_num;
uint32 saved_seq;
unsigned char calc_md5_mac[16];