Commit 6d89364a authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

wined3d: Avoid using the long type.

parent f9d2b85e
......@@ -61,14 +61,14 @@ static char *get_line(char **ptr)
static void shader_arb_dump_program_source(const char *source)
{
unsigned long source_size;
ULONG source_size;
char *ptr, *line, *tmp;
source_size = strlen(source) + 1;
tmp = HeapAlloc(GetProcessHeap(), 0, source_size);
if (!tmp)
{
ERR("Failed to allocate %lu bytes for shader source.\n", source_size);
ERR("Failed to allocate %u bytes for shader source.\n", source_size);
return;
}
memcpy(tmp, source, source_size);
......
......@@ -3941,7 +3941,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface,
{
struct wined3d_buffer *vb = (struct wined3d_buffer *)This->stateBlock->streamSource[e->stream_idx];
e->buffer_object = 0;
e->data = (BYTE *)((unsigned long)e->data + (unsigned long)buffer_get_sysmem(vb, gl_info));
e->data = (BYTE *)((ULONG_PTR)e->data + (ULONG_PTR)buffer_get_sysmem(vb, gl_info));
ENTER_GL();
GL_EXTCALL(glDeleteBuffersARB(1, &vb->buffer_object));
vb->buffer_object = 0;
......
......@@ -327,12 +327,12 @@ fail:
}
/* Adjust the amount of used texture memory */
long WineD3DAdapterChangeGLRam(IWineD3DDeviceImpl *device, long glram)
unsigned int WineD3DAdapterChangeGLRam(IWineD3DDeviceImpl *device, unsigned int glram)
{
struct wined3d_adapter *adapter = device->adapter;
adapter->UsedTextureRam += glram;
TRACE("Adjusted gl ram by %ld to %d\n", glram, adapter->UsedTextureRam);
TRACE("Adjusted gl ram by %d to %d\n", glram, adapter->UsedTextureRam);
return adapter->UsedTextureRam;
}
......
......@@ -71,7 +71,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context
UINT vx_index;
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
const UINT *streamOffset = This->stateBlock->streamOffset;
long SkipnStrides = startIdx + This->stateBlock->loadBaseVertexIndex;
LONG SkipnStrides = startIdx + This->stateBlock->loadBaseVertexIndex;
BOOL pixelShader = use_ps(This->stateBlock);
BOOL specular_fog = FALSE;
const BYTE *texCoords[WINED3DDP_MAXTEXCOORD];
......@@ -423,7 +423,7 @@ static void drawStridedSlowVs(IWineD3DDevice *iface, const struct wined3d_stream
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
long SkipnStrides = startIdx + This->stateBlock->loadBaseVertexIndex;
LONG SkipnStrides = startIdx + This->stateBlock->loadBaseVertexIndex;
const WORD *pIdxBufS = NULL;
const DWORD *pIdxBufL = NULL;
UINT vx_index;
......@@ -536,7 +536,7 @@ static inline void drawStridedInstanced(IWineD3DDevice *iface, const struct wine
{
struct wined3d_buffer *vb =
(struct wined3d_buffer *)stateblock->streamSource[si->elements[instancedData[j]].stream_idx];
ptr += (long)buffer_get_sysmem(vb, &This->adapter->gl_info);
ptr += (ULONG_PTR)buffer_get_sysmem(vb, &This->adapter->gl_info);
}
send_attribute(This, si->elements[instancedData[j]].format_desc->format, instancedData[j], ptr);
......@@ -564,7 +564,7 @@ static inline void remove_vbos(IWineD3DDeviceImpl *This, const struct wined3d_gl
{
struct wined3d_buffer *vb = (struct wined3d_buffer *)This->stateBlock->streamSource[e->stream_idx];
e->buffer_object = 0;
e->data = (BYTE *)((unsigned long)e->data + (unsigned long)buffer_get_sysmem(vb, gl_info));
e->data = (BYTE *)((ULONG_PTR)e->data + (ULONG_PTR)buffer_get_sysmem(vb, gl_info));
}
}
}
......@@ -731,14 +731,14 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
/* Diagnostics */
#ifdef SHOW_FRAME_MAKEUP
{
static long int primCounter = 0;
static LONG primCounter = 0;
/* NOTE: set primCounter to the value reported by drawprim
before you want to to write frame makeup to /tmp */
if (primCounter >= 0) {
WINED3DLOCKED_RECT r;
char buffer[80];
IWineD3DSurface_LockRect(This->render_targets[0], &r, NULL, WINED3DLOCK_READONLY);
sprintf(buffer, "/tmp/backbuffer_%ld.tga", primCounter);
sprintf(buffer, "/tmp/backbuffer_%d.tga", primCounter);
TRACE("Saving screenshot %s\n", buffer);
IWineD3DSurface_SaveSnapshot(This->render_targets[0], buffer);
IWineD3DSurface_UnlockRect(This->render_targets[0]);
......@@ -749,7 +749,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
int textureNo;
for (textureNo = 0; textureNo < MAX_COMBINED_SAMPLERS; ++textureNo) {
if (This->stateBlock->textures[textureNo] != NULL) {
sprintf(buffer, "/tmp/texture_%p_%ld_%d.tga", This->stateBlock->textures[textureNo], primCounter, textureNo);
sprintf(buffer, "/tmp/texture_%p_%d_%d.tga", This->stateBlock->textures[textureNo], primCounter, textureNo);
TRACE("Saving texture %s\n", buffer);
if (IWineD3DBaseTexture_GetType(This->stateBlock->textures[textureNo]) == WINED3DRTYPE_TEXTURE) {
IWineD3DTexture_GetSurfaceLevel(This->stateBlock->textures[textureNo], 0, &pSur);
......@@ -763,7 +763,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
}
#endif
}
TRACE("drawprim #%ld\n", primCounter);
TRACE("drawprim #%d\n", primCounter);
++primCounter;
}
#endif
......@@ -832,7 +832,7 @@ HRESULT tesselate_rectpatch(IWineD3DDeviceImpl *This,
{
struct wined3d_buffer *vb;
vb = (struct wined3d_buffer *)This->stateBlock->streamSource[e->stream_idx];
e->data = (BYTE *)((unsigned long)e->data + (unsigned long)buffer_get_sysmem(vb, context->gl_info));
e->data = (BYTE *)((ULONG_PTR)e->data + (ULONG_PTR)buffer_get_sysmem(vb, context->gl_info));
}
vtxStride = e->stride;
data = e->data +
......
......@@ -4100,7 +4100,7 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
if (stream_info->elements[i].buffer_object)
{
vb = (struct wined3d_buffer *)stateblock->streamSource[stream_info->elements[i].stream_idx];
ptr += (long)buffer_get_sysmem(vb, gl_info);
ptr += (ULONG_PTR)buffer_get_sysmem(vb, gl_info);
}
if (context->numbered_array_mask & (1 << i)) unload_numbered_array(stateblock, context, i);
......
......@@ -230,7 +230,7 @@ static HRESULT WINAPI IWineGDISwapChainImpl_Present(IWineD3DSwapChain *iface, CO
/* FPS support */
if (TRACE_ON(fps))
{
static long prev_time, frames;
static LONG prev_time, frames;
DWORD time = GetTickCount();
frames++;
......
......@@ -337,7 +337,7 @@ static void convert_r8g8_snorm(const BYTE *src, BYTE *dst, UINT pitch, UINT widt
Dest = dst + y * outpitch;
for (x = 0; x < width; x++ )
{
long color = (*Source++);
LONG color = (*Source++);
/* B */ Dest[0] = 0xff;
/* G */ Dest[1] = (color >> 8) + 128; /* V */
/* R */ Dest[2] = (color) + 128; /* U */
......@@ -362,7 +362,7 @@ static void convert_r8g8_snorm_l8x8_unorm(const BYTE *src, BYTE *dst, UINT pitch
Dest = dst + y * pitch;
for (x = 0; x < width; x++ )
{
long color = (*Source++);
LONG color = (*Source++);
/* B */ Dest[0] = ((color >> 16) & 0xff); /* L */
/* G */ Dest[1] = ((color >> 8 ) & 0xff) + 128; /* V */
/* R */ Dest[2] = (color & 0xff) + 128; /* U */
......@@ -386,7 +386,7 @@ static void convert_r8g8_snorm_l8x8_unorm_nv(const BYTE *src, BYTE *dst, UINT pi
Dest = dst + y * pitch;
for (x = 0; x < width; x++ )
{
long color = (*Source++);
LONG color = (*Source++);
/* L */ Dest[2] = ((color >> 16) & 0xff); /* L */
/* V */ Dest[1] = ((color >> 8 ) & 0xff); /* V */
/* U */ Dest[0] = (color & 0xff); /* U */
......@@ -408,7 +408,7 @@ static void convert_r8g8b8a8_snorm(const BYTE *src, BYTE *dst, UINT pitch, UINT
Dest = dst + y * pitch;
for (x = 0; x < width; x++ )
{
long color = (*Source++);
LONG color = (*Source++);
/* B */ Dest[0] = ((color >> 16) & 0xff) + 128; /* W */
/* G */ Dest[1] = ((color >> 8 ) & 0xff) + 128; /* V */
/* R */ Dest[2] = (color & 0xff) + 128; /* U */
......
......@@ -1470,7 +1470,7 @@ struct wined3d_adapter
BOOL initPixelFormats(struct wined3d_gl_info *gl_info, enum wined3d_pci_vendor vendor) DECLSPEC_HIDDEN;
BOOL initPixelFormatsNoGL(struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
extern long WineD3DAdapterChangeGLRam(IWineD3DDeviceImpl *D3DDevice, long glram) DECLSPEC_HIDDEN;
extern unsigned int WineD3DAdapterChangeGLRam(IWineD3DDeviceImpl *D3DDevice, unsigned int glram) DECLSPEC_HIDDEN;
extern void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
/*****************************************************************************
......@@ -2546,7 +2546,7 @@ struct IWineD3DSwapChainImpl
BOOL render_to_fbo;
const struct wined3d_format_desc *ds_format;
long prev_time, frames; /* Performance tracking */
LONG prev_time, frames; /* Performance tracking */
unsigned int vSyncCounter;
struct wined3d_context **context;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment