1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

more fixes from the IRIX compiler (thanks herb!)

This commit is contained in:
Andrew Tridgell 0001-01-01 00:00:00 +00:00
parent 4cf3839b72
commit 02d068ba7d
19 changed files with 27 additions and 41 deletions

View File

@ -151,7 +151,7 @@ ssize_t convert_string(charset_t from, charset_t to,
o_len=destlen;
retval = smb_iconv(descriptor, &inbuf, &i_len, &outbuf, &o_len);
if(retval==(size_t)-1) {
const char *reason="unknown error";
const char *reason;
switch(errno) {
case EINVAL:
reason="Incomplete multibyte sequence";

View File

@ -166,9 +166,9 @@ struct list_struct {
a blocking lock on SIGALRM.
***************************************************************/
static sig_atomic_t *palarm_fired;
static SIG_ATOMIC_T *palarm_fired;
void tdb_set_lock_alarm(sig_atomic_t *palarm)
void tdb_set_lock_alarm(SIG_ATOMIC_T *palarm)
{
palarm_fired = palarm;
}

View File

@ -127,7 +127,7 @@ int tdb_lockall(TDB_CONTEXT *tdb);
void tdb_unlockall(TDB_CONTEXT *tdb);
/* Low level locking functions: use with care */
void tdb_set_lock_alarm(sig_atomic_t *palarm);
void tdb_set_lock_alarm(SIG_ATOMIC_T *palarm);
int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);

View File

@ -439,7 +439,6 @@ static BOOL matchname(char *remotehost, struct in_addr addr)
char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup)
{
char *name_buf;
char *addr_buf;
struct hostent *hp;
struct in_addr addr;
char *p;
@ -457,8 +456,6 @@ char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup)
name_buf = talloc_strdup(mem_ctx, "UNKNOWN");
if (fd == -1) return name_buf;
addr_buf = talloc_strdup(mem_ctx, p);
addr = *interpret_addr2(mem_ctx, p);
/* Look up the remote host name. */
@ -473,7 +470,7 @@ char *get_socket_name(TALLOC_CTX *mem_ctx, int fd, BOOL force_lookup)
}
}
alpha_strcpy(name_buf, name_buf, "_-.", sizeof(name_buf));
alpha_strcpy(name_buf, name_buf, "_-.", strlen(name_buf)+1);
if (strstr(name_buf,"..")) {
name_buf = talloc_strdup(mem_ctx, "UNKNOWN");
}

View File

@ -651,11 +651,8 @@ BOOL in_list(const char *s, const char *list, BOOL casesensitive)
**/
static BOOL string_init(char **dest,const char *src)
{
size_t l;
if (!src) src = "";
l = strlen(src);
(*dest) = strdup(src);
if ((*dest) == NULL) {
DEBUG(0,("Out of memory in string_init\n"));

View File

@ -383,10 +383,9 @@ wide strstr()
const smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins)
{
const smb_ucs2_t *r;
size_t slen, inslen;
size_t inslen;
if (!s || !*s || !ins || !*ins) return NULL;
slen = strlen_w(s);
inslen = strlen_w(ins);
r = s;
while ((r = strchr_w(r, *ins))) {
@ -663,10 +662,9 @@ const smb_ucs2_t *strpbrk_wa(const smb_ucs2_t *s, const char *p)
const smb_ucs2_t *strstr_wa(const smb_ucs2_t *s, const char *ins)
{
const smb_ucs2_t *r;
size_t slen, inslen;
size_t inslen;
if (!s || !*s || !ins || !*ins) return NULL;
slen = strlen_w(s);
inslen = strlen(ins);
r = s;
while ((r = strchr_w(r, UCS2_CHAR(*ins)))) {

View File

@ -93,7 +93,6 @@ const char *uuid_string(TALLOC_CTX *mem_ctx, const GUID in)
char *out;
uuid_unpack(in, &uu);
if (!out) return NULL;
out = talloc_asprintf(mem_ctx,
"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
uu.time_low, uu.time_mid, uu.time_hi_and_version,

View File

@ -206,7 +206,6 @@ struct cli_request *smb_raw_trans2_send(struct cli_tree *tree,
int wct = 14 + parms->in.setup_count;
struct cli_request *req;
char *outdata,*outparam;
int data_sent, param_sent;
int i;
const int padding = 3;
@ -216,10 +215,8 @@ struct cli_request *smb_raw_trans2_send(struct cli_tree *tree,
}
/* fill in SMB parameters */
data_sent = parms->in.data.length;
param_sent = parms->in.params.length;
outparam = req->out.data + padding;
outdata = outparam + param_sent;
outdata = outparam + parms->in.params.length;
/* make sure we don't leak data via the padding */
memset(req->out.data, 0, padding);

View File

@ -367,7 +367,7 @@ NTSTATUS brl_lock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
#if ZERO_ZERO
/* sort the lock list */
qsort(dbuf.dptr, dbuf.dsize/sizeof(lock), sizeof(lock), lock_compare);
qsort(dbuf.dptr, dbuf.dsize/sizeof(lock), sizeof(lock), QSORT_CAST lock_compare);
#endif
tdb_store(tdb, kbuf, dbuf, TDB_REPLACE);

View File

@ -2030,7 +2030,7 @@ int print_queue_status(int snum,
in hash order. */
qsort(tstruct.queue, tstruct.qcount, sizeof(print_queue_struct),
QSORT_CAST(printjob_comp));
QSORT_CAST printjob_comp);
*queue = tstruct.queue;
return tstruct.qcount;

View File

@ -166,9 +166,9 @@ struct list_struct {
a blocking lock on SIGALRM.
***************************************************************/
static sig_atomic_t *palarm_fired;
static SIG_ATOMIC_T *palarm_fired;
void tdb_set_lock_alarm(sig_atomic_t *palarm)
void tdb_set_lock_alarm(SIG_ATOMIC_T *palarm)
{
palarm_fired = palarm;
}

View File

@ -127,7 +127,7 @@ int tdb_lockall(TDB_CONTEXT *tdb);
void tdb_unlockall(TDB_CONTEXT *tdb);
/* Low level locking functions: use with care */
void tdb_set_lock_alarm(sig_atomic_t *palarm);
void tdb_set_lock_alarm(SIG_ATOMIC_T *palarm);
int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);

View File

@ -22,7 +22,6 @@
static fstring password;
static fstring username;
static int got_pass;
static int max_protocol = PROTOCOL_NT1;
static BOOL showall = False;
static BOOL old_list = False;
@ -417,7 +416,6 @@ static void usage(void)
if (p) {
*p = 0;
fstrcpy(password, p+1);
got_pass = 1;
}
break;
case 's':

View File

@ -258,9 +258,11 @@ void nb_findfirst(const char *mask)
void nb_flush(int fnum)
{
struct smb_flush io;
int i;
i = find_handle(fnum);
/* hmmm, we don't have cli_flush() yet */
io.in.fnum = ftable[i].fd;
smb_raw_flush(c->tree, &io);
}
void nb_deltree(const char *dname)

View File

@ -118,6 +118,7 @@ static BOOL test_mv(struct cli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_OK);
done:
cli_close(cli, fnum);
smb_raw_exit(cli->session);
cli_deltree(cli, BASEDIR);
return ret;

View File

@ -546,11 +546,14 @@ static BOOL test_many_files(struct cli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_VALUE(result.count, num_files);
if (search_types[t].level == RAW_SEARCH_BOTH_DIRECTORY_INFO) {
qsort(result.list, result.count, sizeof(result.list[0]), search_both_compare);
qsort(result.list, result.count, sizeof(result.list[0]),
QSORT_CAST search_both_compare);
} else if (search_types[t].level == RAW_SEARCH_STANDARD) {
qsort(result.list, result.count, sizeof(result.list[0]), search_standard_compare);
qsort(result.list, result.count, sizeof(result.list[0]),
QSORT_CAST search_standard_compare);
} else {
qsort(result.list, result.count, sizeof(result.list[0]), search_old_compare);
qsort(result.list, result.count, sizeof(result.list[0]),
QSORT_CAST search_old_compare);
}
for (i=0;i<num_files;i++) {

View File

@ -31,7 +31,6 @@ static BOOL use_oplocks;
static BOOL use_level_II_oplocks;
static const char *client_txt = "client_oplocks.txt";
static BOOL use_kerberos;
static BOOL bypass_io;
BOOL torture_showall = False;
@ -4050,7 +4049,6 @@ static void usage(void)
{
int opt, i;
char *p;
int gotuser = 0;
BOOL correct = True;
char *host, *share, *username;
@ -4097,7 +4095,7 @@ static void usage(void)
srandom(time(NULL));
while ((opt = getopt(argc, argv, "p:hW:U:n:N:O:o:e:m:Ld:Ac:ks:f:bs:")) != EOF) {
while ((opt = getopt(argc, argv, "p:hW:U:n:N:O:o:e:m:Ld:Ac:ks:f:s:")) != EOF) {
switch (opt) {
case 'p':
lp_set_cmdline("smb ports", optarg);
@ -4148,16 +4146,12 @@ static void usage(void)
#endif
break;
case 'U':
gotuser = 1;
parse_user(optarg);
break;
case 'f':
torture_failures = atoi(optarg);
break;
case 'b':
bypass_io = True;
break;
default:
printf("Unknown option %c (%d)\n", (char)opt, opt);
usage();

View File

@ -99,7 +99,7 @@ void web_set_lang(const char *lang_string)
}
str_list_free(&lang_list);
qsort(pl, lang_num, sizeof(struct pri_list), &qsort_cmp_list);
qsort(pl, lang_num, sizeof(struct pri_list), QSORT_CAST qsort_cmp_list);
/* it's not an error to not initialise - we just fall back to
the default */

View File

@ -80,7 +80,7 @@ BOOL reload_services(BOOL test)
Catch a sighup.
****************************************************************************/
VOLATILE sig_atomic_t reload_after_sighup = False;
VOLATILE SIG_ATOMIC_T reload_after_sighup = False;
static void sig_hup(int sig)
{