Browse Source

Fix whitespace errors introduced by porting efforts

v0.7.4-release
Bert Belder 14 years ago
parent
commit
4a2cb07808
  1. 21
      deps/libeio/eio.c
  2. 2
      deps/libeio/xthread.h
  3. 2
      src/node.cc
  4. 4
      src/node_buffer.cc
  5. 7
      src/node_net.cc
  6. 4
      src/platform_win32.h
  7. 2
      wscript

21
deps/libeio/eio.c

@ -1435,6 +1435,7 @@ eio__scandir (eio_req *req, etp_worker *self)
} }
} }
} }
#ifdef PAGESIZE #ifdef PAGESIZE
# define eio_pagesize() PAGESIZE # define eio_pagesize() PAGESIZE
@ -1444,10 +1445,10 @@ eio__scandir (eio_req *req, etp_worker *self)
eio_pagesize (void) eio_pagesize (void)
{ {
SYSTEM_INFO si; SYSTEM_INFO si;
GetSystemInfo(&si); GetSystemInfo(&si);
return si.dwPageSize; return si.dwPageSize;
} }
#else #else
/* POSIX */ /* POSIX */
static intptr_t static intptr_t
@ -1457,7 +1458,7 @@ eio__scandir (eio_req *req, etp_worker *self)
if (!page) if (!page)
page = sysconf (_SC_PAGESIZE); page = sysconf (_SC_PAGESIZE);
return page; return page;
} }
#endif #endif
@ -1712,19 +1713,21 @@ static void eio_execute (etp_worker *self, eio_req *req)
#ifndef _WIN32 #ifndef _WIN32
case EIO_LSTAT: ALLOC (sizeof (EIO_STRUCT_STAT)); case EIO_LSTAT: ALLOC (sizeof (EIO_STRUCT_STAT));
req->result = lstat (req->ptr1, (EIO_STRUCT_STAT *)req->ptr2); break; req->result = lstat (req->ptr1, (EIO_STRUCT_STAT *)req->ptr2); break;
#endif #endif
case EIO_FSTAT: ALLOC (sizeof (EIO_STRUCT_STAT)); case EIO_FSTAT: ALLOC (sizeof (EIO_STRUCT_STAT));
req->result = fstat (req->int1, (EIO_STRUCT_STAT *)req->ptr2); break; req->result = fstat (req->int1, (EIO_STRUCT_STAT *)req->ptr2); break;
#ifndef _WIN32 #ifndef _WIN32
case EIO_STATVFS: ALLOC (sizeof (EIO_STRUCT_STATVFS)); case EIO_STATVFS: ALLOC (sizeof (EIO_STRUCT_STATVFS));
req->result = statvfs (req->ptr1, (EIO_STRUCT_STATVFS *)req->ptr2); break; req->result = statvfs (req->ptr1, (EIO_STRUCT_STATVFS *)req->ptr2); break;
case EIO_FSTATVFS: ALLOC (sizeof (EIO_STRUCT_STATVFS)); case EIO_FSTATVFS: ALLOC (sizeof (EIO_STRUCT_STATVFS));
req->result = fstatvfs (req->int1, (EIO_STRUCT_STATVFS *)req->ptr2); break; req->result = fstatvfs (req->int1, (EIO_STRUCT_STATVFS *)req->ptr2); break;
case EIO_CHOWN: req->result = chown (req->ptr1, req->int2, req->int3); break; case EIO_CHOWN: req->result = chown (req->ptr1, req->int2, req->int3); break;
case EIO_FCHOWN: req->result = fchown (req->int1, req->int2, req->int3); break; case EIO_FCHOWN: req->result = fchown (req->int1, req->int2, req->int3); break;
#endif #endif
case EIO_CHMOD: req->result = chmod (req->ptr1, (mode_t)req->int2); break; case EIO_CHMOD: req->result = chmod (req->ptr1, (mode_t)req->int2); break;
#ifndef _WIN32 #ifndef _WIN32
case EIO_FCHMOD: req->result = fchmod (req->int1, (mode_t)req->int2); break; case EIO_FCHMOD: req->result = fchmod (req->int1, (mode_t)req->int2); break;
case EIO_TRUNCATE: req->result = truncate (req->ptr1, req->offs); break; case EIO_TRUNCATE: req->result = truncate (req->ptr1, req->offs); break;
#endif #endif
@ -1737,11 +1740,11 @@ static void eio_execute (etp_worker *self, eio_req *req)
case EIO_RMDIR: req->result = rmdir (req->ptr1); break; case EIO_RMDIR: req->result = rmdir (req->ptr1); break;
#ifdef _WIN32 #ifdef _WIN32
case EIO_MKDIR: req->result = mkdir (req->ptr1); break; case EIO_MKDIR: req->result = mkdir (req->ptr1); break;
#else #else
case EIO_MKDIR: req->result = mkdir (req->ptr1, (mode_t)req->int2); break; case EIO_MKDIR: req->result = mkdir (req->ptr1, (mode_t)req->int2); break;
#endif #endif
case EIO_RENAME: req->result = rename (req->ptr1, req->ptr2); break; case EIO_RENAME: req->result = rename (req->ptr1, req->ptr2); break;
#ifndef _WIN32 #ifndef _WIN32
case EIO_LINK: req->result = link (req->ptr1, req->ptr2); break; case EIO_LINK: req->result = link (req->ptr1, req->ptr2); break;
case EIO_SYMLINK: req->result = symlink (req->ptr1, req->ptr2); break; case EIO_SYMLINK: req->result = symlink (req->ptr1, req->ptr2); break;
case EIO_MKNOD: req->result = mknod (req->ptr1, (mode_t)req->int2, (dev_t)req->int3); break; case EIO_MKNOD: req->result = mknod (req->ptr1, (mode_t)req->int2, (dev_t)req->int3); break;

2
deps/libeio/xthread.h

@ -30,7 +30,7 @@ typedef int ssize_t
#include <winsock2.h> #include <winsock2.h>
#include <process.h> #include <process.h>
#include <windows.h> #include <windows.h>
#include "pthread.h" #include <pthread.h>
#define sigset_t int #define sigset_t int
#define sigfillset(a) #define sigfillset(a)
#define pthread_sigmask(a,b,c) #define pthread_sigmask(a,b,c)

2
src/node.cc

@ -1257,6 +1257,7 @@ v8::Handle<v8::Value> MemoryUsage(const v8::Arguments& args) {
return scope.Close(info); return scope.Close(info);
} }
#ifdef __POSIX__ #ifdef __POSIX__
Handle<Value> Kill(const Arguments& args) { Handle<Value> Kill(const Arguments& args) {
@ -1893,6 +1894,7 @@ static void SignalExit(int signal) {
_exit(1); _exit(1);
} }
#ifdef __POSIX__ #ifdef __POSIX__
static int RegisterSignalHandler(int signal, void (*handler)(int)) { static int RegisterSignalHandler(int signal, void (*handler)(int)) {
struct sigaction sa; struct sigaction sa;

4
src/node_buffer.cc

@ -7,9 +7,9 @@
#include <string.h> // memcpy #include <string.h> // memcpy
#ifdef __MINGW32__ #ifdef __MINGW32__
# include <winsock2.h> // htons, htonl # include <winsock2.h> // htons, htonl
#else // __POSIX__ #else // __POSIX__
# include <arpa/inet.h> // htons, htonl # include <arpa/inet.h> // htons, htonl
#endif #endif
#include <node.h> #include <node.h>

7
src/node_net.cc

@ -146,6 +146,7 @@ static Handle<Value> Pipe(const Arguments& args) {
return scope.Close(a); return scope.Close(a);
} }
// Creates nonblocking socket pair // Creates nonblocking socket pair
static Handle<Value> SocketPair(const Arguments& args) { static Handle<Value> SocketPair(const Arguments& args) {
HandleScope scope; HandleScope scope;
@ -416,6 +417,7 @@ static Handle<Value> Shutdown(const Arguments& args) {
return Undefined(); return Undefined();
} }
// Connect with unix // Connect with unix
// t.connect(fd, "/tmp/socket") // t.connect(fd, "/tmp/socket")
// //
@ -439,11 +441,13 @@ static Handle<Value> Connect(const Arguments& args) {
#ifdef __POSIX__ #ifdef __POSIX__
int r = connect(fd, addr, addrlen); int r = connect(fd, addr, addrlen);
if (r < 0 && errno != EINPROGRESS) { if (r < 0 && errno != EINPROGRESS) {
return ThrowException(ErrnoException(errno, "connect")); return ThrowException(ErrnoException(errno, "connect"));
} }
#else // __MINGW32__ #else // __MINGW32__
int r = connect(_get_osfhandle(fd), addr, addrlen); int r = connect(_get_osfhandle(fd), addr, addrlen);
if (r == INVALID_SOCKET) { if (r == INVALID_SOCKET) {
int wsaErrno = WSAGetLastError(); int wsaErrno = WSAGetLastError();
if (wsaErrno != WSAEALREADY && wsaErrno != WSAEINPROGRESS) { if (wsaErrno != WSAEALREADY && wsaErrno != WSAEINPROGRESS) {
@ -519,6 +523,7 @@ do { \
#endif // __MINGW32__ #endif // __MINGW32__
#ifdef __POSIX__ #ifdef __POSIX__
static Handle<Value> GetSockName(const Arguments& args) { static Handle<Value> GetSockName(const Arguments& args) {
@ -723,6 +728,7 @@ static Handle<Value> Read(const Arguments& args) {
return scope.Close(Integer::New(bytes_read)); return scope.Close(Integer::New(bytes_read));
} }
#ifdef __POSIX__ #ifdef __POSIX__
// var info = t.recvfrom(fd, buffer, offset, length, flags); // var info = t.recvfrom(fd, buffer, offset, length, flags);
@ -1499,7 +1505,6 @@ void InitNet(Handle<Object> target) {
NODE_SET_METHOD(target, "bind", Bind); NODE_SET_METHOD(target, "bind", Bind);
NODE_SET_METHOD(target, "listen", Listen); NODE_SET_METHOD(target, "listen", Listen);
NODE_SET_METHOD(target, "accept", Accept); NODE_SET_METHOD(target, "accept", Accept);
#ifdef __POSIX__ #ifdef __POSIX__
NODE_SET_METHOD(target, "socketError", SocketError); NODE_SET_METHOD(target, "socketError", SocketError);
NODE_SET_METHOD(target, "toRead", ToRead); NODE_SET_METHOD(target, "toRead", ToRead);

4
src/platform_win32.h

@ -20,7 +20,7 @@
False() False()
#define NO_IMPL_MSG(name...) \ #define NO_IMPL_MSG(name...) \
fprintf(stderr, "Not implemented: %s\n", #name); fprintf(stderr, "Not implemented: %s\n", #name);
namespace node { namespace node {
@ -28,4 +28,4 @@ void winapi_perror(const char* prefix);
} }
#endif // NODE_PLATFORM_WIN32_H_ #endif // NODE_PLATFORM_WIN32_H_

2
wscript

@ -407,7 +407,7 @@ def configure(conf):
# Split off debug variant before adding variant specific defines # Split off debug variant before adding variant specific defines
debug_env = conf.env.copy() debug_env = conf.env.copy()
conf.set_env_name('debug', debug_env) conf.set_env_name('debug', debug_env)
if (sys.platform.startswith("win32")): if (sys.platform.startswith("win32")):
# Static pthread - crashes # Static pthread - crashes
#conf.env.append_value('LINKFLAGS', '../deps/pthreads-w32/libpthreadGC2.a') #conf.env.append_value('LINKFLAGS', '../deps/pthreads-w32/libpthreadGC2.a')

Loading…
Cancel
Save