Skip to content

Commit

Permalink
Misc. cleanups
Browse files Browse the repository at this point in the history
casts, unused vars, function ordering, /* within comment, etc.
  • Loading branch information
piscisaureus committed Jan 18, 2011
1 parent e0f47be commit c99962e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/node_cares.cc
Expand Up @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/node_child_process.h
Expand Up @@ -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?
Expand Down
11 changes: 7 additions & 4 deletions src/node_file.cc
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/node_net.cc
Expand Up @@ -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
*/
Expand Down
3 changes: 2 additions & 1 deletion src/node_os.cc
Expand Up @@ -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));
Expand Down
1 change: 0 additions & 1 deletion src/platform_win32.cc
Expand Up @@ -17,7 +17,6 @@ namespace node {

using namespace v8;

static char buf[MAXPATHLEN + 1];
static char *process_title = NULL;


Expand Down
3 changes: 0 additions & 3 deletions src/platform_win32_winsock.cc
Expand Up @@ -11,7 +11,6 @@

namespace node {


/*
* Guids and typedefs for winsock extension functions
* Mingw32 doesn't have these :-(
Expand Down Expand Up @@ -386,8 +385,6 @@ static void wsa_get_proto_info(int af, int type, int proto, WSAPROTOCOL_INFOW *t
* 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]);
Expand Down
2 changes: 1 addition & 1 deletion src/platform_win32_winsock.h
Expand Up @@ -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);

Expand Down

0 comments on commit c99962e

Please sign in to comment.