Permalink
Browse files

Fix 64-bit fails with long size pointers

  • Loading branch information...
EXL committed Oct 15, 2015
1 parent a2120b6 commit c6dddfdf0ffd88266ff2ff59f8b410d87c4771f1
Showing with 19 additions and 19 deletions.
  1. +2 −2 src/Spout.pro
  2. +1 −1 src/piece.c
  3. +16 −16 src/spout.c
@@ -8,8 +8,8 @@ TEMPLATE = app
TARGET = Spout
INCLUDEPATH += .

QMAKE_CFLAGS = -m32 $$system(sdl-config --cflags)
LIBS = -m32 -lSDL #$$system(sdl-config --libs)
QMAKE_CFLAGS = $$system(sdl-config --cflags)
LIBS = $$system(sdl-config --libs)

# Input
HEADERS += config.h font.h piece.h sintable.h \
@@ -316,7 +316,7 @@ int pceFileClose (FILEACC * pfa)
int main (int argc, char *argv[])
{
SDL_Event event;
long nextTick, wait;
int nextTick, wait;
int cnt = 0;
int pzoom;
char *tail;
@@ -8,7 +8,7 @@

#include "sintable.h"

#define FRAMERATE 50
#define FRAMERATE 60
#define MAX_GRAIN 500

const unsigned char MATSUMI[] = {
@@ -32,7 +32,7 @@ typedef struct {
} SVECTOR;

typedef struct {
long x, y;
int x, y;
} VECTOR;

typedef struct tagGRAIN {
@@ -273,17 +273,17 @@ void pceAppProc (/*int cnt*/)
}

if (upperLine == 111 && height > 0) {
unsigned long *pL;
pL = (unsigned long *) (vbuff2 + 128 * 108 + 4);
while (pL < (unsigned long *) (vbuff2 + 128 * 109 - 4)) {
unsigned int *pL;
pL = (unsigned int *) (vbuff2 + 128 * 108 + 4);
while (pL < (unsigned int *) (vbuff2 + 128 * 109 - 4)) {
*pL++ = 0;
}
pL += 2;
while (pL < (unsigned long *) (vbuff2 + 128 * 110 - 4)) {
while (pL < (unsigned int *) (vbuff2 + 128 * 110 - 4)) {
*pL++ = 0xd3d3d3d3;
}
pL += 2;
while (pL < (unsigned long *) (vbuff2 + 128 * 111 - 4)) {
while (pL < (unsigned int *) (vbuff2 + 128 * 111 - 4)) {
*pL++ = 0;
}
}
@@ -332,13 +332,13 @@ void pceAppProc (/*int cnt*/)
int i, j;

if ((upperLine & 31) == 0) {
unsigned long *pL;
unsigned int *pL;
pceLCDSetBuffer (vbuff2 + ((upperLine - 24) & 127) * 128);
pceFontSetBkColor (0);

switch (upperLine / 32) {
case 0:
pL = (unsigned long *) (vbuff2 + 12 + ((upperLine - 24) & 127) * 128);
pL = (unsigned int *) (vbuff2 + 12 + ((upperLine - 24) & 127) * 128);
for (i = 0; i < 16; i++) {
for (j = 0; j < 26 / 2; j++) {
*pL = 0x91919191;
@@ -591,13 +591,13 @@ void pceAppProc (/*int cnt*/)
dispPos = upperLine;

{
unsigned long *pL, *pL2, *pLe;
pL = (unsigned long *) (vbuff + 2 * 128);
pL2 = (unsigned long *) (vbuff2 + dispPos * 128);
unsigned int *pL, *pL2, *pLe;
pL = (unsigned int *) (vbuff + 2 * 128);
pL2 = (unsigned int *) (vbuff2 + dispPos * 128);

pLe = pL2 + 128 * 78 / 4;
if (pLe > (unsigned long *) (vbuff2 + 128 * 128)) {
pLe = (unsigned long *) (vbuff2 + 128 * 128);
if (pLe > (unsigned int *) (vbuff2 + 128 * 128)) {
pLe = (unsigned int *) (vbuff2 + 128 * 128);
}

while (pL2 < pLe) {
@@ -606,8 +606,8 @@ void pceAppProc (/*int cnt*/)
pL2++;
}

pL2 = (unsigned long *) (vbuff2);
while (pL < (unsigned long *) (vbuff + 128 * (78 + 2))) {
pL2 = (unsigned int *) (vbuff2);
while (pL < (unsigned int *) (vbuff + 128 * (78 + 2))) {
*pL = *pL2 & 0x03030303;
pL++;
pL2++;

0 comments on commit c6dddfd

Please sign in to comment.