summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShih-wei Liao <sliao@google.com>2012-01-30 22:22:18 -0800
committerShih-wei Liao <sliao@google.com>2012-01-30 22:22:18 -0800
commit4c05150d77225cd8be862b006c421d8c045fa71c (patch)
tree55b8b4313640b0506a071ad73ceddeba1635df3d
parent9b34649af4b22a1bbc8658d58fbabcbc3ad73c39 (diff)
downloadgdk-4c05150d77225cd8be862b006c421d8c045fa71c.tar.gz
Clean up.
Change-Id: I561e3059ff9cd8c09f486c045dd9c7b68caeffc5
-rw-r--r--libportable/Android.mk2
-rw-r--r--libportable/arch-mips/mmap.c12
-rw-r--r--libportable/arch-mips/open.c11
-rw-r--r--libportable/arch-mips/socket.c9
4 files changed, 11 insertions, 23 deletions
diff --git a/libportable/Android.mk b/libportable/Android.mk
index 507b3df..0bd38ec 100644
--- a/libportable/Android.mk
+++ b/libportable/Android.mk
@@ -36,7 +36,7 @@ libportable_arch_src_files += arch-mips/mmap.c \
endif
LOCAL_SRC_FILES := \
- $(libportable_common_src_files) \
+ $(libportable_common_src_files) \
$(libportable_arch_src_files)
include $(BUILD_SHARED_LIBRARY)
diff --git a/libportable/arch-mips/mmap.c b/libportable/arch-mips/mmap.c
index 6b23549..ab444c9 100644
--- a/libportable/arch-mips/mmap.c
+++ b/libportable/arch-mips/mmap.c
@@ -1,4 +1,3 @@
-
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
@@ -8,10 +7,9 @@
#define MAP_ANONYMOUS_PORTABLE 0x20
#define PROT_SEM_PORTABLE 0x8
-extern void* __mmap2(void*, size_t, int, int, int, size_t);
+extern void* __mmap2(void*, size_t, int, int, int, size_t);
-static inline int mips_change_prot(int prot)
-{
+static inline int mips_change_prot(int prot) {
if (prot & PROT_SEM_PORTABLE) {
prot &= ~PROT_SEM_PORTABLE;
prot |= PROT_SEM;
@@ -20,8 +18,7 @@ static inline int mips_change_prot(int prot)
return prot;
}
-static inline int mips_change_flags(int flags)
-{
+static inline int mips_change_flags(int flags) {
if (flags & MAP_ANONYMOUS_PORTABLE) {
flags &= ~MAP_ANONYMOUS_PORTABLE;
flags |= MAP_ANONYMOUS;
@@ -31,8 +28,7 @@ static inline int mips_change_flags(int flags)
}
#define MMAP2_SHIFT 12
-void* mmap( void* addr, size_t size, int prot, int flags, int fd, long offset )
-{
+void* mmap(void* addr, size_t size, int prot, int flags, int fd, long offset) {
if ( offset & ((1UL << MMAP2_SHIFT)-1) ) {
errno = EINVAL;
return MAP_FAILED;
diff --git a/libportable/arch-mips/open.c b/libportable/arch-mips/open.c
index 50c4adc..e8b6c1f 100644
--- a/libportable/arch-mips/open.c
+++ b/libportable/arch-mips/open.c
@@ -1,4 +1,3 @@
-
#include <unistd.h>
#include <fcntl.h>
#include <stdarg.h>
@@ -6,8 +5,7 @@
extern int __open(const char*, int, int);
#define O_CREAT_PORTABLE 00000100
-static inline int mips_change_flags(int flags)
-{
+static inline int mips_change_flags(int flags) {
if (flags & O_CREAT_PORTABLE) {
flags &= ~O_CREAT_PORTABLE;
flags |= O_CREAT;
@@ -15,14 +13,12 @@ static inline int mips_change_flags(int flags)
return flags;
}
-int open(const char *pathname, int flags, ...)
-{
+int open(const char *pathname, int flags, ...) {
mode_t mode = 0;
flags = mips_change_flags(flags);
flags |= O_LARGEFILE;
- if (flags & O_CREAT)
- {
+ if (flags & O_CREAT) {
va_list args;
va_start(args, flags);
@@ -32,4 +28,3 @@ int open(const char *pathname, int flags, ...)
return __open(pathname, flags, mode);
}
-
diff --git a/libportable/arch-mips/socket.c b/libportable/arch-mips/socket.c
index d7cb110..d278384 100644
--- a/libportable/arch-mips/socket.c
+++ b/libportable/arch-mips/socket.c
@@ -1,10 +1,8 @@
-
#include <unistd.h>
#include <sys/socket.h>
#include <sys/linux-syscalls.h>
-static inline int mips_change_type(int type)
-{
+static inline int mips_change_type(int type) {
switch (type) {
case SOCK_DGRAM: return 2;
case SOCK_STREAM: return 1;
@@ -13,8 +11,7 @@ static inline int mips_change_type(int type)
}
extern int socket(int, int, int);
-int socket_portable(int domain, int type, int protocol)
-{
+
+int socket_portable(int domain, int type, int protocol) {
return socket(domain,mips_change_type(type),protocol);
}
-