Mercurial > pidgin.yaz
changeset 15638:026f9c6cc942
winpidgin warning fixes
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 15 Feb 2007 18:19:51 +0000 |
parents | 4b08df67bb78 |
children | 37d9f44c7de1 |
files | pidgin/gtkeventloop.c pidgin/gtkmain.c pidgin/plugins/win32/winprefs/gtkappbar.c pidgin/win32/IdleTracker/idletrack.c pidgin/win32/gtkwin32dep.c pidgin/win32/wspell.c pidgin/win32/wspell.h |
diffstat | 7 files changed, 52 insertions(+), 53 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkeventloop.c Thu Feb 15 00:45:01 2007 +0000 +++ b/pidgin/gtkeventloop.c Thu Feb 15 18:19:51 2007 +0000 @@ -63,7 +63,7 @@ #ifdef _WIN32 if(! gaim_cond) { -#if DEBUG +#ifdef DEBUG gaim_debug(GAIM_DEBUG_MISC, "gtk_eventloop", "CLOSURE received GIOCondition of 0x%x, which does not" " match 0x%x (READ) or 0x%x (WRITE)\n",
--- a/pidgin/gtkmain.c Thu Feb 15 00:45:01 2007 +0000 +++ b/pidgin/gtkmain.c Thu Feb 15 18:19:51 2007 +0000 @@ -455,6 +455,8 @@ /* FUCKING GET ME A TOWEL! */ #ifdef _WIN32 +/* suppress gcc "no previous prototype" warning */ +int pidgin_main(HINSTANCE hint, int argc, char *argv[]); int pidgin_main(HINSTANCE hint, int argc, char *argv[]) #else int main(int argc, char *argv[]) @@ -726,7 +728,7 @@ /* TODO: Move pounces loading into gaim_pounces_init() */ gaim_pounces_load(); - + /* HACK BY SEANEGAN: * We've renamed prpl-oscar to prpl-aim and prpl-icq, accordingly. * Let's do that change right here... after everything's loaded, but @@ -741,7 +743,7 @@ gaim_account_set_protocol_id(account, "prpl-aim"); } } - + ui_main(); #ifdef USE_SM
--- a/pidgin/plugins/win32/winprefs/gtkappbar.c Thu Feb 15 00:45:01 2007 +0000 +++ b/pidgin/plugins/win32/winprefs/gtkappbar.c Thu Feb 15 18:19:51 2007 +0000 @@ -4,7 +4,7 @@ * File: gtkappbar.c * Date: August 2, 2003 * Description: Appbar functionality for Windows GTK+ applications - * + * * Copyright (C) 2003, Herman Bloggs <hermanator12002@yahoo.com> * * This program is free software; you can redistribute it and/or modify @@ -128,21 +128,17 @@ } /* Retrieve the rectangle of the active work area at a point */ -static RECT get_rect_at_point(POINT pt) { - RECT rc; - if (!get_rect_at_point_multimonitor(pt, &rc)) { - get_default_workarea(&rc); +static void get_rect_at_point(POINT pt, RECT *rc) { + if (!get_rect_at_point_multimonitor(pt, rc)) { + get_default_workarea(rc); } - return rc; } /* Retrieve the rectangle of the active work area of a window*/ -static RECT get_rect_of_window(HWND window) { - RECT rc; - if (!get_rect_of_window_multimonitor(window, &rc)) { - get_default_workarea(&rc); +static void get_rect_of_window(HWND window, RECT *rc) { + if (!get_rect_of_window_multimonitor(window, rc)) { + get_default_workarea(rc); } - return rc; } static void get_window_normal_rc(HWND hwnd, RECT *rc) { @@ -173,7 +169,7 @@ /* This really should be the following, but SWP_FRAMECHANGED strangely causes initermittent problems "Show Desktop" done more than once. * Not having SWP_FRAMECHANGED *should* cause the Style not to be applied, but i haven't noticed any problems - * SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); + * SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); */ } /** Register the window as an appbar */ @@ -212,15 +208,15 @@ APPBARDATA abd; guint iWidth = 0; - if(!ab->registered) - gtk_appbar_register(ab, hwnd); + if(!ab->registered) + gtk_appbar_register(ab, hwnd); abd.hWnd = hwnd; abd.cbSize = sizeof(APPBARDATA); abd.uEdge = ab->side; iWidth = ab->docked_rect.right - ab->docked_rect.left; - + abd.rc.top = rcWorkspace.top; abd.rc.bottom = rcWorkspace.bottom; switch (abd.uEdge) @@ -288,7 +284,7 @@ gaim_debug(GAIM_DEBUG_INFO, "gtkappbar", "wnd_moving\n"); GetCursorPos(&cp); - monRect = get_rect_at_point(cp); + get_rect_at_point(cp, &monRect); dockAreaWidth = (monRect.right - monRect.left) / 10; /* Which part of the screen are we in ? */ @@ -318,7 +314,7 @@ rc->bottom = rc->top + ab->undocked_height; } - /* Switch to toolbar/regular caption*/ + /* Switch to toolbar/regular caption*/ if(ab->docking) set_toolbar(msg->hwnd, TRUE); else if(!ab->docked) @@ -453,7 +449,7 @@ static GdkFilterReturn wnd_nchittest(GtkAppBar *ab, GdkXEvent *xevent) { MSG *msg = (MSG*)xevent; - + if(ab->docked) { UINT ret = DefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam); @@ -463,7 +459,7 @@ case HTBOTTOMRIGHT: case HTTOP: case HTTOPLEFT: - case HTTOPRIGHT: + case HTTOPRIGHT: return GDK_FILTER_REMOVE; case HTLEFT: if(ab->side == ABE_LEFT) @@ -499,7 +495,7 @@ static GdkFilterReturn gtk_appbar_callback(GtkAppBar *ab, GdkXEvent *xevent) { MSG *msg = (MSG*)xevent; - RECT orig; + RECT orig, windowRect; switch (msg->wParam) { case ABN_STATECHANGE: @@ -519,18 +515,18 @@ } break; - - case ABN_POSCHANGED: - gaim_debug(GAIM_DEBUG_INFO, "gtkappbar", "gtk_appbar_callback: ABN_POSCHANGED\n"); - CopyRect(&orig, &(ab->docked_rect)); - gtk_appbar_querypos(ab, msg->hwnd, get_rect_of_window(msg->hwnd)); + case ABN_POSCHANGED: + gaim_debug(GAIM_DEBUG_INFO, "gtkappbar", "gtk_appbar_callback: ABN_POSCHANGED\n"); + CopyRect(&orig, &(ab->docked_rect)); + get_rect_of_window(msg->hwnd, &windowRect); + gtk_appbar_querypos(ab, msg->hwnd, windowRect); if (EqualRect(&orig, &(ab->docked_rect)) == 0) { - MoveWindow(msg->hwnd, ab->docked_rect.left, ab->docked_rect.top, + MoveWindow(msg->hwnd, ab->docked_rect.left, ab->docked_rect.top, ab->docked_rect.right - ab->docked_rect.left, ab->docked_rect.bottom - ab->docked_rect.top, TRUE); } gtk_appbar_setpos(ab, msg->hwnd); - break; + break; #if 0 default: gaim_debug(GAIM_DEBUG_INFO, "gtkappbar", "gtk_appbar_callback: %d\n", msg->wParam); @@ -577,7 +573,7 @@ } void gtk_appbar_dock(GtkAppBar *ab, UINT side) { - RECT orig; + RECT orig, windowRect; gaim_debug(GAIM_DEBUG_INFO, "gtkappbar", "gtk_appbar_dock\n"); @@ -587,12 +583,12 @@ ab->side = side; get_window_normal_rc(GDK_WINDOW_HWND(ab->win->window), &(ab->docked_rect)); CopyRect(&orig, &(ab->docked_rect)); - gtk_appbar_querypos(ab, GDK_WINDOW_HWND(ab->win->window), - get_rect_of_window(GDK_WINDOW_HWND(ab->win->window))); + get_rect_of_window(GDK_WINDOW_HWND(ab->win->window), &windowRect); + gtk_appbar_querypos(ab, GDK_WINDOW_HWND(ab->win->window), windowRect); if(EqualRect(&orig, &(ab->docked_rect)) == 0) MoveWindow(GDK_WINDOW_HWND(ab->win->window), ab->docked_rect.left, - ab->docked_rect.top, + ab->docked_rect.top, ab->docked_rect.right - ab->docked_rect.left, ab->docked_rect.bottom - ab->docked_rect.top, TRUE); gtk_appbar_setpos(ab, GDK_WINDOW_HWND(ab->win->window));
--- a/pidgin/win32/IdleTracker/idletrack.c Thu Feb 15 00:45:01 2007 +0000 +++ b/pidgin/win32/IdleTracker/idletrack.c Thu Feb 15 18:19:51 2007 +0000 @@ -172,7 +172,9 @@ CloseHandle(hMapObject); } -int WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { +/* suppress gcc "no previous prototype" warning */ +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved); +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { switch(dwReason) { case DLL_PROCESS_ATTACH: g_hInstance = hInstance;
--- a/pidgin/win32/gtkwin32dep.c Thu Feb 15 00:45:01 2007 +0000 +++ b/pidgin/win32/gtkwin32dep.c Thu Feb 15 18:19:51 2007 +0000 @@ -329,7 +329,7 @@ if(!winpidgin_set_idlehooks()) gaim_debug_error("winpidgin", "Failed to initialize idle tracker\n"); - wpidginspell_init(); + winpidgin_spell_init(); gaim_debug_info("winpidgin", "GTK+ :%u.%u.%u\n", gtk_major_version, gtk_minor_version, gtk_micro_version); @@ -365,6 +365,8 @@ } /* DLL initializer */ +/* suppress gcc "no previous prototype" warning */ +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved); BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { dll_hInstance = hinstDLL; return TRUE;
--- a/pidgin/win32/wspell.c Thu Feb 15 00:45:01 2007 +0000 +++ b/pidgin/win32/wspell.c Thu Feb 15 18:19:51 2007 +0000 @@ -30,17 +30,14 @@ #include <gtkspell/gtkspell.h> #include "debug.h" #include "win32dep.h" +#include "wspell.h" /* GTKSPELL DUMMY FUNCS */ -GtkSpell* wgtkspell_new_attach(GtkTextView *view, - const gchar *lang, - GError **error) {return NULL;} -GtkSpell* wgtkspell_get_from_text_view(GtkTextView *view) {return NULL;} -void wgtkspell_detach(GtkSpell *spell) {} -gboolean wgtkspell_set_language(GtkSpell *spell, - const gchar *lang, - GError **error) {return 0;} -void wgtkspell_recheck_all(GtkSpell *spell) {} +static GtkSpell* wgtkspell_new_attach(GtkTextView *view, const gchar *lang, GError **error) {return NULL;} +static GtkSpell* wgtkspell_get_from_text_view(GtkTextView *view) {return NULL;} +static void wgtkspell_detach(GtkSpell *spell) {} +static gboolean wgtkspell_set_language(GtkSpell *spell, const gchar *lang, GError **error) {return FALSE;} +static void wgtkspell_recheck_all(GtkSpell *spell) {} /* GTKSPELL PROTOS */ GtkSpell* (*wpidginspell_new_attach) (GtkTextView *, @@ -58,11 +55,11 @@ void (*wpidginspell_recheck_all) (GtkSpell*) = wgtkspell_recheck_all; static void load_gtkspell() { - wpidginspell_new_attach = (void*)wgaim_find_and_loadproc("libgtkspell.dll", "gtkspell_new_attach" ); - wpidginspell_get_from_text_view = (void*)wgaim_find_and_loadproc("libgtkspell.dll", "gtkspell_get_from_text_view"); - wpidginspell_detach = (void*)wgaim_find_and_loadproc("libgtkspell.dll", "gtkspell_detach"); - wpidginspell_set_language = (void*)wgaim_find_and_loadproc("libgtkspell.dll", "gtkspell_set_language"); - wpidginspell_recheck_all = (void*)wgaim_find_and_loadproc("libgtkspell.dll", "gtkspell_recheck_all"); + wpidginspell_new_attach = (void*) wgaim_find_and_loadproc("libgtkspell.dll", "gtkspell_new_attach" ); + wpidginspell_get_from_text_view = (void*) wgaim_find_and_loadproc("libgtkspell.dll", "gtkspell_get_from_text_view"); + wpidginspell_detach = (void*) wgaim_find_and_loadproc("libgtkspell.dll", "gtkspell_detach"); + wpidginspell_set_language = (void*) wgaim_find_and_loadproc("libgtkspell.dll", "gtkspell_set_language"); + wpidginspell_recheck_all = (void*) wgaim_find_and_loadproc("libgtkspell.dll", "gtkspell_recheck_all"); } static char* lookup_aspell_path() { @@ -74,7 +71,7 @@ return wgaim_read_reg_string(HKEY_LOCAL_MACHINE, "Software\\Aspell", "Path"); } -void wpidginspell_init() { +void winpidgin_spell_init() { char *aspell_path = lookup_aspell_path(); if (aspell_path != NULL) {
--- a/pidgin/win32/wspell.h Thu Feb 15 00:45:01 2007 +0000 +++ b/pidgin/win32/wspell.h Thu Feb 15 18:19:51 2007 +0000 @@ -24,7 +24,7 @@ #define _WSPELL_H_ #include <gtkspell/gtkspell.h> -void wpidginspell_init(void); +void winpidgin_spell_init(void); extern GtkSpell* (*wpidginspell_new_attach)(GtkTextView*, const gchar*, GError**); #define gtkspell_new_attach( view, lang, error ) \ @@ -38,7 +38,7 @@ #define gtkspell_detach( spell ) \ wpidginspell_detach( spell ) -extern gboolean (*wpidginspell_set_language)(GtkSpell*, const gchar*, GError**); +extern gboolean (*wpidginspell_set_language)(GtkSpell*, const gchar*, GError**); #define gtkspell_set_language( spell, lang, error ) \ wpidginspell_set_language( spell, lang, error )