From b549688fddecbf98b79183bae0d4894f5b1ab154 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Sun, 23 Oct 2011 17:59:04 +0100 Subject: [PATCH] Compatibility with MSVC - devast8a --- src/elements/dest.c | 4 ++-- src/elements/emp.c | 4 ++-- src/graphics.c | 4 ++-- src/misc.c | 6 ++++-- src/powder.c | 6 +++--- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/elements/dest.c b/src/elements/dest.c index 17ea2fead..772065a66 100644 --- a/src/elements/dest.c +++ b/src/elements/dest.c @@ -1,7 +1,7 @@ #include int update_DEST(UPDATE_FUNC_ARGS) { - int r,rx,ry; + int r,rx,ry,topv; rx=rand()%5-2; ry=rand()%5-2; @@ -45,7 +45,7 @@ int update_DEST(UPDATE_FUNC_ARGS) { { if (ptypes[r&0xFF].hconduct) parts[r>>8].temp = restrict_flt(parts[r>>8].temp+10000.0f, MIN_TEMP, MAX_TEMP); } - int topv=pv[y/CELL][x/CELL]/9+parts[r>>8].temp/900; + topv=pv[y/CELL][x/CELL]/9+parts[r>>8].temp/900; if (topv>40.0f) topv=40.0f; pv[y/CELL][x/CELL]+=40.0f+topv; diff --git a/src/elements/emp.c b/src/elements/emp.c index a4c606761..c47c90269 100644 --- a/src/elements/emp.c +++ b/src/elements/emp.c @@ -1,7 +1,7 @@ #include int update_EMP(UPDATE_FUNC_ARGS) { - int r,rx,ry,ok=0,t; + int r,rx,ry,ok=0,t,n,nx,ny; if (parts[i].life) return 0; for (rx=-2; rx<3; rx++) @@ -42,7 +42,7 @@ int update_EMP(UPDATE_FUNC_ARGS) { else if (rand()%120==0) part_change_type(r, rx, ry, PT_NTCT); } - int n,nx,ny; + for (nx=-2; nx<3; nx++) for (ny=-2; ny<3; ny++) if (rx+nx>=0 && ry+ny>=0 && rx+nx>8; if(proptype==2){ - *((float*)(((void*)&parts[i])+propoffset)) = *((float*)propvalue); + *((float*)(((char*)&parts[i])+propoffset)) = *((float*)propvalue); } else if(proptype==0) { - *((int*)(((void*)&parts[i])+propoffset)) = *((int*)propvalue); + *((int*)(((char*)&parts[i])+propoffset)) = *((int*)propvalue); } else if(proptype==1) { - *((char*)(((void*)&parts[i])+propoffset)) = *((char*)propvalue); + *((char*)(((char*)&parts[i])+propoffset)) = *((char*)propvalue); } bitmap[(y*XRES)+x] = 1; }