mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-07 08:28:43 +02:00
win32: misc warning fixes
https://bugzilla.gnome.org/show_bug.cgi?id=688109
This commit is contained in:
@@ -1272,7 +1272,7 @@ publish_session_bus (const char *address)
|
||||
}
|
||||
|
||||
static void
|
||||
unpublish_session_bus ()
|
||||
unpublish_session_bus (void)
|
||||
{
|
||||
HANDLE init_mutex;
|
||||
|
||||
@@ -1322,6 +1322,8 @@ idle_timeout_cb (GDBusDaemon *daemon, gpointer user_data)
|
||||
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)
|
||||
{
|
||||
|
@@ -1030,6 +1030,7 @@ _g_dbus_auth_run_server (GDBusAuth *auth,
|
||||
#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);
|
||||
|
@@ -786,6 +786,10 @@ static HMODULE gio_dll = NULL;
|
||||
|
||||
#ifdef DLL_EXPORT
|
||||
|
||||
BOOL WINAPI DllMain (HINSTANCE hinstDLL,
|
||||
DWORD fdwReason,
|
||||
LPVOID lpvReserved);
|
||||
|
||||
BOOL WINAPI
|
||||
DllMain (HINSTANCE hinstDLL,
|
||||
DWORD fdwReason,
|
||||
|
@@ -492,7 +492,7 @@ registry_cache_unref_tree (GNode *tree)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
static void
|
||||
registry_cache_dump (GNode *cache_node,
|
||||
gpointer data)
|
||||
@@ -515,7 +515,7 @@ registry_cache_dump (GNode *cache_node,
|
||||
g_node_children_foreach (cache_node, G_TRAVERSE_ALL, registry_cache_dump,
|
||||
GINT_TO_POINTER (new_depth));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -1743,7 +1743,9 @@ watch_add_notify (GRegistryBackend *self,
|
||||
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);
|
||||
@@ -1785,11 +1787,15 @@ watch_add_notify (GRegistryBackend *self,
|
||||
* 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;
|
||||
@@ -1909,11 +1915,6 @@ g_registry_backend_unsubscribe (GSettingsBackend *backend,
|
||||
* 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)
|
||||
{
|
||||
|
@@ -2400,11 +2400,7 @@ g_socket_check_connect_result (GSocket *socket,
|
||||
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);
|
||||
|
||||
@@ -4322,7 +4318,7 @@ g_socket_receive_message (GSocket *socket,
|
||||
/* decode address */
|
||||
if (address != NULL)
|
||||
{
|
||||
*address = cache_recv_address (socket, &addr, addrlen);
|
||||
*address = cache_recv_address (socket, (struct sockaddr *)&addr, addrlen);
|
||||
}
|
||||
|
||||
/* capture the flags */
|
||||
|
@@ -106,7 +106,7 @@ g_win32_mount_init (GWin32Mount *win32_mount)
|
||||
{
|
||||
}
|
||||
|
||||
gchar *
|
||||
static gchar *
|
||||
_win32_get_displayname (const char *drive)
|
||||
{
|
||||
gunichar2 *wdrive = g_utf8_to_utf16 (drive, -1, NULL, NULL, NULL);
|
||||
@@ -194,7 +194,7 @@ g_win32_mount_get_root (GMount *mount)
|
||||
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)
|
||||
|
@@ -39,9 +39,6 @@
|
||||
|
||||
struct _GWin32VolumeMonitor {
|
||||
GNativeVolumeMonitor parent;
|
||||
|
||||
GList *volumes;
|
||||
GList *mounts;
|
||||
};
|
||||
|
||||
#define g_win32_volume_monitor_get_type _g_win32_volume_monitor_get_type
|
||||
@@ -51,17 +48,6 @@ G_DEFINE_TYPE_WITH_CODE (GWin32VolumeMonitor, g_win32_volume_monitor, G_TYPE_NAT
|
||||
"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:
|
||||
*
|
||||
@@ -125,13 +111,10 @@ get_viewable_logical_drives (void)
|
||||
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)
|
||||
@@ -153,27 +136,20 @@ get_mounts (GVolumeMonitor *volume_monitor)
|
||||
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)
|
||||
@@ -247,12 +223,9 @@ get_mount_for_mount_path (const char *mount_path,
|
||||
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;
|
||||
|
@@ -181,7 +181,6 @@ g_win32_directory_monitor_constructor (GType type,
|
||||
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));
|
||||
@@ -204,17 +203,17 @@ g_win32_directory_monitor_constructor (GType type,
|
||||
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;
|
||||
|
Reference in New Issue
Block a user