1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r15358: Fix some compiler warnings / type safety. Found by tcc

This commit is contained in:
Jelmer Vernooij 2006-04-30 13:54:03 +00:00 committed by Gerald (Jerry) Carter
parent 2cd2e524e6
commit 12ba42de58
8 changed files with 21 additions and 19 deletions

View File

@ -64,8 +64,8 @@ static void *lockData;
this is a workaround for the use of global variables in ejs
*/
struct ejs_state_ctx {
struct MprVar master;
struct MprArray *ejsList;
MprVar master;
MprArray *ejsList;
};
void *ejs_save_state(void)

View File

@ -185,9 +185,6 @@ typedef char* MprStr;
#ifndef __cplusplus
typedef unsigned char uchar;
#ifndef __bool_true_false_are_defined
typedef int bool;
#endif
#endif
/*

View File

@ -462,7 +462,7 @@ _PUBLIC_ int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
child_si->protocol = parent_si->protocol;
child_si->bound = 1;
ret = real_getsockname(fd, &un_my_addr, &un_my_addrlen);
ret = real_getsockname(fd, (struct sockaddr *)&un_my_addr, &un_my_addrlen);
if (ret == -1) return ret;
ret = sockaddr_convert_from_un(child_si, &un_my_addr, un_my_addrlen,

View File

@ -127,9 +127,11 @@ static BOOL decode_server_sort_request(void *mem_ctx, DATA_BLOB in, void **out)
}
if (asn1_peek_tag(&data, ASN1_BOOLEAN)) {
if (!asn1_read_BOOLEAN(&data, &(lssc[num]->reverse))) {
bool reverse;
if (!asn1_read_BOOLEAN(&data, &reverse)) {
return False;
}
lssc[num]->reverse = reverse;
}
if (!asn1_end_tag(&data)) {
@ -902,9 +904,11 @@ BOOL ldap_decode_control(void *mem_ctx, struct asn1_data *data, struct ldb_contr
}
if (asn1_peek_tag(data, ASN1_BOOLEAN)) {
if (!asn1_read_BOOLEAN(data, &(ctrl->critical))) {
bool critical;
if (!asn1_read_BOOLEAN(data, &critical)) {
return False;
}
critical = ctrl->critical;
} else {
ctrl->critical = False;
}

View File

@ -548,7 +548,7 @@ NTSTATUS pvfs_resolve_partial(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx,
NTSTATUS pvfs_resolve_name_fd(struct pvfs_state *pvfs, int fd,
struct pvfs_filename *name)
{
dev_t device = 0;
dev_t device = (dev_t)0;
ino_t inode = 0;
if (name->exists) {

View File

@ -219,7 +219,7 @@ static WERROR winreg_EnumValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *m
/* the client can optionally pass a NULL for type, meaning they don't
want that back */
if (r->in.type != NULL) {
r->out.type = talloc(mem_ctx, uint32_t);
r->out.type = talloc(mem_ctx, enum winreg_Type);
*r->out.type = value->data_type;
}
@ -398,7 +398,7 @@ static WERROR winreg_QueryValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *
}
/* Just asking for the size of the buffer */
r->out.type = &val->data_type;
r->out.type = (enum winreg_Type *)&val->data_type;
r->out.length = &val->data.length;
if (!r->in.data) {
r->out.size = talloc(mem_ctx, uint32_t);

View File

@ -38,7 +38,7 @@ static BOOL test_readwrite(TALLOC_CTX *mem_ctx, const char *host)
struct IUnknown *interfaces[3];
WERROR results[2];
struct com_context *ctx;
char test_data[5];
uint8_t test_data[5];
int i;
com_init();
@ -53,7 +53,7 @@ static BOOL test_readwrite(TALLOC_CTX *mem_ctx, const char *host)
if (host) {
error = dcom_create_object(ctx, &clsid,
host, 2, IID,
&interfaces,
(struct IUnknown ***)&interfaces,
results);
} else {
error = com_create_object(ctx, &clsid, 2, IID, interfaces, results);
@ -74,7 +74,7 @@ static BOOL test_readwrite(TALLOC_CTX *mem_ctx, const char *host)
test_data[i] = i+1;
}
error = IStream_Write((struct IStream *)interfaces[0], mem_ctx, &test_data, 5, NULL);
error = IStream_Write((struct IStream *)interfaces[0], mem_ctx, test_data, 5, NULL);
if (!W_ERROR_IS_OK(error)) {
printf("IStream::Write() failed - %s\n", win_errstr(error));
ret = False;

View File

@ -111,7 +111,7 @@ static BOOL test_CreateKey(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct winreg_CreateKey r;
struct policy_handle newhandle;
NTSTATUS status;
uint32_t action_taken = 0;
enum winreg_CreateAction action_taken = 0;
printf("\ntesting CreateKey\n");
@ -149,7 +149,7 @@ static BOOL test_CreateKey_sd(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
{
struct winreg_CreateKey r;
NTSTATUS status;
uint32_t action_taken = 0;
enum winreg_CreateAction action_taken = 0;
struct security_descriptor *sd;
DATA_BLOB sdblob;
struct winreg_SecBuf secbuf;
@ -500,15 +500,16 @@ static BOOL test_QueryValue(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct p
{
struct winreg_QueryValue r;
NTSTATUS status;
uint32_t zero = 0;
enum winreg_Type zero_type = 0;
uint32_t offered = 0xfff;
uint32_t zero = 0;
printf("Testing QueryValue\n");
r.in.handle = handle;
r.in.data = NULL;
r.in.value_name.name = valuename;
r.in.type = &zero;
r.in.type = &zero_type;
r.in.size = &offered;
r.in.length = &zero;
@ -530,7 +531,7 @@ static BOOL test_EnumValue(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct policy_handle *handle, int max_valnamelen, int max_valbufsize)
{
struct winreg_EnumValue r;
uint32_t type = 0;
enum winreg_Type type = 0;
uint32_t size = max_valbufsize, zero = 0;
BOOL ret = True;
uint8_t buf8;