From fc0b830f419bf64fff6fee91d1d3b9e94da11091 Mon Sep 17 00:00:00 2001 From: Bruce Cran Date: Mon, 20 Feb 2012 21:03:48 +0100 Subject: [PATCH] Fix tabbing and comment characters in Windows code. Update syslog.h with proper flag values. Signed-off-by: Jens Axboe --- os/windows/posix.c | 16 +++++++----- os/windows/posix/include/dirent.h | 4 +-- os/windows/posix/include/netinet/in.h | 10 ++++---- os/windows/posix/include/sys/mman.h | 36 +++++++++++++-------------- os/windows/posix/include/sys/shm.h | 32 ++++++++++++------------ os/windows/posix/include/sys/uio.h | 4 +-- os/windows/posix/include/sys/un.h | 5 ++-- os/windows/posix/include/sys/wait.h | 10 ++++---- os/windows/posix/include/syslog.h | 14 +++++------ 9 files changed, 67 insertions(+), 64 deletions(-) diff --git a/os/windows/posix.c b/os/windows/posix.c index 27793cbd..ea3736d5 100755 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -98,7 +98,7 @@ int gettimeofday(struct timeval *restrict tp, void *restrict tzp) unsigned long long unix_time, windows_time; const time_t MILLISECONDS_BETWEEN_1601_AND_1970 = 11644473600000; - // Ignore the timezone parameter + /* Ignore the timezone parameter */ (void)tzp; /* @@ -191,12 +191,16 @@ int kill(pid_t pid, int sig) return (-1); } -// This is assumed to be used only by the network code, -// and so doesn't try and handle any of the other cases +/* + * This is assumed to be used only by the network code, + * and so doesn't try and handle any of the other cases + */ int fcntl(int fildes, int cmd, ...) { - // non-blocking mode doesn't work the same as in BSD sockets, - // so ignore it. + /* + * non-blocking mode doesn't work the same as in BSD sockets, + * so ignore it. + */ #if 0 va_list ap; int val, opt, status; @@ -440,7 +444,7 @@ int posix_madvise(void *addr, size_t len, int advice) return ENOSYS; } -// Windows doesn't support advice for memory pages. Just ignore it. +/* Windows doesn't support advice for memory pages. Just ignore it. */ int msync(void *addr, size_t len, int flags) { log_err("%s is not implemented\n", __func__); diff --git a/os/windows/posix/include/dirent.h b/os/windows/posix/include/dirent.h index 39a880da..ca4d4c94 100644 --- a/os/windows/posix/include/dirent.h +++ b/os/windows/posix/include/dirent.h @@ -3,8 +3,8 @@ struct dirent { - ino_t d_ino; // File serial number. - char d_name[]; // Name of entry. + ino_t d_ino; /* File serial number */ + char d_name[]; /* Name of entry */ }; typedef int DIR; diff --git a/os/windows/posix/include/netinet/in.h b/os/windows/posix/include/netinet/in.h index 80b69a72..814a30eb 100644 --- a/os/windows/posix/include/netinet/in.h +++ b/os/windows/posix/include/netinet/in.h @@ -11,11 +11,11 @@ struct in6_addr struct sockaddr_in6 { - sa_family_t sin6_family; // AF_INET6. - in_port_t sin6_port; // Port number. - uint32_t sin6_flowinfo; // IPv6 traffic class and flow information. - struct in6_addr sin6_addr; // IPv6 address. - uint32_t sin6_scope_id; // Set of interfaces for a scope. + sa_family_t sin6_family; /* AF_INET6 */ + in_port_t sin6_port; /* Port number */ + uint32_t sin6_flowinfo; /* IPv6 traffic class and flow information */ + struct in6_addr sin6_addr; /* IPv6 address */ + uint32_t sin6_scope_id; /* Set of interfaces for a scope */ }; #endif /* NETINET_IN_H */ diff --git a/os/windows/posix/include/sys/mman.h b/os/windows/posix/include/sys/mman.h index 36480a43..ea139ee1 100644 --- a/os/windows/posix/include/sys/mman.h +++ b/os/windows/posix/include/sys/mman.h @@ -3,27 +3,27 @@ #include -#define PROT_NONE 1 -#define PROT_READ 2 -#define PROT_WRITE 4 +#define PROT_NONE 0x1 +#define PROT_READ 0x2 +#define PROT_WRITE 0x4 -#define MAP_ANON 0x1 -#define MAP_ANONYMOUS MAP_ANON -#define MAP_FIXED 0x2 -#define MAP_HASSEMAPHORE 0x4 -#define MAP_INHERIT 0x8 -#define MAP_NOCORE 0x10 -#define MAP_NOSYNC 0x20 -#define MAP_PREFAULT_READ 0x40 -#define MAP_PRIVATE 0x80 -#define MAP_SHARED 0x100 -#define MAP_STACK 0x200 +#define MAP_ANON 0x1 +#define MAP_ANONYMOUS MAP_ANON +#define MAP_FIXED 0x2 +#define MAP_HASSEMAPHORE 0x4 +#define MAP_INHERIT 0x8 +#define MAP_NOCORE 0x10 +#define MAP_NOSYNC 0x20 +#define MAP_PREFAULT_READ 0x40 +#define MAP_PRIVATE 0x80 +#define MAP_SHARED 0x100 +#define MAP_STACK 0x200 -#define MAP_FAILED NULL +#define MAP_FAILED NULL -#define MS_ASYNC 0x1 -#define MS_SYNC 0x2 -#define MS_INVALIDATE 0x3 +#define MS_ASYNC 0x1 +#define MS_SYNC 0x2 +#define MS_INVALIDATE 0x3 int posix_madvise(void *addr, size_t len, int advice); void *mmap(void *addr, size_t len, int prot, int flags, diff --git a/os/windows/posix/include/sys/shm.h b/os/windows/posix/include/sys/shm.h index 6f6b0328..6ed59577 100644 --- a/os/windows/posix/include/sys/shm.h +++ b/os/windows/posix/include/sys/shm.h @@ -1,9 +1,9 @@ #ifndef SYS_SHM_H #define SYS_SHM_H -#define IPC_RMID 0x1 -#define IPC_CREAT 0x2 -#define IPC_PRIVATE 0x4 +#define IPC_RMID 0x1 +#define IPC_CREAT 0x2 +#define IPC_PRIVATE 0x4 typedef int uid_t; typedef int gid_t; @@ -13,24 +13,24 @@ typedef int key_t; struct ipc_perm { - uid_t uid; //owner's user ID - gid_t gid; //owner's group ID - uid_t cuid; //creator's user ID - gid_t cgid; //creator's group ID - mode_t mode; //read/write permission + uid_t uid; /* owner's user ID */ + gid_t gid; /* owner's group ID */ + uid_t cuid; /* creator's user ID */ + gid_t cgid; /* creator's group ID */ + mode_t mode; /* read/write permission */ }; struct shmid_ds { - struct ipc_perm shm_perm; //operation permission structure - size_t shm_segsz; //size of segment in bytes - pid_t shm_lpid; //process ID of last shared memory operation - pid_t shm_cpid; //process ID of creator - shmatt_t shm_nattch; //number of current attaches - time_t shm_atime; //time of last shmat() - time_t shm_dtime; //time of last shmdt() - time_t shm_ctime; //time of last change by shmctl() + struct ipc_perm shm_perm; /* operation permission structure */ + size_t shm_segsz; /* size of segment in bytes */ + pid_t shm_lpid; /* process ID of last shared memory operation */ + pid_t shm_cpid; /* process ID of creator */ + shmatt_t shm_nattch; /* number of current attaches */ + time_t shm_atime; /* time of last shmat() */ + time_t shm_dtime; /* time of last shmdt() */ + time_t shm_ctime; /* time of last change by shmctl() */ }; int shmctl(int shmid, int cmd, struct shmid_ds *buf); diff --git a/os/windows/posix/include/sys/uio.h b/os/windows/posix/include/sys/uio.h index 10229869..0fac2c01 100644 --- a/os/windows/posix/include/sys/uio.h +++ b/os/windows/posix/include/sys/uio.h @@ -6,8 +6,8 @@ struct iovec { - void *iov_base; //Base address of a memory region for input or output. - size_t iov_len; //The size of the memory pointed to by iov_base. + void *iov_base; /* Base address of a memory region for input or output */ + size_t iov_len; /* The size of the memory pointed to by iov_base */ }; ssize_t readv(int fildes, const struct iovec *iov, int iovcnt); diff --git a/os/windows/posix/include/sys/un.h b/os/windows/posix/include/sys/un.h index 0053f328..ec118054 100644 --- a/os/windows/posix/include/sys/un.h +++ b/os/windows/posix/include/sys/un.h @@ -6,9 +6,8 @@ typedef int in_port_t; struct sockaddr_un { - sa_family_t sun_family; // Address family. - char sun_path[]; // Socket pathname. + sa_family_t sun_family; /* Address family */ + char sun_path[]; /* Socket pathname */ }; - #endif /* SYS_UN_H */ diff --git a/os/windows/posix/include/sys/wait.h b/os/windows/posix/include/sys/wait.h index 954bd2bf..9e68d541 100644 --- a/os/windows/posix/include/sys/wait.h +++ b/os/windows/posix/include/sys/wait.h @@ -1,11 +1,11 @@ #ifndef SYS_WAIT_H #define SYS_WAIT_H -#define WIFSIGNALED(a) 0 -#define WIFEXITED(a) 0 -#define WTERMSIG(a) 0 -#define WEXITSTATUS(a) 0 -#define WNOHANG 0 +#define WIFSIGNALED(a) 0 +#define WIFEXITED(a) 0 +#define WTERMSIG(a) 0 +#define WEXITSTATUS(a) 0 +#define WNOHANG 0 pid_t waitpid(pid_t, int *stat_loc, int options); diff --git a/os/windows/posix/include/syslog.h b/os/windows/posix/include/syslog.h index a06bda48..172261cd 100644 --- a/os/windows/posix/include/syslog.h +++ b/os/windows/posix/include/syslog.h @@ -3,14 +3,14 @@ int syslog(); -#define LOG_INFO 0 -#define LOG_ERROR 1 -#define LOG_WARN 2 +#define LOG_INFO 0x1 +#define LOG_ERROR 0x2 +#define LOG_WARN 0x4 -#define LOG_NDELAY 0 -#define LOG_NOWAIT 0 -#define LOG_PID 0 -#define LOG_USER 0 +#define LOG_NDELAY 0x1 +#define LOG_NOWAIT 0x2 +#define LOG_PID 0x4 +#define LOG_USER 0x8 void closelog(void); void openlog(const char *ident, int logopt, int facility); -- 2.25.1