[Scummvm-git-logs] scummvm master -> 53c3f0d1a51438f7b3b51a9a0c8bc78476632311

dreammaster dreammaster at scummvm.org
Sat Jan 16 06:40:41 UTC 2021


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

Summary:
94b382e69a ULTIMA: Remove wrappers around stdlib functions
53c3f0d1a5 ULTIMA8: Move the Precision enum into the ConsoleStream class


Commit: 94b382e69a7d08e907c430e5f8393516cd61d464
    https://github.com/scummvm/scummvm/commit/94b382e69a7d08e907c430e5f8393516cd61d464
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2021-01-15T22:40:36-08:00

Commit Message:
ULTIMA: Remove wrappers around stdlib functions

Changed paths:
  R engines/ultima/shared/std/misc.cpp
  R engines/ultima/shared/std/misc.h
    engines/ultima/module.mk
    engines/ultima/nuvie/actors/actor.cpp
    engines/ultima/nuvie/conf/configuration.h
    engines/ultima/nuvie/misc/u6_misc.cpp
    engines/ultima/nuvie/screen/surface.cpp
    engines/ultima/shared/conf/xml_tree.cpp
    engines/ultima/ultima4/gfx/image.cpp
    engines/ultima/ultima4/map/mapmgr.h
    engines/ultima/ultima4/views/dungeonview.cpp
    engines/ultima/ultima8/audio/music_flex.cpp
    engines/ultima/ultima8/audio/raw_audio_sample.cpp
    engines/ultima/ultima8/audio/sound_flex.cpp
    engines/ultima/ultima8/audio/u8_music_process.cpp
    engines/ultima/ultima8/conf/ini_file.cpp
    engines/ultima/ultima8/convert/convert_shape.cpp
    engines/ultima/ultima8/filesys/archive_file.cpp
    engines/ultima/ultima8/filesys/file_system.cpp
    engines/ultima/ultima8/filesys/idata_source.h
    engines/ultima/ultima8/filesys/raw_archive.cpp
    engines/ultima/ultima8/filesys/u8_save_file.cpp
    engines/ultima/ultima8/games/game_data.cpp
    engines/ultima/ultima8/games/game_info.cpp
    engines/ultima/ultima8/games/treasure_loader.cpp
    engines/ultima/ultima8/graphics/fonts/font_shape_archive.cpp
    engines/ultima/ultima8/graphics/render_surface.cpp
    engines/ultima/ultima8/graphics/shape.cpp
    engines/ultima/ultima8/misc/debugger.cpp
    engines/ultima/ultima8/misc/debugger.h
    engines/ultima/ultima8/misc/istring.h
    engines/ultima/ultima8/misc/util.h
    engines/ultima/ultima8/usecode/uc_machine.cpp
    engines/ultima/ultima8/usecode/uc_stack.h
    engines/ultima/ultima8/world/actors/pathfinder.cpp
    engines/ultima/ultima8/world/current_map.cpp


diff --git a/engines/ultima/module.mk b/engines/ultima/module.mk
index 60937cb437..8baf9053d6 100644
--- a/engines/ultima/module.mk
+++ b/engines/ultima/module.mk
@@ -52,7 +52,6 @@ MODULE_OBJS := \
 	shared/maps/map_tile.o \
 	shared/maps/map_widget.o \
 	shared/maps/creature.o \
-	shared/std/misc.o \
 	shared/std/string.o \
 	ultima0/core/resources.o \
 	ultima0/game.o \
diff --git a/engines/ultima/nuvie/actors/actor.cpp b/engines/ultima/nuvie/actors/actor.cpp
index 6284b11206..32952a0532 100644
--- a/engines/ultima/nuvie/actors/actor.cpp
+++ b/engines/ultima/nuvie/actors/actor.cpp
@@ -40,7 +40,6 @@
 #include "ultima/nuvie/core/events.h"
 #include "ultima/nuvie/actors/u6_actor.h"
 #include "ultima/shared/std/containers.h"
-#include "ultima/shared/std/misc.h"
 
 namespace Ultima {
 namespace Nuvie {
diff --git a/engines/ultima/nuvie/conf/configuration.h b/engines/ultima/nuvie/conf/configuration.h
index 9cca4e1c04..a5b396b55d 100644
--- a/engines/ultima/nuvie/conf/configuration.h
+++ b/engines/ultima/nuvie/conf/configuration.h
@@ -25,7 +25,6 @@
 
 #include "ultima/shared/std/string.h"
 #include "ultima/shared/std/containers.h"
-#include "ultima/shared/std/misc.h"
 #include "ultima/detection.h"
 
 namespace Ultima {
diff --git a/engines/ultima/nuvie/misc/u6_misc.cpp b/engines/ultima/nuvie/misc/u6_misc.cpp
index b4f63e2d60..3e5662b04c 100644
--- a/engines/ultima/nuvie/misc/u6_misc.cpp
+++ b/engines/ultima/nuvie/misc/u6_misc.cpp
@@ -21,7 +21,6 @@
  */
 
 #include "ultima/shared/std/containers.h"
-#include "ultima/shared/std/misc.h"
 #include "ultima/nuvie/core/nuvie_defs.h"
 #include "ultima/nuvie/misc/u6_misc.h"
 #include "ultima/nuvie/conf/configuration.h"
@@ -618,9 +617,9 @@ void draw_line_8bit(int sx, int sy, int ex, int ey, uint8 col, uint8 *pixels, ui
 		}
 	}
 	// Diagonal xdiff >= ydiff
-	else if (Std::labs(sx - ex) >= Std::labs(sy - ey)) {
+	else if (ABS(sx - ex) >= ABS(sy - ey)) {
 		//Std::cout << "Diagonal 1" << Std::endl;
-		uint32 fraction = Std::labs((LINE_FRACTION * (sy - ey)) / (sx - ex));
+		uint32 fraction = ABS((LINE_FRACTION * (sy - ey)) / (sx - ex));
 		uint32 ycounter = 0;
 
 		for (; ;) {
@@ -642,7 +641,7 @@ void draw_line_8bit(int sx, int sy, int ex, int ey, uint8 col, uint8 *pixels, ui
 	// Diagonal ydiff > xdiff
 	else {
 		//Std::cout << "Diagonal 2" << Std::endl;
-		uint32 fraction = Std::labs((LINE_FRACTION * (sx - ex)) / (sy - ey));
+		uint32 fraction = ABS((LINE_FRACTION * (sx - ex)) / (sy - ey));
 		uint32 xcounter = 0;
 
 		for (; ;) {
diff --git a/engines/ultima/nuvie/screen/surface.cpp b/engines/ultima/nuvie/screen/surface.cpp
index 4fbdf37960..c83040dba6 100644
--- a/engines/ultima/nuvie/screen/surface.cpp
+++ b/engines/ultima/nuvie/screen/surface.cpp
@@ -22,7 +22,6 @@
 
 #include "ultima/nuvie/core/nuvie_defs.h"
 #include "ultima/nuvie/screen/surface.h"
-#include "ultima/shared/std/misc.h"
 #include "common/algorithm.h"
 
 namespace Ultima {
@@ -297,9 +296,9 @@ void RenderSurface::draw_line16(int sx, int sy, int ex, int ey, unsigned char co
 		}
 	}
 	// Diagonal xdiff >= ydiff
-	else if (Std::labs(sx - ex) >= Std::labs(sy - ey)) {
+	else if (ABS(sx - ex) >= ABS(sy - ey)) {
 		//Std::cout << "Diagonal 1" << Std::endl;
-		uint32 fraction = Std::labs((LINE_FRACTION * (sy - ey)) / (sx - ex));
+		uint32 fraction = ABS((LINE_FRACTION * (sy - ey)) / (sx - ex));
 		uint32 ycounter = 0;
 
 		for (; ;) {
@@ -321,7 +320,7 @@ void RenderSurface::draw_line16(int sx, int sy, int ex, int ey, unsigned char co
 	// Diagonal ydiff > xdiff
 	else {
 		//Std::cout << "Diagonal 2" << Std::endl;
-		uint32 fraction = Std::labs((LINE_FRACTION * (sx - ex)) / (sy - ey));
+		uint32 fraction = ABS((LINE_FRACTION * (sx - ex)) / (sy - ey));
 		uint32 xcounter = 0;
 
 		for (; ;) {
@@ -415,9 +414,9 @@ void RenderSurface::draw_line32(int sx, int sy, int ex, int ey, unsigned char co
 		}
 	}
 	// Diagonal xdiff >= ydiff
-	else if (Std::labs(sx - ex) >= Std::labs(sy - ey)) {
+	else if (ABS(sx - ex) >= ABS(sy - ey)) {
 		//Std::cout << "Diagonal 1" << Std::endl;
-		uint32 fraction = Std::labs((LINE_FRACTION * (sy - ey)) / (sx - ex));
+		uint32 fraction = ABS((LINE_FRACTION * (sy - ey)) / (sx - ex));
 		uint32 ycounter = 0;
 
 		for (; ;) {
@@ -439,7 +438,7 @@ void RenderSurface::draw_line32(int sx, int sy, int ex, int ey, unsigned char co
 	// Diagonal ydiff > xdiff
 	else {
 		//Std::cout << "Diagonal 2" << Std::endl;
-		uint32 fraction = Std::labs((LINE_FRACTION * (sx - ex)) / (sy - ey));
+		uint32 fraction = ABS((LINE_FRACTION * (sx - ex)) / (sy - ey));
 		uint32 xcounter = 0;
 
 		for (; ;) {
diff --git a/engines/ultima/shared/conf/xml_tree.cpp b/engines/ultima/shared/conf/xml_tree.cpp
index d50cf2491f..967cb21883 100644
--- a/engines/ultima/shared/conf/xml_tree.cpp
+++ b/engines/ultima/shared/conf/xml_tree.cpp
@@ -22,7 +22,6 @@
 
 #include "ultima/shared/conf/xml_tree.h"
 #include "ultima/shared/conf/xml_node.h"
-#include "ultima/shared/std/misc.h"
 #include "common/algorithm.h"
 #include "common/file.h"
 
diff --git a/engines/ultima/shared/std/misc.cpp b/engines/ultima/shared/std/misc.cpp
deleted file mode 100644
index 4e817c4b35..0000000000
--- a/engines/ultima/shared/std/misc.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/shared/std/misc.h"
-#include "common/algorithm.h"
-
-namespace Ultima {
-namespace Std {
-
-void memset(void *data, byte val, size_t count) {
-	::memset(data, val, count);
-}
-
-int memcmp(const void *ptr1, const void *ptr2, size_t num) {
-	return ::memcmp(ptr1, ptr2, num);
-}
-
-void *memcpy(void *destination, const void *source, size_t num) {
-	return ::memcpy(destination, source, num);
-}
-
-void strncpy(char *buffer, const char *src, size_t bufSize) {
-	::strncpy(buffer, src, bufSize);
-}
-
-size_t strlen(const char *str) {
-	return ::strlen(str);
-}
-
-int toUpper(int ch) {
-	return toupper(ch);
-}
-
-int toLower(int ch) {
-	return tolower(ch);
-}
-
-int strcmp(const char *leftStr, const char *rightStr) {
-	return ::strcmp(leftStr, rightStr);
-}
-
-int strncmp(const char *str1, const char *str2, size_t n) {
-	return ::strncmp(str1, str2, n);
-}
-
-long int strtol(const char *str, char **endptr, int base) {
-	return ::strtol(str, endptr, base);
-}
-
-int atoi(const char *str) {
-	return ::atoi(str);
-}
-
-double atof(const char *str) {
-	return ::atof(str);
-}
-
-double sqrt(double val) {
-	return ::sqrt(val);
-}
-
-int labs(int v) {
-	return ABS(v);
-}
-
-const char *strstr(const char *str, const char *substr) {
-	return ::strstr(str, substr);
-}
-
-double pow(double x, double y) {
-	return ::pow(x, y);
-}
-
-void *malloc(size_t size) {
-	return ::malloc(size);
-}
-
-void *calloc(size_t num, size_t size) {
-	return ::calloc(num, size);
-}
-
-void free(void *&p) {
-	::free(p);
-	p = 0;
-}
-
-} // End of namespace Std
-} // End of namespace Ultima
diff --git a/engines/ultima/shared/std/misc.h b/engines/ultima/shared/std/misc.h
deleted file mode 100644
index fe30fce512..0000000000
--- a/engines/ultima/shared/std/misc.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef ULTIMA8_STD_MISC_H
-#define ULTIMA8_STD_MISC_H
-
-#include "common/scummsys.h"
-
-namespace Ultima {
-namespace Std {
-
-enum Precision { hex = 16, dec = 10 };
-
-extern void memset(void *data, byte val, size_t count);
-extern int memcmp(const void *ptr1, const void *ptr2, size_t num);
-extern void *memcpy(void *destination, const void *source, size_t num);
-extern void strncpy(char *buffer, const char *src, size_t bufSize);
-extern size_t strlen(const char *str);
-extern int toUpper(int ch);
-extern int toLower(int ch);
-extern int strcmp(const char *leftStr, const char *rightStr);
-extern int strncmp(const char *str1, const char *str2, size_t n);
-extern long int strtol(const char *str, char **endptr, int base);
-extern int atoi(const char *str);
-extern double atof(const char *str);
-extern const char *strstr(const char *str, const char *substr);
-extern double pow(double x, double y);
-extern double sqrt(double val);
-extern int labs(int v);
-
-extern void *malloc(size_t size);
-extern void *calloc(size_t num, size_t size);
-extern void free(void *&p);
-
-} // End of namespace Std
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima4/gfx/image.cpp b/engines/ultima/ultima4/gfx/image.cpp
index 5833b8e183..9537b9401f 100644
--- a/engines/ultima/ultima4/gfx/image.cpp
+++ b/engines/ultima/ultima4/gfx/image.cpp
@@ -25,7 +25,6 @@
 #include "ultima/ultima4/core/settings.h"
 #include "ultima/ultima4/core/utils.h"
 #include "ultima/shared/std/containers.h"
-#include "ultima/shared/std/misc.h"
 #include "common/system.h"
 #include "common/list.h"
 #include "common/textconsole.h"
diff --git a/engines/ultima/ultima4/map/mapmgr.h b/engines/ultima/ultima4/map/mapmgr.h
index 39ef124f94..fa8bb1fc9d 100644
--- a/engines/ultima/ultima4/map/mapmgr.h
+++ b/engines/ultima/ultima4/map/mapmgr.h
@@ -24,7 +24,6 @@
 #define ULTIMA4_MAP_MAPMGR_H
 
 #include "ultima/ultima4/map/map.h"
-#include "ultima/shared/std/misc.h"
 
 namespace Ultima {
 namespace Ultima4 {
diff --git a/engines/ultima/ultima4/views/dungeonview.cpp b/engines/ultima/ultima4/views/dungeonview.cpp
index 691996e149..da66d2b174 100644
--- a/engines/ultima/ultima4/views/dungeonview.cpp
+++ b/engines/ultima/ultima4/views/dungeonview.cpp
@@ -29,7 +29,6 @@
 #include "ultima/ultima4/map/tileset.h"
 #include "ultima/ultima4/views/dungeonview.h"
 #include "ultima/ultima4/ultima4.h"
-#include "ultima/shared/std/misc.h"
 
 namespace Ultima {
 namespace Ultima4 {
diff --git a/engines/ultima/ultima8/audio/music_flex.cpp b/engines/ultima/ultima8/audio/music_flex.cpp
index b70e5e9347..ce4a479a9a 100644
--- a/engines/ultima/ultima8/audio/music_flex.cpp
+++ b/engines/ultima/ultima8/audio/music_flex.cpp
@@ -30,9 +30,9 @@ namespace Ultima {
 namespace Ultima8 {
 
 MusicFlex::MusicFlex(Common::SeekableReadStream *rs) : Archive(rs) {
-	Std::memset(_info, 0, sizeof(SongInfo *) * 128);
+	memset(_info, 0, sizeof(SongInfo *) * 128);
 	_songs = new XMidiData *[_count];
-	Std::memset(_songs, 0, sizeof(XMidiData *) * _count);
+	memset(_songs, 0, sizeof(XMidiData *) * _count);
 	loadSongInfo();
 }
 
@@ -48,8 +48,8 @@ MusicFlex::~MusicFlex() {
 }
 
 MusicFlex::SongInfo::SongInfo() : _numMeasures(0), _loopJump(0) {
-	Std::memset(_filename, 0, 16);
-	Std::memset(_transitions, 0, 128 * sizeof(int *));
+	memset(_filename, 0, 16);
+	memset(_transitions, 0, 128 * sizeof(int *));
 }
 
 MusicFlex::SongInfo::~SongInfo() {
@@ -134,12 +134,12 @@ void MusicFlex::loadSongInfo() {
 		// Now number of measures
 		begIdx = line.findFirstNotOf(' ', endIdx);
 		endIdx = line.findFirstOf(' ', begIdx);
-		int measures = Std::atoi(line.substr(begIdx, endIdx - begIdx).c_str());
+		int measures = atoi(line.substr(begIdx, endIdx - begIdx).c_str());
 
 		// Now finally _loopJump
 		begIdx = line.findFirstNotOf(' ', endIdx);
 		endIdx = line.findFirstOf(' ', begIdx);
-		int loopJump = Std::atoi(line.substr(begIdx, endIdx - begIdx).c_str());
+		int loopJump = atoi(line.substr(begIdx, endIdx - begIdx).c_str());
 
 		// Uh oh
 		if (num < 0 || num > 127)
@@ -150,7 +150,7 @@ void MusicFlex::loadSongInfo() {
 
 		_info[num] = new SongInfo();
 
-		Std::strncpy(_info[num]->_filename, name.c_str(), 16);
+		strncpy(_info[num]->_filename, name.c_str(), 16);
 		_info[num]->_numMeasures = measures;
 		_info[num]->_loopJump = loopJump;
 	};
diff --git a/engines/ultima/ultima8/audio/raw_audio_sample.cpp b/engines/ultima/ultima8/audio/raw_audio_sample.cpp
index 1c448efc80..5f5a4fe7c1 100644
--- a/engines/ultima/ultima8/audio/raw_audio_sample.cpp
+++ b/engines/ultima/ultima8/audio/raw_audio_sample.cpp
@@ -57,7 +57,7 @@ uint32 RawAudioSample::decompressFrame(void *DecompData, void *samples) const {
 		count = _bufferSize - decomp->_pos;
 
 	if (!_signedData) {
-		Std::memcpy(samples, _buffer + decomp->_pos, count);
+		memcpy(samples, _buffer + decomp->_pos, count);
 	} else {
 		uint8 *dest = static_cast<uint8 *>(samples);
 		for (unsigned int i = 0; i < count; ++i)
diff --git a/engines/ultima/ultima8/audio/sound_flex.cpp b/engines/ultima/ultima8/audio/sound_flex.cpp
index 2ffa3b7de8..7ec1dd6380 100644
--- a/engines/ultima/ultima8/audio/sound_flex.cpp
+++ b/engines/ultima/ultima8/audio/sound_flex.cpp
@@ -81,7 +81,7 @@ void SoundFlex::cache(uint32 index) {
 
 	if (!_samples) {
 		_samples = new AudioSample * [_count];
-		Std::memset(_samples, 0, sizeof(AudioSample *) * _count);
+		memset(_samples, 0, sizeof(AudioSample *) * _count);
 	}
 
 	if (_samples[index]) return;
@@ -92,7 +92,7 @@ void SoundFlex::cache(uint32 index) {
 
 	if (!buf || !size) return;
 
-	if (Std::strncmp(reinterpret_cast<const char *>(buf), "ASFX", 4) == 0) {
+	if (strncmp(reinterpret_cast<const char *>(buf), "ASFX", 4) == 0) {
 		// After the 32 byte header, ASFX (crusader audio) is just raw 11025 data
 		const SoundFlexEntry &entry = _index[index];
 		debug(6, "SoundFlex: Playing sfx %d (%s) with data 0x%04X", index, entry._name.c_str(), entry._data);
diff --git a/engines/ultima/ultima8/audio/u8_music_process.cpp b/engines/ultima/ultima8/audio/u8_music_process.cpp
index f09eb470dc..cd0916a5ea 100644
--- a/engines/ultima/ultima8/audio/u8_music_process.cpp
+++ b/engines/ultima/ultima8/audio/u8_music_process.cpp
@@ -35,13 +35,13 @@ DEFINE_RUNTIME_CLASSTYPE_CODE(U8MusicProcess)
 U8MusicProcess::U8MusicProcess() : _midiPlayer(nullptr), _state(PLAYBACK_NORMAL),
 		_currentTrack(0), _combatMusicActive(false),
 		_savedTrackState(nullptr) {
-	Std::memset(_songBranches, (byte)-1, 128 * sizeof(int));
+	memset(_songBranches, (byte)-1, 128 * sizeof(int));
 }
 
 U8MusicProcess::U8MusicProcess(MidiPlayer *player) : _midiPlayer(player),
 		_state(PLAYBACK_NORMAL), _currentTrack(0), _combatMusicActive(false),
 		_savedTrackState(nullptr) {
-	Std::memset(_songBranches, (byte)-1, 128 * sizeof(int));
+	memset(_songBranches, (byte)-1, 128 * sizeof(int));
 
 	_theMusicProcess = this;
 	_type = 1; // persistent
diff --git a/engines/ultima/ultima8/conf/ini_file.cpp b/engines/ultima/ultima8/conf/ini_file.cpp
index 618cd147ff..fb68f28a08 100644
--- a/engines/ultima/ultima8/conf/ini_file.cpp
+++ b/engines/ultima/ultima8/conf/ini_file.cpp
@@ -376,7 +376,7 @@ bool INIFile::value(istring key, int &ret) {
 
 	if (!found) return false;
 
-	ret = Std::strtol(stringval.c_str(), 0, 0);
+	ret = strtol(stringval.c_str(), 0, 0);
 	return true;
 }
 
diff --git a/engines/ultima/ultima8/convert/convert_shape.cpp b/engines/ultima/ultima8/convert/convert_shape.cpp
index 1045c397b0..7897de56fa 100644
--- a/engines/ultima/ultima8/convert/convert_shape.cpp
+++ b/engines/ultima/ultima8/convert/convert_shape.cpp
@@ -63,7 +63,7 @@ void ConvertShape::Read(IDataSource *source, const ConvertShapeFormat *csf, uint
 		char ident[4];
 		source->read(ident, csf->_bytes_ident);
 
-		if (Std::memcmp (ident, csf->_ident, csf->_bytes_ident)) {
+		if (memcmp (ident, csf->_ident, csf->_bytes_ident)) {
 			perr << "Warning: Corrupt shape!" << Std::endl;
 			return;
 		}
@@ -102,7 +102,7 @@ void ConvertShape::Read(IDataSource *source, const ConvertShapeFormat *csf, uint
 
 	// Create _frames array
 	_frames = new ConvertShapeFrame[_num_frames];
-	Std::memset (_frames, 0, _num_frames * sizeof(ConvertShapeFrame));
+	memset (_frames, 0, _num_frames * sizeof(ConvertShapeFrame));
 
 	// Now read the _frames
 	for(uint32 f = 0; f < _num_frames; ++f) {
@@ -429,7 +429,7 @@ bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uin
 		ident[csf->_bytes_ident] = 0;
 		source->read(ident, csf->_bytes_ident);
 
-		if (Std::memcmp (ident, csf->_ident, csf->_bytes_ident)) {
+		if (memcmp (ident, csf->_ident, csf->_bytes_ident)) {
 			// Return to start position
 			source->seek(start_pos);
 			return false;
@@ -449,7 +449,7 @@ bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uin
 
 	// Create _frames array
 	ConvertShapeFrame oneframe;
-	Std::memset (&oneframe, 0, sizeof(ConvertShapeFrame));
+	memset (&oneframe, 0, sizeof(ConvertShapeFrame));
 
 	// Now read the _frames
 	for (int f = 0; f < numFrames; f++) {
@@ -608,7 +608,7 @@ bool ConvertShape::CheckUnsafe(IDataSource *source, const ConvertShapeFormat *cs
 		ident[csf->_bytes_ident] = 0;
 		source->read(ident, csf->_bytes_ident);
 
-		if (Std::memcmp (ident, csf->_ident, csf->_bytes_ident)) {
+		if (memcmp (ident, csf->_ident, csf->_bytes_ident)) {
 			// Return to start position
 			source->seek(start_pos);
 			return false;
@@ -628,7 +628,7 @@ bool ConvertShape::CheckUnsafe(IDataSource *source, const ConvertShapeFormat *cs
 
 	// Create _frames array
 	ConvertShapeFrame oneframe;
-	Std::memset (&oneframe, 0, sizeof(ConvertShapeFrame));
+	memset (&oneframe, 0, sizeof(ConvertShapeFrame));
 
 	// Now read the _frames
 	for (int f = 0; f < numFrames; f++) {
diff --git a/engines/ultima/ultima8/filesys/archive_file.cpp b/engines/ultima/ultima8/filesys/archive_file.cpp
index e37979322a..90f0dccb4c 100644
--- a/engines/ultima/ultima8/filesys/archive_file.cpp
+++ b/engines/ultima/ultima8/filesys/archive_file.cpp
@@ -35,7 +35,7 @@ bool ArchiveFile::extractIndexFromName(const Std::string &name, uint32 &index) {
 	char *endptr;
 	long val;
 
-	val = Std::strtol(name.c_str(), &endptr, 10);
+	val = strtol(name.c_str(), &endptr, 10);
 
 	// if remainder of name doesn't start with a '.', invalid name
 	if (*endptr != '\0' && *endptr != '.') return false;
diff --git a/engines/ultima/ultima8/filesys/file_system.cpp b/engines/ultima/ultima8/filesys/file_system.cpp
index c8173d6bed..55c166f67c 100644
--- a/engines/ultima/ultima8/filesys/file_system.cpp
+++ b/engines/ultima/ultima8/filesys/file_system.cpp
@@ -94,7 +94,7 @@ bool FileSystem::rawOpen(Common::SeekableReadStream *&in, const string &fname) {
 
 	// Handle opening savegames
 	if (name.hasPrefix("@save/")) {
-		int slotNumber = Std::atoi(name.c_str() + 6);
+		int slotNumber = atoi(name.c_str() + 6);
 		Std::string saveFilename = Ultima8Engine::get_instance()->getSaveStateName(slotNumber);
 
 		in = g_system->getSavefileManager()->openForLoading(saveFilename);
@@ -126,7 +126,7 @@ bool FileSystem::rawOpen(Common::WriteStream *&out,  const string &fname) {
 	switch_slashes(name);
 
 	if (name.hasPrefix("@save/")) {
-		int slotNumber = Std::atoi(name.c_str() + 6);
+		int slotNumber = atoi(name.c_str() + 6);
 		Std::string saveFilename = Ultima8Engine::get_instance()->getSaveStateName(slotNumber);
 
 		out = g_system->getSavefileManager()->openForSaving(saveFilename, false);
@@ -178,7 +178,7 @@ bool FileSystem::base_to_uppercase(string &str, int count) {
 		if (todo <= 0)
 			break;
 
-		*X = static_cast<char>(Std::toUpper(*X));
+		*X = static_cast<char>(toupper(*X));
 	}
 	if (X == str.rend())
 		todo--; // start of pathname counts as separator too
diff --git a/engines/ultima/ultima8/filesys/idata_source.h b/engines/ultima/ultima8/filesys/idata_source.h
index fd7aa566e2..c240c59d91 100644
--- a/engines/ultima/ultima8/filesys/idata_source.h
+++ b/engines/ultima/ultima8/filesys/idata_source.h
@@ -24,7 +24,6 @@
 #define ULTIMA8_FILESYS_IDATASOURCE_H
 
 #include "common/stream.h"
-#include "ultima/shared/std/misc.h"
 #include "ultima/shared/std/string.h"
 
 namespace Ultima {
@@ -148,7 +147,7 @@ public:
 		uint32 count = num_bytes;
 		if (_bufPtr + num_bytes > _buf + _size)
 			count = static_cast<int32>(_buf - _bufPtr + _size);
-		Std::memcpy(str, _bufPtr, count);
+		memcpy(str, _bufPtr, count);
 		_bufPtr += count;
 		return count;
 	}
diff --git a/engines/ultima/ultima8/filesys/raw_archive.cpp b/engines/ultima/ultima8/filesys/raw_archive.cpp
index 7fa423de86..42c3ce1888 100644
--- a/engines/ultima/ultima8/filesys/raw_archive.cpp
+++ b/engines/ultima/ultima8/filesys/raw_archive.cpp
@@ -75,7 +75,7 @@ uint8 *RawArchive::get_object(uint32 index) {
 		if (size == 0)
 			return nullptr;
 		uint8 *object = new uint8[size];
-		Std::memcpy(object, _objects[index], size);
+		memcpy(object, _objects[index], size);
 		return object;
 	}
 
diff --git a/engines/ultima/ultima8/filesys/u8_save_file.cpp b/engines/ultima/ultima8/filesys/u8_save_file.cpp
index 4c40007340..98e2809ef0 100644
--- a/engines/ultima/ultima8/filesys/u8_save_file.cpp
+++ b/engines/ultima/ultima8/filesys/u8_save_file.cpp
@@ -45,7 +45,7 @@ bool U8SaveFile::isU8SaveFile(Common::SeekableReadStream *_rs) {
 	_rs->read(buf, 23);
 	buf[23] = '\0';
 
-	return (Std::strncmp(buf, "Ultima 8 SaveGame File.", 23) == 0);
+	return (strncmp(buf, "Ultima 8 SaveGame File.", 23) == 0);
 }
 
 bool U8SaveFile::readMetadata() {
diff --git a/engines/ultima/ultima8/games/game_data.cpp b/engines/ultima/ultima8/games/game_data.cpp
index 2052718184..d72c39fe83 100644
--- a/engines/ultima/ultima8/games/game_data.cpp
+++ b/engines/ultima/ultima8/games/game_data.cpp
@@ -381,7 +381,7 @@ void GameData::setupJPOverrides() {
 
 	jpkeyvals = config->listKeyValues("language/jpfonts");
 	for (iter = jpkeyvals.begin(); iter != jpkeyvals.end(); ++iter) {
-		int fontnum = Std::atoi(iter->_key.c_str());
+		int fontnum = atoi(iter->_key.c_str());
 		const Std::string &fontdesc = iter->_value;
 
 		Std::vector<Std::string> vals;
@@ -391,8 +391,8 @@ void GameData::setupJPOverrides() {
 			continue;
 		}
 
-		unsigned int jpfontnum = Std::atoi(vals[0].c_str());
-		uint32 col32 = Std::strtol(vals[1].c_str(), 0, 0);
+		unsigned int jpfontnum = atoi(vals[0].c_str());
+		uint32 col32 = strtol(vals[1].c_str(), 0, 0);
 
 		if (!fontmanager->addJPOverride(fontnum, jpfontnum, col32)) {
 			perr << "failed to setup jpfont override for font " << fontnum
@@ -419,7 +419,7 @@ void GameData::setupTTFOverrides(const char *configkey, bool SJIS) {
 
 	ttfkeyvals = config->listKeyValues(configkey);
 	for (iter = ttfkeyvals.begin(); iter != ttfkeyvals.end(); ++iter) {
-		int fontnum = Std::atoi(iter->_key.c_str());
+		int fontnum = atoi(iter->_key.c_str());
 		const Std::string &fontdesc = iter->_value;
 
 		Std::vector<Std::string> vals;
@@ -430,9 +430,9 @@ void GameData::setupTTFOverrides(const char *configkey, bool SJIS) {
 		}
 
 		const Std::string &filename = vals[0];
-		int pointsize = Std::atoi(vals[1].c_str());
-		uint32 col32 = Std::strtol(vals[2].c_str(), 0, 0);
-		int border = Std::atoi(vals[3].c_str());
+		int pointsize = atoi(vals[1].c_str());
+		uint32 col32 = strtol(vals[2].c_str(), 0, 0);
+		int border = atoi(vals[3].c_str());
 
 		if (!fontmanager->addTTFOverride(fontnum, filename, pointsize,
 		                                 col32, border, SJIS)) {
diff --git a/engines/ultima/ultima8/games/game_info.cpp b/engines/ultima/ultima8/games/game_info.cpp
index 7807e022a2..1118b97439 100644
--- a/engines/ultima/ultima8/games/game_info.cpp
+++ b/engines/ultima/ultima8/games/game_info.cpp
@@ -164,7 +164,7 @@ bool GameInfo::match(GameInfo &other, bool ignoreMD5) const {
 
 	if (ignoreMD5) return true;
 
-	return (Std::memcmp(_md5, other._md5, 16) == 0);
+	return (memcmp(_md5, other._md5, 16) == 0);
 }
 
 void GameInfo::save(Common::WriteStream *ws) {
@@ -213,14 +213,14 @@ bool GameInfo::load(IDataSource *ids, uint32 ver) {
 	}
 	if (!gamelangs[i].name) return false;
 
-	this->version = Std::strtol(parts[2].c_str(), 0, 0);
+	this->version = strtol(parts[2].c_str(), 0, 0);
 
 	for (i = 0; i < 16; ++i) {
 		char buf[3];
 		buf[0] = parts[3][2 * i];
 		buf[1] = parts[3][2 * i + 1];
 		buf[2] = 0;
-		long x = Std::strtol(buf, 0, 16);
+		long x = strtol(buf, 0, 16);
 		_md5[i] = static_cast<uint8>(x);
 	}
 
diff --git a/engines/ultima/ultima8/games/treasure_loader.cpp b/engines/ultima/ultima8/games/treasure_loader.cpp
index aa198bb9f9..ebcffbeefd 100644
--- a/engines/ultima/ultima8/games/treasure_loader.cpp
+++ b/engines/ultima/ultima8/games/treasure_loader.cpp
@@ -196,13 +196,13 @@ bool TreasureLoader::parseUIntRange(const Std::string &val,
 
 bool TreasureLoader::parseDouble(const Std::string &val, double &d) {
 	// TODO: error checking
-	d = Std::atof(val.c_str());
+	d = atof(val.c_str());
 	return true;
 }
 
 bool TreasureLoader::parseInt(const Std::string &val, int &i) {
 	// TODO: error checking
-	i = Std::strtol(val.c_str(), 0, 0);
+	i = strtol(val.c_str(), 0, 0);
 	return true;
 }
 
diff --git a/engines/ultima/ultima8/graphics/fonts/font_shape_archive.cpp b/engines/ultima/ultima8/graphics/fonts/font_shape_archive.cpp
index 4fbf558284..ad30ccefc3 100644
--- a/engines/ultima/ultima8/graphics/fonts/font_shape_archive.cpp
+++ b/engines/ultima/ultima8/graphics/fonts/font_shape_archive.cpp
@@ -68,7 +68,7 @@ void FontShapeArchive::setHVLeads() {
 	KeyMap::const_iterator iter;
 
 	for (iter = leadkeyvals.begin(); iter != leadkeyvals.end(); ++iter) {
-		int fontnum = Std::atoi(iter->_key.c_str());
+		int fontnum = atoi(iter->_key.c_str());
 		Std::string leaddesc = iter->_value;
 
 		Std::vector<Std::string> vals;
@@ -79,8 +79,8 @@ void FontShapeArchive::setHVLeads() {
 			continue;
 		}
 
-		int hlead = Std::atoi(vals[0].c_str());
-		int vlead = Std::atoi(vals[1].c_str());
+		int hlead = atoi(vals[0].c_str());
+		int vlead = atoi(vals[1].c_str());
 
 		ShapeFont *font = getFont(fontnum);
 		if (font) {
diff --git a/engines/ultima/ultima8/graphics/render_surface.cpp b/engines/ultima/ultima8/graphics/render_surface.cpp
index a26f50ace1..88fee33054 100644
--- a/engines/ultima/ultima8/graphics/render_surface.cpp
+++ b/engines/ultima/ultima8/graphics/render_surface.cpp
@@ -67,8 +67,8 @@ RenderSurface *RenderSurface::SetVideoMode(uint32 width, uint32 height, int bpp)
 
 	// Initialize gamma correction tables
 	for (int i = 0; i < 256; i++) {
-		_gamma22toGamma10[i] = static_cast<uint8>(0.5 + (Std::pow(i / 255.0, 2.2 / 1.0) * 255.0));
-		_gamma10toGamma22[i] = static_cast<uint8>(0.5 + (Std::pow(i / 255.0, 1.0 / 2.2) * 255.0));
+		_gamma22toGamma10[i] = static_cast<uint8>(0.5 + (pow(i / 255.0, 2.2 / 1.0) * 255.0));
+		_gamma10toGamma22[i] = static_cast<uint8>(0.5 + (pow(i / 255.0, 1.0 / 2.2) * 255.0));
 	}
 
 	return surf;
diff --git a/engines/ultima/ultima8/graphics/shape.cpp b/engines/ultima/ultima8/graphics/shape.cpp
index 59b89b857d..e65bbbb616 100644
--- a/engines/ultima/ultima8/graphics/shape.cpp
+++ b/engines/ultima/ultima8/graphics/shape.cpp
@@ -150,7 +150,7 @@ Common::Array<RawShapeFrame *> Shape::loadGenericFormat(const uint8 *data, uint3
 	if (format->_bytes_ident) {
 		uint8 *ident = new uint8[format->_bytes_ident];
 		ds.read(ident, format->_bytes_ident);
-		bool match = Std::memcmp(ident, format->_ident, format->_bytes_ident) == 0;
+		bool match = memcmp(ident, format->_ident, format->_bytes_ident) == 0;
 		delete[] ident;
 
 		if (!match) {
diff --git a/engines/ultima/ultima8/misc/debugger.cpp b/engines/ultima/ultima8/misc/debugger.cpp
index c0d524c664..d9ba1e7999 100644
--- a/engines/ultima/ultima8/misc/debugger.cpp
+++ b/engines/ultima/ultima8/misc/debugger.cpp
@@ -390,7 +390,7 @@ bool Debugger::cmdMemberVar(int argc, const char **argv) {
 		else if (istr)
 			*istr = argv[2];
 		else if (i)
-			*i = Std::strtol(argv[2], 0, 0);
+			*i = strtol(argv[2], 0, 0);
 		else if (str)
 			*str = argv[2];
 
diff --git a/engines/ultima/ultima8/misc/debugger.h b/engines/ultima/ultima8/misc/debugger.h
index fe1616318a..d2e1cdb7b6 100644
--- a/engines/ultima/ultima8/misc/debugger.h
+++ b/engines/ultima/ultima8/misc/debugger.h
@@ -26,11 +26,15 @@
 #include "ultima/ultima8/misc/common_types.h"
 #include "ultima/shared/engine/debugger.h"
 #include "ultima/shared/std/containers.h"
-#include "ultima/shared/std/misc.h"
 #include "common/debug.h"
 #include "common/stream.h"
 
 namespace Ultima {
+
+namespace Std {
+enum Precision { hex = 16, dec = 10 };
+}
+
 namespace Ultima8 {
 
 class ConsoleStream : public Common::WriteStream {
diff --git a/engines/ultima/ultima8/misc/istring.h b/engines/ultima/ultima8/misc/istring.h
index 93ebf594f4..69971cbc3b 100644
--- a/engines/ultima/ultima8/misc/istring.h
+++ b/engines/ultima/ultima8/misc/istring.h
@@ -23,7 +23,6 @@
 #ifndef ULTIMA8_MISC_ISTRING_H
 #define ULTIMA8_MISC_ISTRING_H
 
-#include "ultima/shared/std/misc.h"
 #include "ultima/shared/std/string.h"
 #include "common/array.h"
 
diff --git a/engines/ultima/ultima8/misc/util.h b/engines/ultima/ultima8/misc/util.h
index f6c5ffb57f..9708026a17 100644
--- a/engines/ultima/ultima8/misc/util.h
+++ b/engines/ultima/ultima8/misc/util.h
@@ -24,7 +24,6 @@
 #define ULTIMA8_MISC_UTIL_H
 
 #include "ultima/shared/std/containers.h"
-#include "ultima/shared/std/misc.h"
 
 namespace Ultima {
 namespace Ultima8 {
diff --git a/engines/ultima/ultima8/usecode/uc_machine.cpp b/engines/ultima/ultima8/usecode/uc_machine.cpp
index cd4c90d880..155dc8510c 100644
--- a/engines/ultima/ultima8/usecode/uc_machine.cpp
+++ b/engines/ultima/ultima8/usecode/uc_machine.cpp
@@ -2241,7 +2241,7 @@ bool UCMachine::dereferencePointer(uint32 ptr, uint8 *data, uint32 size) {
 			     << "process (pid: " << segment << ")" << Std::endl;
 			return false;
 		} else {
-			Std::memcpy(data, proc->_stack.access(offset), size);
+			memcpy(data, proc->_stack.access(offset), size);
 		}
 	} else if (segment == SEG_OBJ) {
 		if (size != 2) {
diff --git a/engines/ultima/ultima8/usecode/uc_stack.h b/engines/ultima/ultima8/usecode/uc_stack.h
index d8232ff306..0b94bdbab7 100644
--- a/engines/ultima/ultima8/usecode/uc_stack.h
+++ b/engines/ultima/ultima8/usecode/uc_stack.h
@@ -24,7 +24,6 @@
 #define ULTIMA8_USECODE_UCSTACK_H
 
 #include "common/scummsys.h"
-#include "ultima/shared/std/misc.h"
 
 namespace Ultima {
 namespace Ultima8 {
@@ -87,12 +86,12 @@ public:
 	// Push an arbitrary number of bytes of 0
 	inline void push0(const uint32 count) {
 		_bufPtr -= count;
-		Std::memset(_bufPtr, 0, count);
+		memset(_bufPtr, 0, count);
 	}
 	// Push an arbitrary number of bytes
 	inline void push(const uint8 *in, const uint32 count) {
 		_bufPtr -= count;
-		Std::memcpy(_bufPtr, in, count);
+		memcpy(_bufPtr, in, count);
 	}
 
 	//
@@ -114,7 +113,7 @@ public:
 		return (b0 | (b1 << 8) | (b2 << 16) | (b3 << 24));
 	}
 	inline void pop(uint8 *out, const uint32 count) {
-		Std::memcpy(out, _bufPtr, count);
+		memcpy(out, _bufPtr, count);
 		_bufPtr += count;
 	}
 
@@ -157,7 +156,7 @@ public:
 		const_cast<uint8 *>(_buf)[offset + 3] = static_cast<uint8>((val >> 24) & 0xFF);
 	}
 	inline void assign(const uint32 offset, const uint8 *in, const uint32 len) {
-		Std::memcpy(const_cast<uint8 *>(_buf) + offset, in, len);
+		memcpy(const_cast<uint8 *>(_buf) + offset, in, len);
 	}
 };
 
diff --git a/engines/ultima/ultima8/world/actors/pathfinder.cpp b/engines/ultima/ultima8/world/actors/pathfinder.cpp
index 631b85b16a..98848f13c7 100644
--- a/engines/ultima/ultima8/world/actors/pathfinder.cpp
+++ b/engines/ultima/ultima8/world/actors/pathfinder.cpp
@@ -222,7 +222,7 @@ unsigned int Pathfinder::costHeuristic(PathNode *node) const {
 	sqrddist += (_targetY - node->state._y + _actorYd / 2) *
 	            (_targetY - node->state._y + _actorYd / 2);
 
-	unsigned int dist = static_cast<unsigned int>(Std::sqrt(sqrddist));
+	unsigned int dist = static_cast<unsigned int>(sqrt(sqrddist));
 #else
 	// This calculates the distance to the target using only lines in
 	// the 8 available directions (instead of the straight line above)
@@ -379,7 +379,7 @@ void Pathfinder::newNode(PathNode *oldnode, PathfindingState &state,
 	             (newnode->state._z - oldnode->state._z));
 
 	unsigned int dist;
-	dist = static_cast<unsigned int>(Std::sqrt(sqrddist));
+	dist = static_cast<unsigned int>(sqrt(sqrddist));
 
 	int turn = 0;
 
diff --git a/engines/ultima/ultima8/world/current_map.cpp b/engines/ultima/ultima8/world/current_map.cpp
index b3c6a3a777..fce71a36d6 100644
--- a/engines/ultima/ultima8/world/current_map.cpp
+++ b/engines/ultima/ultima8/world/current_map.cpp
@@ -47,7 +47,7 @@ static const int INT_MAX_VALUE = 0x7fffffff;
 CurrentMap::CurrentMap() : _currentMap(0), _eggHatcher(0),
 	  _fastXMin(-1), _fastYMin(-1), _fastXMax(-1), _fastYMax(-1) {
 	for (unsigned int i = 0; i < MAP_NUM_CHUNKS; i++) {
-		Std::memset(_fast[i], false, sizeof(uint32)*MAP_NUM_CHUNKS / 32);
+		memset(_fast[i], false, sizeof(uint32)*MAP_NUM_CHUNKS / 32);
 	}
 
 	if (GAME_IS_U8) {
@@ -76,7 +76,7 @@ void CurrentMap::clear() {
 				delete *iter;
 			_items[i][j].clear();
 		}
-		Std::memset(_fast[i], false, sizeof(uint32)*MAP_NUM_CHUNKS / 32);
+		memset(_fast[i], false, sizeof(uint32)*MAP_NUM_CHUNKS / 32);
 	}
 
 	_fastXMin =  _fastYMin = _fastXMax = _fastYMax = -1;
@@ -183,7 +183,7 @@ void CurrentMap::loadMap(Map *map) {
 
 	// Clear fast area
 	for (unsigned int i = 0; i < MAP_NUM_CHUNKS; i++) {
-		Std::memset(_fast[i], false, sizeof(uint32)*MAP_NUM_CHUNKS / 32);
+		memset(_fast[i], false, sizeof(uint32)*MAP_NUM_CHUNKS / 32);
 	}
 	_fastXMin = -1;
 	_fastYMin = -1;


Commit: 53c3f0d1a51438f7b3b51a9a0c8bc78476632311
    https://github.com/scummvm/scummvm/commit/53c3f0d1a51438f7b3b51a9a0c8bc78476632311
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2021-01-15T22:40:36-08:00

Commit Message:
ULTIMA8: Move the Precision enum into the ConsoleStream class

Changed paths:
    engines/ultima/ultima8/misc/debugger.h
    engines/ultima/ultima8/usecode/uc_machine.cpp
    engines/ultima/ultima8/world/actors/actor.cpp
    engines/ultima/ultima8/world/item.cpp
    engines/ultima/ultima8/world/map.cpp


diff --git a/engines/ultima/ultima8/misc/debugger.h b/engines/ultima/ultima8/misc/debugger.h
index d2e1cdb7b6..e7c9215b73 100644
--- a/engines/ultima/ultima8/misc/debugger.h
+++ b/engines/ultima/ultima8/misc/debugger.h
@@ -30,18 +30,15 @@
 #include "common/stream.h"
 
 namespace Ultima {
-
-namespace Std {
-enum Precision { hex = 16, dec = 10 };
-}
-
 namespace Ultima8 {
 
 class ConsoleStream : public Common::WriteStream {
+public:
+	enum Precision { hex = 16, dec = 10 };
 private:
-	Std::Precision _precision;
+	Precision _precision;
 public:
-	ConsoleStream() : Common::WriteStream(), _precision(Std::dec) {
+	ConsoleStream() : Common::WriteStream(), _precision(dec) {
 	}
 
 	int32 pos() const override {
@@ -73,14 +70,14 @@ public:
 		return *this;
 	}
 
-	ConsoleStream &operator<<(Std::Precision p) {
+	ConsoleStream &operator<<(Precision p) {
 		_precision = p;
 		return *this;
 	}
 
 	ConsoleStream &operator<<(int val) {
 		Common::String str = Common::String::format(
-			(_precision == Std::hex) ? "%x" : "%d", val);
+			(_precision == hex) ? "%x" : "%d", val);
 		write(str.c_str(), str.size());
 		return *this;
 	}
diff --git a/engines/ultima/ultima8/usecode/uc_machine.cpp b/engines/ultima/ultima8/usecode/uc_machine.cpp
index 155dc8510c..72ee04c821 100644
--- a/engines/ultima/ultima8/usecode/uc_machine.cpp
+++ b/engines/ultima/ultima8/usecode/uc_machine.cpp
@@ -162,10 +162,10 @@ void UCMachine::execProcess(UCProcess *p) {
 
 #ifdef DEBUG
 	if (trace_show(p->_pid, p->_itemNum, p->_classId)) {
-		pout << Std::hex << "running process " << p->_pid
+		pout << ConsoleStream::hex << "running process " << p->_pid
 		     << ", item " << p->_itemNum << ", type " << p->_type
 		     << ", class " << p->_classId << ", offset " << p->_ip
-		     << Std::dec << Std::endl;
+		     << ConsoleStream::dec << Std::endl;
 	}
 #endif
 
@@ -398,7 +398,7 @@ void UCMachine::execProcess(UCProcess *p) {
 				//!! hackish
 				if (_intrinsics[func] == UCMachine::I_dummyProcess ||
 				        _intrinsics[func] == UCMachine::I_true) {
-//						perr << "Unhandled intrinsic \'" << _convUse->_intrinsics()[func] << "\' (" << Std::hex << func << Std::dec << ") called" << Std::endl;
+//						perr << "Unhandled intrinsic \'" << _convUse->_intrinsics()[func] << "\' (" << ConsoleStream::hex << func << ConsoleStream::dec << ") called" << Std::endl;
 				}
 				uint8 *argbuf = new uint8[arg_bytes];
 				p->_stack.pop(argbuf, arg_bytes);
@@ -1237,7 +1237,7 @@ void UCMachine::execProcess(UCProcess *p) {
 			_globals->setEntries(ui16a, ui16b, ui32a);
 
 			if ((GAME_IS_U8 && (ui32a & ~(((1 << ui16b) - 1)))) || ui16b > 2) {
-				perr << "Warning: value popped into a flag it doesn't fit in (" << Std::hex
+				perr << "Warning: value popped into a flag it doesn't fit in (" << ConsoleStream::hex
 					 << ui16a << " " << ui16b << " " << ui32a << ")" << Std::endl;
 			}
 
@@ -1397,10 +1397,10 @@ void UCMachine::execProcess(UCProcess *p) {
 
 #ifdef DEBUG
 			if (trace_show(p->_pid, p->_itemNum, p->_classId)) {
-				pout << Std::hex << "(still) running process " << p->_pid
+				pout << ConsoleStream::hex << "(still) running process " << p->_pid
 				     << ", item " << p->_itemNum << ", type " << p->_type
 				     << ", class " << p->_classId << ", offset " << p->_ip
-				     << Std::dec << Std::endl;
+				     << ConsoleStream::dec << Std::endl;
 			}
 #endif
 			break;
@@ -1431,9 +1431,9 @@ void UCMachine::execProcess(UCProcess *p) {
 
 #ifdef DEBUG
 			if (trace_show(p->_pid, p->_itemNum, p->_classId)) {
-				pout << Std::hex << "(still) running process " << p->_pid
+				pout << ConsoleStream::hex << "(still) running process " << p->_pid
 				     << ", item " << p->_itemNum << ", class " << p->_classId
-				     << ", offset " << p->_ip << Std::dec << Std::endl;
+				     << ", offset " << p->_ip << ConsoleStream::dec << Std::endl;
 			}
 #endif
 			p->_stack.push2(newpid); //! push pid of new proc
@@ -2209,8 +2209,8 @@ bool UCMachine::assignPointer(uint32 ptr, const uint8 *data, uint32 size) {
 			CANT_HAPPEN_MSG("Global pointers must be size 1 or 2");
 		}
 	} else {
-		perr << "Trying to access segment " << Std::hex
-		     << segment << Std::dec << Std::endl;
+		perr << "Trying to access segment " << ConsoleStream::hex
+		     << segment << ConsoleStream::dec << Std::endl;
 		return false;
 	}
 
@@ -2267,8 +2267,8 @@ bool UCMachine::dereferencePointer(uint32 ptr, uint8 *data, uint32 size) {
 			CANT_HAPPEN_MSG("Global pointers must be size 1 or 2");
 		}
 	} else {
-		perr << "Trying to access segment " << Std::hex
-		     << segment << Std::dec << Std::endl;
+		perr << "Trying to access segment " << ConsoleStream::hex
+		     << segment << ConsoleStream::dec << Std::endl;
 		return false;
 	}
 	return true;
@@ -2303,8 +2303,8 @@ uint16 UCMachine::ptrToObject(uint32 ptr) {
 	} else if (segment == SEG_GLOBAL) {
 		return get_instance()->_globals->getEntries(offset, 2);
 	} else {
-		perr << "Trying to access segment " << Std::hex
-		     << segment << Std::dec << Std::endl;
+		perr << "Trying to access segment " << ConsoleStream::hex
+		     << segment << ConsoleStream::dec << Std::endl;
 		return 0;
 	}
 }
diff --git a/engines/ultima/ultima8/world/actors/actor.cpp b/engines/ultima/ultima8/world/actors/actor.cpp
index 4c3507b078..44f1b2a45c 100644
--- a/engines/ultima/ultima8/world/actors/actor.cpp
+++ b/engines/ultima/ultima8/world/actors/actor.cpp
@@ -1000,8 +1000,8 @@ void Actor::receiveHitU8(uint16 other, Direction dir, int damage, uint16 damage_
 	}
 
 	pout << "Actor " << getObjId() << " received hit from " << other
-	     << " (dmg=" << damage << ",type=" << Std::hex << damage_type
-	     << Std::dec << "). ";
+	     << " (dmg=" << damage << ",type=" << ConsoleStream::hex << damage_type
+	     << ConsoleStream::dec << "). ";
 
 	damage = calculateAttackDamage(other, damage, damage_type);
 
@@ -1565,10 +1565,10 @@ void Actor::dumpInfo() const {
 
 	pout << "hp: " << _hitPoints << ", mp: " << _mana << ", str: " << _strength
 	     << ", dex: " << _dexterity << ", int: " << _intelligence
-	     << ", ac: " << getArmourClass() << ", defense: " << Std::hex
+	     << ", ac: " << getArmourClass() << ", defense: " << ConsoleStream::hex
 	     << getDefenseType() << " align: " << getAlignment() << " enemy: "
 	     << getEnemyAlignment() << ", flags: " << _actorFlags
-	     << Std::dec << Std::endl;
+	     << ConsoleStream::dec << Std::endl;
 }
 
 void Actor::saveData(Common::WriteStream *ws) {
diff --git a/engines/ultima/ultima8/world/item.cpp b/engines/ultima/ultima8/world/item.cpp
index 8b2d0c6854..c26b479942 100644
--- a/engines/ultima/ultima8/world/item.cpp
+++ b/engines/ultima/ultima8/world/item.cpp
@@ -101,7 +101,7 @@ void Item::dumpInfo() const {
 
 	pout << ") q:" << getQuality()
 	     << ", m:" << getMapNum() << ", n:" << getNpcNum()
-	     << ", f:0x" << Std::hex << getFlags() << ", ef:0x"
+	     << ", f:0x" << ConsoleStream::hex << getFlags() << ", ef:0x"
 		 << getExtFlags();
 
 	const ShapeInfo *info = getShapeInfo();
@@ -110,7 +110,7 @@ void Item::dumpInfo() const {
 			 << info->_family << ", et:" << info->_equipType;
 	}
 
-	pout << ")" << Std::dec << Std::endl;
+	pout << ")" << ConsoleStream::dec << Std::endl;
 }
 
 Container *Item::getParentAsContainer() const {
diff --git a/engines/ultima/ultima8/world/map.cpp b/engines/ultima/ultima8/world/map.cpp
index 5bee3f9e6b..467ca3b040 100644
--- a/engines/ultima/ultima8/world/map.cpp
+++ b/engines/ultima/ultima8/world/map.cpp
@@ -239,13 +239,13 @@ void Map::loadFixedFormatObjects(Std::list<Item *> &itemlist,
 		}
 
 #ifdef DUMP_ITEMS
-		pout << shape << "," << frame << ":\t(" << x << "," << y << "," << z << "),\t" << Std::hex << flags << Std::dec << ", " << quality << ", " << npcNum << ", " << mapNum << ", " << next << Std::endl;
+		pout << shape << "," << frame << ":\t(" << x << "," << y << "," << z << "),\t" << ConsoleStream::hex << flags << ConsoleStream::dec << ", " << quality << ", " << npcNum << ", " << mapNum << ", " << next << Std::endl;
 #endif
 
 		Item *item = ItemFactory::createItem(shape, frame, quality, flags, npcNum,
 		                                     mapNum, extendedflags, false);
 		if (!item) {
-			pout << shape << "," << frame << ":\t(" << x << "," << y << "," << z << "),\t" << Std::hex << flags << Std::dec << ", " << quality << ", " << npcNum << ", " << mapNum << ", " << next;
+			pout << shape << "," << frame << ":\t(" << x << "," << y << "," << z << "),\t" << ConsoleStream::hex << flags << ConsoleStream::dec << ", " << quality << ", " << npcNum << ", " << mapNum << ", " << next;
 
 			const ShapeInfo *info = GameData::get_instance()->getMainShapes()->
 			                  getShapeInfo(shape);




More information about the Scummvm-git-logs mailing list