mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
get rid of compiler warnings (casts and delete unused variables)
This commit is contained in:
parent
1b3123df48
commit
51cb4411df
@ -122,7 +122,7 @@ BOOL lang_tdb_init(const char *lang)
|
||||
/* if no lang then we don't translate */
|
||||
if (!lang) return True;
|
||||
|
||||
asprintf(&msg_path, "%s.msg", lib_path(lang));
|
||||
asprintf(&msg_path, "%s.msg", lib_path((char *)lang));
|
||||
if (stat(msg_path, &st) != 0) {
|
||||
/* the msg file isn't available */
|
||||
free(msg_path);
|
||||
@ -202,7 +202,7 @@ const char *lang_msg_rotate(const char *msgid)
|
||||
static pstring bufs[NUM_LANG_BUFS];
|
||||
static int next;
|
||||
|
||||
msgstr = lang_msg(msgid);
|
||||
msgstr = (char *)lang_msg(msgid);
|
||||
if (!msgstr) return msgid;
|
||||
|
||||
pstrcpy(bufs[next], msgstr);
|
||||
|
@ -61,15 +61,15 @@ void init_iconv(void)
|
||||
|
||||
for (c1=0;c1<NUM_CHARSETS;c1++) {
|
||||
for (c2=0;c2<NUM_CHARSETS;c2++) {
|
||||
char *n1 = charset_name(c1);
|
||||
char *n2 = charset_name(c2);
|
||||
char *n1 = charset_name((charset_t)c1);
|
||||
char *n2 = charset_name((charset_t)c2);
|
||||
if (conv_handles[c1][c2]) {
|
||||
smb_iconv_close(conv_handles[c1][c2]);
|
||||
}
|
||||
conv_handles[c1][c2] = smb_iconv_open(n2,n1);
|
||||
if (conv_handles[c1][c2] == (smb_iconv_t)-1) {
|
||||
DEBUG(0,("Conversion from %s to %s not supported\n",
|
||||
charset_name(c1), charset_name(c2)));
|
||||
charset_name((charset_t)c1), charset_name((charset_t)c2)));
|
||||
conv_handles[c1][c2] = NULL;
|
||||
}
|
||||
}
|
||||
@ -135,20 +135,18 @@ size_t convert_string(charset_t from, charset_t to,
|
||||
|
||||
int unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen)
|
||||
{
|
||||
int size,len;
|
||||
int size;
|
||||
smb_ucs2_t *buffer=(smb_ucs2_t*)cvtbuf;
|
||||
size=convert_string(CH_UNIX, CH_UCS2, src, srclen, buffer, sizeof(cvtbuf));
|
||||
len=size/2;
|
||||
if (!strupper_w(buffer) && (dest == src)) return srclen;
|
||||
return convert_string(CH_UCS2, CH_UNIX, buffer, size, dest, destlen);
|
||||
}
|
||||
|
||||
int unix_strlower(const char *src, size_t srclen, char *dest, size_t destlen)
|
||||
{
|
||||
int size,len;
|
||||
int size;
|
||||
smb_ucs2_t *buffer=(smb_ucs2_t*)cvtbuf;
|
||||
size=convert_string(CH_UNIX, CH_UCS2, src, srclen, buffer, sizeof(cvtbuf));
|
||||
len=size/2;
|
||||
if (!strlower_w(buffer) && (dest == src)) return srclen;
|
||||
return convert_string(CH_UCS2, CH_UNIX, buffer, size, dest, destlen);
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ size_t smb_iconv(smb_iconv_t cd,
|
||||
/* in many cases we can go direct */
|
||||
if (cd->direct) {
|
||||
return cd->direct(cd->cd_direct,
|
||||
inbuf, inbytesleft, outbuf, outbytesleft);
|
||||
(char **)inbuf, inbytesleft, outbuf, outbytesleft);
|
||||
}
|
||||
|
||||
|
||||
@ -96,7 +96,7 @@ size_t smb_iconv(smb_iconv_t cd,
|
||||
bufsize = sizeof(cvtbuf);
|
||||
|
||||
if (cd->pull(cd->cd_pull,
|
||||
inbuf, inbytesleft, &bufp, &bufsize) == -1
|
||||
(char **)inbuf, inbytesleft, &bufp, &bufsize) == -1
|
||||
&& errno != E2BIG) return -1;
|
||||
|
||||
bufp = cvtbuf;
|
||||
|
@ -370,7 +370,7 @@ static int setup_ver2_dfs_referral(char* pathname, char** ppdata,
|
||||
requestedpathlen = rpcstr_push(uni_requestedpath, pathname, -1,
|
||||
STR_TERMINATE);
|
||||
|
||||
dump_data(10,uni_requestedpath,requestedpathlen);
|
||||
dump_data(10,(const char *)uni_requestedpath,requestedpathlen);
|
||||
|
||||
DEBUG(10,("ref count = %u\n",junction->referral_count));
|
||||
|
||||
@ -464,7 +464,7 @@ static int setup_ver3_dfs_referral(char* pathname, char** ppdata,
|
||||
|
||||
reqpathlen = rpcstr_push(uni_reqpath, pathname, -1, STR_TERMINATE);
|
||||
|
||||
dump_data(10,uni_reqpath,reqpathlen);
|
||||
dump_data(10,(const char *)uni_reqpath,reqpathlen);
|
||||
|
||||
uni_reqpathoffset1 = REFERRAL_HEADER_SIZE + VERSION3_REFERRAL_SIZE * junction->referral_count;
|
||||
uni_reqpathoffset2 = uni_reqpathoffset1 + reqpathlen;
|
||||
|
@ -121,7 +121,7 @@ static SMB_BIG_UINT disk_free(const char *path, BOOL small_query,
|
||||
} else
|
||||
sys_fsusage(path, dfree, dsize);
|
||||
|
||||
if (disk_quotas(path, &bsize_q, &dfree_q, &dsize_q)) {
|
||||
if (disk_quotas((char *)path, &bsize_q, &dfree_q, &dsize_q)) {
|
||||
(*bsize) = bsize_q;
|
||||
(*dfree) = MIN(*dfree,dfree_q);
|
||||
(*dsize) = MIN(*dsize,dsize_q);
|
||||
|
@ -1568,7 +1568,6 @@ void mangle_name_83(char *s)
|
||||
{
|
||||
smb_ucs2_t *u2, *res;
|
||||
size_t slen, u2len;
|
||||
BOOL ret = False;
|
||||
|
||||
DEBUG(10,("mangle_name_83: I'm so ugly, please remove me!\n"));
|
||||
DEBUG(10,("mangle_name_83: testing -> [%s]\n", s));
|
||||
|
@ -129,7 +129,7 @@ static int reply_lanman2(char *inbuf, char *outbuf)
|
||||
generate_next_challenge(cryptkey);
|
||||
} else {
|
||||
memcpy(cryptkey, cli->secblob.data, 8);
|
||||
set_challenge(cryptkey);
|
||||
set_challenge((unsigned char *)cryptkey);
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,8 +171,8 @@ static int negprot_spnego(char *p, uint8 cryptkey[8])
|
||||
int len;
|
||||
|
||||
memset(guid, 0, 16);
|
||||
safe_strcpy(guid, global_myname, 16);
|
||||
strlower(guid);
|
||||
safe_strcpy((char *)guid, global_myname, 16);
|
||||
strlower((char *)guid);
|
||||
|
||||
/* win2000 uses host$@REALM, which we will probably use eventually,
|
||||
but for now this works */
|
||||
@ -230,7 +230,7 @@ static int reply_nt1(char *inbuf, char *outbuf)
|
||||
|
||||
if (global_encrypted_passwords_negotiated) {
|
||||
if (!cli) {
|
||||
generate_next_challenge(cryptkey);
|
||||
generate_next_challenge((char *)cryptkey);
|
||||
} else {
|
||||
memcpy(cryptkey, cli->secblob.data, 8);
|
||||
set_challenge(cryptkey);
|
||||
|
@ -420,7 +420,7 @@ static int reply_sesssetup_and_X_spnego(connection_struct *conn, char *inbuf,cha
|
||||
global_client_caps = IVAL(inbuf,smb_vwv10);
|
||||
}
|
||||
|
||||
p = smb_buf(inbuf);
|
||||
p = (uint8 *)smb_buf(inbuf);
|
||||
|
||||
if (SVAL(inbuf, smb_vwv7) == 0) {
|
||||
/* an anonymous request */
|
||||
|
Loading…
x
Reference in New Issue
Block a user