[Scummvm-git-logs] scummvm master -> b3762508462d0f06dc91792995bfd43e85822145

sev- sev at scummvm.org
Sat Aug 29 15:23:11 UTC 2020


This automated email contains information about 8 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3d2f4e78b5 KINGDOM: Initialize variable
d01ac29dd2 DM: Properly set mapX and mapY. CID #1362609
3c939d848d DEVTOOLS: Remove useless assert(). CID 1386623
1a998cddad JANITORIAL: Whitespace fixes
343bfe42d8 GLK: TADS2: Remove no-op check. CID 1401577
8c01b5c675 ULTIMA: ULTIMA1: Added virtual destructor
045df72426 EVENTRECORDER: Fix crash on attempt to save. Fixed #10045
b376250846 EVENTRECORDER: Do not check md5s which were skipped on save


Commit: 3d2f4e78b5f759a2467a6af4aaa5b68ce850006d
    https://github.com/scummvm/scummvm/commit/3d2f4e78b5f759a2467a6af4aaa5b68ce850006d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-29T17:22:24+02:00

Commit Message:
KINGDOM: Initialize variable

Changed paths:
    engines/kingdom/logic.cpp


diff --git a/engines/kingdom/logic.cpp b/engines/kingdom/logic.cpp
index c667a88b67..f999c19e1d 100644
--- a/engines/kingdom/logic.cpp
+++ b/engines/kingdom/logic.cpp
@@ -54,6 +54,8 @@ void Logic::initVariables() {
 	_lastObstacle = 0;
 	_help = false;
 	_eye = false;
+	_fstFwd = false;
+
 	for (int i = 0; i < 99; i++)
 		_nodes[i] = 0;
 	_currMap = 0;
@@ -154,7 +156,7 @@ void Logic::initOpcodes() {
 	if (_vm->isDemo())
 		initOpcodesDemo();
 	else
-		initOpcodesFull();	
+		initOpcodesFull();
 }
 
 void Logic::initOpcodesDemo() {
@@ -520,7 +522,7 @@ void Logic::gameHelp() {
 		break;
 	case 0x245: {
 		// Show Credits
-		
+
 		_vm->fadeToBlack1();
 		// The demo isn't saving pMovie.
 		// It's obviously a bug and this behavior wasn't kept in ScummVM


Commit: d01ac29dd213935a54e447e9a5b189266ffab5f6
    https://github.com/scummvm/scummvm/commit/d01ac29dd213935a54e447e9a5b189266ffab5f6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-29T17:22:24+02:00

Commit Message:
DM: Properly set mapX and mapY. CID #1362609

Changed paths:
    engines/dm/champion.h


diff --git a/engines/dm/champion.h b/engines/dm/champion.h
index 60c45a8825..0f06e451d5 100644
--- a/engines/dm/champion.h
+++ b/engines/dm/champion.h
@@ -47,9 +47,9 @@ public:
 	uint16 getMapY() { return (_scent >> 5) & 0x1F; }
 	uint16 getMapIndex() { return (_scent >> 10) & 0x3F; }
 
-	void setMapX(uint16 val) { _scent = (_scent & ~0x1F) & (val & 0x1F); }
-	void setMapY(uint16 val) { _scent = (_scent & ~(0x1F << 5)) & (val & 0x1F); }
-	void setMapIndex(uint16 val) { _scent = (_scent & ~(0x1F << 10)) & (val & 0x3F); }
+	void setMapX(uint16 val) { _scent = (_scent & ~0x1F) | (val & 0x1F); }
+	void setMapY(uint16 val) { _scent = (_scent & ~(0x1F << 5)) | (val & 0x1F); }
+	void setMapIndex(uint16 val) { _scent = (_scent & ~(0x1F << 10)) | (val & 0x3F); }
 	void setVal(uint16 val) { _scent = val; }
 
 	uint16 toUint16() { return _scent; }


Commit: 3c939d848d36b25096a3892f122222c67580fa6a
    https://github.com/scummvm/scummvm/commit/3c939d848d36b25096a3892f122222c67580fa6a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-29T17:22:24+02:00

Commit Message:
DEVTOOLS: Remove useless assert(). CID 1386623

_size is uint16, thus it will be always < 65536

Changed paths:
    devtools/create_xeen/cc.cpp


diff --git a/devtools/create_xeen/cc.cpp b/devtools/create_xeen/cc.cpp
index c2f7878324..1a8fea8fe8 100644
--- a/devtools/create_xeen/cc.cpp
+++ b/devtools/create_xeen/cc.cpp
@@ -151,7 +151,6 @@ Common::MemFile CCArchive::getMember(const Common::String &name) {
 	for (uint idx = 0; idx < _index.size(); ++idx) {
 		CCEntry &entry = _index[idx];
 		if (entry._id == id) {
-			assert(entry._size < MAX_MEM_SIZE);
 			_file.seek(entry._offset);
 			_file.read(entry._data, entry._size);
 


Commit: 1a998cddad7396883146f839432669001236d59b
    https://github.com/scummvm/scummvm/commit/1a998cddad7396883146f839432669001236d59b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-29T17:22:24+02:00

Commit Message:
JANITORIAL: Whitespace fixes

Changed paths:
    engines/glk/tads/tads2/memory_cache_swap.cpp


diff --git a/engines/glk/tads/tads2/memory_cache_swap.cpp b/engines/glk/tads/tads2/memory_cache_swap.cpp
index 8d78892963..ddbaeedb53 100644
--- a/engines/glk/tads/tads2/memory_cache_swap.cpp
+++ b/engines/glk/tads/tads2/memory_cache_swap.cpp
@@ -21,60 +21,54 @@
  */
 
 #include "glk/tads/tads2/memory_cache_swap.h"
+#include "glk/tads/tads2/error.h"
 #include "glk/tads/tads2/memory_cache.h"
 #include "glk/tads/tads2/memory_cache_heap.h"
-#include "glk/tads/tads2/error.h"
 
 namespace Glk {
 namespace TADS {
 namespace TADS2 {
 
-
 /* initialize swapper:  allocate memory for swap page table */
 void mcsini(mcscxdef *ctx, mcmcx1def *gmemctx, ulong maxsiz,
-            osfildef *fp, char *swapfilename, errcxdef *errctx)
-{
-    uchar  *p;
-
-    ctx->mcscxtab = (mcsdsdef **)0;                   /* anticipate failure */
-    
-    /* allocate space from the low-level heap for page table and one page */
-    p = mchalo(errctx, ((MCSPAGETAB * sizeof(mcsdsdef *))
-                        + (MCSPAGECNT * sizeof(mcsdsdef))), "mcsini");
-    
-    /* set up the context with pointers to this chunk */
-    ctx->mcscxtab = (mcsdsdef **)p;
-    memset(p, 0, (size_t)(MCSPAGETAB * sizeof(mcsdsdef *)));
-    p += MCSPAGETAB * sizeof(mcsdsdef *);
-    ctx->mcscxtab[0] = (mcsdsdef *)p;
-    
-    /* set up the rest of the context */
-    ctx->mcscxtop = (ulong)0;
-    ctx->mcscxmax = maxsiz;
-    ctx->mcscxmsg = 0;
-    ctx->mcscxfp  = fp;
-    ctx->mcscxerr = errctx;
-    ctx->mcscxmem = gmemctx;
-
-    /* 
+            osfildef *fp, char *swapfilename, errcxdef *errctx) {
+	uchar *p;
+
+	ctx->mcscxtab = (mcsdsdef **)0; /* anticipate failure */
+
+	/* allocate space from the low-level heap for page table and one page */
+	p = mchalo(errctx, ((MCSPAGETAB * sizeof(mcsdsdef *)) + (MCSPAGECNT * sizeof(mcsdsdef))), "mcsini");
+
+	/* set up the context with pointers to this chunk */
+	ctx->mcscxtab = (mcsdsdef **)p;
+	memset(p, 0, (size_t)(MCSPAGETAB * sizeof(mcsdsdef *)));
+	p += MCSPAGETAB * sizeof(mcsdsdef *);
+	ctx->mcscxtab[0] = (mcsdsdef *)p;
+
+	/* set up the rest of the context */
+	ctx->mcscxtop = (ulong)0;
+	ctx->mcscxmax = maxsiz;
+	ctx->mcscxmsg = 0;
+	ctx->mcscxfp = fp;
+	ctx->mcscxerr = errctx;
+	ctx->mcscxmem = gmemctx;
+
+	/*
      *   store the swap filename - make a copy so that the caller doesn't
-     *   have to retain the original copy (in case it's on the stack) 
+     *   have to retain the original copy (in case it's on the stack)
      */
-    if (swapfilename != 0)
-    {
-        ctx->mcscxfname = (char *)mchalo(errctx,
-                                         (strlen(swapfilename)+1),
-                                         "mcsini");
-        strcpy(ctx->mcscxfname, swapfilename);
+	if (swapfilename != 0) {
+		ctx->mcscxfname = (char *)mchalo(errctx, (strlen(swapfilename) + 1), "mcsini");
+		strcpy(ctx->mcscxfname, swapfilename);
+	} else {
+		ctx->mcscxfname = 0;
     }
-    else
-        ctx->mcscxfname = 0;
 }
 
 /* close the swapper */
-void mcsclose(mcscxdef *ctx)
-{
-    if (ctx->mcscxtab) mchfre(ctx->mcscxtab);
+void mcsclose(mcscxdef *ctx) {
+	if (ctx->mcscxtab)
+		mchfre(ctx->mcscxtab);
 }
 
 /*
@@ -84,246 +78,224 @@ void mcsclose(mcscxdef *ctx)
  *   allocated size equal its used size for each in-use segment, and leave
  *   free segments at their allocated sizes.
  */
-static void mcscompact(mcscxdef *ctx)
-{
-    char      buf[512];
-    ulong     max;
-    mcsseg    cur_in;
-    mcsseg    cur_out;
-    mcsdsdef *desc_in;
-    mcsdsdef *desc_out;
-    uint      siz;
-    uint      rdsiz;
-    ulong     ptr_in;
-    ulong     ptr_out;
-    
-    max = 0;                            /* start at offset zero within file */
-    for (cur_in = cur_out = 0 ; cur_in < ctx->mcscxmsg ; ++cur_in)
-    {
-        desc_in = mcsdsc(ctx, cur_in);
-        
-        /*
+static void mcscompact(mcscxdef *ctx) {
+	char buf[512];
+	ulong max;
+	mcsseg cur_in;
+	mcsseg cur_out;
+	mcsdsdef *desc_in;
+	mcsdsdef *desc_out;
+	uint siz;
+	uint rdsiz;
+	ulong ptr_in;
+	ulong ptr_out;
+
+	max = 0; /* start at offset zero within file */
+	for (cur_in = cur_out = 0; cur_in < ctx->mcscxmsg; ++cur_in) {
+		desc_in = mcsdsc(ctx, cur_in);
+
+		/*
          *   If the present descriptor's address is wrong, and the swap
          *   segment is in use, move the swap segment.  If it's not in
          *   use, we don't need to move it, because we're going to throw
-         *   away the segment entirely.  
+         *   away the segment entirely.
          */
-        if (desc_in->mcsdsptr != max
-            && (desc_in->mcsdsflg & MCSDSFINUSE))
-        {
-            /* ptr_in is the old location, ptr_out is the new location */
-            ptr_in = desc_in->mcsdsptr;
-            ptr_out = max;
-            
-            /* copy through our buffer */
-            for (siz = desc_in->mcsdsosz ; siz ; siz -= rdsiz)
-            {
-                /* size is whole buffer, or last piece if smaller */
-                rdsiz = (siz > sizeof(buf) ? sizeof(buf) : siz);
-
-                /* seek to old location and get the piece */
-                osfseek(ctx->mcscxfp, ptr_in, OSFSK_SET);
-                (void)osfrb(ctx->mcscxfp, buf, (size_t)rdsiz);
-                
-                /* seek to new location and write the piece */
-                osfseek(ctx->mcscxfp, ptr_out, OSFSK_SET);
-                (void)osfwb(ctx->mcscxfp, buf, (size_t)rdsiz);
-                
-                /* adjust the pointers by the size copied */
-                ptr_in += rdsiz;
-                ptr_out += rdsiz;
-            }
-        }
-        
-        /* adjust object descriptor to reflect new location */
-        desc_in->mcsdsptr = max;
-        
-        /*
+		if (desc_in->mcsdsptr != max && (desc_in->mcsdsflg & MCSDSFINUSE)) {
+			/* ptr_in is the old location, ptr_out is the new location */
+			ptr_in = desc_in->mcsdsptr;
+			ptr_out = max;
+
+			/* copy through our buffer */
+			for (siz = desc_in->mcsdsosz; siz; siz -= rdsiz) {
+				/* size is whole buffer, or last piece if smaller */
+				rdsiz = (siz > sizeof(buf) ? sizeof(buf) : siz);
+
+				/* seek to old location and get the piece */
+				osfseek(ctx->mcscxfp, ptr_in, OSFSK_SET);
+				(void)osfrb(ctx->mcscxfp, buf, (size_t)rdsiz);
+
+				/* seek to new location and write the piece */
+				osfseek(ctx->mcscxfp, ptr_out, OSFSK_SET);
+				(void)osfwb(ctx->mcscxfp, buf, (size_t)rdsiz);
+
+				/* adjust the pointers by the size copied */
+				ptr_in += rdsiz;
+				ptr_out += rdsiz;
+			}
+		}
+
+		/* adjust object descriptor to reflect new location */
+		desc_in->mcsdsptr = max;
+
+		/*
          *   Make current object's size exact if it's in use.  If it's
          *   not in use, delete the segment altogether.
          */
-        if (desc_in->mcsdsflg & MCSDSFINUSE)
-        {
-            desc_in->mcsdssiz = desc_in->mcsdsosz;
-            max += desc_in->mcsdssiz;
-            
-            /* copy descriptor to correct position to close any holes */
-            if (cur_out != cur_in)
-            {
-                desc_out = mcsdsc(ctx, cur_out);
-                OSCPYSTRUCT(*desc_out, *desc_in);
-                
-                /* we need to renumber the corresponding object as well */
-                mcmcsw(ctx->mcscxmem, (mcmon)desc_in->mcsdsobj,
-                       cur_out, cur_in);
-            }
-            
-            /* we actually wrote this one, so move output pointer */
-            ++cur_out;
-        }
-        else
-        {
-            /*
+		if (desc_in->mcsdsflg & MCSDSFINUSE) {
+			desc_in->mcsdssiz = desc_in->mcsdsosz;
+			max += desc_in->mcsdssiz;
+
+			/* copy descriptor to correct position to close any holes */
+			if (cur_out != cur_in) {
+				desc_out = mcsdsc(ctx, cur_out);
+				OSCPYSTRUCT(*desc_out, *desc_in);
+
+				/* we need to renumber the corresponding object as well */
+				mcmcsw(ctx->mcscxmem, (mcmon)desc_in->mcsdsobj,
+				       cur_out, cur_in);
+			}
+
+			/* we actually wrote this one, so move output pointer */
+			++cur_out;
+		} else {
+			/*
              *   We need to renumber the corresponding object so that it
-             *   knows there is no swap segment for it any more.  
+             *   knows there is no swap segment for it any more.
              */
-            mcmcsw(ctx->mcscxmem, (mcmon)desc_in->mcsdsobj,
-                   MCSSEGINV, cur_in);
-        }
-    }
-    
-    /*
+			mcmcsw(ctx->mcscxmem, (mcmon)desc_in->mcsdsobj,
+			       MCSSEGINV, cur_in);
+		}
+	}
+
+	/*
      *   Adjust the top of the file for our new size, and add the savings
      *   into the available space counter.  Also, adjust the total handle
      *   count to reflect any descriptors that we've deleted.
      */
-    ctx->mcscxmax += (ctx->mcscxtop - max);
-    ctx->mcscxtop = max;
-    ctx->mcscxmsg = cur_out;
+	ctx->mcscxmax += (ctx->mcscxtop - max);
+	ctx->mcscxtop = max;
+	ctx->mcscxmsg = cur_out;
 }
 
 /* swap an object out to the swap file */
 mcsseg mcsout(mcscxdef *ctx, uint objid, uchar *ptr, ushort siz,
-              mcsseg oldseg, int dirty)
-{
-    mcsdsdef  *desc;
-    mcsdsdef **pagep;
-    uint       i;
-    uint       j;
-    mcsseg     min;
-    mcsseg     cur;
-	ushort     minsiz = 0;
-    
-    IF_DEBUG(printf("<< mcsout: objid=%d, ptr=%lx, siz=%u, oldseg=%u >>\n",
-                    objid, (unsigned long)ptr, siz, oldseg));
-    
-    /* see if old segment can be reused */
-    if (oldseg != MCSSEGINV)
-    {
-        desc = mcsdsc(ctx, oldseg);
-        if (!(desc->mcsdsflg & MCSDSFINUSE)     /* if old seg is not in use */
-            && desc->mcsdsobj == objid            /* and it has same object */
-            && desc->mcsdssiz >= siz           /* and it's still big enough */
-            && !dirty)      /* and the object in memory hasn't been changed */
-        {
-            /* we can reuse the old segment without rewriting it */
-            desc->mcsdsflg |= MCSDSFINUSE;        /* mark segment as in use */
-            return(oldseg);
-        }
-    }
-    
-    /* look for the smallest unused segment big enough for this object */
-    for (cur = 0, min = MCSSEGINV, i = 0, pagep = ctx->mcscxtab
-         ; cur < ctx->mcscxmsg && i < MCSPAGETAB && *pagep ; ++pagep, ++i)
-    {
-        for (j = 0, desc = *pagep ; cur < ctx->mcscxmsg && j < MCSPAGECNT
-             ; ++desc, ++j, ++cur)
-        {
-            if (!(desc->mcsdsflg & MCSDSFINUSE)
-                && desc->mcsdssiz >= siz
-                && (min == MCSSEGINV || desc->mcsdssiz < minsiz))
-            {
-                min = cur;
-                minsiz = desc->mcsdssiz;
-                if (minsiz == siz) break;       /* exact match - we're done */
-            }
-        }
-        /* quit if we found an exact match */
-        if (min != MCSSEGINV && minsiz == siz) break;
-    }
-    
-    /* if we found nothing, allocate a new segment if possible */
-    if (min == MCSSEGINV)
-    {
-        if (siz > ctx->mcscxmax)
-        {
-            /* swap file is too big; compact it and try again */
-            mcscompact(ctx);
-            if (siz > ctx->mcscxmax)
-                errsig(ctx->mcscxerr, ERR_SWAPBIG);
-        }
-            
-        min = ctx->mcscxmsg;
-        if ((min >> 8) >= MCSPAGETAB)      /* exceeded pages in page table? */
-            errsig(ctx->mcscxerr, ERR_SWAPPG);
-        
-        if (!ctx->mcscxtab[min >> 8])         /* haven't allocate page yet? */
-        {
-            ctx->mcscxtab[min >> 8] = 
-                (mcsdsdef *)mchalo(ctx->mcscxerr,
-                                   (MCSPAGECNT * sizeof(mcsdsdef)),
-                                   "mcsout");
-        }
-
-        /* set up new descriptor */
-        desc = mcsdsc(ctx, min);
-        desc->mcsdsptr = ctx->mcscxtop;
-        desc->mcsdssiz = siz;
-        desc->mcsdsobj = objid;
-
-        /* write out the segment */
-        mcswrt(ctx, desc, ptr, siz);
-        desc->mcsdsflg = MCSDSFINUSE;
-
-        /* update context information to account for new segment */
-        ctx->mcscxtop += siz;             /* add to top seek offset in file */
-        ctx->mcscxmax -= siz;                     /* take size out of quota */
-        ctx->mcscxmsg++;                /* increment last segment allocated */
-        
-        return(min);
-    }
-    else
-    {
-        desc = mcsdsc(ctx, min);
-        desc->mcsdsobj = objid;
-        mcswrt(ctx, desc, ptr, siz);
-        desc->mcsdsflg |= MCSDSFINUSE;
-
-        return(min);
-    }
+              mcsseg oldseg, int dirty) {
+	mcsdsdef *desc;
+	mcsdsdef **pagep;
+	uint i;
+	uint j;
+	mcsseg min;
+	mcsseg cur;
+	ushort minsiz = 0;
+
+	IF_DEBUG(printf("<< mcsout: objid=%d, ptr=%lx, siz=%u, oldseg=%u >>\n",
+	                objid, (unsigned long)ptr, siz, oldseg));
+
+	/* see if old segment can be reused */
+	if (oldseg != MCSSEGINV) {
+		desc = mcsdsc(ctx, oldseg);
+		if (!(desc->mcsdsflg & MCSDSFINUSE) /* if old seg is not in use */
+		    && desc->mcsdsobj == objid      /* and it has same object */
+		    && desc->mcsdssiz >= siz        /* and it's still big enough */
+		    && !dirty)                      /* and the object in memory hasn't been changed */
+		{
+			/* we can reuse the old segment without rewriting it */
+			desc->mcsdsflg |= MCSDSFINUSE; /* mark segment as in use */
+			return (oldseg);
+		}
+	}
+
+	/* look for the smallest unused segment big enough for this object */
+	for (cur = 0, min = MCSSEGINV, i = 0, pagep = ctx->mcscxtab; cur < ctx->mcscxmsg && i < MCSPAGETAB && *pagep; ++pagep, ++i) {
+		for (j = 0, desc = *pagep; cur < ctx->mcscxmsg && j < MCSPAGECNT; ++desc, ++j, ++cur) {
+			if (!(desc->mcsdsflg & MCSDSFINUSE) && desc->mcsdssiz >= siz && (min == MCSSEGINV || desc->mcsdssiz < minsiz)) {
+				min = cur;
+				minsiz = desc->mcsdssiz;
+				if (minsiz == siz)
+					break; /* exact match - we're done */
+			}
+		}
+		/* quit if we found an exact match */
+		if (min != MCSSEGINV && minsiz == siz)
+			break;
+	}
+
+	/* if we found nothing, allocate a new segment if possible */
+	if (min == MCSSEGINV) {
+		if (siz > ctx->mcscxmax) {
+			/* swap file is too big; compact it and try again */
+			mcscompact(ctx);
+			if (siz > ctx->mcscxmax)
+				errsig(ctx->mcscxerr, ERR_SWAPBIG);
+		}
+
+		min = ctx->mcscxmsg;
+		if ((min >> 8) >= MCSPAGETAB) /* exceeded pages in page table? */
+			errsig(ctx->mcscxerr, ERR_SWAPPG);
+
+		if (!ctx->mcscxtab[min >> 8]) /* haven't allocate page yet? */
+		{
+			ctx->mcscxtab[min >> 8] =
+			    (mcsdsdef *)mchalo(ctx->mcscxerr,
+			                       (MCSPAGECNT * sizeof(mcsdsdef)),
+			                       "mcsout");
+		}
+
+		/* set up new descriptor */
+		desc = mcsdsc(ctx, min);
+		desc->mcsdsptr = ctx->mcscxtop;
+		desc->mcsdssiz = siz;
+		desc->mcsdsobj = objid;
+
+		/* write out the segment */
+		mcswrt(ctx, desc, ptr, siz);
+		desc->mcsdsflg = MCSDSFINUSE;
+
+		/* update context information to account for new segment */
+		ctx->mcscxtop += siz; /* add to top seek offset in file */
+		ctx->mcscxmax -= siz; /* take size out of quota */
+		ctx->mcscxmsg++;      /* increment last segment allocated */
+
+		return (min);
+	} else {
+		desc = mcsdsc(ctx, min);
+		desc->mcsdsobj = objid;
+		mcswrt(ctx, desc, ptr, siz);
+		desc->mcsdsflg |= MCSDSFINUSE;
+
+		return (min);
+	}
 }
 
-void mcsin(mcscxdef *ctx, mcsseg seg, uchar *ptr, ushort siz)
-{
-    mcsdsdef *desc = mcsdsc(ctx, seg);
+void mcsin(mcscxdef *ctx, mcsseg seg, uchar *ptr, ushort siz) {
+	mcsdsdef *desc = mcsdsc(ctx, seg);
+
+	IF_DEBUG(printf("<< mcsin: seg=%u, ptr=%lx, siz=%d, objid=%u >>\n",
+	                seg, (unsigned long)ptr, siz, desc->mcsdsobj));
 
-    IF_DEBUG(printf("<< mcsin: seg=%u, ptr=%lx, siz=%d, objid=%u >>\n",
-                    seg, (unsigned long)ptr, siz, desc->mcsdsobj));
+	assert(seg < ctx->mcscxmsg);
 
-    assert(seg < ctx->mcscxmsg);
+	/* can only swap in as much as we wrote */
+	if (desc->mcsdsosz < siz)
+		siz = desc->mcsdsosz;
 
-    /* can only swap in as much as we wrote */
-    if (desc->mcsdsosz < siz) siz = desc->mcsdsosz;
+	/* seek to and read the segment */
+	if (osfseek(ctx->mcscxfp, desc->mcsdsptr, OSFSK_SET))
+		errsig(ctx->mcscxerr, ERR_FSEEK);
+	if (osfrb(ctx->mcscxfp, ptr, (size_t)siz))
+		errsig(ctx->mcscxerr, ERR_FREAD);
 
-    /* seek to and read the segment */
-    if (osfseek(ctx->mcscxfp, desc->mcsdsptr, OSFSK_SET))
-        errsig(ctx->mcscxerr, ERR_FSEEK);
-    if (osfrb(ctx->mcscxfp, ptr, (size_t)siz))
-        errsig(ctx->mcscxerr, ERR_FREAD);
-    
-    desc->mcsdsflg &= ~MCSDSFINUSE;             /* segment no longer in use */
+	desc->mcsdsflg &= ~MCSDSFINUSE; /* segment no longer in use */
 }
 
-void mcswrt(mcscxdef *ctx, mcsdsdef *desc, uchar *buf, ushort bufl)
-{
-    int tries;
-    
-    desc->mcsdsosz = bufl;
-    
-    for (tries = 0 ; tries < 2 ; ++tries)
-    {
-        /* attempt to write the object to the swap file */
-        if (osfseek(ctx->mcscxfp, desc->mcsdsptr, OSFSK_SET))
-            errsig(ctx->mcscxerr, ERR_FSEEK);
-        if (!osfwb(ctx->mcscxfp, buf, (size_t)bufl))
-            return;
-        
-        /* couldn't write it; compact the swap file */
-        mcscompact(ctx);
-    }
-    
-    /* couldn't write to swap file, even after compacting it */
-    errsig(ctx->mcscxerr, ERR_FWRITE);
+void mcswrt(mcscxdef *ctx, mcsdsdef *desc, uchar *buf, ushort bufl) {
+	int tries;
+
+	desc->mcsdsosz = bufl;
+
+	for (tries = 0; tries < 2; ++tries) {
+		/* attempt to write the object to the swap file */
+		if (osfseek(ctx->mcscxfp, desc->mcsdsptr, OSFSK_SET))
+			errsig(ctx->mcscxerr, ERR_FSEEK);
+		if (!osfwb(ctx->mcscxfp, buf, (size_t)bufl))
+			return;
+
+		/* couldn't write it; compact the swap file */
+		mcscompact(ctx);
+	}
+
+	/* couldn't write to swap file, even after compacting it */
+	errsig(ctx->mcscxerr, ERR_FWRITE);
 }
 
 } // End of namespace TADS2


Commit: 343bfe42d855462cfe014c45b7aec6cf4f5d78e1
    https://github.com/scummvm/scummvm/commit/343bfe42d855462cfe014c45b7aec6cf4f5d78e1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-29T17:22:24+02:00

Commit Message:
GLK: TADS2: Remove no-op check. CID 1401577

min is uint16, and MCSPAGETAB is 256, thus, min >> 8 will be always < 256

Changed paths:
    engines/glk/tads/tads2/memory_cache_swap.cpp


diff --git a/engines/glk/tads/tads2/memory_cache_swap.cpp b/engines/glk/tads/tads2/memory_cache_swap.cpp
index ddbaeedb53..c2d2f0eea0 100644
--- a/engines/glk/tads/tads2/memory_cache_swap.cpp
+++ b/engines/glk/tads/tads2/memory_cache_swap.cpp
@@ -220,8 +220,6 @@ mcsseg mcsout(mcscxdef *ctx, uint objid, uchar *ptr, ushort siz,
 		}
 
 		min = ctx->mcscxmsg;
-		if ((min >> 8) >= MCSPAGETAB) /* exceeded pages in page table? */
-			errsig(ctx->mcscxerr, ERR_SWAPPG);
 
 		if (!ctx->mcscxtab[min >> 8]) /* haven't allocate page yet? */
 		{


Commit: 8c01b5c6755fef0a87fbbd76aacbd38fad038d66
    https://github.com/scummvm/scummvm/commit/8c01b5c6755fef0a87fbbd76aacbd38fad038d66
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-29T17:22:24+02:00

Commit Message:
ULTIMA: ULTIMA1: Added virtual destructor

Changed paths:
    engines/ultima/ultima1/core/party.h


diff --git a/engines/ultima/ultima1/core/party.h b/engines/ultima/ultima1/core/party.h
index 9f6c0352be..b5dc24db82 100644
--- a/engines/ultima/ultima1/core/party.h
+++ b/engines/ultima/ultima1/core/party.h
@@ -60,7 +60,7 @@ private:
 	Ultima1Game *_game;
 	Character *_character;
 	WeaponType _type;
-public:	
+public:
 	/**
 	 * Constructor
 	 */
@@ -98,7 +98,7 @@ private:
 //	Ultima1Game *_game;
 	Character *_character;
 	ArmorType _type;
-public:	
+public:
 	/**
 	 * Constructor
 	 */
@@ -171,6 +171,7 @@ public:
 	 * Constructor
 	 */
 	Character(Ultima1Game *game);
+	virtual ~Character() {}
 
 	/**
 	 * Setup the party


Commit: 045df724267d09414d2ce8783162a3d7b84cd372
    https://github.com/scummvm/scummvm/commit/045df724267d09414d2ce8783162a3d7b84cd372
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-29T17:22:38+02:00

Commit Message:
EVENTRECORDER: Fix crash on attempt to save. Fixed #10045

Since we have two event managers during recording, we invalidate
cache in order to avoid cache miss

Changed paths:
    backends/saves/recorder/recorder-saves.cpp
    common/recorderfile.cpp


diff --git a/backends/saves/recorder/recorder-saves.cpp b/backends/saves/recorder/recorder-saves.cpp
index e2cdc5c1c2..0d53d413ed 100644
--- a/backends/saves/recorder/recorder-saves.cpp
+++ b/backends/saves/recorder/recorder-saves.cpp
@@ -32,4 +32,3 @@ Common::InSaveFile *RecorderSaveFileManager::openForLoading(const Common::String
 Common::StringArray RecorderSaveFileManager::listSaveFiles(const Common::String &pattern) {
 	return g_eventRec.listSaveFiles(pattern);
 }
-
diff --git a/common/recorderfile.cpp b/common/recorderfile.cpp
index e74c013e2d..27fb61bd5e 100644
--- a/common/recorderfile.cpp
+++ b/common/recorderfile.cpp
@@ -633,7 +633,11 @@ Graphics::Surface *PlaybackFile::getScreenShot(int number) {
 
 void PlaybackFile::updateHeader() {
 	if (_mode == kWrite) {
+		StringArray dummy;
+		g_system->getSavefileManager()->updateSavefilesList(dummy);
 		_readStream = g_system->getSavefileManager()->openForLoading(_header.fileName);
+
+		assert (_readStream);
 	}
 	_readStream->seek(0);
 	skipHeader();


Commit: b3762508462d0f06dc91792995bfd43e85822145
    https://github.com/scummvm/scummvm/commit/b3762508462d0f06dc91792995bfd43e85822145
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-29T17:22:50+02:00

Commit Message:
EVENTRECORDER: Do not check md5s which were skipped on save

Changed paths:
    gui/EventRecorder.cpp


diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp
index 5f29314dcc..b31fcb9711 100644
--- a/gui/EventRecorder.cpp
+++ b/gui/EventRecorder.cpp
@@ -334,6 +334,9 @@ bool EventRecorder::checkGameHash(const ADGameDescription *gameDesc) {
 		return false;
 	}
 	for (const ADGameFileDescription *fileDesc = gameDesc->filesDescriptions; fileDesc->fileName; fileDesc++) {
+		if (fileDesc->md5 == nullptr)
+			continue;
+
 		if (_playbackFile->getHeader().hashRecords.find(fileDesc->fileName) == _playbackFile->getHeader().hashRecords.end()) {
 			warning("MD5 hash for file %s not found in record file", fileDesc->fileName);
 			debugC(1, kDebugLevelEventRec, "playback:action=\"Check game hash\" filename=%s filehash=%s storedhash=\"\" result=different", fileDesc->fileName, fileDesc->md5);




More information about the Scummvm-git-logs mailing list