diff options
author | Alan Fitton <ajf@eth0.org.uk> | 2012-01-26 10:21:55 +0000 |
---|---|---|
committer | Alan Fitton <ajf@eth0.org.uk> | 2012-01-26 10:21:55 +0000 |
commit | 294b9f3bdcfd63a4bf571f4efd035a0c7551de4a (patch) | |
tree | 80c3bd2d78d0ad8d40c9a3fb8e91d2475183efc3 /src/win32-mailslot.c | |
parent | b8396f5447270cf04ef3279b6306833eea529091 (diff) |
fix some c99 long long warnings by using GMAXINT_64 instead of INT64_MAX
Diffstat (limited to 'src/win32-mailslot.c')
-rw-r--r-- | src/win32-mailslot.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/win32-mailslot.c b/src/win32-mailslot.c index d000281..cca051f 100644 --- a/src/win32-mailslot.c +++ b/src/win32-mailslot.c @@ -19,7 +19,7 @@ #if WIN32 -#define TRG_MAILSLOT_NAME "\\\\.\\mailslot\\TransmissionRemoteGTK" //Name given to the Mailslot +#define TRG_MAILSLOT_NAME "\\\\.\\mailslot\\TransmissionRemoteGTK" #define MAILSLOT_BUFFER_SIZE 1024*32 #include <windows.h> @@ -65,10 +65,10 @@ static gpointer mailslot_recv_thread(gpointer data) DWORD cbBytes; BOOL bResult; - hMailslot = CreateMailslot(TRG_MAILSLOT_NAME, // mailslot name - MAILSLOT_BUFFER_SIZE, // input buffer size - MAILSLOT_WAIT_FOREVER, // no timeout - NULL); // default security attribute + hMailslot = CreateMailslot(TRG_MAILSLOT_NAME, /* mailslot name */ + MAILSLOT_BUFFER_SIZE, /* input buffer size */ + MAILSLOT_WAIT_FOREVER, /* no timeout */ + NULL); /* default security attribute */ if (INVALID_HANDLE_VALUE == hMailslot) { g_error("\nError occurred while creating the mailslot: %d", @@ -77,11 +77,11 @@ static gpointer mailslot_recv_thread(gpointer data) } while (1) { - bResult = ReadFile(hMailslot, // handle to mailslot - szBuffer, // buffer to receive data - sizeof(szBuffer), // size of buffer - &cbBytes, // number of bytes read - NULL); // not overlapped I/O + bResult = ReadFile(hMailslot, /* handle to mailslot */ + szBuffer, /* buffer to receive data */ + sizeof(szBuffer), // size of buffer */ + &cbBytes, /* number of bytes read */ + NULL); /* not overlapped I/O */ if ((!bResult) || (0 == cbBytes)) { g_error("Mailslot error from client: %d", GetLastError()); @@ -131,7 +131,7 @@ static gpointer mailslot_recv_thread(gpointer data) } CloseHandle(hMailslot); - return NULL; //Success + return NULL; /* Success */ } void mailslot_start_background_listener(TrgMainWindow * win) @@ -141,13 +141,13 @@ void mailslot_start_background_listener(TrgMainWindow * win) gboolean mailslot_send_message(gchar ** args) { - HANDLE hMailSlot = CreateFile(TRG_MAILSLOT_NAME, // mailslot name - GENERIC_WRITE, // mailslot write only - FILE_SHARE_READ, // required for mailslots - NULL, // default security attributes - OPEN_EXISTING, // opens existing mailslot - FILE_ATTRIBUTE_NORMAL, // normal attributes - NULL); // no template file + HANDLE hMailSlot = CreateFile(TRG_MAILSLOT_NAME, /* mailslot name */ + GENERIC_WRITE, /* mailslot write only */ + FILE_SHARE_READ, /* required for mailslots */ + NULL, /* default security attributes */ + OPEN_EXISTING, /* opens existing mailslot */ + FILE_ATTRIBUTE_NORMAL, /* normal attributes */ + NULL); /* no template file */ if (hMailSlot != INVALID_HANDLE_VALUE) { DWORD cbBytes; @@ -178,10 +178,10 @@ gboolean mailslot_send_message(gchar ** args) json_node_free(node); g_object_unref(generator); - WriteFile(hMailSlot, // handle to mailslot - msg, // buffer to write from - strlen(msg) + 1, // number of bytes to write, include the NULL - &cbBytes, // number of bytes written + WriteFile(hMailSlot, /* handle to mailslot */ + msg, /* buffer to write from */ + strlen(msg) + 1, /* number of bytes to write, include the NULL */ + &cbBytes, /* number of bytes written */ NULL); CloseHandle(hMailSlot); |