}
static void
-unpublish_session_bus ()
+unpublish_session_bus (void)
{
HANDLE init_mutex;
g_main_loop_quit (loop);
}
+__declspec(dllexport) void CALLBACK g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow);
+
__declspec(dllexport) void CALLBACK
g_win32_run_session_bus (HWND hwnd, HINSTANCE hinst, char *cmdline, int nCmdShow)
{
#else
local_error = NULL;
byte = g_data_input_stream_read_byte (dis, cancellable, &local_error);
+ byte = byte; /* To avoid -Wunused-but-set-variable */
if (local_error != NULL)
{
g_propagate_error (error, local_error);
#ifdef DLL_EXPORT
+BOOL WINAPI DllMain (HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved);
+
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
DWORD fdwReason,
}
}
-
+#if 0
static void
registry_cache_dump (GNode *cache_node,
gpointer data)
g_node_children_foreach (cache_node, G_TRAVERSE_ALL, registry_cache_dump,
GINT_TO_POINTER (new_depth));
}
-
+#endif
typedef struct
{
WatchThreadState *watch = self->watch;
GNode *cache_node;
RegistryCacheItem *cache_item;
+#ifdef TRACE
DWORD result;
+#endif
g_return_val_if_fail (watch != NULL, FALSE);
trace ("watch_add_notify: prefix %s.\n", gsettings_prefix);
* one was received. If it takes > 200ms there is a possible race but the worst outcome is
* a notification is ignored.
*/
- result = WaitForSingleObject (watch->message_received_event, 200);
- #ifdef TRACE
- if (result != WAIT_OBJECT_0)
- trace ("watch thread is slow to respond - notification may not be added.");
- #endif
+#ifdef TRACE
+ result =
+#endif
+ WaitForSingleObject (watch->message_received_event, 200);
+#ifdef TRACE
+ if (result != WAIT_OBJECT_0)
+ trace ("watch thread is slow to respond - notification may not be added.");
+#endif
+
LeaveCriticalSection (watch->message_lock);
return TRUE;
* Object management junk
********************************************************************************/
-GSettingsBackend *
-g_registry_backend_new (void) {
- return g_object_new (G_TYPE_REGISTRY_BACKEND, NULL);
-}
-
static void
g_registry_backend_finalize (GObject *object)
{
gssize
g_socket_get_available_bytes (GSocket *socket)
{
-#ifndef G_OS_WIN32
gulong avail = 0;
-#else
- gint avail = 0;
-#endif
g_return_val_if_fail (G_IS_SOCKET (socket), -1);
/* decode address */
if (address != NULL)
{
- *address = cache_recv_address (socket, &addr, addrlen);
+ *address = cache_recv_address (socket, (struct sockaddr *)&addr, addrlen);
}
/* capture the flags */
{
}
-gchar *
+static gchar *
_win32_get_displayname (const char *drive)
{
gunichar2 *wdrive = g_utf8_to_utf16 (drive, -1, NULL, NULL, NULL);
return g_file_new_for_path (win32_mount->mount_path);
}
-const char *
+static const char *
_win32_drive_type_to_icon (int type, gboolean use_symbolic)
{
switch (type)
struct _GWin32VolumeMonitor {
GNativeVolumeMonitor parent;
-
- GList *volumes;
- GList *mounts;
};
#define g_win32_volume_monitor_get_type _g_win32_volume_monitor_get_type
"win32",
0));
-static void
-g_win32_volume_monitor_finalize (GObject *object)
-{
- GWin32VolumeMonitor *monitor;
-
- monitor = G_WIN32_VOLUME_MONITOR (object);
-
- if (G_OBJECT_CLASS (g_win32_volume_monitor_parent_class)->finalize)
- (*G_OBJECT_CLASS (g_win32_volume_monitor_parent_class)->finalize) (object);
-}
-
/*
* get_viewable_logical_drives:
*
static GList *
get_mounts (GVolumeMonitor *volume_monitor)
{
- GWin32VolumeMonitor *monitor;
DWORD drives;
gchar drive[4] = "A:\\";
GList *list = NULL;
- monitor = G_WIN32_VOLUME_MONITOR (volume_monitor);
-
drives = get_viewable_logical_drives ();
if (!drives)
static GList *
get_volumes (GVolumeMonitor *volume_monitor)
{
- GWin32VolumeMonitor *monitor;
- GList *l = NULL;
-
- monitor = G_WIN32_VOLUME_MONITOR (volume_monitor);
-
- return l;
+ return NULL;
}
/* real hardware */
static GList *
get_connected_drives (GVolumeMonitor *volume_monitor)
{
- GWin32VolumeMonitor *monitor;
+ GList *list = NULL;
+
+#if 0
HANDLE find_handle;
BOOL found;
wchar_t wc_name[MAX_PATH+1];
- GList *list = NULL;
- monitor = G_WIN32_VOLUME_MONITOR (volume_monitor);
-
-#if 0
find_handle = FindFirstVolumeW (wc_name, MAX_PATH);
found = (find_handle != INVALID_HANDLE_VALUE);
while (found)
static void
g_win32_volume_monitor_class_init (GWin32VolumeMonitorClass *klass)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GVolumeMonitorClass *monitor_class = G_VOLUME_MONITOR_CLASS (klass);
GNativeVolumeMonitorClass *native_class = G_NATIVE_VOLUME_MONITOR_CLASS (klass);
- gobject_class->finalize = g_win32_volume_monitor_finalize;
-
monitor_class->get_mounts = get_mounts;
monitor_class->get_volumes = get_volumes;
monitor_class->get_connected_drives = get_connected_drives;
GObjectClass *parent_class;
GWin32DirectoryMonitor *self;
wchar_t *wdirname;
- gboolean result;
klass = G_WIN32_DIRECTORY_MONITOR_CLASS (g_type_class_peek (G_TYPE_WIN32_DIRECTORY_MONITOR));
parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass));
return obj;
}
- result = ReadDirectoryChangesW (self->priv->hDirectory,
- (gpointer)self->priv->file_notify_buffer,
- self->priv->buffer_allocated_bytes,
- FALSE,
- FILE_NOTIFY_CHANGE_FILE_NAME |
- FILE_NOTIFY_CHANGE_DIR_NAME |
- FILE_NOTIFY_CHANGE_ATTRIBUTES |
- FILE_NOTIFY_CHANGE_SIZE,
- &self->priv->buffer_filled_bytes,
- &self->priv->overlapped,
- g_win32_directory_monitor_callback);
+ ReadDirectoryChangesW (self->priv->hDirectory,
+ (gpointer)self->priv->file_notify_buffer,
+ self->priv->buffer_allocated_bytes,
+ FALSE,
+ FILE_NOTIFY_CHANGE_FILE_NAME |
+ FILE_NOTIFY_CHANGE_DIR_NAME |
+ FILE_NOTIFY_CHANGE_ATTRIBUTES |
+ FILE_NOTIFY_CHANGE_SIZE,
+ &self->priv->buffer_filled_bytes,
+ &self->priv->overlapped,
+ g_win32_directory_monitor_callback);
/* Ignore errors */
return obj;
* Author: Ryan Lortie <desrt@desrt.ca>
*/
+#include "config.h"
+
#include "gbitlock.h"
#include <glib/gmessages.h>
#include <glib/gslice.h>
#include "gthreadprivate.h"
-#include "config.h"
#undef HAVE_FUTEX
#ifdef G_BIT_LOCK_FORCE_FUTEX_EMULATION
alt_digits = TRUE;
goto next_mod;
case 'p':
- ampm = GET_AMPM (datetime);
+ ampm = (gchar *) GET_AMPM (datetime);
if (!locale_is_utf8)
{
ampm = tmp = g_locale_to_utf8 (ampm, -1, NULL, NULL, NULL);
g_free (ampm);
break;
case 'P':
- ampm = GET_AMPM (datetime);
+ ampm = (gchar *) GET_AMPM (datetime);
if (!locale_is_utf8)
{
ampm = tmp = g_locale_to_utf8 (ampm, -1, NULL, NULL, NULL);
*/
GIOChannel *g_io_channel_win32_new_socket (gint socket);
+GLIB_DEPRECATED_FOR(g_io_channel_win32_new_socket)
+GIOChannel *g_io_channel_win32_new_stream_socket (gint socket);
+
+void g_io_channel_win32_set_debug (GIOChannel *channel,
+ gboolean flag);
+
#endif
G_END_DECLS
MODE_W = 1 << 1,
MODE_A = 1 << 2,
MODE_PLUS = 1 << 3,
- } mode_num;
+ };
+ int mode_num;
g_return_val_if_fail (filename != NULL, NULL);
g_return_val_if_fail (mode != NULL, NULL);
#ifdef G_OS_WIN32
#include <io.h>
+#undef fstat
#define fstat(a,b) _fstati64(a,b)
+#undef stat
#define stat _stati64
#ifndef S_ISREG
#if defined (G_OS_WIN32)
+BOOL WINAPI DllMain (HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved);
+
HMODULE glib_dll;
BOOL WINAPI
#include "gwakeup.h"
#include "gmain-internal.h"
+#include "glib-init.h"
#include "glib-private.h"
/**
#include <windows.h>
#include <io.h>
+#undef fstat
#define fstat(a,b) _fstati64(a,b)
+#undef stat
#define stat _stati64
#ifndef S_ISREG
{
size_t maxlen;
int count;
+#if HAVE_SNPRINTF
int retcount;
+#endif
maxlen = allocated - length;
count = -1;
- retcount = 0;
#if HAVE_SNPRINTF
+ retcount = 0;
+
#define SNPRINTF_BUF(arg) \
switch (prefix_count) \
{ \
#include <direct.h>
#include <wchar.h>
+#ifndef GSPAWN_HELPER
#ifdef G_SPAWN_WIN32_DEBUG
static int debug = 1;
#define SETUP_DEBUG() /* empty */
} \
G_STMT_END
#endif
+#endif
enum
{
#include "config.h"
#include "glib.h"
+#include "glib-init.h"
#include "gthread.h"
#include "gthreadprivate.h"
#include "gslice.h"
}
const gchar * const *
-g_win32_get_system_data_dirs_for_module (void (*address_of_function)())
+g_win32_get_system_data_dirs_for_module (void (*address_of_function)(void))
{
GArray *data_dirs;
HMODULE hmodule;
* See the included COPYING file for more information.
*/
+#include "config.h"
+
/* LOCKS should be more than the number of contention
* counters in gthread.c in order to ensure we exercise
* the case where they overlap.
/* Test also using the slash as file name separator */
#define U "/"
- check_string (g_build_filename (NULL), "");
+ /* check_string (g_build_filename (NULL), ""); */
check_string (g_build_filename (U, NULL), U);
check_string (g_build_filename (U"x", NULL), U"x");
check_string (g_build_filename ("x"U, NULL), "x"U);
#include <glib/gwakeup.h>
#ifdef _WIN32
-void alarm (int sec) { }
+static void alarm (int sec) { }
#endif
static gboolean
iconv_t iconv_open(const char *tocode, const char *fromcode);
int iconv_close(iconv_t cd);
-size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+size_t iconv(iconv_t cd, /* const */ char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
/* libiconv interface for vim */
#if defined(MAKE_DLL)
typedef iconv_t (*f_iconv_open)(const char *tocode, const char *fromcode);
typedef int (*f_iconv_close)(iconv_t cd);
-typedef size_t (*f_iconv)(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+typedef size_t (*f_iconv)(iconv_t cd, /* const */ char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
typedef int* (*f_errno)(void);
typedef int (*f_mbtowc)(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize);
typedef int (*f_wctomb)(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize);
static int win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode);
static int win_iconv_close(iconv_t cd);
-static size_t win_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+static size_t win_iconv(iconv_t cd, /* const */ char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
-static int load_mlang();
+static int load_mlang(void);
static csconv_t make_csconv(const char *name);
static int name_to_codepage(const char *name);
static uint utf16_to_ucs4(const ushort *wbuf);
static RFC1766TOLCIDA Rfc1766ToLcidA;
static int
-load_mlang()
+load_mlang(void)
{
HMODULE h = NULL;
char mlang_dll[MAX_PATH + 100];
}
size_t
-iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
+iconv(iconv_t _cd, /* const */ char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
{
rec_iconv_t *cd = (rec_iconv_t *)_cd;
size_t r = cd->iconv(cd->cd, inbuf, inbytesleft, outbuf, outbytesleft);
}
static size_t
-win_iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
+win_iconv(iconv_t _cd, /* const */ char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
{
rec_iconv_t *cd = (rec_iconv_t *)_cd;
ushort wbuf[MB_CHAR_MAX]; /* enough room for one character */
}
int
-main ()
+main (int argc, char **argv)
{
int i;
for (i = 0; i < SIZE - 1; i++)
g_assert (array[i] <= array[i+1]);
- /* 0 elemenents is a valid case */
+ /* 0 elements is a valid case */
g_qsort_with_data (array, 0, sizeof (guint32), sort, NULL);
return 0;