Misc. cleanups
casts, unused vars, function ordering, /* within comment, etc.
This commit is contained in:
parent
e0f47be9d0
commit
c99962e4cd
@ -25,7 +25,7 @@
|
||||
#endif // __OpenBSD__
|
||||
|
||||
/*
|
||||
* HACK to use inet_pton/inet_ntop from c-ares because mingw32 doesn't have it /*
|
||||
* HACK to use inet_pton/inet_ntop from c-ares because mingw32 doesn't have it
|
||||
* This trick is used in node_net.cc as well
|
||||
* TODO fixme
|
||||
*/
|
||||
|
@ -75,7 +75,7 @@ class ChildProcess : ObjectWrap {
|
||||
// called still.
|
||||
int Kill(int sig);
|
||||
|
||||
private:
|
||||
private:
|
||||
void OnExit(int code);
|
||||
|
||||
#ifdef __POSIX__ // Shouldn't this just move to node_child_process.cc?
|
||||
|
@ -24,29 +24,32 @@
|
||||
#define PATH_MAX 4096
|
||||
#endif
|
||||
|
||||
/* HACK to use pread/pwrite from eio because MINGW32 doesn't have it /*
|
||||
/* HACK to use pread/pwrite from eio because MINGW32 doesn't have it */
|
||||
/* TODO fixme */
|
||||
#ifdef __MINGW32__
|
||||
# define pread eio__pread
|
||||
# define pwrite eio__pwrite
|
||||
#endif
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
|
||||
|
||||
namespace node {
|
||||
|
||||
using namespace v8;
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
|
||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define THROW_BAD_ARGS \
|
||||
ThrowException(Exception::TypeError(String::New("Bad argument")))
|
||||
|
||||
static Persistent<String> encoding_symbol;
|
||||
static Persistent<String> errno_symbol;
|
||||
static Persistent<String> buf_symbol;
|
||||
|
||||
// Buffer for readlink() and other misc callers; keep this scoped at
|
||||
// file-level rather than method-level to avoid excess stack usage.
|
||||
static char getbuf[PATH_MAX + 1];
|
||||
// Not used on windows atm
|
||||
#ifdef __POSIX__
|
||||
static char getbuf[PATH_MAX + 1];
|
||||
#endif
|
||||
|
||||
static int After(eio_req *req) {
|
||||
HandleScope scope;
|
||||
|
@ -42,7 +42,7 @@
|
||||
#endif
|
||||
|
||||
/*
|
||||
* HACK to use inet_pton/inet_ntop from c-ares because mingw32 doesn't have it /*
|
||||
* HACK to use inet_pton/inet_ntop from c-ares because mingw32 doesn't have it
|
||||
* This trick is used in node_ares.cc as well
|
||||
* TODO fixme
|
||||
*/
|
||||
|
@ -73,7 +73,8 @@ static Handle<Value> GetOSRelease(const Arguments& args) {
|
||||
return Undefined();
|
||||
}
|
||||
|
||||
sprintf(release, "%d.%d.%d", info.dwMajorVersion, info.dwMinorVersion, info.dwBuildNumber);
|
||||
sprintf(release, "%d.%d.%d", static_cast<int>(info.dwMajorVersion),
|
||||
static_cast<int>(info.dwMinorVersion), static_cast<int>(info.dwBuildNumber));
|
||||
#endif
|
||||
|
||||
return scope.Close(String::New(release));
|
||||
|
@ -17,7 +17,6 @@ namespace node {
|
||||
|
||||
using namespace v8;
|
||||
|
||||
static char buf[MAXPATHLEN + 1];
|
||||
static char *process_title = NULL;
|
||||
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace node {
|
||||
|
||||
|
||||
/*
|
||||
* Guids and typedefs for winsock extension functions
|
||||
* Mingw32 doesn't have these :-(
|
||||
@ -386,8 +385,6 @@ error:
|
||||
* Initializes (fills) the WSAPROTOCOL_INFOW structure cache
|
||||
*/
|
||||
static void wsa_init_proto_info_cache() {
|
||||
WSAPROTOCOL_INFOW *cache = (WSAPROTOCOL_INFOW*)&proto_info_cache;
|
||||
|
||||
wsa_get_proto_info(AF_INET, SOCK_STREAM, IPPROTO_TCP, &proto_info_cache[0]);
|
||||
wsa_get_proto_info(AF_INET, SOCK_DGRAM, IPPROTO_UDP, &proto_info_cache[1]);
|
||||
wsa_get_proto_info(AF_INET6, SOCK_STREAM, IPPROTO_TCP, &proto_info_cache[2]);
|
||||
|
@ -14,9 +14,9 @@ void wsa_init();
|
||||
|
||||
void wsa_perror(const char* prefix = "");
|
||||
|
||||
SOCKET wsa_sync_socket(int af, int type, int proto);
|
||||
BOOL wsa_disconnect_ex(SOCKET socket, OVERLAPPED *overlapped, DWORD flags, DWORD reserved);
|
||||
|
||||
SOCKET wsa_sync_socket(int af, int type, int proto);
|
||||
int wsa_socketpair(int af, int type, int proto, SOCKET sock[2]);
|
||||
int wsa_sync_async_socketpair(int af, int type, int proto, SOCKET *syncSocket, SOCKET *asyncSocket);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user