diff options
author | Edwin Groothuis <edwin@FreeBSD.org> | 2002-10-26 14:05:11 +0000 |
---|---|---|
committer | Edwin Groothuis <edwin@FreeBSD.org> | 2002-10-26 14:05:11 +0000 |
commit | f8f04af8cae40a244ede4a3db744dee28c32a02a (patch) | |
tree | d7972e07690f0808e673c29177a612a5d2f62b58 /games/znibbles/files/patch-src::Map.C | |
parent | Correct RUN_DEPENDS. (diff) |
Makes games/znibbles compiling again with gcc 3.2.1.
The patch has become somebody bigger than I was hoping for. And
the original author is MIA...
Approved by: Yin-Jieh Chen <yinjieh@csie.nctu.edu.tw> (maintainer)
Notes
Notes:
svn path=/head/; revision=68869
Diffstat (limited to 'games/znibbles/files/patch-src::Map.C')
-rw-r--r-- | games/znibbles/files/patch-src::Map.C | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/games/znibbles/files/patch-src::Map.C b/games/znibbles/files/patch-src::Map.C new file mode 100644 index 000000000000..365e115f01b7 --- /dev/null +++ b/games/znibbles/files/patch-src::Map.C @@ -0,0 +1,89 @@ +--- src/Map.C Mon May 10 13:39:48 1999 ++++ src/Map.C Sat Oct 26 00:40:04 2002 +@@ -32,7 +32,7 @@ + #endif + + #include <stdio.h> +-#include <iostream.h> ++#include <iostream> + #include <string.h> + + #include "Map.H" +@@ -61,7 +61,7 @@ + + // @@ do something appropriate here + if (_types == NULL) +- cerr << "Map::make(): malloc failed. Everything should crash." << endl; ++ std::cerr << "Map::make(): malloc failed. Everything should crash." << std::endl; + + clear(); + } +@@ -112,39 +112,39 @@ + // Text based display of this map (debug purposes) + void Map::display() + { +- cout << endl; ++ std::cout << std::endl; + + for (int i = 0; i < _y; i++) { + for (int j = 0; j < _x; j++) +- cout << _map[i][j] << " "; +- cout << endl; ++ std::cout << _map[i][j] << " "; ++ std::cout << std::endl; + } + } + + // Text based display of the types in the map (debug purposes) + void Map::display_t() + { +- cout << endl; ++ std::cout << std::endl; + + for (int i = 0; i < _y; i++) { + for (int j = 0; j < _x; j++) { +- cout << "? " ; +- // cout << _maptype[i][j].length() << " "; ++ std::cout << "? " ; ++ // std::cout << _maptype[i][j].length() << " "; + } +- cout << endl; ++ std::cout << std::endl; + } + } + + void Map::add_type(int x, int y, _Object& obj) + { + if (_types_index >= _types_size - 1) { +-// cout << "Map::add_type(): realloc()" << endl; ++// std::cout << "Map::add_type(): realloc()" << std::endl; + // resize type array + _types_size += 200; // @@ computation has to be done correctly + _types = (MapType *) realloc(_types, _types_size * sizeof(MapType)); + // @@ Do something in case of error ! + if (_types == NULL) +- cerr << "Map::add_type: realloc failed. Everything should crash." << endl; ++ std::cerr << "Map::add_type: realloc failed. Everything should crash." << std::endl; + } + + _types[_types_index].object = &obj; +@@ -170,15 +170,15 @@ + MapType * mt = get_type(x, y); + + if (mt == NULL) +- cout << "<empty>"; ++ std::cout << "<empty>"; + else { +- cout << "<" << mt->object; ++ std::cout << "<" << mt->object; + mt = mt->next; + while (mt != NULL) { +- cout << "," << mt->object; ++ std::cout << "," << mt->object; + mt = mt->next; + } +- cout << ">"; ++ std::cout << ">"; + } + + } |