// suppress some Visual C++ warnings
#ifdef __VISUALC__
+# pragma warning(disable:4201) // nonstandard extension used: nameless struct/union
# pragma warning(disable:4244) // conversion from double to float
# pragma warning(disable:4100) // unreferenced formal parameter
# pragma warning(disable:4511) // copy ctor couldn't be generated
# pragma warning(disable:4512) // operator=() couldn't be generated
-#ifndef WIN32
+# pragma warning(disable:4699) // Using precompiled header
# pragma warning(disable:4134) // conversion between pointers to members of same class
+#ifndef WIN32
# pragma warning(disable:4135) // conversion between different integral types
# pragma warning(disable:4769) // assignment of near pointer to long integer
+// This one is really annoying, since it occurs for each cast to (HANDLE)...
+# pragma warning(disable:4305) // truncation of long to near ptr
#endif
#endif // __VISUALC__
WXFARPROC MSWGetOldWndProc() const { return m_oldWndProc; }
void MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; }
- wxWindow *FindItem(int id) const;
+ wxWindow *FindItem(long id) const;
wxWindow *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const;
// Make a Windows extended style from the given wxWindows window style
+# pragma warning(disable:4001) /* non standard extension used: single line comment */
#include "wx/setup.h"
#include <math.h>
}
}
- /* disable the warning about 'possible loss of data' */
+ /* disable the warning about 'possible loss of data' & 'conversion between diff types' */
#ifdef _MSC_VER
#pragma warning(disable: 4244)
+ #pragma warning(disable: 4135)
#endif /* Visual C++ */
bytes[0] = (expon >> 8) & 0xff;
#ifdef _MSC_VER
#pragma warning(default: 4244)
+ #pragma warning(default: 4135)
#endif /* Visual C++ */
}
if (!table)
table = wxDefaultResourceTable;
- table->identifiers.Put(name, (wxObject *)value);
+ table->identifiers.Put(name, (wxObject *)(long)value);
return TRUE;
}
Read unzip.h for more info
*/
+# pragma warning(disable:4001) /* non standard extension used: single line comment */
#include "wx/setup.h"
#if wxUSE_ZLIB && wxUSE_ZIPSTREAM
HBITMAP hbmpOld = (HBITMAP)SelectObject(hdcMem, hbmpCheck);
// then draw a check mark into it
- RECT rect = { 0, 0, nCheckWidth, nCheckHeight };
+ RECT rect ;
+ rect.left = 0 ;
+ rect.top = 0 ;
+ rect.right = nCheckWidth ;
+ rect.bottom = nCheckHeight ;
#ifdef __WIN32__
#ifndef __SC__
// FIXME this doesn't work if the listbox is scrolled!
size_t nHeight = m_pParent->GetItemHeight();
size_t y = m_nIndex * nHeight;
- RECT rcUpdate = { 0, y, GetDefaultMarginWidth(), y + nHeight};
+ RECT rcUpdate ;
+ rcUpdate.left = 0 ;
+ rcUpdate.top = y ;
+ rcUpdate.right = GetDefaultMarginWidth() ;
+ rcUpdate.bottom = y + nHeight ;
#endif // Win32/16
InvalidateRect(hwndListbox, &rcUpdate, FALSE);
connection->m_hConv = 0;
connection->m_topicName = topic_buf;
DDECurrentlyConnecting = connection;
- return (DDERETURN)TRUE;
+ return (DDERETURN)(DWORD)TRUE;
}
}
else return (DDERETURN)0;
{
DDECurrentlyConnecting->m_hConv = (WXHCONV) hConv;
DDECurrentlyConnecting = NULL;
- return (DDERETURN)TRUE;
+ return (DDERETURN)(DWORD)TRUE;
}
else return 0;
break;
if (connection && connection->OnDisconnect())
{
DDEDeleteConnection(hConv); // Delete mapping: hConv => connection
- return (DDERETURN)TRUE;
+ return (DDERETURN)(DWORD)TRUE;
}
else return (DDERETURN)0;
break;
DWORD len = DdeGetData(hData, (LPBYTE)(connection->m_bufPtr), connection->m_bufSize, 0);
DdeFreeDataHandle(hData);
if (connection->OnExecute(connection->m_topicName, connection->m_bufPtr, (int)len, (wxIPCFormat) wFmt))
- return (DDERETURN)DDE_FACK;
+ return (DDERETURN)(DWORD)DDE_FACK;
else
return (DDERETURN)DDE_FNOTPROCESSED;
} else return (DDERETURN)DDE_FNOTPROCESSED;
DWORD len = DdeGetData(hData, (LPBYTE)(connection->m_bufPtr), connection->m_bufSize, 0);
DdeFreeDataHandle(hData);
connection->OnPoke(connection->m_topicName, wxString(item_name), connection->m_bufPtr, (int)len, (wxIPCFormat) wFmt);
- return (DDERETURN)DDE_FACK;
+ return (DDERETURN)(DWORD)DDE_FACK;
} else return (DDERETURN)DDE_FNOTPROCESSED;
break;
}
DdeQueryString(DDEIdInst, hsz2, (LPTSTR)item_name, WXSIZEOF(item_name),
CP_WINANSI);
- return (DDERETURN)connection->OnStartAdvise(connection->m_topicName, wxString(item_name));
+ return (DDERETURN)(DWORD)connection->OnStartAdvise(connection->m_topicName, wxString(item_name));
} else return (DDERETURN)0;
break;
}
wxChar item_name[200];
DdeQueryString(DDEIdInst, hsz2, (LPTSTR)item_name, WXSIZEOF(item_name),
CP_WINANSI);
- return (DDERETURN)connection->OnStopAdvise(connection->m_topicName, wxString(item_name));
+ return (DDERETURN)(DWORD)connection->OnStopAdvise(connection->m_topicName, wxString(item_name));
} else return (DDERETURN)0;
break;
}
DWORD len = DdeGetData(hData, (LPBYTE)(connection->m_bufPtr), connection->m_bufSize, 0);
DdeFreeDataHandle(hData);
if (connection->OnAdvise(connection->m_topicName, wxString(item_name), connection->m_bufPtr, (int)len, (wxIPCFormat) wFmt))
- return (DDERETURN)DDE_FACK;
+ return (DDERETURN)(DWORD)DDE_FACK;
else
return (DDERETURN)DDE_FNOTPROCESSED;
} else return (DDERETURN)DDE_FNOTPROCESSED;
/* Get a DC to determine whether device is mono or not, and set
* default foreground/background colors as appropriate.
*/
- if ((hdc = CreateIC(_T("DISPLAY"), NULL, NULL, 0L)))
+ hdc = CreateIC(_T("DISPLAY"), NULL, NULL, 0L) ;
+ if (hdc)
{
/* check for mono-display */
if ((GetDeviceCaps(hdc, BITSPIXEL) == 1) &&
case WM_SETFONT:
/* if NULL hFont, use system font */
- if (!(hFont = (HFONT)wParam))
+ hFont = (HFONT)wParam ;
+ if (!hFont)
hFont = (HFONT) GetStockObject(SYSTEM_FONT);
pgauge->hFont = hFont;
(WPARAM)font.GetResourceHandle(), 0L);
}
- m_subControls.Append((wxObject *)(WXWORD)newId);
+ m_subControls.Append((wxObject *)(WXDWORD)(WXWORD)newId);
}
// Create a dummy radio control to end the group.
}
}
- RECT rect = { x, y, x + w, y + h };
+ RECT rect ;
+ rect.left = x ;
+ rect.top = y ;
+ rect.right = x + w ;
+ rect.bottom = y + h ;
InvalidateRect((HWND)GetParent()->GetHWND(), &rect, TRUE);
}
// ----------------------------------------------------------------------------
// a simple wrapper around TOOLINFO Win32 structure
+#pragma warning( disable : 4097 )
class wxToolInfo : public TOOLINFO
{
public:
uId = (UINT)win->GetHWND();
}
};
+#pragma warning( default : 4097 )
// ----------------------------------------------------------------------------
// private functions
// ----------------------------------------------------------------------------
// a convenient wrapper around TV_ITEM struct which adds a ctor
+#pragma warning( disable : 4097 )
struct wxTreeViewItem : public TV_ITEM
{
wxTreeViewItem(const wxTreeItemId& item, // the item handle
hItem = (HTREEITEM) (WXHTREEITEM) item;
}
};
+#pragma warning( default : 4097 )
// a class which encapsulates the tree traversal logic: it vists all (unless
// OnVisit() returns FALSE) items under the given one
// ---------------------------------------------------------------------------
// Find an item given the MS Windows id
-wxWindow *wxWindow::FindItem(int id) const
+wxWindow *wxWindow::FindItem(long id) const
{
wxWindowList::Node *current = GetChildren().GetFirst();
while (current)
#define PNG_INTERNAL
#include "png.h"
+#if defined(_MSC_VER) && !defined(__MWERKS__)
+#define __VISUALC__ _MSC_VER
+#endif
+#ifdef __VISUALC__
+#ifndef WIN32
+#pragma warning(disable:4135)
+#endif
+#endif
+
/* Set the action on getting a CRC error for an ancillary or critical chunk. */
void
png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action)
char **sptr;
if (extensions) {
- for (i = 0, ext = extensions; i < nextensions; i++, ext++) {
+ for (i = 0, ext = extensions; i < (unsigned int)nextensions; i++, ext++) {
if (ext->name)
XpmFree(ext->name);
nlines = ext->nlines;
return (XpmNoMemory);
for (i = 0, i2 = (mask ? i + 1 : i), color = colors, xcolor = xcolors;
- i < ncolors; i++, i2++, color++, xcolor++, pixels++) {
+ i < (unsigned int)ncolors; i++, i2++, color++, xcolor++, pixels++) {
if (!(s = color->string = (char *) XpmMalloc(cpp + 1))) {
XpmFree(xcolors);
}
/* end 3.2 bc */
- for (i = 0, color = colors, xcolor = xcolors; i < ncolors;
+ for (i = 0, color = colors, xcolor = xcolors; i < (unsigned int)ncolors;
i++, color++, xcolor++) {
/* look for related info from the attributes if any */
FUNC(xpmHashIntern, int, (xpmHashTable *table, char *tag, void *data));
#define HashAtomData(i) ((void *)i)
-#define HashColorIndex(slot) ((unsigned int)((*slot)->data))
+#define HashColorIndex(slot) ((unsigned int)(unsigned long)((*slot)->data))
#define USE_HASHTABLE (cpp > 2 && ncolors > 4)
#ifdef NEED_STRDUP
/* Check that the bit counts in bl_count are consistent. The last code
* must be all ones.
*/
- Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
+ Assert (code + bl_count[MAX_BITS]-1 == (ush)(1<<MAX_BITS)-(ush)1,
"inconsistent bit counts");
Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
} /* literal or match pair ? */
/* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
- Assert(s->pending < s->lit_bufsize + 2*lx, "pendingBuf overflow");
+ Assert((unsigned)s->pending < s->lit_bufsize + 2*lx, "pendingBuf overflow");
} while (lx < s->last_lit);