Adding Herb's compile warning fixes to HEAD.
authorJeremy Allison <jra@samba.org>
Wed, 4 Oct 2000 01:03:23 +0000 (01:03 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 4 Oct 2000 01:03:23 +0000 (01:03 +0000)
Jeremy.

13 files changed:
source/lib/kanji.c
source/lib/messages.c
source/lib/msrpc_use.c
source/lib/util_sid.c
source/lib/util_unistr.c
source/nsswitch/wb_common.c
source/rpc_parse/parse_creds.c
source/rpc_parse/parse_misc.c
source/rpc_parse/parse_prs.c
source/rpc_parse/parse_samr.c
source/rpc_server/srv_lsa.c
source/rpc_server/srv_samr.c
source/rpc_server/srv_spoolss_nt.c

index fe65f98b58fad8cab8e9ec691dfc65c4fa103467..ca81933a195140c17e78dcf1d53b4adfc08cdcdc 100644 (file)
@@ -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;
index 2409e5b1e886cb4ce773be83d8e826c63d3a70be..258610f409a803bca7735f3ca44018e670ae5191 100644 (file)
@@ -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);
 
index cf6f63c669f7f15c4487dfd655dce8227026efad..7558a266b3e432c670701a3001b7d2787a62051e 100644 (file)
@@ -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;
index b4b88c9d888fd25c7dca4eb61ca7a9021b073add..80254318c48e546cd59ef115e2ae9518af8600e3 100644 (file)
@@ -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
 {
index 93f5490ffcd1cc92410f9ec8599fe4e7bff44273..3282761ff8a9a21d13940b3ce02465ae82c547de 100644 (file)
@@ -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;
 }
 
index 42712d68da8b019d2c6a6b10e6bc599f94aa089d..3671cf2e4fbf10095a4e7fe00664c3fbb8ea5a6b 100644 (file)
@@ -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 */
index d00a842b1e119e45b82f8c31a5dc469c88381026..05b33d4da7413d5dee052e8846754d27fa696f9a 100644 (file)
@@ -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
        {
index 34788068c062b12f41e8f3f0ceb1ca94d8ede449..93f47bbc7a26bd17b671f00d6cf962082226a114 100644 (file)
@@ -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;
        }
index b9b52a029dc57cd77bb949771f8afb4981293759..d6e5797aaf0ed7980ec62f98c36ca83ccaa42e75 100644 (file)
@@ -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;
        }
index ce26ad454f5187677358dd2428a90740d56863c4..c6b219d382d1046fc68cc38e1139b33163976213 100644 (file)
@@ -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;
 
index a7abc614e37cb158c6ab5c4acd05871aa932e970..9c3d7856276b96d9b7b308d2d4200cd7be1bd453 100644 (file)
@@ -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 */
 
index e3425f324739ec2acdb6418bb56bf65650562381..7891fc16dc1ea6eb8e37b8ae742b0e01c8a292df 100644 (file)
@@ -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;
index 717ee1bed1462b3373290cb4f986669974c5f0de..c32ca8d871308af8934b71114b3aac291fb124f7 100644 (file)
@@ -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