xfreecell-1.0.5b-gentoo.patch 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. diff -ru xfreecellg/card.cpp xfreecell/card.cpp
  2. --- xfreecellg/card.cpp 1999-03-27 05:36:28.000000000 -0800
  3. +++ xfreecell/card.cpp 2004-02-25 02:17:24.000000000 -0800
  4. @@ -119,7 +119,7 @@
  5. int oldy = y();
  6. int newx = dest_x;
  7. int newy = dest_y;
  8. - int steps = max(abs(oldx - newx), abs(oldy - newy)) / Option::speedup();
  9. + int steps = std::max(abs(oldx - newx), abs(oldy - newy)) / Option::speedup();
  10. float curx = (float) oldx;
  11. float cury = (float) oldy;
  12. diff -ru xfreecellg/freecell.cpp xfreecell/freecell.cpp
  13. --- xfreecellg/freecell.cpp 1999-07-27 07:15:27.000000000 -0700
  14. +++ xfreecell/freecell.cpp 2004-02-25 02:18:13.000000000 -0800
  15. @@ -64,7 +64,7 @@
  16. static GameNumberManager* gnManager;
  17. static const int PathLength = 256;
  18. static char msNumbersPath[PathLength] = "\0";;
  19. -static const char defaultMSNumbersPath[] = "/usr/local/lib/xfreecell/MSNumbers";
  20. +static const char defaultMSNumbersPath[] = "/usr/share/games/xfreecell/MSNumbers";
  21. // ##### Functions declarations #####
  22. static void adjustSubwindow(NSWindow*);
  23. @@ -603,7 +603,7 @@
  24. void readMSNumbersPath()
  25. {
  26. char* home = getenv("HOME");
  27. - string saveFile;
  28. + std::string saveFile;
  29. if (home == NULL) {
  30. fprintf(stderr, "Cannot get $HOME. Assuming I am at home directory now.\n");
  31. diff -ru xfreecellg/gnmanager.cpp xfreecell/gnmanager.cpp
  32. --- xfreecellg/gnmanager.cpp 1999-07-27 07:18:05.000000000 -0700
  33. +++ xfreecell/gnmanager.cpp 2004-02-25 02:17:24.000000000 -0800
  34. @@ -16,7 +16,7 @@
  35. GameNumberManager::GameNumberManager()
  36. {
  37. char* home = getenv("HOME");
  38. - string directory;
  39. + std::string directory;
  40. if (home == NULL) {
  41. fprintf(stderr, "Cannot get $HOME. Assuming I am at home directory now.\n");
  42. @@ -143,7 +143,7 @@
  43. readFile(msLostGameFile, &msLostGames);
  44. }
  45. -void GameNumberManager::readFile(const string& file, hash_set<int>* hs)
  46. +void GameNumberManager::readFile(const std::string& file, hash_set<int>* hs)
  47. {
  48. FILE* fp = fopen(file.c_str(), "r");
  49. char line[lineLength];
  50. @@ -169,7 +169,7 @@
  51. writeFile(msLostGameFile, &msLostGames);
  52. }
  53. -void GameNumberManager::writeFile(const string& file, hash_set<int>* hs)
  54. +void GameNumberManager::writeFile(const std::string& file, hash_set<int>* hs)
  55. {
  56. FILE* fp = fopen(file.c_str(), "w+");
  57. diff -ru xfreecellg/gnmanager.h xfreecell/gnmanager.h
  58. --- xfreecellg/gnmanager.h 1999-03-29 05:07:19.000000000 -0800
  59. +++ xfreecell/gnmanager.h 2004-02-25 02:17:24.000000000 -0800
  60. @@ -2,7 +2,13 @@
  61. #define GNManager_H
  62. #include <string>
  63. +
  64. +#if __GNUG__ < 3
  65. #include <hash_set>
  66. +#else
  67. +#include <ext/hash_set>
  68. +using __gnu_cxx::hash_set;
  69. +#endif
  70. class GameNumberManager {
  71. public:
  72. @@ -20,15 +26,15 @@
  73. bool alreadyLost(int);
  74. void readFiles();
  75. - void readFile(const string&, hash_set<int>*);
  76. - void writeFile(const string&, hash_set<int>*);
  77. + void readFile(const std::string&, hash_set<int>*);
  78. + void writeFile(const std::string&, hash_set<int>*);
  79. - string lostGameFile, wonGameFile;
  80. + std::string lostGameFile, wonGameFile;
  81. hash_set<int> wonGames;
  82. hash_set<int> lostGames;
  83. - string msLostGameFile, msWonGameFile;
  84. + std::string msLostGameFile, msWonGameFile;
  85. hash_set<int> msWonGames;
  86. hash_set<int> msLostGames;
  87. diff -ru xfreecellg/makefile xfreecell/makefile
  88. --- xfreecellg/makefile 1999-04-03 05:42:49.000000000 -0800
  89. +++ xfreecell/makefile 2004-02-25 02:17:48.000000000 -0800
  90. @@ -1,16 +1,15 @@
  91. OBJECTS=card.o freecell.o option.o stack.o subwindows.o undo.o util.o gnmanager.o random.o
  92. -CC=g++
  93. -CFLAGS=-g -Wall -DSHAPE -DBOGUSRANDOM
  94. +CFLAGS=$(CXXFLAGS) -DSHAPE -DBOGUSRANDOM
  95. LIBS=-lm -L. -lns -L/usr/X11R6/lib -lXext -lX11
  96. STATICDIR=xfreecell-static
  97. DOCS=README CHANGES mshuffle.txt xfreecell.6
  98. LIBDIR=/usr/local/lib/xfreecell
  99. all: $(OBJECTS) lib
  100. - $(CC) -o xfreecell $(CFLAGS) $(OBJECTS) $(LIBS)
  101. + $(CXX) -o xfreecell $(LDFLAGS) $(OBJECTS) $(LIBS)
  102. static: $(OBJECTS) lib
  103. - $(CC) -o xfreecell -static $(CFLAGS) $(OBJECTS) $(LIBS)
  104. + $(CXX) -o xfreecell -static $(CFLAGS) $(OBJECTS) $(LIBS)
  105. static-release: static
  106. mkdir $(STATICDIR)
  107. @@ -21,17 +20,17 @@
  108. rm -rf $(STATICDIR)
  109. %.o: %.cpp
  110. - $(CC) -c $(CFLAGS) $<
  111. + $(CXX) -c $(CFLAGS) $<
  112. clean:
  113. rm -f *~ *.o a.out xfreecell libns.a
  114. - make -C widget clean
  115. + $(MAKE) -C widget clean
  116. lib:
  117. - make -C widget lib
  118. + $(MAKE) -C widget lib
  119. install: all
  120. - install xfreecell $(DESTDIR)/usr/local/bin
  121. - install xfreecell.6 $(DESTDIR)/usr/local/man/man6
  122. + install xfreecell $(DESTDIR)/usr/bin
  123. + install xfreecell.6 $(DESTDIR)/usr/share/man/man6
  124. # install -d $(LIBDIR)
  125. -# install ms-compatible/MSNumbers $(DESTDIR)/usr/local/lib/xfreecell
  126. \ No newline at end of file
  127. +# install ms-compatible/MSNumbers $(DESTDIR)/usr/share/xfreecell
  128. diff -ru xfreecellg/option.h xfreecell/option.h
  129. --- xfreecellg/option.h 1999-03-27 11:39:17.000000000 -0800
  130. +++ xfreecell/option.h 2004-02-25 02:17:24.000000000 -0800
  131. @@ -22,7 +22,7 @@
  132. void readPrefs();
  133. void writePrefs();
  134. - string saveFile;
  135. + std::string saveFile;
  136. static int _speedup;
  137. static bool _queryWindow;
  138. diff -ru xfreecellg/stack.h xfreecell/stack.h
  139. --- xfreecellg/stack.h 1999-03-02 10:20:02.000000000 -0800
  140. +++ xfreecell/stack.h 2004-02-25 02:17:24.000000000 -0800
  141. @@ -28,7 +28,7 @@
  142. int _next_x, _next_y;
  143. private:
  144. - vector<Card*> _cards;
  145. + std::vector<Card*> _cards;
  146. };
  147. class PlayStack : public Stack {
  148. diff -ru xfreecellg/subwindows.h xfreecell/subwindows.h
  149. --- xfreecellg/subwindows.h 1999-03-15 15:09:49.000000000 -0800
  150. +++ xfreecell/subwindows.h 2004-02-25 02:17:24.000000000 -0800
  151. @@ -76,7 +76,7 @@
  152. int _undos;
  153. int _totalScore;
  154. - string saveFile;
  155. + std::string saveFile;
  156. bool exitPressed;
  157. diff -ru xfreecellg/undo.cpp xfreecell/undo.cpp
  158. --- xfreecellg/undo.cpp 1999-03-25 07:48:40.000000000 -0800
  159. +++ xfreecell/undo.cpp 2004-02-25 02:17:24.000000000 -0800
  160. @@ -22,7 +22,7 @@
  161. c->moveToStack(from, false, false);
  162. }
  163. -stack<Move> moves;
  164. +std::stack<Move> moves;
  165. void undoClearMoves()
  166. {
  167. diff -ru xfreecellg/widget/container.cpp xfreecell/widget/container.cpp
  168. --- xfreecellg/widget/container.cpp 1999-03-03 09:34:52.000000000 -0800
  169. +++ xfreecell/widget/container.cpp 2004-02-25 02:17:24.000000000 -0800
  170. @@ -61,18 +61,18 @@
  171. void NSContainer::remove(NSComponent* nsc)
  172. {
  173. - vector<NSComponent*>::iterator iter;
  174. + std::vector<NSComponent*>::iterator iter;
  175. for (iter = nscVec.begin(); iter != nscVec.end(); iter++)
  176. if (*iter == nsc) nscVec.erase(iter);
  177. }
  178. void NSContainer::hremove(NSComponent* nsc)
  179. {
  180. - vector<NSComponent*>::iterator iter;
  181. + std::vector<NSComponent*>::iterator iter;
  182. for (iter = nscVec.begin(); iter != nscVec.end(); iter++) {
  183. if (*iter == nsc) {
  184. int w = (*iter)->width() + _neighborGap;
  185. - vector<NSComponent*>::iterator iter2 = iter + 1;
  186. + std::vector<NSComponent*>::iterator iter2 = iter + 1;
  187. if (nscVec.size() == 0) {
  188. _width = 0; _height = 0;
  189. } else {
  190. @@ -87,11 +87,11 @@
  191. void NSContainer::vremove(NSComponent* nsc)
  192. {
  193. - vector<NSComponent*>::iterator iter;
  194. + std::vector<NSComponent*>::iterator iter;
  195. for (iter = nscVec.begin(); iter != nscVec.end(); iter++) {
  196. if (*iter == nsc) {
  197. int h = (*iter)->height() + _neighborGap;
  198. - vector<NSComponent*>::iterator iter2 = iter + 1;
  199. + std::vector<NSComponent*>::iterator iter2 = iter + 1;
  200. if (nscVec.size() == 0) {
  201. _width = 0; _height = 0;
  202. } else {
  203. diff -ru xfreecellg/widget/makefile xfreecell/widget/makefile
  204. --- xfreecellg/widget/makefile 1999-03-17 21:54:57.000000000 -0800
  205. +++ xfreecell/widget/makefile 2004-02-25 02:17:59.000000000 -0800
  206. @@ -1,15 +1,13 @@
  207. OBJECTS=window.o plate.o string.o button.o label.o textfield.o container.o frame.o util.o scrollbar.o font.o main.o
  208. -#C=/usr/local/gcc-2.8.1/bin/g++
  209. -CC=g++
  210. -CFLAGS=-g -Wall
  211. +CFLAGS=$(CXXFLAGS) -Wall
  212. LIBS=-L/usr/X11R6/lib -lX11
  213. LIBNAME=libns.a
  214. all: test.o $(OBJECTS)
  215. - $(CC) $(CFLAGS) test.o $(OBJECTS) $(LIBS)
  216. + $(CXX) $(CFLAGS) test.o $(OBJECTS) $(LIBS)
  217. %.o: %.cpp
  218. - $(CC) $(CFLAGS) -c $<
  219. + $(CXX) $(CFLAGS) -c $<
  220. clean:
  221. rm -f *.o *~ a.out .nfs* dummy
  222. diff -ru xfreecellg/widget/textfield.cpp xfreecell/widget/textfield.cpp
  223. --- xfreecellg/widget/textfield.cpp 1999-03-03 09:34:52.000000000 -0800
  224. +++ xfreecell/widget/textfield.cpp 2004-02-25 02:17:24.000000000 -0800
  225. @@ -1,3 +1,4 @@
  226. +#include <cctype>
  227. #include "widget.h"
  228. GC NSTextField::gc;
  229. diff -ru xfreecellg/widget/widget.h xfreecell/widget/widget.h
  230. --- xfreecellg/widget/widget.h 1999-03-15 08:29:32.000000000 -0800
  231. +++ xfreecell/widget/widget.h 2004-02-25 02:17:24.000000000 -0800
  232. @@ -114,7 +114,7 @@
  233. Elt(NSWindow* nw, Window w) { nswindow = nw; window = w; }
  234. };
  235. - static vector<Elt> eltVector;
  236. + static std::vector<Elt> eltVector;
  237. static void eraseWindow(Window);
  238. static void registerWindow(NSWindow*, Window);
  239. };
  240. @@ -171,7 +171,7 @@
  241. void fontWindowHeight(unsigned int);
  242. void resizable(bool arg) { _resizable = arg; }
  243. - string _label;
  244. + std::string _label;
  245. private:
  246. static const int fontGap = 4;
  247. static XFontStruct* fontStruct;
  248. @@ -272,7 +272,7 @@
  249. static unsigned int charWidth, charHeight;
  250. unsigned int maxCharNum;
  251. - string _str;
  252. + std::string _str;
  253. unsigned int cursorPos;
  254. unsigned int strStart;
  255. bool cursorOnTF;
  256. @@ -327,7 +327,7 @@
  257. unsigned int _vGap, _hGap, _neighborGap;
  258. Window _parentWindow;
  259. - vector<NSComponent*> nscVec;
  260. + std::vector<NSComponent*> nscVec;
  261. };
  262. // ##### NSHContainer #####
  263. diff -ru xfreecellg/widget/window.cpp xfreecell/widget/window.cpp
  264. --- xfreecellg/widget/window.cpp 1999-03-03 09:34:52.000000000 -0800
  265. +++ xfreecell/widget/window.cpp 2004-02-25 02:17:24.000000000 -0800
  266. @@ -2,7 +2,7 @@
  267. bool NSWindow::windowInitialized = false;
  268. Window NSWindow::_root;
  269. -vector<NSWindow::Elt> NSWindow::eltVector;
  270. +std::vector<NSWindow::Elt> NSWindow::eltVector;
  271. NSWindow::NSWindow(bool create, Window w, int x, int y, unsigned int width, unsigned int height,
  272. unsigned int borderWidth, unsigned long border, unsigned long bg)
  273. @@ -86,8 +86,8 @@
  274. void NSWindow::registerWindow(NSWindow* nsw, Window w)
  275. {
  276. - vector<Elt>::iterator begin = eltVector.begin();
  277. - vector<Elt>::iterator end = eltVector.end();
  278. + std::vector<Elt>::iterator begin = eltVector.begin();
  279. + std::vector<Elt>::iterator end = eltVector.end();
  280. Elt elt(nsw, w);
  281. if (eltVector.size() == 0 || w > eltVector.back().window) {
  282. @@ -95,7 +95,7 @@
  283. return;
  284. }
  285. - for (vector<Elt>::iterator iter = begin; iter != end; iter++)
  286. + for (std::vector<Elt>::iterator iter = begin; iter != end; iter++)
  287. if ((*iter).window > w)
  288. eltVector.insert(iter, elt);
  289. @@ -104,9 +104,9 @@
  290. void NSWindow::eraseWindow(Window w)
  291. {
  292. - vector<Elt>::iterator begin = eltVector.begin();
  293. - vector<Elt>::iterator end = eltVector.end();
  294. - vector<Elt>::iterator iter;
  295. + std::vector<Elt>::iterator begin = eltVector.begin();
  296. + std::vector<Elt>::iterator end = eltVector.end();
  297. + std::vector<Elt>::iterator iter;
  298. for (iter = begin; iter != end; iter++) {
  299. if ((*iter).window == w) eltVector.erase(iter);