Some C++ warnings
authorVolker Lendecke <vl@samba.org>
Thu, 20 Dec 2007 21:17:16 +0000 (22:17 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 21 Dec 2007 08:58:20 +0000 (09:58 +0100)
(This used to be commit 5ab82d4f574f2a2e2761e9e414c66a70aeffb05d)

source3/lib/memcache.c
source3/lib/socket_wrapper/socket_wrapper.c
source3/lib/time.c
source3/libsmb/clientgen.c
source3/rpc_server/srv_dfs_nt.c
source3/rpc_server/srv_srvsvc_nt.c
source3/rpc_server/srv_winreg_nt.c
source3/rpc_server/srv_wkssvc_nt.c
source3/smbd/reply.c

index 192a822cde10947098340a73ccf35af17a1e881c..448b8b2f8465cbbb397f4f7ad5c65ccd49258ff4 100644 (file)
@@ -61,7 +61,7 @@ static int memcache_destructor(struct memcache *cache) {
 
        for (e = cache->mru; e != NULL; e = next) {
                next = e->next;
-               if (memcache_is_talloc(e->n)
+               if (memcache_is_talloc((enum memcache_number)e->n)
                    && (e->valuelength == sizeof(void *))) {
                        DATA_BLOB key, value;
                        void *ptr;
index 3a72c5a74a0ecd0826c2b751110eaaa857f1d98c..a84c460114779296b2dba66908de551041a27cca 100644 (file)
@@ -571,8 +571,8 @@ static const char *socket_wrapper_pcap_file(void)
 {
        static int initialized = 0;
        static const char *s = NULL;
-       static const struct swrap_file_hdr h;
-       static const struct swrap_packet p;
+       static const struct swrap_file_hdr h = { 0, };
+       static const struct swrap_packet p = { 0, };
 
        if (initialized == 1) {
                return s;
index 5301e3a55a4049bd6908ecc90cb13e76eb08e9c0..f98e03197f210315d52b2045e6985a58af4915f5 100644 (file)
@@ -1382,7 +1382,7 @@ void unix_to_nt_time_abs(NTTIME *nt, time_t t)
        d = (double)(t);
        d *= 1.0e7;
 
-       *nt = d;
+       *nt = (NTTIME)d;
 
        /* convert to a negative value */
        *nt=~*nt;
@@ -1443,7 +1443,7 @@ const char *display_time(NTTIME nttime)
        low = ~(nttime & 0xFFFFFFFF);
        low = low/(1000*1000*10);
 
-       sec=high+low;
+       sec=(int)(high+low);
 
        days=sec/(60*60*24);
        hours=(sec - (days*60*60*24)) / (60*60);
index 1a6fb8f93fb9149dfe4ce1377a861f05ca74582d..0544b3d879ce726a1133224cfd25e38f666025bd 100644 (file)
@@ -471,7 +471,7 @@ struct cli_state *cli_initialise(void)
        cli->inbuf = (char *)SMB_MALLOC(cli->bufsize+SAFETY_MARGIN);
        cli->oplock_handler = cli_oplock_ack;
        cli->case_sensitive = False;
-       cli->smb_rw_error = 0;
+       cli->smb_rw_error = SMB_READ_OK;
 
        cli->use_spnego = lp_client_use_spnego();
 
@@ -606,7 +606,7 @@ void cli_shutdown(struct cli_state *cli)
                close(cli->fd);
        }
        cli->fd = -1;
-       cli->smb_rw_error = 0;
+       cli->smb_rw_error = SMB_READ_OK;
 
        SAFE_FREE(cli);
 }
index 8a1cdedb4fa3757b566d916bd4a1509ebc75e4b5..690ddd60d683c60f8e87717577c4f5afb50787aa 100644 (file)
@@ -34,7 +34,7 @@ void _dfs_GetManagerVersion(pipes_struct *p, struct dfs_GetManagerVersion *r)
        if (lp_host_msdfs()) {
                *r->out.version = DFS_MANAGER_VERSION_NT4;
        } else {
-               *r->out.version = 0;
+               *r->out.version = (enum dfs_ManagerVersion)0;
        }
 }
 
index 43f57a01097322f8089a7518261de98d6c6e1d3d..3cc2472116a7793b677d223ff557ecc3303fef00 100644 (file)
@@ -2167,7 +2167,7 @@ WERROR _srv_net_file_query_secdesc(pipes_struct *p, SRV_Q_NET_FILE_QUERY_SECDESC
        r_u->size_secdesc = sd_size;
        r_u->sec_desc = psd;
 
-       psd->dacl->revision = (uint16) NT4_ACL_REVISION;
+       psd->dacl->revision = NT4_ACL_REVISION;
 
        unbecome_user();
        close_cnum(conn, user.vuid);
index 873224085c1d9ada8babdb0131e87f0598f04fe5..7dd5268088c075e4a9f25ab3638586d5df274500 100644 (file)
@@ -234,7 +234,7 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r)
        if ( !regkey )
                return WERR_BADFID;
 
-       *r->out.value_length = *r->out.type = 0;
+       *r->out.value_length = *r->out.type = REG_NONE;
        
        DEBUG(7,("_reg_info: policy key name = [%s]\n", regkey->key->name));
        DEBUG(7,("_reg_info: policy key type = [%08x]\n", regkey->key->type));
index 1e43b5ae994d56b839b0e2c3bf388dba39bb47ea..d9d2df344a16dd2da299e1ec12825c6ae769ba53 100644 (file)
@@ -32,7 +32,7 @@
 
 static void create_wks_info_100(struct wkssvc_NetWkstaInfo100 *info100)
 {
-       info100->platform_id     = 0x000001f4;  /* unknown */
+       info100->platform_id     = PLATFORM_ID_NT;      /* unknown */
        info100->version_major   = lp_major_announce_version();
        info100->version_minor   = lp_minor_announce_version();
 
index 45081808e1a2dbf95055d218e8ba7522cb665bcf..575ca13ff685c31d5b9dfa5fcf08a554ed2fe613 100644 (file)
@@ -1163,8 +1163,8 @@ void reply_dskattr(connection_struct *conn, struct smb_request *req)
                total_space = dsize * (double)bsize;
                free_space = dfree * (double)bsize;
 
-               dsize = (total_space+63*512) / (64*512);
-               dfree = (free_space+63*512) / (64*512);
+               dsize = (SMB_BIG_UINT)((total_space+63*512) / (64*512));
+               dfree = (SMB_BIG_UINT)((free_space+63*512) / (64*512));
                
                if (dsize > 0xFFFF) dsize = 0xFFFF;
                if (dfree > 0xFFFF) dfree = 0xFFFF;