summaryrefslogtreecommitdiff
path: root/protocols/Sametime/src/glib
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-22 14:09:08 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-22 14:09:08 +0000
commitef3f477d42156b0c9994f1de3f85cf052448e52c (patch)
treed776b22042f2a68dd2d085148389cb358dd343b2 /protocols/Sametime/src/glib
parentdbc42a362991cff4ec4a7499b95b36167ebb43d0 (diff)
- project cleaning
- warning fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@8687 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Sametime/src/glib')
-rw-r--r--protocols/Sametime/src/glib/gfileutils.c6
-rw-r--r--protocols/Sametime/src/glib/giowin32.c31
-rw-r--r--protocols/Sametime/src/glib/gkeyfile.c6
-rw-r--r--protocols/Sametime/src/glib/glib_12.vcxproj1
-rw-r--r--protocols/Sametime/src/glib/glib_12.vcxproj.filters3
-rw-r--r--protocols/Sametime/src/glib/grand.c2
-rw-r--r--protocols/Sametime/src/glib/gspawn-win32-helper.c42
-rw-r--r--protocols/Sametime/src/glib/gspawn-win32.c32
-rw-r--r--protocols/Sametime/src/glib/gwin32.c54
-rw-r--r--protocols/Sametime/src/glib/libintl.c4
10 files changed, 61 insertions, 120 deletions
diff --git a/protocols/Sametime/src/glib/gfileutils.c b/protocols/Sametime/src/glib/gfileutils.c
index 185a756dcd..6965cbf020 100644
--- a/protocols/Sametime/src/glib/gfileutils.c
+++ b/protocols/Sametime/src/glib/gfileutils.c
@@ -904,7 +904,7 @@ write_to_temp_file (const gchar *contents,
}
errno = 0;
- file = fdopen (fd, "wb");
+ file = _fdopen(fd, "wb");
if (!file)
{
save_errno = errno;
@@ -915,7 +915,7 @@ write_to_temp_file (const gchar *contents,
display_name,
g_strerror (save_errno));
- close (fd);
+ _close(fd);
g_unlink (tmp_name);
goto out;
@@ -1974,7 +1974,7 @@ g_mkstemp (gchar *tmpl)
/* This is the backward compatibility system codepage version,
* thus use normal open().
*/
- fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600);
+ fd = _open(tmpl, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600);
if (fd >= 0)
return fd;
diff --git a/protocols/Sametime/src/glib/giowin32.c b/protocols/Sametime/src/glib/giowin32.c
index c632c59a52..6ac7f2eb16 100644
--- a/protocols/Sametime/src/glib/giowin32.c
+++ b/protocols/Sametime/src/glib/giowin32.c
@@ -372,7 +372,7 @@ read_thread (void *parameter)
LeaveCriticalSection (&channel->mutex);
- nbytes = read (channel->fd, buffer, nbytes);
+ nbytes = _read(channel->fd, buffer, nbytes);
EnterCriticalSection (&channel->mutex);
@@ -397,14 +397,13 @@ read_thread (void *parameter)
}
channel->running = FALSE;
- if (channel->needs_close)
- {
- if (channel->debug)
- g_print ("read_thread %#x: channel fd %d needs closing\n",
- channel->thread_id, channel->fd);
- close (channel->fd);
- channel->fd = -1;
- }
+ if (channel->needs_close) {
+ if (channel->debug)
+ g_print("read_thread %#x: channel fd %d needs closing\n",
+ channel->thread_id, channel->fd);
+ _close(channel->fd);
+ channel->fd = -1;
+ }
if (channel->debug)
g_print ("read_thread %#x: EOF, rdp=%d, wrp=%d, setting data_avail\n",
@@ -492,7 +491,7 @@ write_thread (void *parameter)
channel->thread_id, nbytes);
LeaveCriticalSection (&channel->mutex);
- nbytes = write (channel->fd, buffer, nbytes);
+ nbytes = _write(channel->fd, buffer, nbytes);
EnterCriticalSection (&channel->mutex);
if (channel->debug)
@@ -522,7 +521,7 @@ write_thread (void *parameter)
if (channel->debug)
g_print ("write_thread %#x: channel fd %d needs closing\n",
channel->thread_id, channel->fd);
- close (channel->fd);
+ _close(channel->fd);
channel->fd = -1;
}
@@ -1201,7 +1200,7 @@ g_io_win32_fd_and_console_read (GIOChannel *channel,
return buffer_read (win32_channel, buf, count, bytes_read, err);
}
- result = read (win32_channel->fd, buf, count);
+ result = _read(win32_channel->fd, buf, count);
if (win32_channel->debug)
g_print ("g_io_win32_fd_read: read() => %d\n", result);
@@ -1244,7 +1243,7 @@ g_io_win32_fd_and_console_write (GIOChannel *channel,
return buffer_write (win32_channel, buf, count, bytes_written, err);
}
- result = write (win32_channel->fd, buf, count);
+ result = _write(win32_channel->fd, buf, count);
if (win32_channel->debug)
g_print ("g_io_win32_fd_write: fd=%d count=%" G_GSIZE_FORMAT " => %d\n",
win32_channel->fd, count, result);
@@ -1309,7 +1308,7 @@ g_io_win32_fd_seek (GIOChannel *channel,
return G_IO_STATUS_ERROR;
}
- result = lseek (win32_channel->fd, tmp_offset, whence);
+ result = _lseek(win32_channel->fd, tmp_offset, whence);
if (result < 0)
{
@@ -1349,7 +1348,7 @@ g_io_win32_fd_close (GIOChannel *channel,
{
if (win32_channel->debug)
g_print ("closing fd %d\n", win32_channel->fd);
- close (win32_channel->fd);
+ _close(win32_channel->fd);
if (win32_channel->debug)
g_print ("closed fd %d, setting to -1\n",
win32_channel->fd);
@@ -1407,7 +1406,7 @@ g_io_win32_console_close (GIOChannel *channel,
{
GIOWin32Channel *win32_channel = (GIOWin32Channel *)channel;
- if (close (win32_channel->fd) < 0)
+ if (_close(win32_channel->fd) < 0)
{
g_set_error_literal (err, G_IO_CHANNEL_ERROR,
g_io_channel_error_from_errno (errno),
diff --git a/protocols/Sametime/src/glib/gkeyfile.c b/protocols/Sametime/src/glib/gkeyfile.c
index 10ca2a2afd..fa20c5a8b4 100644
--- a/protocols/Sametime/src/glib/gkeyfile.c
+++ b/protocols/Sametime/src/glib/gkeyfile.c
@@ -415,7 +415,7 @@ g_key_file_load_from_fd (GKeyFile *key_file,
do
{
- bytes_read = read (fd, read_buf, 4096);
+ bytes_read = _read(fd, read_buf, 4096);
if (bytes_read == 0) /* End of File */
break;
@@ -492,7 +492,7 @@ g_key_file_load_from_file (GKeyFile *key_file,
}
g_key_file_load_from_fd (key_file, fd, flags, &key_file_error);
- close (fd);
+ _close(fd);
if (key_file_error)
{
@@ -617,7 +617,7 @@ g_key_file_load_from_dirs (GKeyFile *key_file,
found_file = g_key_file_load_from_fd (key_file, fd, flags,
&key_file_error);
- close (fd);
+ _close(fd);
if (key_file_error)
{
diff --git a/protocols/Sametime/src/glib/glib_12.vcxproj b/protocols/Sametime/src/glib/glib_12.vcxproj
index 784ef2d00f..44e177123e 100644
--- a/protocols/Sametime/src/glib/glib_12.vcxproj
+++ b/protocols/Sametime/src/glib/glib_12.vcxproj
@@ -284,7 +284,6 @@
<ClCompile Include="pcre\pcre_try_flipped.c" />
<ClCompile Include="pcre\pcre_ucp_searchfuncs.c" />
<ClCompile Include="pcre\pcre_xclass.c" />
- <ClCompile Include="win_iconv.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="gnulib\g-gnulib.h" />
diff --git a/protocols/Sametime/src/glib/glib_12.vcxproj.filters b/protocols/Sametime/src/glib/glib_12.vcxproj.filters
index ec51fce763..d39d49f366 100644
--- a/protocols/Sametime/src/glib/glib_12.vcxproj.filters
+++ b/protocols/Sametime/src/glib/glib_12.vcxproj.filters
@@ -232,9 +232,6 @@
<ClCompile Include="libintl.c">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="win_iconv.c">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="pcre\pcre_chartables.c">
<Filter>Source Files\pcre</Filter>
</ClCompile>
diff --git a/protocols/Sametime/src/glib/grand.c b/protocols/Sametime/src/glib/grand.c
index a70ce7b875..c00d70868d 100644
--- a/protocols/Sametime/src/glib/grand.c
+++ b/protocols/Sametime/src/glib/grand.c
@@ -260,7 +260,7 @@ g_rand_new (void)
g_get_current_time (&now);
seed[0] = now.tv_sec;
seed[1] = now.tv_usec;
- seed[2] = getpid ();
+ seed[2] = _getpid ();
#ifdef G_OS_UNIX
seed[3] = getppid ();
#else
diff --git a/protocols/Sametime/src/glib/gspawn-win32-helper.c b/protocols/Sametime/src/glib/gspawn-win32-helper.c
index 40108bb67a..87d4423e6d 100644
--- a/protocols/Sametime/src/glib/gspawn-win32-helper.c
+++ b/protocols/Sametime/src/glib/gspawn-win32-helper.c
@@ -35,8 +35,8 @@ write_err_and_exit (gint fd,
{
gintptr en = errno;
- write (fd, &msg, sizeof(gintptr));
- write (fd, &en, sizeof(gintptr));
+ _write (fd, &msg, sizeof(gintptr));
+ _write (fd, &en, sizeof(gintptr));
_exit (1);
}
@@ -213,11 +213,11 @@ main (int ignored_argc, char **ignored_argv)
; /* Nothing */
else if (__argv[ARG_STDIN][0] == 'z')
{
- fd = open ("NUL:", O_RDONLY);
+ fd = _open ("NUL:", O_RDONLY);
if (fd != 0)
{
- dup2 (fd, 0);
- close (fd);
+ _dup2 (fd, 0);
+ _close (fd);
}
}
else
@@ -225,8 +225,8 @@ main (int ignored_argc, char **ignored_argv)
fd = atoi (__argv[ARG_STDIN]);
if (fd != 0)
{
- dup2 (fd, 0);
- close (fd);
+ _dup2 (fd, 0);
+ _close (fd);
}
}
@@ -234,11 +234,11 @@ main (int ignored_argc, char **ignored_argv)
; /* Nothing */
else if (__argv[ARG_STDOUT][0] == 'z')
{
- fd = open ("NUL:", O_WRONLY);
+ fd = _open ("NUL:", O_WRONLY);
if (fd != 1)
{
- dup2 (fd, 1);
- close (fd);
+ _dup2 (fd, 1);
+ _close (fd);
}
}
else
@@ -246,8 +246,8 @@ main (int ignored_argc, char **ignored_argv)
fd = atoi (__argv[ARG_STDOUT]);
if (fd != 1)
{
- dup2 (fd, 1);
- close (fd);
+ _dup2 (fd, 1);
+ _close (fd);
}
}
@@ -255,11 +255,11 @@ main (int ignored_argc, char **ignored_argv)
; /* Nothing */
else if (__argv[ARG_STDERR][0] == 'z')
{
- fd = open ("NUL:", O_WRONLY);
+ fd = _open ("NUL:", O_WRONLY);
if (fd != 2)
{
- dup2 (fd, 2);
- close (fd);
+ _dup2 (fd, 2);
+ _close (fd);
}
}
else
@@ -267,8 +267,8 @@ main (int ignored_argc, char **ignored_argv)
fd = atoi (__argv[ARG_STDERR]);
if (fd != 2)
{
- dup2 (fd, 2);
- close (fd);
+ _dup2 (fd, 2);
+ _close (fd);
}
}
@@ -287,7 +287,7 @@ main (int ignored_argc, char **ignored_argv)
if (__argv[ARG_CLOSE_DESCRIPTORS][0] == 'y')
for (i = 3; i < 1000; i++) /* FIXME real limit? */
if (i != child_err_report_fd && i != helper_sync_fd)
- close (i);
+ _close (i);
/* We don't want our child to inherit the error report and
* helper sync fds.
@@ -324,10 +324,10 @@ main (int ignored_argc, char **ignored_argv)
if (handle == -1 && saved_errno != 0)
write_err_and_exit (child_err_report_fd, CHILD_SPAWN_FAILED);
- write (child_err_report_fd, &no_error, sizeof (no_error));
- write (child_err_report_fd, &handle, sizeof (handle));
+ _write (child_err_report_fd, &no_error, sizeof (no_error));
+ _write (child_err_report_fd, &handle, sizeof (handle));
- read (helper_sync_fd, &c, 1);
+ _read (helper_sync_fd, &c, 1);
return 0;
}
diff --git a/protocols/Sametime/src/glib/gspawn-win32.c b/protocols/Sametime/src/glib/gspawn-win32.c
index 44ae907ff0..d13d9906f1 100644
--- a/protocols/Sametime/src/glib/gspawn-win32.c
+++ b/protocols/Sametime/src/glib/gspawn-win32.c
@@ -109,7 +109,7 @@ dup_noninherited (int fd,
DuplicateHandle (GetCurrentProcess (), (LPHANDLE) _get_osfhandle (fd),
GetCurrentProcess (), &filehandle,
0, FALSE, DUPLICATE_SAME_ACCESS);
- close (fd);
+ _close (fd);
return _open_osfhandle ((gintptr) filehandle, mode | _O_NOINHERIT);
}
@@ -243,7 +243,7 @@ close_and_invalidate (gint *fd)
if (*fd < 0)
return;
- close (*fd);
+ _close (*fd);
*fd = -1;
}
@@ -323,7 +323,7 @@ read_helper_report (int fd,
__FILE__,
sizeof(gintptr)*2 - bytes);
- chunk = read (fd, ((gchar*)report) + bytes,
+ chunk = _read (fd, ((gchar*)report) + bytes,
sizeof(gintptr)*2 - bytes);
if (debug)
@@ -793,7 +793,7 @@ do_spawn_with_pipes (gint *exit_status,
*/
g_assert (err_report != NULL);
*err_report = child_err_report_pipe[0];
- write (helper_sync_pipe[1], " ", 1);
+ _write (helper_sync_pipe[1], " ", 1);
close_and_invalidate (&helper_sync_pipe[1]);
}
else
@@ -824,12 +824,12 @@ do_spawn_with_pipes (gint *exit_status,
}
else if (child_handle)
*child_handle = 0;
- write (helper_sync_pipe[1], " ", 1);
+ _write (helper_sync_pipe[1], " ", 1);
close_and_invalidate (&helper_sync_pipe[1]);
break;
default:
- write (helper_sync_pipe[1], " ", 1);
+ _write (helper_sync_pipe[1], " ", 1);
close_and_invalidate (&helper_sync_pipe[1]);
set_child_error (helper_report, working_directory, error);
goto cleanup_and_fail;
@@ -854,25 +854,25 @@ do_spawn_with_pipes (gint *exit_status,
if (rc != -1)
CloseHandle ((HANDLE) rc);
if (child_err_report_pipe[0] != -1)
- close (child_err_report_pipe[0]);
+ _close (child_err_report_pipe[0]);
if (child_err_report_pipe[1] != -1)
- close (child_err_report_pipe[1]);
+ _close (child_err_report_pipe[1]);
if (helper_sync_pipe[0] != -1)
- close (helper_sync_pipe[0]);
+ _close (helper_sync_pipe[0]);
if (helper_sync_pipe[1] != -1)
- close (helper_sync_pipe[1]);
+ _close (helper_sync_pipe[1]);
if (stdin_pipe[0] != -1)
- close (stdin_pipe[0]);
+ _close (stdin_pipe[0]);
if (stdin_pipe[1] != -1)
- close (stdin_pipe[1]);
+ _close (stdin_pipe[1]);
if (stdout_pipe[0] != -1)
- close (stdout_pipe[0]);
+ _close (stdout_pipe[0]);
if (stdout_pipe[1] != -1)
- close (stdout_pipe[1]);
+ _close (stdout_pipe[1]);
if (stderr_pipe[0] != -1)
- close (stderr_pipe[0]);
+ _close (stderr_pipe[0]);
if (stderr_pipe[1] != -1)
- close (stderr_pipe[1]);
+ _close (stderr_pipe[1]);
return FALSE;
}
diff --git a/protocols/Sametime/src/glib/gwin32.c b/protocols/Sametime/src/glib/gwin32.c
index 9ba02ad752..88e9a4b4ff 100644
--- a/protocols/Sametime/src/glib/gwin32.c
+++ b/protocols/Sametime/src/glib/gwin32.c
@@ -393,38 +393,6 @@ g_win32_get_package_installation_directory_utf8 (const gchar *package,
return result;
}
-#if !defined (_WIN64)
-
-/* DLL ABI binary compatibility version that uses system codepage file names */
-
-gchar *
-g_win32_get_package_installation_directory (const gchar *package,
- const gchar *dll_name)
-{
- gchar *utf8_package = NULL, *utf8_dll_name = NULL;
- gchar *utf8_retval, *retval;
-
- if (package != NULL)
- utf8_package = g_locale_to_utf8 (package, -1, NULL, NULL, NULL);
-
- if (dll_name != NULL)
- utf8_dll_name = g_locale_to_utf8 (dll_name, -1, NULL, NULL, NULL);
-
- utf8_retval =
- g_win32_get_package_installation_directory_utf8 (utf8_package,
- utf8_dll_name);
-
- retval = g_locale_from_utf8 (utf8_retval, -1, NULL, NULL, NULL);
-
- g_free (utf8_package);
- g_free (utf8_dll_name);
- g_free (utf8_retval);
-
- return retval;
-}
-
-#endif
-
/**
* g_win32_get_package_installation_subdirectory:
* @package: You should pass %NULL for this.
@@ -470,28 +438,6 @@ g_win32_get_package_installation_subdirectory_utf8 (const gchar *package,
return dirname;
}
-#if !defined (_WIN64)
-
-/* DLL ABI binary compatibility version that uses system codepage file names */
-
-gchar *
-g_win32_get_package_installation_subdirectory (const gchar *package,
- const gchar *dll_name,
- const gchar *subdir)
-{
- gchar *prefix;
- gchar *dirname;
-
- prefix = g_win32_get_package_installation_directory (package, dll_name);
-
- dirname = g_build_filename (prefix, subdir, NULL);
- g_free (prefix);
-
- return dirname;
-}
-
-#endif
-
static guint windows_version;
static void
diff --git a/protocols/Sametime/src/glib/libintl.c b/protocols/Sametime/src/glib/libintl.c
index ae0f9e676e..89b6c92af8 100644
--- a/protocols/Sametime/src/glib/libintl.c
+++ b/protocols/Sametime/src/glib/libintl.c
@@ -145,10 +145,10 @@ DUMMY (dcngettext,
DUMMY (textdomain,
(const char *domainname),
(domainname ?
- (free (current_domain), current_domain = strdup (domainname)) :
+ (free(current_domain), current_domain = _strdup(domainname)) :
(current_domain ?
current_domain :
- (current_domain = strdup ("messages")))))
+ (current_domain = _strdup ("messages")))))
/* bindtextdomain() should return the current dirname for the domain,
* after possibly changing it. I don't think software usually checks