get rid of compiler warnings (casts and delete unused variables)
authorHerb Lewis <herb@samba.org>
Tue, 23 Oct 2001 19:10:30 +0000 (19:10 +0000)
committerHerb Lewis <herb@samba.org>
Tue, 23 Oct 2001 19:10:30 +0000 (19:10 +0000)
(This used to be commit 51cb4411df61d1caec9d84809b1a53a6a632f808)

source3/intl/lang_tdb.c
source3/lib/charcnv.c
source3/lib/iconv.c
source3/msdfs/msdfs.c
source3/smbd/dfree.c
source3/smbd/mangle.c
source3/smbd/negprot.c
source3/smbd/sesssetup.c

index 38bdcdd132c530d19bdfd879d6ca0b84322362e7..36f8020bbe1bb9ddd2d6aec12106a855b85b3b2a 100644 (file)
@@ -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);
index b7af6fef4b76d8bc0ebc7eedac942e1cd210ede4..d14a1f04e4e6d166c106549b2ad54b0528551a2c 100644 (file)
@@ -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);
 }
index cf9fabf8c6503ed0f2cac99226498644b9445625..8bcd92d72a3f28f74412e8ce14a050a7d19b3aae 100644 (file)
@@ -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;
index 7ba40a5bd01fa707a0791f20d456fb4cbd0b6a64..f2915606e839b35401fc7b962663a848fee16633 100644 (file)
@@ -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;
index 51f0614941966916459e3d8eeae5afb533efe871..13a3e86c6e1775581eca812e43cb360f6f124c6d 100644 (file)
@@ -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);
index d68d05297884ff0314396146393825289fbe1976..40e66061afe068bc739358a886ce1a3188270388 100644 (file)
@@ -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));
index 097cb79e67a527b1d8b6c5224f77838f44b8594f..16d315f1d89879168755636362a061079aac8680 100644 (file)
@@ -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);
index fc6c694d9f1d12497cee00f9a617e07b11a67237..5412cc3badad988fe26abe0241c4be2b18bf70bf 100644 (file)
@@ -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 */