summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/display/curve.cpp4
-rw-r--r--src/extension/implementation/script.cpp2
-rw-r--r--src/io/sys.cpp11
-rw-r--r--src/ui/dialog/filedialogimpl-win32.cpp6
-rw-r--r--src/verbs.cpp12
5 files changed, 19 insertions, 16 deletions
diff --git a/src/display/curve.cpp b/src/display/curve.cpp
index 7c3c3d480..1b54c981c 100644
--- a/src/display/curve.cpp
+++ b/src/display/curve.cpp
@@ -51,10 +51,10 @@ SPCurve::new_from_rect(Geom::Rect const &rect)
Geom::Point p = rect.corner(0);
c->moveto(p);
- for (int i=3; i>=0; i--) {
+ for (int i=3; i>=1; i--) {
c->lineto(rect.corner(i));
}
- c->closepath_current();
+ c->closepath();
return c;
}
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index 5f1bef8d1..7a558b6fc 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -156,7 +156,7 @@ Script::resolveInterpreterExecutable(const Glib::ustring &interpNameArg)
char szExePath[MAX_PATH];
char szCurrentDir[MAX_PATH];
GetCurrentDirectory(sizeof(szCurrentDir), szCurrentDir);
- unsigned int ret = (unsigned int)FindExecutable(
+ HINSTANCE ret = (unsigned int)FindExecutable(
interpName.c_str(), szCurrentDir, szExePath);
if (ret > 32) {
interpName = szExePath;
diff --git a/src/io/sys.cpp b/src/io/sys.cpp
index 2841f0af8..f25575c9c 100644
--- a/src/io/sys.cpp
+++ b/src/io/sys.cpp
@@ -36,9 +36,11 @@
#include <process.h> // declares spawn functions
#include <wchar.h> // declares _wspawn functions
-#ifdef __cplusplus
+
+#ifndef __MINGW32__
+# ifdef __cplusplus
extern "C" {
-#endif
+# endif
_CRTIMP int __cdecl __MINGW_NOTHROW _wspawnl (int, const wchar_t*, const wchar_t*, ...);
_CRTIMP int __cdecl __MINGW_NOTHROW _wspawnle (int, const wchar_t*, const wchar_t*, ...);
_CRTIMP int __cdecl __MINGW_NOTHROW _wspawnlp (int, const wchar_t*, const wchar_t*, ...);
@@ -47,8 +49,9 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _wspawnv (int, const wchar_t*, const wchar_t
_CRTIMP int __cdecl __MINGW_NOTHROW _wspawnve (int, const wchar_t*, const wchar_t* const*, const wchar_t* const*);
_CRTIMP int __cdecl __MINGW_NOTHROW _wspawnvp (int, const wchar_t*, const wchar_t* const*);
_CRTIMP int __cdecl __MINGW_NOTHROW _wspawnvpe (int, const wchar_t*, const wchar_t* const*, const wchar_t* const*);
-#ifdef __cplusplus
+# ifdef __cplusplus
}
+# endif
#endif
#include <unistd.h>
#include <glibmm/i18n.h>
@@ -409,7 +412,7 @@ dup_noninherited (int fd,
GetCurrentProcess (), &filehandle,
0, FALSE, DUPLICATE_SAME_ACCESS);
close (fd);
- return _open_osfhandle ((long) filehandle, mode | _O_NOINHERIT);
+ return _open_osfhandle ((LONG_PTR) filehandle, mode | _O_NOINHERIT);
}
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp
index c3889a62d..3cdd61184 100644
--- a/src/ui/dialog/filedialogimpl-win32.cpp
+++ b/src/ui/dialog/filedialogimpl-win32.cpp
@@ -454,15 +454,15 @@ UINT_PTR CALLBACK FileOpenDialogImplWin32::GetOpenFileName_hookproc(
pImpl = (FileOpenDialogImplWin32*)ofn->lCustData;
// Subclass the parent
- pImpl->_base_window_proc = (WNDPROC)GetWindowLongPtr(hParentWnd, GWL_WNDPROC);
- SetWindowLongPtr(hParentWnd, GWL_WNDPROC, (LONG_PTR)file_dialog_subclass_proc);
+ pImpl->_base_window_proc = (WNDPROC)GetWindowLongPtr(hParentWnd, GWLP_WNDPROC);
+ SetWindowLongPtr(hParentWnd, GWLP_WNDPROC, (LONG_PTR)file_dialog_subclass_proc);
// Add a button to the toolbar
pImpl->_toolbar_wnd = FindWindowEx(hParentWnd, NULL, "ToolbarWindow32", NULL);
pImpl->_show_preview_button_bitmap = LoadBitmap(
hInstance, MAKEINTRESOURCE(IDC_SHOW_PREVIEW));
- TBADDBITMAP tbAddBitmap = {NULL, (UINT)pImpl->_show_preview_button_bitmap};
+ TBADDBITMAP tbAddBitmap = {NULL, (UINT_PTR)pImpl->_show_preview_button_bitmap};
const int iBitmapIndex = SendMessage(pImpl->_toolbar_wnd,
TB_ADDBITMAP, 1, (LPARAM)&tbAddBitmap);
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 421736b7f..f9a544186 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -767,7 +767,7 @@ FileVerb::perform(SPAction *action, void *data, void */*pdata*/)
Gtk::Window *parent = desktop->getToplevel();
g_assert(parent != NULL);
- switch ((long) data) {
+ switch (reinterpret_cast<std::size_t>(data)) {
case SP_VERB_FILE_NEW:
sp_file_new_default();
break;
@@ -1079,7 +1079,7 @@ void
LayerVerb::perform(SPAction *action, void *data, void */*pdata*/)
{
SPDesktop *dt = static_cast<SPDesktop*>(sp_action_get_view(action));
- unsigned int verb = reinterpret_cast<std::size_t>(data);
+ size_t verb = reinterpret_cast<std::size_t>(data);
if ( !dt || !dt->currentLayer() ) {
return;
@@ -1568,7 +1568,7 @@ ZoomVerb::perform(SPAction *action, void *data, void */*pdata*/)
gdouble zoom_inc =
prefs->getDoubleLimited( "/options/zoomincrement/value", 1.414213562, 1.01, 10 );
- switch (GPOINTER_TO_INT(data)) {
+ switch (reinterpret_cast<std::size_t>(data)) {
case SP_VERB_ZOOM_IN:
{
gint mul = 1 + gobble_key_events(
@@ -2025,7 +2025,7 @@ EffectLastVerb::perform(SPAction *action, void *data, void */*pdata*/)
if (effect == NULL) return;
if (current_view == NULL) return;
- switch ((long) data) {
+ switch (reinterpret_cast<std::size_t>(data)) {
case SP_VERB_EFFECT_LAST_PREF:
effect->prefs(current_view);
break;
@@ -2090,7 +2090,7 @@ FitCanvasVerb::perform(SPAction *action, void *data, void */*pdata*/)
SPDocument *doc = sp_desktop_document(dt);
if (!doc) return;
- switch ((long) data) {
+ switch (reinterpret_cast<std::size_t>(data)) {
case SP_VERB_FIT_CANVAS_TO_SELECTION:
verb_fit_canvas_to_selection(dt);
break;
@@ -2159,7 +2159,7 @@ LockAndHideVerb::perform(SPAction *action, void *data, void */*pdata*/)
SPDocument *doc = sp_desktop_document(dt);
if (!doc) return;
- switch ((long) data) {
+ switch (reinterpret_cast<std::size_t>(data)) {
case SP_VERB_UNLOCK_ALL:
unlock_all(dt);
sp_document_done(doc, SP_VERB_UNLOCK_ALL, _("Unlock all objects in the current layer"));