-
diff -uri scummvm-original/common/file.cpp scummvm/common/file.cpp
old
|
new
|
|
28 | 28 | char buf[512]; |
29 | 29 | char *ptr; |
30 | 30 | |
31 | | assert(directory); |
| 31 | assert(directory != NULL); |
32 | 32 | strcpy(buf, directory); |
33 | 33 | |
34 | 34 | #ifdef WIN32 |
-
diff -uri scummvm-original/common/util.cpp scummvm/common/util.cpp
old
|
new
|
|
178 | 178 | } |
179 | 179 | |
180 | 180 | void StackLock::lock() { |
181 | | assert(_syst); |
| 181 | assert(_syst != NULL); |
182 | 182 | _syst->lock_mutex(_mutex); |
183 | 183 | } |
184 | 184 | |
185 | 185 | void StackLock::unlock() { |
186 | | assert(_syst); |
| 186 | assert(_syst != NULL); |
187 | 187 | _syst->unlock_mutex(_mutex); |
188 | 188 | } |
189 | 189 | |
-
diff -uri scummvm-original/gui/newgui.cpp scummvm/gui/newgui.cpp
old
|
new
|
|
451 | 451 | void NewGui::blitFromBuffer(int x, int y, int w, int h, const byte *buf, int pitch) { |
452 | 452 | NewGuiColor *ptr = getBasePtr(x, y); |
453 | 453 | |
454 | | assert(buf); |
| 454 | assert(buf != NULL); |
455 | 455 | while (h--) { |
456 | 456 | memcpy(ptr, buf, w*2); |
457 | 457 | ptr += _screenPitch; |
… |
… |
|
465 | 465 | void NewGui::blitToBuffer(int x, int y, int w, int h, byte *buf, int pitch) { |
466 | 466 | NewGuiColor *ptr = getBasePtr(x, y); |
467 | 467 | |
468 | | assert(buf); |
| 468 | assert(buf != NULL); |
469 | 469 | while (h--) { |
470 | 470 | memcpy(buf, ptr, w*2); |
471 | 471 | ptr += _screenPitch; |
-
diff -uri scummvm-original/scumm/actor.cpp scummvm/scumm/actor.cpp
old
|
new
|
|
1035 | 1035 | |
1036 | 1036 | if (_vm->_features & GF_NEW_COSTUMES) { |
1037 | 1037 | byte *akos = _vm->getResourceAddress(rtCostume, costume); |
1038 | | assert(akos); |
| 1038 | assert(akos != NULL); |
1039 | 1039 | if (_vm->akos_increaseAnims(akos, this)) { |
1040 | 1040 | needRedraw = true; |
1041 | 1041 | } |
… |
… |
|
1067 | 1067 | const byte *aksq, *akfo; |
1068 | 1068 | uint size; |
1069 | 1069 | byte *akos = _vm->getResourceAddress(rtCostume, costume); |
1070 | | assert(akos); |
| 1070 | assert(akos != NULL); |
1071 | 1071 | |
1072 | 1072 | aksq = _vm->findResourceData(MKID('AKSQ'), akos); |
1073 | 1073 | akfo = _vm->findResourceData(MKID('AKFO'), akos); |
-
diff -uri scummvm-original/scumm/akos.cpp scummvm/scumm/akos.cpp
old
|
new
|
|
117 | 117 | const AkosHeader *akhd; |
118 | 118 | |
119 | 119 | akos = getResourceAddress(rtCostume, a->costume); |
120 | | assert(akos); |
| 120 | assert(akos != NULL); |
121 | 121 | |
122 | 122 | akhd = (const AkosHeader *)findResourceData(MKID('AKHD'), akos); |
123 | 123 | return (akhd->flags & 2) != 0; |
… |
… |
|
146 | 146 | anim = akos_frameToAnim(a, frame); |
147 | 147 | |
148 | 148 | akos = getResourceAddress(rtCostume, a->costume); |
149 | | assert(akos); |
| 149 | assert(akos != NULL); |
150 | 150 | |
151 | 151 | akhd = (const AkosHeader *)findResourceData(MKID('AKHD'), akos); |
152 | 152 | |
… |
… |
|
154 | 154 | return; |
155 | 155 | |
156 | 156 | r = findResourceData(MKID('AKCH'), akos); |
157 | | assert(r); |
| 157 | assert(r != NULL); |
158 | 158 | |
159 | 159 | offs = READ_LE_UINT16(r + anim * sizeof(uint16)); |
160 | 160 | if (offs == 0) |
… |
… |
|
231 | 231 | |
232 | 232 | void AkosRenderer::setCostume(int costume) { |
233 | 233 | akos = _vm->getResourceAddress(rtCostume, costume); |
234 | | assert(akos); |
| 234 | assert(akos != NULL); |
235 | 235 | |
236 | 236 | akhd = (const AkosHeader *) _vm->findResourceData(MKID('AKHD'), akos); |
237 | 237 | akof = (const AkosOffset *) _vm->findResourceData(MKID('AKOF'), akos); |
-
diff -uri scummvm-original/scumm/bomp.cpp scummvm/scumm/bomp.cpp
old
|
new
|
|
242 | 242 | |
243 | 243 | // Setup vertical scaling |
244 | 244 | if (bd.scale_y != 255) { |
245 | | assert(scalingYPtr); |
| 245 | assert(scalingYPtr != NULL); |
246 | 246 | |
247 | 247 | skip_y_new = *scalingYPtr++; |
248 | 248 | skip_y_bits = 0x80; |
… |
… |
|
254 | 254 | |
255 | 255 | // Setup horizontal scaling |
256 | 256 | if (bd.scale_x != 255) { |
257 | | assert(bd.scalingXPtr); |
| 257 | assert(bd.scalingXPtr != NULL); |
258 | 258 | if (clip_right > bd.scaleRight) { |
259 | 259 | clip_right = bd.scaleRight; |
260 | 260 | } |
-
diff -uri scummvm-original/scumm/boxes.cpp scummvm/scumm/boxes.cpp
old
|
new
|
|
109 | 109 | _extraBoxFlags[box] = val; |
110 | 110 | } else { |
111 | 111 | Box *ptr = getBoxBaseAddr(box); |
112 | | assert(ptr); |
| 112 | assert(ptr != NULL); |
113 | 113 | if (_version == 8) |
114 | 114 | ptr->v8.flags = TO_LE_32(val); |
115 | 115 | else if (_version <= 2) |
… |
… |
|
133 | 133 | |
134 | 134 | void Scumm::setBoxScale(int box, int scale) { |
135 | 135 | Box *ptr = getBoxBaseAddr(box); |
136 | | assert(ptr); |
| 136 | assert(ptr != NULL); |
137 | 137 | if (_version == 8) |
138 | 138 | ptr->v8.scale = TO_LE_32(scale); |
139 | 139 | else if (_version <= 2) |
… |
… |
|
144 | 144 | |
145 | 145 | void Scumm::setBoxScaleSlot(int box, int slot) { |
146 | 146 | Box *ptr = getBoxBaseAddr(box); |
147 | | assert(ptr); |
| 147 | assert(ptr != NULL); |
148 | 148 | ptr->v8.scaleSlot = TO_LE_32(slot); |
149 | 149 | } |
150 | 150 | |
… |
… |
|
373 | 373 | |
374 | 374 | void Scumm::getBoxCoordinates(int boxnum, BoxCoords *box) { |
375 | 375 | Box *bp = getBoxBaseAddr(boxnum); |
376 | | assert(bp); |
| 376 | assert(bp != NULL); |
377 | 377 | |
378 | 378 | if (_version == 8) { |
379 | 379 | box->ul.x = (short)FROM_LE_32(bp->v8.ulx); |
… |
… |
|
601 | 601 | |
602 | 602 | byte *Scumm::getBoxMatrixBaseAddr() { |
603 | 603 | byte *ptr = getResourceAddress(rtMatrix, 1); |
604 | | assert(ptr); |
| 604 | assert(ptr != NULL); |
605 | 605 | if (*ptr == 0xFF) |
606 | 606 | ptr++; |
607 | 607 | return ptr; |
-
diff -uri scummvm-original/scumm/charset.cpp scummvm/scumm/charset.cpp
old
|
new
|
|
1242 | 1242 | assert(id < 5); |
1243 | 1243 | _curId = id; |
1244 | 1244 | _current = _fr[id]; |
1245 | | assert(_current); |
| 1245 | assert(_current != NULL); |
1246 | 1246 | } |
1247 | 1247 | |
1248 | 1248 | int CharsetRendererNut::getCharWidth(byte chr) { |
1249 | | assert(_current); |
| 1249 | assert(_current != NULL); |
1250 | 1250 | return _current->getCharWidth(chr); |
1251 | 1251 | } |
1252 | 1252 | |
1253 | 1253 | int CharsetRendererNut::getFontHeight() { |
1254 | 1254 | // FIXME / TODO: how to implement this properly??? |
1255 | | assert(_current); |
| 1255 | assert(_current != NULL); |
1256 | 1256 | return _current->getCharHeight('|'); |
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | void CharsetRendererNut::printChar(int chr) { |
1260 | 1260 | int shadow_left, shadow_right, shadow_top, shadow_bottom; |
1261 | 1261 | |
1262 | | assert(_current); |
| 1262 | assert(_current != NULL); |
1263 | 1263 | if (chr == '@') |
1264 | 1264 | return; |
1265 | 1265 | |
-
diff -uri scummvm-original/scumm/gfx.cpp scummvm/scumm/gfx.cpp
old
|
new
|
|
894 | 894 | */ |
895 | 895 | void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height, |
896 | 896 | int stripnr, int numstrip, byte flag, StripTable *table) { |
897 | | assert(ptr); |
| 897 | assert(ptr != NULL); |
898 | 898 | assert(height > 0); |
899 | 899 | byte *backbuff_ptr, *bgbak_ptr; |
900 | 900 | const byte *smap_ptr; |
… |
… |
|
921 | 921 | else |
922 | 922 | smap_ptr = findResource(MKID('SMAP'), ptr); |
923 | 923 | |
924 | | assert(smap_ptr); |
| 924 | assert(smap_ptr != NULL); |
925 | 925 | |
926 | 926 | zplane_list[0] = smap_ptr; |
927 | 927 | |
… |
… |
|
3309 | 3309 | const byte *cptr; |
3310 | 3310 | |
3311 | 3311 | cptr = getResourceAddress(rtRoom, _roomResource); |
3312 | | assert(cptr); |
| 3312 | assert(cptr != NULL); |
3313 | 3313 | if (_CLUT_offs) { |
3314 | 3314 | cptr += _CLUT_offs; |
3315 | 3315 | } else { |
3316 | 3316 | cptr = findPalInPals(cptr + _PALS_offs, _curPalIndex); |
3317 | 3317 | } |
3318 | | assert(cptr); |
| 3318 | assert(cptr != NULL); |
3319 | 3319 | return cptr; |
3320 | 3320 | } |
3321 | 3321 | |
-
diff -uri scummvm-original/scumm/object.cpp scummvm/scumm/object.cpp
old
|
new
|
|
244 | 244 | return; |
245 | 245 | } |
246 | 246 | imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), ptr); |
247 | | assert(imhd); |
| 247 | assert(imhd != NULL); |
248 | 248 | if (_version == 8) { |
249 | 249 | x = od.x_pos + (int32)READ_LE_UINT32(&imhd->v8.hotspot[state].x); |
250 | 250 | y = od.y_pos + (int32)READ_LE_UINT32(&imhd->v8.hotspot[state].y); |
… |
… |
|
501 | 501 | searchptr = rootptr = getResourceAddress(rtRoomScripts, _roomResource); |
502 | 502 | else |
503 | 503 | searchptr = rootptr = room; |
504 | | assert(searchptr); |
| 504 | assert(searchptr != NULL); |
505 | 505 | |
506 | 506 | // Load in new room objects |
507 | 507 | ResourceIterator obcds(searchptr, false); |
… |
… |
|
666 | 666 | const CodeHeader *cdhd = NULL; |
667 | 667 | const ImageHeader *imhd = NULL; |
668 | 668 | |
669 | | assert(room); |
| 669 | assert(room != NULL); |
670 | 670 | |
671 | 671 | if (_features & GF_SMALL_HEADER) { |
672 | 672 | |
… |
… |
|
941 | 941 | ptr = getResourceAddress(rtRoomScripts, _roomResource); |
942 | 942 | else |
943 | 943 | ptr = getResourceAddress(rtRoom, _roomResource); |
944 | | assert(ptr); |
| 944 | assert(ptr != NULL); |
945 | 945 | return ptr + _objs[i].OBCDoffset; |
946 | 946 | } |
947 | 947 | } |
… |
… |
|
964 | 964 | } |
965 | 965 | |
966 | 966 | const byte *Scumm::getObjectImage(const byte *ptr, int state) { |
967 | | assert(ptr); |
| 967 | assert(ptr != NULL); |
968 | 968 | if (_features & GF_OLD_BUNDLE) |
969 | 969 | ptr += 0; |
970 | 970 | else if (_features & GF_SMALL_HEADER) { |
… |
… |
|
1023 | 1023 | slot = getInventorySlot(); |
1024 | 1024 | _inventory[slot] = obj; |
1025 | 1025 | dst = createResource(rtInventory, slot, size); |
1026 | | assert(dst); |
| 1026 | assert(dst != NULL); |
1027 | 1027 | memcpy(dst, ptr, size); |
1028 | 1028 | |
1029 | 1029 | CHECK_HEAP |
… |
… |
|
1046 | 1046 | error("findObjectInRoom foCheckAlreadyLoaded NYI for GF_OLD_BUNDLE (id = %d, room = %d)", id, room); |
1047 | 1047 | } |
1048 | 1048 | fo->obcd = obcdptr = getOBCDFromObject(id); |
1049 | | assert(obcdptr); |
| 1049 | assert(obcdptr != NULL); |
1050 | 1050 | fo->obim = obimptr = obcdptr + RES_SIZE(obcdptr); |
1051 | 1051 | fo->cdhd = (const CodeHeader *)findResourceData(MKID('CDHD'), obcdptr); |
1052 | 1052 | fo->imhd = (const ImageHeader *)findResourceData(MKID('IMHD'), obimptr); |
… |
… |
|
1107 | 1107 | searchptr = getResourceAddress(rtRoomScripts, room); |
1108 | 1108 | else |
1109 | 1109 | searchptr = roomptr; |
1110 | | assert(searchptr); |
| 1110 | assert(searchptr != NULL); |
1111 | 1111 | ResourceIterator obcds(searchptr, (_features & GF_SMALL_HEADER) != 0); |
1112 | 1112 | for (i = 0;;) { |
1113 | 1113 | obcdptr = obcds.findNext(MKID('OBCD')); |
… |
… |
|
1359 | 1359 | } |
1360 | 1360 | |
1361 | 1361 | dataptr = getObjectImage(foir.obim, imgindex); |
1362 | | assert(dataptr); |
| 1362 | assert(dataptr != NULL); |
1363 | 1363 | if (_version == 8) { |
1364 | 1364 | bomp = dataptr; |
1365 | 1365 | } else { |
… |
… |
|
1458 | 1458 | |
1459 | 1459 | const byte *img = getObjectImage(ptr, eo->image); |
1460 | 1460 | if (_version == 8) { |
1461 | | assert(img); |
| 1461 | assert(img != NULL); |
1462 | 1462 | bomp = img + 8; |
1463 | 1463 | } else { |
1464 | 1464 | if (!img) |
1465 | 1465 | img = getObjectImage(ptr, 1); // Backward compatibility with samnmax blast objects |
1466 | | assert(img); |
| 1466 | assert(img != NULL); |
1467 | 1467 | bomp = findResourceData(MKID('BOMP'), img); |
1468 | 1468 | } |
1469 | 1469 | |
… |
… |
|
1636 | 1636 | // Allocate slot & memory for floating object |
1637 | 1637 | slot = findFlObjectSlot(); |
1638 | 1638 | flob = createResource(rtFlObject, slot, flob_size); |
1639 | | assert(flob); |
| 1639 | assert(flob != NULL); |
1640 | 1640 | |
1641 | 1641 | // Copy object code + object image to floating object |
1642 | 1642 | ((uint32 *)flob)[0] = MKID('FLOB'); |
-
diff -uri scummvm-original/scumm/resource.cpp scummvm/scumm/resource.cpp
old
|
new
|
|
2052 | 2052 | |
2053 | 2053 | ResourceIterator::ResourceIterator(const byte *searchin, bool smallHeader) |
2054 | 2054 | : _ptr(searchin), _smallHeader(smallHeader) { |
2055 | | assert(searchin); |
| 2055 | assert(searchin != NULL); |
2056 | 2056 | if (_smallHeader) { |
2057 | 2057 | _size = READ_LE_UINT32(searchin); |
2058 | 2058 | _pos = 6; |
… |
… |
|
2104 | 2104 | const byte *findResource(uint32 tag, const byte *searchin) { |
2105 | 2105 | uint32 curpos, totalsize, size; |
2106 | 2106 | |
2107 | | assert(searchin); |
| 2107 | assert(searchin != NULL); |
2108 | 2108 | |
2109 | 2109 | searchin += 4; |
2110 | 2110 | totalsize = READ_BE_UINT32(searchin); |
… |
… |
|
2137 | 2137 | if (smallTag == 0) |
2138 | 2138 | return NULL; |
2139 | 2139 | |
2140 | | assert(searchin); |
| 2140 | assert(searchin != NULL); |
2141 | 2141 | |
2142 | 2142 | totalsize = READ_LE_UINT32(searchin); |
2143 | 2143 | searchin += 6; |
-
diff -uri scummvm-original/scumm/script.cpp scummvm/scumm/script.cpp
old
|
new
|
|
139 | 139 | return 0; |
140 | 140 | |
141 | 141 | objptr = getOBCDFromObject(obj); |
142 | | assert(objptr); |
| 142 | assert(objptr != NULL); |
143 | 143 | |
144 | 144 | if (_version <= 2) |
145 | 145 | verbptr = objptr + 15; |
… |
… |
|
150 | 150 | else |
151 | 151 | verbptr = findResource(MKID('VERB'), objptr); |
152 | 152 | |
153 | | assert(verbptr); |
| 153 | assert(verbptr != NULL); |
154 | 154 | |
155 | 155 | verboffs = verbptr - objptr; |
156 | 156 | |
-
diff -uri scummvm-original/scumm/script_v2.cpp scummvm/scumm/script_v2.cpp
old
|
new
|
|
971 | 971 | if ((_gameId == GID_MANIAC && _version == 1) && (VAR(VAR_SENTENCE_PREPOSITION) == 0)) { |
972 | 972 | if (_verbs[slot].prep == 0xFF) { |
973 | 973 | byte *ptr = getOBCDFromObject(VAR(VAR_SENTENCE_OBJECT1)); |
974 | | assert(ptr); |
| 974 | assert(ptr != NULL); |
975 | 975 | VAR(VAR_SENTENCE_PREPOSITION) = (*(ptr+12) >> 5); |
976 | 976 | } else |
977 | 977 | VAR(VAR_SENTENCE_PREPOSITION) = _verbs[slot].prep; |
-
diff -uri scummvm-original/scumm/script_v5.cpp scummvm/scumm/script_v5.cpp
old
|
new
|
|
821 | 821 | getResultPos(); |
822 | 822 | string = getVarOrDirectByte(0x80); |
823 | 823 | ptr = getResourceAddress(rtString, string); |
824 | | assert(ptr); |
| 824 | assert(ptr != NULL); |
825 | 825 | |
826 | 826 | width = _charset->getStringWidth(0, ptr); |
827 | 827 | |
… |
… |
|
1952 | 1952 | byte *searchin = objptr; |
1953 | 1953 | uint32 curpos, totalsize; |
1954 | 1954 | |
1955 | | assert(searchin); |
| 1955 | assert(searchin != NULL); |
1956 | 1956 | |
1957 | 1957 | searchin += 4; |
1958 | 1958 | totalsize = READ_BE_UINT32(searchin); |
-
diff -uri scummvm-original/scumm/script_v6.cpp scummvm/scumm/script_v6.cpp
old
|
new
|
|
2386 | 2386 | // _imuseDigital->stopAll(); |
2387 | 2387 | // } |
2388 | 2388 | uint32 speed; |
2389 | | assert(getStringAddressVar(VAR_VIDEONAME)); |
| 2389 | assert(getStringAddressVar(VAR_VIDEONAME) != NULL); |
2390 | 2390 | if (strcmp((char *)getStringAddressVar(VAR_VIDEONAME), "sq3.san") == 0) |
2391 | 2391 | speed = 71000; |
2392 | 2392 | else { |
-
diff -uri scummvm-original/scumm/script_v8.cpp scummvm/scumm/script_v8.cpp
old
|
new
|
|
1111 | 1111 | |
1112 | 1112 | assert(0 <= _curVerbSlot && _curVerbSlot < _maxVerbs); |
1113 | 1113 | vs = &_verbs[_curVerbSlot]; |
1114 | | assert(vs); |
| 1114 | assert(vs != NULL); |
1115 | 1115 | |
1116 | 1116 | switch (subOp) { |
1117 | 1117 | case 0x96: // SO_VERB_INIT Choose verb number for editing |
-
diff -uri scummvm-original/scumm/smush/imuse_channel.cpp scummvm/scumm/smush/imuse_channel.cpp
old
|
new
|
|
189 | 189 | byte *keep, *decoded; |
190 | 190 | uint32 value; |
191 | 191 | keep = decoded = new byte[new_size * 2]; |
192 | | assert(keep); |
| 192 | assert(keep != NULL); |
193 | 193 | unsigned char * source = _sbuffer; |
194 | 194 | while (loop_size--) { |
195 | 195 | byte v1 = *source++; |
-
diff -uri scummvm-original/scumm/smush/smush_font.cpp scummvm/scumm/smush/smush_font.cpp
old
|
new
|
|
33 | 33 | } |
34 | 34 | |
35 | 35 | int SmushFont::getStringWidth(const char *str) { |
36 | | assert(str); |
| 36 | assert(str != NULL); |
37 | 37 | if (!_loaded) { |
38 | 38 | warning("SmushFont::getStringWidth() Font is not loaded"); |
39 | 39 | return 0; |
… |
… |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | int SmushFont::getStringHeight(const char *str) { |
50 | | assert(str); |
| 50 | assert(str != NULL); |
51 | 51 | if (!_loaded) { |
52 | 52 | warning("SmushFont::getStringHeight() Font is not loaded"); |
53 | 53 | return 0; |
-
diff -uri scummvm-original/scumm/smush/smush_player.cpp scummvm/scumm/smush/smush_player.cpp
old
|
new
|
|
110 | 110 | data_end -= 2; |
111 | 111 | assert(data_end > data_start); |
112 | 112 | char *value = new char[data_end - data_start + 1]; |
113 | | assert(value); |
| 113 | assert(value != NULL); |
114 | 114 | memcpy(value, data_start, data_end - data_start); |
115 | 115 | value[data_end - data_start] = 0; |
116 | 116 | char *line_start = value; |
… |
… |
|
163 | 163 | } |
164 | 164 | int32 length = theFile.size(); |
165 | 165 | char *filebuffer = new char [length + 1]; |
166 | | assert(filebuffer); |
| 166 | assert(filebuffer != NULL); |
167 | 167 | theFile.read(filebuffer, length); |
168 | 168 | filebuffer[length] = 0; |
169 | 169 | |
… |
… |
|
187 | 187 | length -= ETRS_HEADER_LENGTH; |
188 | 188 | } |
189 | 189 | StringResource *sr = new StringResource; |
190 | | assert(sr); |
| 190 | assert(sr != NULL); |
191 | 191 | sr->init(filebuffer, length); |
192 | 192 | delete []filebuffer; |
193 | 193 | return sr; |
… |
… |
|
707 | 707 | |
708 | 708 | int32 chunk_size = b.getSize() - 14; |
709 | 709 | byte *chunk_buffer = (byte *)malloc(chunk_size); |
710 | | assert(chunk_buffer); |
| 710 | assert(chunk_buffer != NULL); |
711 | 711 | b.read(chunk_buffer, chunk_size); |
712 | 712 | |
713 | 713 | switch (codec) { |
-
diff -uri scummvm-original/scumm/sound.cpp scummvm/scumm/sound.cpp
old
|
new
|
|
179 | 179 | ptr = _scumm->getResourceAddress(rtSound, soundID); |
180 | 180 | if (ptr) { |
181 | 181 | if (READ_UINT32(ptr) == MKID('iMUS')){ |
182 | | assert(_scumm->_imuseDigital); |
| 182 | assert(_scumm->_imuseDigital != NULL); |
183 | 183 | _scumm->_imuseDigital->startSound(soundID); |
184 | 184 | return; |
185 | 185 | } |
186 | 186 | else if (READ_UINT32(ptr) == MKID('Crea')) { |
187 | | assert(_scumm->_imuseDigital); |
| 187 | assert(_scumm->_imuseDigital != NULL); |
188 | 188 | _scumm->_imuseDigital->startSound(soundID); |
189 | 189 | return; |
190 | 190 | } |
-
diff -uri scummvm-original/scumm/verbs.cpp scummvm/scumm/verbs.cpp
old
|
new
|
|
226 | 226 | |
227 | 227 | _string[1].color = v2_mouseover_boxes[i].color; |
228 | 228 | _messagePtr = getObjOrActorName(obj); |
229 | | assert(_messagePtr); |
| 229 | assert(_messagePtr != NULL); |
230 | 230 | |
231 | 231 | // Prevent inventory entries from overflowing by truncating the text |
232 | 232 | // after 144/8 = 18 chars |
… |
… |
|
397 | 397 | _messagePtr = getResourceAddress(rtVerb, verb); |
398 | 398 | if (!_messagePtr) |
399 | 399 | return; |
400 | | assert(_messagePtr); |
| 400 | /* this seems strange, the check above already does this for us, no? */ |
| 401 | assert(_messagePtr != NULL); |
401 | 402 | |
402 | 403 | if ((_version == 8) && (_messagePtr[0] == '/')) { |
403 | 404 | translateText(_messagePtr, _transText); |
… |
… |
|
453 | 454 | ydiff = y - vs->topline; |
454 | 455 | |
455 | 456 | obim = getResourceAddress(rtVerb, verb); |
456 | | assert(obim); |
| 457 | assert(obim != NULL); |
457 | 458 | if (_features & GF_OLD_BUNDLE) { |
458 | 459 | imgw = obim[0]; |
459 | 460 | imgh = obim[1] >> 3; |
… |
… |
|
475 | 476 | } |
476 | 477 | imptr = getObjectImage(obim, 1); |
477 | 478 | } |
478 | | assert(imptr); |
| 479 | assert(imptr != NULL); |
479 | 480 | if (_version == 1) { |
480 | 481 | gdi._C64ObjectMode = true; |
481 | 482 | gdi.decodeC64Gfx(imptr, gdi._C64ObjectMap, imgw * imgh * 3); |
-
diff -uri scummvm-original/sound/mixer.cpp scummvm/sound/mixer.cpp
old
|
new
|
|
49 | 49 | |
50 | 50 | Channel(SoundMixer *mixer, PlayingSoundHandle *handle) |
51 | 51 | : _mixer(mixer), _handle(handle), _converter(0), _input(0), _id(-1) { |
52 | | assert(mixer); |
| 52 | assert(mixer != NULL); |
53 | 53 | } |
54 | 54 | virtual ~Channel(); |
55 | 55 | void destroy(); |
… |
… |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | void SoundMixer::mixCallback(void *s, byte *samples, int len) { |
250 | | assert(s); |
251 | | assert(samples); |
| 250 | assert(s != NULL); |
| 251 | assert(samples != NULL); |
252 | 252 | // Len is the number of bytes in the buffer; we divide it by |
253 | 253 | // four to get the number of samples (stereo 16 bit). |
254 | 254 | ((SoundMixer *)s)->mix((int16 *)samples, len >> 2); |
… |
… |
|
383 | 383 | 16 bits, for a total of 40 bytes. |
384 | 384 | */ |
385 | 385 | void Channel::mix(int16 *data, uint len) { |
386 | | assert(_input); |
| 386 | assert(_input != NULL); |
387 | 387 | if (_input->eos()) { |
388 | 388 | // TODO: call drain method |
389 | 389 | destroy(); |
390 | 390 | } else { |
391 | | assert(_converter); |
| 391 | assert(_converter != NULL); |
392 | 392 | _converter->flow(*_input, data, len, getVolume()); |
393 | 393 | } |
394 | 394 | } |
… |
… |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | void ChannelStream::mix(int16 *data, uint len) { |
448 | | assert(_input); |
| 448 | assert(_input != NULL); |
449 | 449 | if (_input->eos()) { |
450 | 450 | // TODO: call drain method |
451 | 451 | |
… |
… |
|
460 | 460 | return; |
461 | 461 | } |
462 | 462 | |
463 | | assert(_converter); |
| 463 | assert(_converter != NULL); |
464 | 464 | _converter->flow(*_input, data, len, getVolume()); |
465 | 465 | } |
466 | 466 | |