r9780: Clean up a bunch of compiler warnings.
authorJames Peach <jpeach@samba.org>
Tue, 30 Aug 2005 06:41:32 +0000 (06:41 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:03:26 +0000 (11:03 -0500)
source/lib/util_unistr.c
source/libads/krb5_setpw.c
source/nsswitch/wb_common.c
source/nsswitch/winbindd_util.c
source/param/loadparm.c
source/rpc_parse/parse_lsa.c
source/rpc_server/srv_reg_nt.c
source/rpc_server/srv_srvsvc_nt.c
source/utils/profiles.c

index 8ed8c5c37fb6ecebaf1bb7c94ba09dd883aeebd4..d80bb2ce5219b74149db09547e58fb52f0b0bfa4 100644 (file)
@@ -213,8 +213,9 @@ void init_valid_table(void)
 
 size_t dos_PutUniCode(char *dst,const char *src, ssize_t len, BOOL null_terminate)
 {
-       return push_ucs2(NULL, dst, src, len, 
-                        STR_UNICODE|STR_NOALIGN | (null_terminate?STR_TERMINATE:0));
+       int flags = null_terminate ? STR_UNICODE|STR_NOALIGN|STR_TERMINATE
+                                  : STR_UNICODE|STR_NOALIGN;
+       return push_ucs2(NULL, dst, src, len, flags);
 }
 
 
index dadce2593c85262aca7550fb5309cb8bf19c629b..c261d15c219df940603a98f85de619b1e2c01697 100644 (file)
@@ -317,23 +317,17 @@ static krb5_error_code parse_setpw_reply(krb5_context context,
                switch(res_code) {
                        case KRB5_KPASSWD_ACCESSDENIED:
                                return KRB5KDC_ERR_BADOPTION;
-                               break;
                        case KRB5_KPASSWD_INITIAL_FLAG_NEEDED:
                                return KRB5KDC_ERR_BADOPTION;
                                /* return KV5M_ALT_METHOD; MIT-only define */
-                               break;
                        case KRB5_KPASSWD_ETYPE_NOSUPP:
                                return KRB5KDC_ERR_ETYPE_NOSUPP;
-                               break;
                        case KRB5_KPASSWD_BAD_PRINCIPAL:
                                return KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN;
-                               break;
                        case KRB5_KPASSWD_POLICY_REJECT:
                                return KRB5KDC_ERR_POLICY;
-                               break;
                        default:
                                return KRB5KRB_ERR_GENERIC;
-                               break;
                }
        }
 }
index b6f617eb952c9d1e6963ef3d6751d4511e9742e7..5ed0b9161e7c49e50c7793ed04c38d5af486fc66 100644 (file)
@@ -280,14 +280,6 @@ static int winbind_named_pipe_sock(const char *dir)
 
        close(fd);
        return -1;
-
-       if (connect(fd, (struct sockaddr *)&sunaddr, 
-                   sizeof(sunaddr)) == -1) {
-               close(fd);
-               return -1;
-       }
-        
-       return fd;
 }
 
 /* Connect to winbindd socket */
index 6b1a6b5b4dfed924f41dc7d529902ce319d72230..14b6f03fd41c261e4eee00534f08a37a3e757b3f 100644 (file)
@@ -98,7 +98,7 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const
 {
        struct winbindd_domain *domain;
        const char *alternative_name = NULL;
-       static const DOM_SID null_sid;
+       static const DOM_SID null_sid = {0};
        
        /* ignore alt_name if we are not in an AD domain */
        
index 00f191db280b27aa5bc3ca0f73ef1ed200429d8d..3c97a3bb37dffb1ec4a3e097678c880edea2dad6 100644 (file)
@@ -2004,9 +2004,9 @@ FN_LOCAL_INTEGER(lp_oplock_contention_limit, iOplockContentionLimit)
 FN_LOCAL_INTEGER(lp_csc_policy, iCSCPolicy)
 FN_LOCAL_INTEGER(lp_write_cache_size, iWriteCacheSize)
 FN_LOCAL_INTEGER(lp_block_size, iBlock_size)
-FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size);
-FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize);
-FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize);
+FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size)
+FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize)
+FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize)
 FN_LOCAL_CHAR(lp_magicchar, magic_char)
 FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time)
 FN_GLOBAL_INTEGER(lp_winbind_max_idle_children, &Globals.winbind_max_idle_children)
index 884012c9be76f8c2a6b7c0ca2aad0ba954bf2e2f..d924ea27d1f9272088d03b4afc3744af4d04d431 100644 (file)
@@ -3036,7 +3036,6 @@ static BOOL lsa_io_trustdom_query(const char *desc, prs_struct *ps, int depth, L
        default:
                DEBUG(0,("unsupported info-level: %d\n", info->info_class));
                return False;
-               break;
        }
 
        return True;
index 8b861f8431af134f35f25e88587ca3b2b3f0ae5c..7a5216ada547baf4fa3bcb6b8595f03bb51db265 100644 (file)
@@ -1078,8 +1078,6 @@ WERROR _reg_save_key(pipes_struct *p, REG_Q_SAVE_KEY  *q_u, REG_R_SAVE_KEY *r_u)
        DEBUG(2,("_reg_save_key: Saving [%s] to %s in share %s\n", regkey->name, filename, lp_servicename(snum) ));
                
        return backup_registry_key( regkey, filename );
-
-       return WERR_OK;
 }
 
 /*******************************************************************
index b607d32e547cbf236f7b62df6e34e9f26879718c..e9dd015421ca974c1e44fff566be8f65c4b6d75e 100644 (file)
@@ -1597,11 +1597,9 @@ WERROR _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S
                        DEBUG(3, ("_srv_net_share_set_info: client is trying to change csc policy from the network; must be done with smb.conf\n"));
                        return WERR_ACCESS_DENIED;
                }
-               break;
        case 1006:
        case 1007:
                return WERR_ACCESS_DENIED;
-               break;
        case 1501:
                pstrcpy(pathname, lp_pathname(snum));
                fstrcpy(comment, lp_comment(snum));
@@ -1753,7 +1751,6 @@ WERROR _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S
        case 1006:
        case 1007:
                return WERR_ACCESS_DENIED;
-               break;
        case 1501:
                /* DFS only level. */
                return WERR_ACCESS_DENIED;
index 52970bdffca16fe0747913306b2177bdd944064e..6bf9e44a14a472576a7b81e5d9083768ef4ba296 100644 (file)
@@ -188,7 +188,7 @@ int main( int argc, char *argv[] )
                exit(1);
        }
 
-       if ((!change & new_val) || (change & !new_val)) {
+       if ((!change && new_val) || (change && !new_val)) {
                fprintf(stderr, "You must specify both -c and -n if one or the other is set!\n");
                poptPrintUsage(pc, stderr, 0);
                exit(252);
@@ -225,5 +225,5 @@ int main( int argc, char *argv[] )
 
        poptFreeContext(pc);
 
-       exit( 0 );
+       return( 0 );
 }