patch-x11_ui_cpp 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. $OpenBSD: patch-x11_ui_cpp,v 1.2 2010/06/15 19:04:05 landry Exp $
  2. --- x11/ui.cpp.orig Wed Mar 19 10:05:38 2003
  3. +++ x11/ui.cpp Tue Jun 15 20:52:51 2010
  4. @@ -40,9 +40,11 @@ extern "C" {
  5. #include <X11/Xatom.h>
  6. }
  7. -#include <iostream.h>
  8. -#include <strstream.h>
  9. +#include <iostream>
  10. +#include <strstream>
  11. +using namespace std;
  12. +
  13. #include "coord.h"
  14. #include "area.h"
  15. #include "xdata.h"
  16. @@ -930,7 +932,7 @@ void Ui::menu_enemies_refill_CB(void* value,Viewport*,
  17. UiP ui = (UiP)closure;
  18. ui->settingsChanges |= UIenemiesRefill;
  19. // SGI compiler says you can't cast void* to Boolean.
  20. - Boolean val = (Boolean)(int)value;
  21. + Boolean val = (Boolean)(intptr_t)value;
  22. ui->settings.enemiesRefill = val;
  23. }
  24. @@ -939,7 +941,7 @@ void Ui::menu_enemies_refill_CB(void* value,Viewport*,
  25. void Ui::menu_controls_CB(void* value,Viewport* vPort,void* closure) {
  26. UiP ui = (UiP)closure;
  27. int dpyNum = vPort->get_dpy_num();
  28. - Boolean val = (Boolean)(int)value;
  29. + Boolean val = (Boolean)(intptr_t)value;
  30. if (val) {
  31. XMapWindow(ui->xvars.dpy[dpyNum],ui->xdata.controls[dpyNum]);
  32. }
  33. @@ -955,7 +957,7 @@ void Ui::menu_learn_controls_CB(void* value,
  34. Viewport* vPort,void* closure) {
  35. UiP ui = (UiP)closure;
  36. int dpyNum = vPort->get_dpy_num();
  37. - Boolean active = (Boolean)(int)value;
  38. + Boolean active = (Boolean)(intptr_t)value;
  39. if (active) {
  40. ui->lControls[dpyNum].input = ui->lControls[dpyNum].key =
  41. @@ -994,7 +996,7 @@ void Ui::menu_learn_controls_CB(void* value,
  42. void Ui::menu_scenarios_CB(void* value,Viewport*,void* closure) {
  43. UiP ui = (UiP)closure;
  44. - Boolean val = (Boolean)(int)value;
  45. + Boolean val = (Boolean)(intptr_t)value;
  46. if (val) {
  47. ui->settingsChanges |= UIstyle;
  48. ui->settings.style = SCENARIOS;
  49. @@ -1005,7 +1007,7 @@ void Ui::menu_scenarios_CB(void* value,Viewport*,void*
  50. void Ui::menu_levels_CB(void* value,Viewport*,void* closure) {
  51. UiP ui = (UiP)closure;
  52. - Boolean val = (Boolean)(int)value;
  53. + Boolean val = (Boolean)(intptr_t)value;
  54. if (val) {
  55. ui->settingsChanges |= UIstyle;
  56. ui->settings.style = LEVELS;
  57. @@ -1016,7 +1018,7 @@ void Ui::menu_levels_CB(void* value,Viewport*,void* cl
  58. void Ui::menu_kill_CB(void* value,Viewport*,void* closure) {
  59. UiP ui = (UiP)closure;
  60. - Boolean val = (Boolean)(int)value;
  61. + Boolean val = (Boolean)(intptr_t)value;
  62. if (val) {
  63. ui->settingsChanges |= UIstyle;
  64. ui->settings.style = KILL;
  65. @@ -1027,7 +1029,7 @@ void Ui::menu_kill_CB(void* value,Viewport*,void* clos
  66. void Ui::menu_duel_CB(void* value,Viewport*,void* closure) {
  67. UiP ui = (UiP)closure;
  68. - Boolean val = (Boolean)(int)value;
  69. + Boolean val = (Boolean)(intptr_t)value;
  70. if (val) {
  71. ui->settingsChanges |= UIstyle;
  72. ui->settings.style = DUEL;
  73. @@ -1038,7 +1040,7 @@ void Ui::menu_duel_CB(void* value,Viewport*,void* clos
  74. void Ui::menu_extended_CB(void* value,Viewport*,void* closure) {
  75. UiP ui = (UiP)closure;
  76. - Boolean val = (Boolean)(int)value;
  77. + Boolean val = (Boolean)(intptr_t)value;
  78. if (val) {
  79. ui->settingsChanges |= UIstyle;
  80. ui->settings.style = EXTENDED;
  81. @@ -1049,7 +1051,7 @@ void Ui::menu_extended_CB(void* value,Viewport*,void*
  82. void Ui::menu_training_CB(void* value,Viewport*,void* closure) {
  83. UiP ui = (UiP)closure;
  84. - Boolean val = (Boolean)(int)value;
  85. + Boolean val = (Boolean)(intptr_t)value;
  86. if (val) {
  87. ui->settingsChanges |= UIstyle;
  88. ui->settings.style = TRAINING;
  89. @@ -1070,7 +1072,7 @@ void Ui::menu_quanta_CB(void* value,Viewport*,void* cl
  90. void Ui::menu_cooperative_CB(void* value,Viewport*,void* closure) {
  91. UiP ui = (UiP)closure;
  92. ui->settingsChanges |= UIcooperative;
  93. - Boolean val = (Boolean)(int)value;
  94. + Boolean val = (Boolean)(intptr_t)value;
  95. ui->settings.cooperative = val;
  96. }
  97. @@ -1079,7 +1081,7 @@ void Ui::menu_cooperative_CB(void* value,Viewport*,voi
  98. void Ui::menu_help_CB(void* value,Viewport* vPort,void* closure) {
  99. UiP ui = (UiP)closure;
  100. int dpyNum = vPort->get_dpy_num();
  101. - Boolean active = (Boolean)(int)value;
  102. + Boolean active = (Boolean)(intptr_t)value;
  103. if (active) {
  104. XMapWindow(ui->xvars.dpy[dpyNum],ui->xdata.help[dpyNum]);
  105. @@ -1094,7 +1096,7 @@ void Ui::menu_help_CB(void* value,Viewport* vPort,void
  106. void Ui::status_weapon_CB(void* value,Viewport* vPort,void*) {
  107. // Some mouse controls.
  108. // UiP ui = (UiP)closure;
  109. - int button = (int)value;
  110. + intptr_t button = (intptr_t)value;
  111. switch (button) {
  112. case Button1:
  113. @@ -1113,7 +1115,7 @@ void Ui::status_weapon_CB(void* value,Viewport* vPort,
  114. void Ui::status_item_CB(void* value,Viewport* vPort,void*) {
  115. // UiP ui = (UiP)closure;
  116. - int button = (int)value;
  117. + intptr_t button = (intptr_t)value;
  118. switch (button) {
  119. case Button1: