diff options
author | Jeremy Allison <jra@samba.org> | 2000-10-04 01:03:23 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-10-04 01:03:23 +0000 |
commit | 23f78fd7b91878176c518471cdca84cad826cba9 (patch) | |
tree | 477d465d5b415d25789c9d53153c9d4a636c2b96 /source3 | |
parent | 6692d0905e3e8605884ced5d38efb26929648d29 (diff) | |
download | samba-23f78fd7b91878176c518471cdca84cad826cba9.tar.gz |
Adding Herb's compile warning fixes to HEAD.
Jeremy.
(This used to be commit d131ad1ce3f6e72e295f865a463f8dcbfa6f8d42)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/lib/kanji.c | 8 | ||||
-rw-r--r-- | source3/lib/messages.c | 2 | ||||
-rw-r--r-- | source3/lib/msrpc_use.c | 2 | ||||
-rw-r--r-- | source3/lib/util_sid.c | 10 | ||||
-rw-r--r-- | source3/lib/util_unistr.c | 8 | ||||
-rw-r--r-- | source3/nsswitch/wb_common.c | 4 | ||||
-rw-r--r-- | source3/rpc_parse/parse_creds.c | 14 | ||||
-rw-r--r-- | source3/rpc_parse/parse_misc.c | 2 | ||||
-rw-r--r-- | source3/rpc_parse/parse_prs.c | 2 | ||||
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr.c | 4 | ||||
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 45 |
13 files changed, 32 insertions, 73 deletions
diff --git a/source3/lib/kanji.c b/source3/lib/kanji.c index fe65f98b58f..ca81933a195 100644 --- a/source3/lib/kanji.c +++ b/source3/lib/kanji.c @@ -422,11 +422,11 @@ static int euc2sjis (int hi, int lo) static int sjis2euc (int hi, int lo) { int minidx = 0; - int maxidx = SJISCONVTBLSIZ; + int maxidx = SJISCONVTBLSIZ -1; /* max index 1 less than number of entries */ int i = ( 0 + SJISCONVTBLSIZ ) % 2; int w = (int)((hi << 8) | lo); - if ( (sjisconv[0].start < w) && (w < sjisconv[SJISCONVTBLSIZ].end) ) { + if ( (sjisconv[0].start < w) && (w < sjisconv[SJISCONVTBLSIZ-1].end) ) { while (maxidx >= minidx) { if ( sjisconv[i].start > w ) { maxidx = i-1; @@ -778,11 +778,11 @@ static char *euc3_to_sj(char *from, BOOL overwrite) static int sjis2jis(int hi, int lo) { int minidx = 0; - int maxidx = SJISCONVTBLSIZ; + int maxidx = SJISCONVTBLSIZ -1; /* max index 1 less than number of entries */ int i = (0 + SJISCONVTBLSIZ) % 2; int w = (int)((hi << 8) | lo); - if ((sjisconv[0].start < w) && (w < sjisconv[SJISCONVTBLSIZ].end)) { + if ((sjisconv[0].start < w) && (w < sjisconv[SJISCONVTBLSIZ-1].end)) { while (maxidx >= minidx) { if (sjisconv[i].start > w) { maxidx = i-1; diff --git a/source3/lib/messages.c b/source3/lib/messages.c index 2409e5b1e88..258610f409a 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -89,7 +89,7 @@ BOOL message_init(void) return False; } - CatchSignal(SIGUSR1, sig_usr1); + CatchSignal(SIGUSR1, SIGNAL_CAST sig_usr1); message_register(MSG_PING, ping_message); diff --git a/source3/lib/msrpc_use.c b/source3/lib/msrpc_use.c index cf6f63c669f..7558a266b3e 100644 --- a/source3/lib/msrpc_use.c +++ b/source3/lib/msrpc_use.c @@ -148,7 +148,7 @@ static struct msrpc_use *msrpc_find(const char* pipe_name, continue; } if (!usr_creds->reuse && - !pwd_compare(&usr_creds->ntc.pwd, &c->cli->usr.ntc.pwd)) + !pwd_compare((struct pwd_info *)&usr_creds->ntc.pwd, &c->cli->usr.ntc.pwd)) { DEBUG(100,("password doesn't match\n")); continue; diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index b4b88c9d888..80254318c48 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -51,8 +51,12 @@ typedef struct _known_sid_users { } known_sid_users; /* static known_sid_users no_users[] = {{0, 0, NULL}}; */ -static known_sid_users everyone_users[] = {{ 0, SID_NAME_WKN_GRP, "Everyone" }, {0, 0, NULL}}; -static known_sid_users creator_owner_users[] = {{ 0, SID_NAME_ALIAS, "Creator Owner" }, {0, 0, NULL}}; +static known_sid_users everyone_users[] = { + { 0, SID_NAME_WKN_GRP, "Everyone" }, + {0, (enum SID_NAME_USE)0, NULL}}; +static known_sid_users creator_owner_users[] = { + { 0, SID_NAME_ALIAS, "Creator Owner" }, + {0, (enum SID_NAME_USE)0, NULL}}; static known_sid_users nt_authority_users[] = { { 1, SID_NAME_ALIAS, "Dialup" }, { 2, SID_NAME_ALIAS, "Network"}, @@ -64,7 +68,7 @@ static known_sid_users nt_authority_users[] = { { 9, SID_NAME_ALIAS, "ServerLogon"}, { 11, SID_NAME_ALIAS, "Authenticated Users"}, { 18, SID_NAME_ALIAS, "SYSTEM"}, - { 0, 0, NULL}}; + { 0, (enum SID_NAME_USE)0, NULL}}; static struct sid_name_map_info { diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c index 93f5490ffcd..3282761ff8a 100644 --- a/source3/lib/util_unistr.c +++ b/source3/lib/util_unistr.c @@ -945,8 +945,8 @@ int strcmp_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2) return c1 - c2; if (c1 == 0) - return 0; - } + break; + } return 0; } @@ -966,9 +966,9 @@ int strncmp_w(const smb_ucs2_t *s1, const smb_ucs2_t *s2, size_t len) return c1 - c2; if (c1 == 0) - return 0; + break; - } + } return 0; } diff --git a/source3/nsswitch/wb_common.c b/source3/nsswitch/wb_common.c index 42712d68da8..3671cf2e4fb 100644 --- a/source3/nsswitch/wb_common.c +++ b/source3/nsswitch/wb_common.c @@ -37,7 +37,7 @@ void init_request(struct winbindd_request *request, int request_type) static char *domain_env; static BOOL initialised; - request->cmd = request_type; + request->cmd = (enum winbindd_cmd)request_type; request->pid = getpid(); request->domain[0] = '\0'; @@ -59,7 +59,7 @@ void init_response(struct winbindd_response *response) { /* Initialise return value */ - response->result = NSS_STATUS_UNAVAIL; + response->result = (enum winbindd_result)NSS_STATUS_UNAVAIL; } /* Close established socket */ diff --git a/source3/rpc_parse/parse_creds.c b/source3/rpc_parse/parse_creds.c index d00a842b1e1..05b33d4da74 100644 --- a/source3/rpc_parse/parse_creds.c +++ b/source3/rpc_parse/parse_creds.c @@ -255,22 +255,22 @@ BOOL creds_io_pwd_info(char *desc, struct pwd_info *pwd, prs_struct *ps, int dep } prs_uint32("crypted", ps, depth, (uint32 *)&(pwd->crypted)); - prs_uint8s(False, "smb_lm_pwd", ps, depth, (char*)&pwd->smb_lm_pwd, sizeof(pwd->smb_lm_pwd)); + prs_uint8s(False, "smb_lm_pwd", ps, depth, (unsigned char*)&pwd->smb_lm_pwd, sizeof(pwd->smb_lm_pwd)); prs_align(ps); - prs_uint8s(False, "smb_nt_pwd", ps, depth, (char*)&pwd->smb_nt_pwd, sizeof(pwd->smb_nt_pwd)); + prs_uint8s(False, "smb_nt_pwd", ps, depth, (unsigned char*)&pwd->smb_nt_pwd, sizeof(pwd->smb_nt_pwd)); prs_align(ps); - prs_uint8s(False, "smb_lm_owf", ps, depth, (char*)&pwd->smb_lm_owf, sizeof(pwd->smb_lm_owf)); + prs_uint8s(False, "smb_lm_owf", ps, depth, (unsigned char*)&pwd->smb_lm_owf, sizeof(pwd->smb_lm_owf)); prs_align(ps); prs_uint32("nt_owf_len", ps, depth, &(pwd->nt_owf_len)); if (pwd->nt_owf_len > sizeof(pwd->smb_nt_owf)) { return False; } - prs_uint8s(False, "smb_nt_owf", ps, depth, (char*)&pwd->smb_nt_owf, pwd->nt_owf_len); + prs_uint8s(False, "smb_nt_owf", ps, depth, (unsigned char*)&pwd->smb_nt_owf, pwd->nt_owf_len); prs_align(ps); - prs_uint8s(False, "lm_cli_chal", ps, depth, (char*)&pwd->lm_cli_chal, sizeof(pwd->lm_cli_chal)); + prs_uint8s(False, "lm_cli_chal", ps, depth, (unsigned char*)&pwd->lm_cli_chal, sizeof(pwd->lm_cli_chal)); prs_align(ps); prs_uint32("nt_cli_chal_len", ps, depth, &(pwd->nt_cli_chal_len)); @@ -278,7 +278,7 @@ BOOL creds_io_pwd_info(char *desc, struct pwd_info *pwd, prs_struct *ps, int dep { return False; } - prs_uint8s(False, "nt_cli_chal", ps, depth, (char*)&pwd->nt_cli_chal, pwd->nt_cli_chal_len); + prs_uint8s(False, "nt_cli_chal", ps, depth, (unsigned char*)&pwd->nt_cli_chal, pwd->nt_cli_chal_len); prs_align(ps); return True; @@ -354,7 +354,7 @@ BOOL creds_io_hybrid(char *desc, CREDS_HYBRID *r_u, prs_struct *ps, int depth) } if (r_u->ptr_ssk != 0) { - prs_uint8s(False, "usr_sess_key", ps, depth, (char*)&r_u->usr_sess_key, sizeof(r_u->usr_sess_key)); + prs_uint8s(False, "usr_sess_key", ps, depth, (unsigned char*)&r_u->usr_sess_key, sizeof(r_u->usr_sess_key)); } else { diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index 34788068c06..93f47bbc7a2 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -620,7 +620,7 @@ BOOL smb_io_buffer3(char *desc, BUFFER3 *buf3, prs_struct *ps, int depth) return False; if (UNMARSHALLING(ps)) { - buf3->buffer = prs_alloc_mem(ps, buf3->buf_max_len); + buf3->buffer = (unsigned char *)prs_alloc_mem(ps, buf3->buf_max_len); if (buf3->buffer == NULL) return False; } diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index b9b52a029dc..d6e5797aaf0 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -592,7 +592,7 @@ BOOL prs_string2(BOOL charmode, char *name, prs_struct *ps, int depth, STRING2 * return False; if (UNMARSHALLING(ps)) { - str->buffer = prs_alloc_mem(ps,str->str_str_len); + str->buffer = (unsigned char *)prs_alloc_mem(ps,str->str_str_len); if (str->buffer == NULL) return False; } diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index ce26ad454f5..c6b219d382d 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -2074,7 +2074,7 @@ BOOL samr_io_q_lookup_names(char *desc, SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *p ********************************************************************/ void init_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, - uint32 num_rids, uint32 *rid, uint8 *type, uint32 status) + uint32 num_rids, uint32 *rid, enum SID_NAME_USE *type, uint32 status) { int i; diff --git a/source3/rpc_server/srv_lsa.c b/source3/rpc_server/srv_lsa.c index a7abc614e37..9c3d7856276 100644 --- a/source3/rpc_server/srv_lsa.c +++ b/source3/rpc_server/srv_lsa.c @@ -298,7 +298,7 @@ static void init_lsa_trans_names(DOM_R_REF *ref, LSA_TRANS_NAME_ENUM *trn, uint32 rid = 0xffffffff; int dom_idx = -1; fstring name, dom_name; - enum SID_NAME_USE sid_name_use = 0; + enum SID_NAME_USE sid_name_use = (enum SID_NAME_USE)0; /* Lookup sid from winbindd */ diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index e3425f32473..7891fc16dc1 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -966,7 +966,7 @@ static BOOL samr_reply_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO *q_u, SAMR_R_QUERY_ALIASINFO r_e; fstring alias_desc = "Local Unix group"; fstring alias=""; - uint8 type; + enum SID_NAME_USE type; uint32 alias_rid; ZERO_STRUCT(r_e); @@ -1112,7 +1112,7 @@ static BOOL samr_reply_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u, prs_struct *rdata) { uint32 rid[MAX_SAM_ENTRIES]; - uint8 type[MAX_SAM_ENTRIES]; + enum SID_NAME_USE type[MAX_SAM_ENTRIES]; uint32 status = 0; int i; int num_rids = q_u->num_names1; diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 717ee1bed14..c32ca8d8713 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -318,10 +318,8 @@ static BOOL get_printer_snum(POLICY_HND *hnd, int *number) return (*number != -1); case PRINTER_HANDLE_IS_PRINTSERVER: return False; - break; default: return False; - break; } } @@ -1459,7 +1457,6 @@ static uint32 size_of_notify_info_data(uint16 type, uint16 field) (notify_info_data_table[i].field == field ) ) { return (notify_info_data_table[i].size); - continue; } i++; } @@ -1486,7 +1483,6 @@ static BOOL type_of_notify_info_data(uint16 type, uint16 field) { return (True); } - continue; } i++; } @@ -1796,10 +1792,8 @@ uint32 _spoolss_rfnpcnex( POLICY_HND *handle, uint32 change, switch (Printer->printer_type) { case PRINTER_HANDLE_IS_PRINTSERVER: return printserver_notify_info(handle, info); - break; case PRINTER_HANDLE_IS_PRINTER: return printer_notify_info(handle, info); - break; } return ERROR_INVALID_HANDLE; @@ -2503,18 +2497,14 @@ uint32 _spoolss_enumprinters( uint32 flags, const UNISTR2 *servername, uint32 le switch (level) { case 1: return enumprinters_level1(flags, name, buffer, offered, needed, returned); - break; case 2: return enumprinters_level2(flags, name, buffer, offered, needed, returned); - break; case 5: return enumprinters_level5(flags, name, buffer, offered, needed, returned); - break; case 3: case 4: default: return ERROR_INVALID_LEVEL; - break; } } @@ -2679,7 +2669,6 @@ uint32 _spoolss_getprinter(POLICY_HND *handle, uint32 level, return getprinter_level_3(servername,snum, buffer, offered, needed); default: return ERROR_INVALID_LEVEL; - break; } } @@ -3137,19 +3126,14 @@ uint32 _spoolss_getprinterdriver2(POLICY_HND *handle, const UNISTR2 *uni_arch, u switch (level) { case 1: return getprinterdriver2_level1(servername, architecture, clientmajorversion, snum, buffer, offered, needed); - break; case 2: return getprinterdriver2_level2(servername, architecture, clientmajorversion, snum, buffer, offered, needed); - break; case 3: return getprinterdriver2_level3(servername, architecture, clientmajorversion, snum, buffer, offered, needed); - break; case 6: return getprinterdriver2_level6(servername, architecture, clientmajorversion, snum, buffer, offered, needed); - break; default: return ERROR_INVALID_LEVEL; - break; } } @@ -3629,17 +3613,13 @@ uint32 _spoolss_setprinter(POLICY_HND *handle, uint32 level, switch (level) { case 0: return control_printer(handle, command, p); - break; case 2: return update_printer(handle, level, info, devmode_ctr.devmode); - break; case 3: return update_printer_sec(handle, level, info, p, secdesc_ctr); - break; default: return ERROR_INVALID_LEVEL; - break; } } @@ -3893,15 +3873,12 @@ uint32 _spoolss_enumjobs( POLICY_HND *handle, uint32 firstjob, uint32 numofjobs, switch (level) { case 1: return enumjobs_level1(queue, snum, buffer, offered, needed, returned); - break; case 2: return enumjobs_level2(queue, snum, buffer, offered, needed, returned); - break; default: safe_free(queue); *returned=0; return ERROR_INVALID_LEVEL; - break; } } @@ -4217,18 +4194,14 @@ uint32 _spoolss_enumprinterdrivers( UNISTR2 *name, UNISTR2 *environment, uint32 switch (level) { case 1: return enumprinterdrivers_level1(servername, architecture, buffer, offered, needed, returned); - break; case 2: return enumprinterdrivers_level2(servername, architecture, buffer, offered, needed, returned); - break; case 3: return enumprinterdrivers_level3(servername, architecture, buffer, offered, needed, returned); - break; default: *returned=0; safe_free(list); return ERROR_INVALID_LEVEL; - break; } } @@ -4609,13 +4582,10 @@ uint32 _spoolss_enumports( UNISTR2 *name, uint32 level, switch (level) { case 1: return enumports_level_1(buffer, offered, needed, returned); - break; case 2: return enumports_level_2(buffer, offered, needed, returned); - break; default: return ERROR_INVALID_LEVEL; - break; } } @@ -4703,15 +4673,12 @@ uint32 _spoolss_addprinterex( const UNISTR2 *uni_srv_name, uint32 level, /* we don't handle yet */ /* but I know what to do ... */ return ERROR_INVALID_LEVEL; - break; case 2: return spoolss_addprinterex_level_2(uni_srv_name, info, unk0, unk1, unk2, unk3, user_switch, user, handle); - break; default: return ERROR_INVALID_LEVEL; - break; } } @@ -4810,10 +4777,8 @@ uint32 _spoolss_getprinterdriverdirectory(UNISTR2 *name, UNISTR2 *uni_environmen switch(level) { case 1: return getprinterdriverdir_level_1(name, uni_environment, buffer, offered, needed); - break; default: return ERROR_INVALID_LEVEL; - break; } } @@ -5198,10 +5163,8 @@ uint32 _spoolss_enumprintprocessors(UNISTR2 *name, UNISTR2 *environment, uint32 switch (level) { case 1: return enumprintprocessors_level_1(buffer, offered, needed, returned); - break; default: return ERROR_INVALID_LEVEL; - break; } } @@ -5250,10 +5213,8 @@ uint32 _spoolss_enumprintprocdatatypes(UNISTR2 *name, UNISTR2 *processor, uint32 switch (level) { case 1: return enumprintprocdatatypes_level_1(buffer, offered, needed, returned); - break; default: return ERROR_INVALID_LEVEL; - break; } } @@ -5342,13 +5303,10 @@ uint32 _spoolss_enumprintmonitors(UNISTR2 *name,uint32 level, switch (level) { case 1: return enumprintmonitors_level_1(buffer, offered, needed, returned); - break; case 2: return enumprintmonitors_level_2(buffer, offered, needed, returned); - break; default: return ERROR_INVALID_LEVEL; - break; } } @@ -5479,14 +5437,11 @@ uint32 _spoolss_getjob( POLICY_HND *handle, uint32 jobid, uint32 level, switch (level) { case 1: return getjob_level_1(queue, count, snum, jobid, buffer, offered, needed); - break; case 2: return getjob_level_2(queue, count, snum, jobid, buffer, offered, needed); - break; default: safe_free(queue); return ERROR_INVALID_LEVEL; - break; } } #undef OLD_NTDOMAIN |