Skip to content

Commit

Permalink
2007-02-25 Krzysztof Kosciuszkiewicz <[email protected]>
Browse files Browse the repository at this point in the history
	* V144
	* .gdbinint: Added electric fence support.
	* mc2.c (MissionSteps): Negative array index fix.
	* pace.c: Commented out debug stuff.
	* place.c (BigHardMe): Off by one fixed (real pain on win32).
	* admin.c (EditAst): Memory overrun fixed.
	* utils.c (get_time): Mingw32 struct _timeb fix.
	* utils.h: Fixed order of includes.
  • Loading branch information
drvee committed Feb 25, 2007
1 parent cf1cdb5 commit 7838411
Show file tree
Hide file tree
Showing 11 changed files with 91 additions and 20 deletions.
37 changes: 37 additions & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
###############################################################################
# Electric Fence
#
# Debian's Electric Fence package provides efence as a shared library, which is
# very useful.
###############################################################################

define efence
set environment EF_PROTECT_BELOW 0
set environment LD_PRELOAD /usr/lib/libefence.so.0.0
echo Enabled Electric Fence\n
end
document efence
Enable memory allocation debugging through Electric Fence (efence(3)).
See also nofence and underfence.
end


define erfence-under
set environment EF_PROTECT_BELOW 1
set environment LD_PRELOAD /usr/lib/libefence.so.0.0
echo Enabled Electric Fence for undeflow detection\n
end
document efence-under
Enable memory allocation debugging for underflows through Electric Fence
(efence(3)).
See also nofence and efence.
end


define efence-off
unset environment LD_PRELOAD
echo Disabled Electric Fence\n
end
document efence-off
Disable memory allocation debugging through Electric Fence (efence(3)).
end
18 changes: 18 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
2007-02-25 Krzysztof Kosciuszkiewicz <[email protected]>

* V144

* .gdbinint: Added electric fence support.

* mc2.c (MissionSteps): Negative array index fix.

* pace.c: Commented out debug stuff.

* place.c (BigHardMe): Off by one fixed (real pain on win32).

* admin.c (EditAst): Memory overrun fixed.

* utils.c (get_time): Mingw32 struct _timeb fix.

* utils.h: Fixed order of includes.

2007-02-25 Krzysztof Kosciuszkiewicz <[email protected]>

* V143
Expand Down
16 changes: 10 additions & 6 deletions mc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,20 +210,24 @@ void MissionSteps(char plr,int mcode,int Mgoto,int step,int pad)
if (MANNED[pad]>0)
switch(Mev[step].Class) {
case 0: // capsule
Mev[step].ast=CAP[pad]; // index into MA
Mev[step].asf=MA[pad][Mev[step].ast].A->Cap;
Mev[step].ast=CAP[pad]; // index into MA
if (Mev[step].ast >= 0)
Mev[step].asf=MA[pad][Mev[step].ast].A->Cap;
break;
case 2: // lm
Mev[step].ast=LM[pad]; // index into MA
Mev[step].asf=MA[pad][Mev[step].ast].A->LM;
if (Mev[step].ast >= 0)
Mev[step].asf=MA[pad][Mev[step].ast].A->LM;
break;
case 3: // docking
Mev[step].ast=DOC[pad]; // index into MA
Mev[step].asf=MA[pad][Mev[step].ast].A->Docking;
if (Mev[step].ast >= 0)
Mev[step].asf=MA[pad][Mev[step].ast].A->Docking;
break;
case 5: // eva
Mev[step].ast=EVA[pad]; // index into MA
Mev[step].asf=MA[pad][Mev[step].ast].A->EVA;
if (Mev[step].ast >= 0)
Mev[step].asf=MA[pad][Mev[step].ast].A->EVA;
break;
case 7: // covers power on for docking module
Mev[step].ast=-1;
Expand Down Expand Up @@ -636,4 +640,4 @@ void MisRush(char ms)
return;
}

// EOF
/* vim: set noet ts=4 sw=4 tw=77: */
1 change: 1 addition & 0 deletions os_win32/Makefile.os
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CFLAGS += -O2 -DNDEBUG
#CFLAGS += -g

DOCFILES = $(addsuffix .txt,AUTHORS COPYING README DEVELOPER)

Expand Down
2 changes: 2 additions & 0 deletions pace.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ play_audio (int sidx, int mode)
}

#define debug_file stdout
#if 0
void
vdbg (char const *fmt, va_list args)
{
Expand Down Expand Up @@ -574,3 +575,4 @@ dbg (char const *fmt, ...)
vdbg (fmt, args);
va_end (args);
}
#endif
2 changes: 1 addition & 1 deletion place.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void BigHardMe(char plr,int x,int y,char hw,char unit,char sh,unsigned char coff
n = gxVirtualSize(gxVGA_13,104,77);
for (j=0;j<n;j++) local.vptr[j]+=coff;

local.vptr[104*77]=0;
local.vptr[n - 1]=0;
if (FADE==0) gxSetDisplayPalette(pal);
gxPutImage(&local,gxSET,x,y,0);
DV(&local); DV(&local2);
Expand Down
8 changes: 5 additions & 3 deletions prefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "gamedata.h"
#include "Buzz_inc.h"
#include "externs.h"
#include <assert.h>

extern struct ManPool *Men;
struct ManPool *Sov;
Expand Down Expand Up @@ -596,16 +597,17 @@ void EditAst(void)
Cnt=Cur=0; // holds current change
ShBox(27,49+BarA*8,153,57+BarA*8); ShBox(187,49+BarB*8,313,57+BarB*8);
Men=(struct ManPool *) buffer;
Sov=(struct ManPool *) buffer+10000;
Sov=(struct ManPool *) buffer+106*sizeof(struct ManPool);
assert(2 * 106 * sizeof(struct ManPool) < BUFFER_SIZE);
FadeIn(2,pal,10,0,0);

temp=Help("i105");

if (temp==1) fin = sOpen("CREW.DAT","rb",0); /* Open Astronaut Data File */
else fin=sOpen("USER.DAT","rb",0);
fseek(fin,((sizeof (struct ManPool))*106)*0,SEEK_SET);
/* fseek(fin,((sizeof (struct ManPool))*106)*0,SEEK_SET); */
fread(Men,(sizeof (struct ManPool))*106,1,fin);
fseek(fin,((sizeof (struct ManPool))*106)*1,SEEK_SET);
/* fseek(fin,((sizeof (struct ManPool))*106)*1,SEEK_SET); */
fread(Sov,(sizeof (struct ManPool))*106,1,fin);
fclose(fin);

Expand Down
15 changes: 9 additions & 6 deletions race.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION

/* The size of a `char', as computed by sizeof. */
/* The size of `char', as computed by sizeof. */
#undef SIZEOF_CHAR

/* The size of a `int', as computed by sizeof. */
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT

/* The size of a `long', as computed by sizeof. */
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG

/* The size of a `short', as computed by sizeof. */
/* The size of `short', as computed by sizeof. */
#undef SIZEOF_SHORT

/* The size of a `void*', as computed by sizeof. */
/* The size of `void*', as computed by sizeof. */
#undef SIZEOF_VOIDP

/* Define to 1 if you have the ANSI C header files. */
Expand All @@ -117,5 +117,8 @@
#undef inline
#endif

/* Define to `unsigned' if <sys/types.h> does not define. */
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t

/* Define to `int' if <sys/types.h> does not define. */
#undef ssize_t
5 changes: 4 additions & 1 deletion utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ double
get_time (void)
{
#ifdef CONFIG_WIN32
struct timeb tb;
/* mingw was complaining */
struct _timeb tb;

_ftime(&tb);
return tb.time + tb.millitm / 1e3;
Expand Down Expand Up @@ -138,3 +139,5 @@ fread_dyn(char **destp, size_t *n, FILE *stream)
*destp = xrealloc(*destp, *n *= 2);
}
}

/* vim: set noet ts=4 sw=4 tw=77: */
5 changes: 3 additions & 2 deletions utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#define _UTILS_H

#include "race.h"
#include "inttypes.h"
#include "int_types.h"
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>

Expand All @@ -12,7 +13,7 @@ void *xrealloc (void *ptr, size_t size);
char *xstrdup (char const *a);
int xstrcasecmp (char const *a, char const *b);
int xstrncasecmp (char const *a, char const *b, int len);
ssize_t fread_dyn(char **destp, size_t *n, FILE *stream);
ssize_t fread_dyn (char **destp, size_t *n, FILE *stream);
double get_time (void);

#endif /* _UTILS_H */
2 changes: 1 addition & 1 deletion version.c
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
142
144

0 comments on commit 7838411

Please sign in to comment.