Follow my own advice and write any 32-bit hex constant > 0x7fffffff as (constant|0)

The Closure Compiler does a fine job of replacing all such expressions with their decimal equivalent, relieving us from having to calculate them ourselves, and eliminating any runtime impact
This commit is contained in:
Jeff Parsons 2015-02-19 11:18:40 -08:00 committed by jeffpar
commit c8aec14b0b
153 changed files with 6296 additions and 188 deletions

View file

@ -629,7 +629,7 @@ Disk.prototype.build = function(buffer, fModified)
var adw = sector['data'];
for (var idw = 0; idw < cdw; idw++, ib += 4) {
var dw = adw[idw] = dv.getInt32(ib, true);
dwChecksum = (dwChecksum + dw) & 0xffffffff;
dwChecksum = (dwChecksum + dw) & (0xffffffff|0);
}
if (fModified) sector.cModify = cdw;
head[iSector] = sector;
@ -857,7 +857,7 @@ Disk.prototype.doneLoad = function(sDiskFile, sDiskData, nErrorCode, sDiskPath)
* being written). So all we need to do at this point is checksum all the initial sector data.
*/
for (var idw = 0; idw < adw.length; idw++) {
dwChecksum = (dwChecksum + adw[idw]) & 0xffffffff;
dwChecksum = (dwChecksum + adw[idw]) & (0xffffffff|0);
}
}
}