r17590: Some C++ Warnings
authorVolker Lendecke <vlendec@samba.org>
Thu, 17 Aug 2006 14:28:03 +0000 (14:28 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:41 +0000 (11:38 -0500)
(This used to be commit b7ec240880af0072ef20b2c0d688ef3cc386d484)

source3/printing/notify.c
source3/printing/nt_printing.c
source3/printing/printing.c

index f27eb2011ff4dab8dee6c013a741466180be5853..916ff213cc50c2491eb6a621a30d80305aedb899 100644 (file)
@@ -99,7 +99,7 @@ again:
                                msg->len, msg->notify.data);
 
        if (buflen != len) {
-               buf = TALLOC_REALLOC(send_ctx, buf, len);
+               buf = (char *)TALLOC_REALLOC(send_ctx, buf, len);
                if (!buf)
                        return False;
                buflen = len;
@@ -140,7 +140,7 @@ static void print_notify_send_messages_to_printer(const char *printer, unsigned
        }
        offset += 4; /* For count. */
 
-       buf = TALLOC(send_ctx, offset);
+       buf = (char *)TALLOC(send_ctx, offset);
        if (!buf) {
                DEBUG(0,("print_notify_send_messages: Out of memory\n"));
                talloc_free_children(send_ctx);
@@ -220,7 +220,7 @@ static BOOL copy_notify2_msg( SPOOLSS_NOTIFY_MSG *to, SPOOLSS_NOTIFY_MSG *from )
        memcpy( to, from, sizeof(SPOOLSS_NOTIFY_MSG) );
        
        if ( from->len ) {
-               to->notify.data = TALLOC_MEMDUP(send_ctx, from->notify.data, from->len );
+               to->notify.data = (char *)TALLOC_MEMDUP(send_ctx, from->notify.data, from->len );
                if ( !to->notify.data ) {
                        DEBUG(0,("copy_notify2_msg: talloc_memdup() of size [%d] failed!\n", from->len ));
                        return False;
index 4b71f6e0b6688f1173d814f18c7f6e5c8797effc..6b71286b1b28c2572250c3827888d003d5a02182 100644 (file)
@@ -1035,7 +1035,7 @@ static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32
        char    *buf = NULL;
        ssize_t byte_count;
 
-       if ((buf=SMB_MALLOC(PE_HEADER_SIZE)) == NULL) {
+       if ((buf=(char *)SMB_MALLOC(PE_HEADER_SIZE)) == NULL) {
                DEBUG(0,("get_file_version: PE file [%s] PE Header malloc failed bytes = %d\n",
                                fname, PE_HEADER_SIZE));
                goto error_exit;
@@ -1091,7 +1091,7 @@ static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32
                        goto error_exit;
 
                SAFE_FREE(buf);
-               if ((buf=SMB_MALLOC(section_table_bytes)) == NULL) {
+               if ((buf=(char *)SMB_MALLOC(section_table_bytes)) == NULL) {
                        DEBUG(0,("get_file_version: PE file [%s] section table malloc failed bytes = %d\n",
                                        fname, section_table_bytes));
                        goto error_exit;
@@ -1115,7 +1115,7 @@ static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32
                                        goto error_exit;
 
                                SAFE_FREE(buf);
-                               if ((buf=SMB_MALLOC(section_bytes)) == NULL) {
+                               if ((buf=(char *)SMB_MALLOC(section_bytes)) == NULL) {
                                        DEBUG(0,("get_file_version: PE file [%s] version malloc failed bytes = %d\n",
                                                        fname, section_bytes));
                                        goto error_exit;
@@ -1175,7 +1175,7 @@ static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32
 
                /* Allocate a bit more space to speed up things */
                SAFE_FREE(buf);
-               if ((buf=SMB_MALLOC(VS_NE_BUF_SIZE)) == NULL) {
+               if ((buf=(char *)SMB_MALLOC(VS_NE_BUF_SIZE)) == NULL) {
                        DEBUG(0,("get_file_version: NE file [%s] malloc failed bytes  = %d\n",
                                        fname, PE_HEADER_SIZE));
                        goto error_exit;
@@ -2083,7 +2083,7 @@ static WERROR get_a_printer_driver_3_default(NT_PRINTER_DRIVER_INFO_LEVEL_3 **in
        memset(info.dependentfiles, '\0', 2*sizeof(fstring));
        fstrcpy(info.dependentfiles[0], "");
 
-       *info_ptr = memdup(&info, sizeof(info));
+       *info_ptr = (NT_PRINTER_DRIVER_INFO_LEVEL_3 *)memdup(&info, sizeof(info));
        if (!*info_ptr) {
                SAFE_FREE(info.dependentfiles);
                return WERR_NOMEM;
@@ -2555,7 +2555,7 @@ NT_DEVICEMODE *dup_nt_devicemode(NT_DEVICEMODE *nt_devicemode)
 
        new_nt_devicemode->nt_dev_private = NULL;
        if (nt_devicemode->nt_dev_private != NULL) {
-               if ((new_nt_devicemode->nt_dev_private = memdup(nt_devicemode->nt_dev_private, nt_devicemode->driverextra)) == NULL) {
+               if ((new_nt_devicemode->nt_dev_private = (uint8 *)memdup(nt_devicemode->nt_dev_private, nt_devicemode->driverextra)) == NULL) {
                        SAFE_FREE(new_nt_devicemode);
                        DEBUG(0,("dup_nt_devicemode: malloc fail.\n"));
                        return NULL;
@@ -3039,7 +3039,7 @@ static WERROR nt_printer_publish_ads(ADS_STRUCT *ads,
        /* We use ldap_get_dn here as we need the answer
         * in utf8 to call ldap_explode_dn(). JRA. */
 
-       srv_dn_utf8 = ldap_get_dn(ads->ld, res);
+       srv_dn_utf8 = ldap_get_dn((LDAP *)ads->ld, (LDAPMessage *)res);
        if (!srv_dn_utf8) {
                ads_destroy(&ads);
                return WERR_SERVER_UNAVAILABLE;
index fbb81665650c27da3ccba6c1be9bea514bec8661..0d9ae02545a51ae07b8d2ab3c91d7f9b2647d909 100644 (file)
@@ -271,7 +271,7 @@ static TDB_DATA print_key(uint32 jobid)
        TDB_DATA ret;
 
        SIVAL(&j, 0, jobid);
-       ret.dptr = (void *)&j;
+       ret.dptr = (char *)&j;
        ret.dsize = sizeof(j);
        return ret;
 }
@@ -917,7 +917,7 @@ static void set_updating_pid(const fstring sharename, BOOL updating)
        }
        
        SIVAL( buffer, 0, updating_pid);
-       data.dptr = (void *)buffer;
+       data.dptr = (char *)buffer;
        data.dsize = 4;         /* we always assume this is a 4 byte value */
 
        tdb_store(pdb->tdb, key, data, TDB_REPLACE);    
@@ -984,7 +984,7 @@ static void store_queue_struct(struct tdb_print_db *pdb, struct traverse_struct
                                queue[i].fs_file);
        }
 
-       if ((data.dptr = SMB_MALLOC(data.dsize)) == NULL)
+       if ((data.dptr = (char *)SMB_MALLOC(data.dsize)) == NULL)
                return;
 
         len = 0;
@@ -1235,7 +1235,7 @@ static void print_queue_update_internal( const char *sharename,
        key.dsize = strlen(keystr);
 
        status.qcount = qcount;
-       data.dptr = (void *)&status;
+       data.dptr = (char *)&status;
        data.dsize = sizeof(status);
        tdb_store(pdb->tdb, key, data, TDB_REPLACE);    
 
@@ -1357,7 +1357,7 @@ static void print_queue_receive(int msg_type, struct process_id src,
        int printing_type;
        size_t len;
 
-       len = tdb_unpack( buf, msglen, "fdPP",
+       len = tdb_unpack( (char *)buf, msglen, "fdPP",
                sharename,
                &printing_type,
                lpqcommand,
@@ -1605,7 +1605,7 @@ BOOL print_notify_register_pid(int snum)
 
        if (i == data.dsize) {
                /* We weren't in the list. Realloc. */
-               data.dptr = SMB_REALLOC(data.dptr, data.dsize + 8);
+               data.dptr = (char *)SMB_REALLOC(data.dptr, data.dsize + 8);
                if (!data.dptr) {
                        DEBUG(0,("print_notify_register_pid: Relloc fail for printer %s\n",
                                                printername));