r18047: More C++ stuff
authorVolker Lendecke <vlendec@samba.org>
Mon, 4 Sep 2006 19:47:48 +0000 (19:47 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:43:24 +0000 (11:43 -0500)
(This used to be commit 86f4ca84f2df2aa8977eb24828e3aa840dda7201)

source3/client/clitar.c
source3/libads/kerberos_verify.c
source3/libads/sasl.c
source3/libsmb/smbdes.c
source3/nsswitch/winbindd_async.c
source3/printing/print_iprint.c
source3/rpc_parse/parse_dfs.c
source3/utils/net_lookup.c

index d8cf43e652638cc10425fd77efa8a286d0f14867..f228db119981f62b7cb981b39759d8f47a8a9130 100644 (file)
@@ -1075,7 +1075,7 @@ static char *get_longfilename(file_info2 finfo)
        /* finfo.size here is the length of the filename as written by the "/./@LongLink" name
         * header call. */
        int namesize = finfo.size + strlen(cur_dir) + 2;
-       char *longname = SMB_MALLOC(namesize);
+       char *longname = (char *)SMB_MALLOC(namesize);
        int offset = 0, left = finfo.size;
        BOOL first = True;
 
@@ -1523,7 +1523,7 @@ static int read_inclusion_file(char *filename)
        while ((! error) && (x_fgets(buf, sizeof(buf)-1, inclusion))) {
                if (inclusion_buffer == NULL) {
                        inclusion_buffer_size = 1024;
-                       if ((inclusion_buffer = SMB_MALLOC(inclusion_buffer_size)) == NULL) {
+                       if ((inclusion_buffer = (char *)SMB_MALLOC(inclusion_buffer_size)) == NULL) {
                                DEBUG(0,("failure allocating buffer to read inclusion file\n"));
                                error = 1;
                                break;
@@ -1536,7 +1536,7 @@ static int read_inclusion_file(char *filename)
     
                if ((strlen(buf) + 1 + inclusion_buffer_sofar) >= inclusion_buffer_size) {
                        inclusion_buffer_size *= 2;
-                       inclusion_buffer = SMB_REALLOC(inclusion_buffer,inclusion_buffer_size);
+                       inclusion_buffer = (char *)SMB_REALLOC(inclusion_buffer,inclusion_buffer_size);
                        if (!inclusion_buffer) {
                                DEBUG(0,("failure enlarging inclusion buffer to %d bytes\n",
                                                inclusion_buffer_size));
index 3aa0860809d39692ab612483107d83d7e9ccffc3..dc2f2a1e788acfcfc6677b0c8ac5b5958b32e171 100644 (file)
@@ -101,7 +101,7 @@ static BOOL ads_keytab_verify_ticket(krb5_context context, krb5_auth_context aut
                                if (strequal(entry_princ_s, valid_princ_formats[i])) {
                                        number_matched_principals++;
                                        p_packet->length = ticket->length;
-                                       p_packet->data = (krb5_pointer)ticket->data;
+                                       p_packet->data = (char *)ticket->data;
                                        *pp_tkt = NULL;
 
                                        ret = krb5_rd_req_return_keyblock_from_keytab(context, &auth_context, p_packet,
@@ -228,7 +228,7 @@ static BOOL ads_secrets_verify_ticket(krb5_context context, krb5_auth_context au
        /* CIFS doesn't use addresses in tickets. This would break NAT. JRA */
 
        p_packet->length = ticket->length;
-       p_packet->data = (krb5_pointer)ticket->data;
+       p_packet->data = (char *)ticket->data;
 
        /* We need to setup a auth context with each possible encoding type in turn. */
        for (i=0;enctypes[i];i++) {
index fe31ef94bb6e9bd0aebdd5d9776674c2b77ff192..c3f496938acc2faf1279099f428485515b9e33ff 100644 (file)
@@ -348,7 +348,7 @@ static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads)
                        goto failed;
                }
 
-               cred.bv_val = output_token.value;
+               cred.bv_val = (char *)output_token.value;
                cred.bv_len = output_token.length;
 
                rc = ldap_sasl_bind_s(ads->ld, NULL, "GSSAPI", &cred, NULL, NULL, 
@@ -397,7 +397,7 @@ static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads)
        gss_release_buffer(&minor_status, &output_token);
 
        output_token.value = SMB_MALLOC(strlen(ads->config.bind_path) + 8);
-       p = output_token.value;
+       p = (uint8 *)output_token.value;
 
        *p++ = 1; /* no sign & seal selection */
        /* choose the same size as the server gave us */
@@ -419,7 +419,7 @@ static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads)
 
        free(output_token.value);
 
-       cred.bv_val = input_token.value;
+       cred.bv_val = (char *)input_token.value;
        cred.bv_len = input_token.length;
 
        rc = ldap_sasl_bind_s(ads->ld, NULL, "GSSAPI", &cred, NULL, NULL, 
index ee43f4beee5981d0324df4f1e237033bc94c62b8..8168eee207f8f68d71d9b21eb727811837e87654 100644 (file)
@@ -172,7 +172,7 @@ static void concat(char *out, char *in1, char *in2, int l1, int l2)
                *out++ = *in2++;
 }
 
-static void xor(char *out, char *in1, char *in2, int n)
+static void x_or(char *out, char *in1, char *in2, int n)
 {
        int i;
        for (i=0;i<n;i++)
@@ -223,7 +223,7 @@ static void dohash(char *out, char *in, char *key, int forw)
 
                permute(er, r, perm4, 48);
 
-               xor(erk, er, ki[forw ? i : 15 - i], 48);
+               x_or(erk, er, ki[forw ? i : 15 - i], 48);
 
                for (j=0;j<8;j++)
                        for (k=0;k<6;k++)
@@ -244,7 +244,7 @@ static void dohash(char *out, char *in, char *key, int forw)
                                cb[j*4+k] = b[j][k];
                permute(pcb, cb, perm5, 32);
 
-               xor(r2, l, pcb, 32);
+               x_or(r2, l, pcb, 32);
 
                for (j=0;j<32;j++)
                        l[j] = r[j];
index 696f3501efaa94b1d44730b461a2c7694462c4c7..bb8b523246785d6ed0ad760d521c684fde8c27a0 100644 (file)
@@ -169,8 +169,9 @@ enum winbindd_result winbindd_dual_idmapset(struct winbindd_domain *domain,
        else
                id.gid = state->request.data.dual_idmapset.gid;
 
-       result = idmap_set_mapping(&sid, id,
-                                  state->request.data.dual_idmapset.type);
+       result = idmap_set_mapping(
+               &sid, id,
+               (enum idmap_type)state->request.data.dual_idmapset.type);
        return NT_STATUS_IS_OK(result) ? WINBINDD_OK : WINBINDD_ERROR;
 }
 
@@ -1559,7 +1560,8 @@ void winbindd_uid2sid_async(TALLOC_CTX *mem_ctx, uid_t uid,
        ZERO_STRUCT(request);
        request.cmd = WINBINDD_DUAL_UID2SID;
        request.data.uid = uid;
-       do_async(mem_ctx, idmap_child(), &request, winbindd_uid2sid_recv, cont, private_data);
+       do_async(mem_ctx, idmap_child(), &request, winbindd_uid2sid_recv,
+                (void *)cont, private_data);
 }
 
 enum winbindd_result winbindd_dual_uid2sid(struct winbindd_domain *domain,
@@ -1615,7 +1617,8 @@ void winbindd_gid2sid_async(TALLOC_CTX *mem_ctx, gid_t gid,
        ZERO_STRUCT(request);
        request.cmd = WINBINDD_DUAL_GID2SID;
        request.data.gid = gid;
-       do_async(mem_ctx, idmap_child(), &request, winbindd_gid2sid_recv, cont, private_data);
+       do_async(mem_ctx, idmap_child(), &request, winbindd_gid2sid_recv,
+                (void *)cont, private_data);
 }
 
 enum winbindd_result winbindd_dual_gid2sid(struct winbindd_domain *domain,
index 04b096a8a5b3bc6244bf7123737a2492e8e11868..3eb231c2ebaa2650937751697db668bc4d4be9e4 100644 (file)
@@ -92,7 +92,7 @@ static int iprint_get_server_version(http_t *http, char* serviceUri)
 
        request = ippNew();
 
-       request->request.op.operation_id = OPERATION_NOVELL_MGMT;
+       request->request.op.operation_id = (ipp_op_t)OPERATION_NOVELL_MGMT;
        request->request.op.request_id   = 1;
 
        language = cupsLangDefault();
@@ -343,7 +343,8 @@ BOOL iprint_cache_reload(void)
 
        request = ippNew();
 
-       request->request.op.operation_id = OPERATION_NOVELL_LIST_PRINTERS;
+       request->request.op.operation_id =
+               (ipp_op_t)OPERATION_NOVELL_LIST_PRINTERS;
        request->request.op.request_id   = 1;
 
        language = cupsLangDefault();
index 6d439632bac8d5682e4ff375bac61c13fef38a82..f246e2f2548d5fb379f5a12c2605bcab2d40720c 100644 (file)
@@ -2576,7 +2576,7 @@ BOOL init_netdfs_q_dfs_EnumEx(NETDFS_Q_DFS_ENUMEX *v, uint32 level, uint32 bufsi
        if (!dfs_name)
                return False;
        
-       init_unistr2(&v->dfs_name, dfs_name, UNI_FLAGS_NONE|UNI_STR_TERMINATE);
+       init_unistr2(&v->dfs_name, dfs_name, UNI_STR_TERMINATE);
 
        v->level = level;
        
index 8e1450cfa0638a9bd24cf3d8202961fbf5a15dbd..ebc7ba98b0d9da7bf30a32353d3d1f9b1f1644ac 100644 (file)
@@ -211,10 +211,10 @@ static int net_lookup_kdc(int argc, const char **argv)
        }
 
        if (argc>0) {
-                realm.data = CONST_DISCARD(krb5_pointer, argv[0]);
+                realm.data = CONST_DISCARD(char *, argv[0]);
                realm.length = strlen(argv[0]);
        } else if (lp_realm() && *lp_realm()) {
-               realm.data = (krb5_pointer) lp_realm();
+               realm.data = lp_realm();
                realm.length = strlen(realm.data);
        } else {
                rc = krb5_get_host_realm(ctx, NULL, &realms);
@@ -223,7 +223,7 @@ static int net_lookup_kdc(int argc, const char **argv)
                                 error_message(rc)));
                        return -1;
                }
-               realm.data = (krb5_pointer) *realms;
+               realm.data = (char *) *realms;
                realm.length = strlen(realm.data);
        }