Fix warnings.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5168 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin
2003-10-25 22:33:23 +00:00
parent 547692fa51
commit 7dab5189a7
3 changed files with 32 additions and 21 deletions
+23 -16
View File
@@ -10,6 +10,9 @@
#include <iovec.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <net_settings.h>
#include <netdb.h>
#include <TLS.h>
@@ -18,32 +21,37 @@ extern int h_errno;
// was defined by netdb.h
static int32 h_errno_tls;
void initialize_before(void);
void terminate_after(void);
const char * hstrerror(int error);
int _socket_interrupt(void);
int _netconfig_find(void);
/* These should probably be moved to a seperate file as they
* are unique to the library as a whole...
*/
/*
void _init()
_EXPORT void _init()
{
h_errno_tls = tls_allocate();
}
void _fini()
_EXPORT void _fini()
{
}
*/
void initialize_before()
_EXPORT void initialize_before(void)
{
h_errno_tls = tls_allocate();
}
void terminate_after()
_EXPORT void terminate_after(void)
{
}
struct net_settings {
int dummy;
};
_EXPORT int closesocket(int sock)
{
return close(sock);
@@ -57,10 +65,9 @@ _EXPORT const char * hstrerror(int error)
}
_EXPORT int herror()
_EXPORT void herror(const char *error)
{
printf("herror() not yet supported.");
return 0;
}
_EXPORT int *_h_errnop()
@@ -69,13 +76,13 @@ _EXPORT int *_h_errnop()
}
_EXPORT int _socket_interrupt()
_EXPORT int _socket_interrupt(void)
{
printf("_socket_interrupt\n");
return 0;
}
_EXPORT int _netconfig_find()
_EXPORT int _netconfig_find(void)
{
printf("_netconfig_find\n");
return 0;
@@ -86,7 +93,7 @@ _EXPORT int _netconfig_find()
* will make both R5 and BONE compatible
*/
_EXPORT char * find_net_setting(struct net_settings * ncw, const char * heading, const char * name, char * value, unsigned nbytes)
_EXPORT char * find_net_setting(net_settings * ncw, const char * heading, const char * name, char * value, unsigned nbytes)
{
printf("find_net_setting\n");
@@ -107,7 +114,7 @@ _EXPORT char * find_net_setting(struct net_settings * ncw, const char * heading,
}
_EXPORT status_t set_net_setting(struct net_settings * ncw, const char * heading, const char * name, const char * value)
_EXPORT status_t set_net_setting(net_settings * ncw, const char * heading, const char * name, const char * value)
{
printf("set_net_setting\n");
return B_UNSUPPORTED;
@@ -124,7 +131,7 @@ _EXPORT int gethostname(char * name, size_t length)
}
_EXPORT int getusername(char * name, uint length)
_EXPORT int getusername(char * name, size_t length)
{
printf("getusername\n");
if (find_net_setting(NULL, "GLOBAL", "USERNAME", name, length) == NULL)
@@ -134,7 +141,7 @@ _EXPORT int getusername(char * name, uint length)
}
_EXPORT int getpassword(char * pwd, uint length)
_EXPORT int getpassword(char * pwd, size_t length)
{
printf("getpassword\n");
if (find_net_setting(NULL, "GLOBAL", "PASSWORD", pwd, length) == NULL)
+3 -3
View File
@@ -10,7 +10,7 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout)
fd_set read_set;
fd_set write_set;
fd_set exception_set;
int i;
nfds_t i;
int n;
int rc;
@@ -48,10 +48,10 @@ int poll(struct pollfd *fds, nfds_t numfds, int timeout)
if (rc < 0)
return rc;
for(i = 0; i < n; i++) {
for(i = 0; i < (nfds_t) n; i++) {
fds[i].revents = 0;
if (FD_ISSET(fds[i].fd, &read_set)) fds[i].revents |= POLLIN;
if (FD_ISSET(fds[i].fd, &read_set)) fds[i].revents |= POLLIN;
if (FD_ISSET(fds[i].fd, &write_set)) fds[i].revents |= POLLOUT;
if (FD_ISSET(fds[i].fd, &exception_set)) fds[i].revents |= POLLERR;
};
+6 -2
View File
@@ -17,6 +17,9 @@
#include "net_stack_driver.h"
// Forward declaration of sysctl.h, because it's currently declared under headers/private/kernel/sysctl.h
int sysctl(int *, uint, void *, size_t *, void *, size_t);
static bool g_beos_r5_compatibility = false;
struct beosr5_sockaddr_in {
@@ -26,11 +29,12 @@ struct beosr5_sockaddr_in {
char sin_zero[4];
};
static char * get_stack_driver_path();
static char * get_stack_driver_path(void);
static void convert_from_beos_r5_sockaddr(struct sockaddr *to, const struct sockaddr *from);
static void convert_to_beos_r5_sockaddr(struct sockaddr *to, const struct sockaddr *from);
static void convert_from_beos_r5_sockopt(int *level, int *optnum);
_EXPORT int socket(int family, int type, int protocol)
{
int sock;
@@ -424,7 +428,7 @@ _EXPORT int sysctl (int *name, uint namelen, void *oldp, size_t *oldlenp,
* ----------------
*/
static char * get_stack_driver_path() {
static char * get_stack_driver_path(void) {
char * path;
// user-defined stack driver path?