aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorakir <akir>2004-10-21 10:03:43 (GMT)
committerakir <akir>2004-10-21 10:03:43 (GMT)
commitb7190ee2e57c7e0fe78473275d9b94397fa1ddee (patch)
treeef1837de4e8a359642c6b2567aa7bece8f3d74ec /src
parente53e1b3b23f10a72f789dbe3bb7f1d4c5f391e9a (diff)
downloadfluxbox-b7190ee2e57c7e0fe78473275d9b94397fa1ddee.zip
fluxbox-b7190ee2e57c7e0fe78473275d9b94397fa1ddee.tar.bz2
fix for mipspro: no 'new(nothrow)' available for MIPSpro Compilers: Version 7.3.1.3m
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/TextureRender.cc34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/FbTk/TextureRender.cc b/src/FbTk/TextureRender.cc
index d34aafe..b2c3831 100644
--- a/src/FbTk/TextureRender.cc
+++ b/src/FbTk/TextureRender.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: TextureRender.cc,v 1.13 2004/10/06 19:19:43 akir Exp $ 25// $Id: TextureRender.cc,v 1.14 2004/10/21 10:03:43 akir Exp $
26 26
27#include "TextureRender.hh" 27#include "TextureRender.hh"
28 28
@@ -41,6 +41,14 @@
41#endif 41#endif
42using namespace std; 42using namespace std;
43 43
44// mipspro has no new(nothrow)
45#if defined sgi && ! defined GCC
46#define FB_new_nothrow new
47#else
48#warning yeah, thats the way
49#define FB_new_nothrow new(std::nothrow)
50#endif
51
44namespace FbTk { 52namespace FbTk {
45 53
46TextureRender::TextureRender(ImageControl &imgctrl, 54TextureRender::TextureRender(ImageControl &imgctrl,
@@ -98,28 +106,34 @@ Pixmap TextureRender::render(const FbTk::Texture &texture) {
98} 106}
99 107
100void TextureRender::allocateColorTables() { 108void TextureRender::allocateColorTables() {
101 red = new(nothrow) unsigned char[width * height];
102 109
103 _FB_USES_NLS; 110 _FB_USES_NLS;
111
112 const size_t size = width * height;
113 red = FB_new_nothrow unsigned char[size];
114
104 if (red == 0) { 115 if (red == 0) {
105 char sbuf[128]; 116 char sbuf[128];
106 sprintf(sbuf, "%d", width*height); 117 sprintf(sbuf, "%d", size);
107 throw string("TextureRender::TextureRender(): " + string(_FBTKTEXT(Error, OutOfMemoryRed, "Out of memory while allocating red buffer.", "")) + string(sbuf)); 118 throw std::string("TextureRender::TextureRender(): " +
119 std::string(_FBTKTEXT(Error, OutOfMemoryRed, "Out of memory while allocating red buffer.", "")) + string(sbuf));
108 } 120 }
109 121
110 122
111 green = new(nothrow) unsigned char[width * height]; 123 green = FB_new_nothrow unsigned char[size];
112 if (green == 0) { 124 if (green == 0) {
113 char sbuf[128]; 125 char sbuf[128];
114 sprintf(sbuf, "%d", width*height); 126 sprintf(sbuf, "%d", size);
115 throw string("TextureRender::TextureRender(): " +string(_FBTKTEXT(Error, OutOfMemoryGreen, "Out of memory while allocating green buffer.", ""))+ string(sbuf)); 127 throw std::string("TextureRender::TextureRender(): " +
128 std::string(_FBTKTEXT(Error, OutOfMemoryGreen, "Out of memory while allocating green buffer.", ""))+ string(sbuf));
116 } 129 }
117 130
118 blue = new(nothrow) unsigned char[width * height]; 131 blue = FB_new_nothrow unsigned char[size];
119 if (blue == 0) { 132 if (blue == 0) {
120 char sbuf[128]; 133 char sbuf[128];
121 sprintf(sbuf, "%d", width*height); 134 sprintf(sbuf, "%d", size);
122 throw string("TextureRender::TextureRender(): " +string(_FBTKTEXT(Error, OutOfMemoryBlue, "Out of memory while allocating blue buffer.", ""))+ string(sbuf)); 135 throw std::string("TextureRender::TextureRender(): " +
136 std::string(_FBTKTEXT(Error, OutOfMemoryBlue, "Out of memory while allocating blue buffer.", ""))+ string(sbuf));
123 } 137 }
124 138
125 139