Text archives Help
- From: "Thiago Ize" <
>
- To:
- Subject: [Manta] r2328 - in trunk: Core/Color Core/Exceptions Core/Util Engine/Display
- Date: Thu, 18 Sep 2008 13:19:33 -0600 (MDT)
Author: thiago
Date: Thu Sep 18 13:19:32 2008
New Revision: 2328
Modified:
trunk/Core/Color/ColorDB.cc
trunk/Core/Color/RegularColorMap.cc
trunk/Core/Exceptions/ArrayIndexOutOfBounds.cc
trunk/Core/Exceptions/Exception.cc
trunk/Core/Util/rgbe.cc
trunk/Engine/Display/OpenGLDisplay.cc
Log:
Remove warnings brought up by gcc 4.2.
Modified: trunk/Core/Color/ColorDB.cc
==============================================================================
--- trunk/Core/Color/ColorDB.cc (original)
+++ trunk/Core/Color/ColorDB.cc Thu Sep 18 13:19:32 2008
@@ -8,7 +8,7 @@
using namespace std;
struct RGBData {
- char* name;
+ const char* name;
unsigned char r, g, b;
};
@@ -815,12 +815,12 @@
else
l = m;
}
-
+
if(name != namedColors[l].name)
return false;
-
+
RGBData& nc = namedColors[l];
-
+
result[0] = nc.r;
result[1] = nc.g;
result[2] = nc.b;
Modified: trunk/Core/Color/RegularColorMap.cc
==============================================================================
--- trunk/Core/Color/RegularColorMap.cc (original)
+++ trunk/Core/Color/RegularColorMap.cc Thu Sep 18 13:19:32 2008
@@ -139,7 +139,7 @@
bool RegularColorMap::fillColor(const char* file, Array1<Color>& colors)
{
- char *me="RegularColorMap::fillColor(file)";
+ const char *me="RegularColorMap::fillColor(file)";
Array1<Color> new_colors;
ifstream infile(file);
if (!infile) {
@@ -191,11 +191,11 @@
}
unsigned int RegularColorMap::parseType(const char* type) {
- string type_string(type);
+ const string type_string(type);
if (type_string == "InvRainbowIso" || type_string == "invrainbowiso" ||
type_string == "iril")
return InvRainbowIso;
- else if (type == "InvRainbow" || type_string == "invrainbow" ||
+ else if (type_string == "InvRainbow" || type_string == "invrainbow" ||
type_string == "ir")
return InvRainbow;
else if (type_string == "Rainbow" || type_string == "rainbow" ||
Modified: trunk/Core/Exceptions/ArrayIndexOutOfBounds.cc
==============================================================================
--- trunk/Core/Exceptions/ArrayIndexOutOfBounds.cc (original)
+++ trunk/Core/Exceptions/ArrayIndexOutOfBounds.cc Thu Sep 18 13:19:32
2008
@@ -41,9 +41,9 @@
*/
#include <Core/Exceptions/ArrayIndexOutOfBounds.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#include <iostream>
#include <sstream>
Modified: trunk/Core/Exceptions/Exception.cc
==============================================================================
--- trunk/Core/Exceptions/Exception.cc (original)
+++ trunk/Core/Exceptions/Exception.cc Thu Sep 18 13:19:32 2008
@@ -42,9 +42,9 @@
#include <Core/Exceptions/Exception.h>
#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
#ifndef _WIN32
#include <unistd.h>
#else
@@ -99,7 +99,7 @@
// Set this environment variable if you want to have a default
// response to the question below. Value values are:
// ask, dbx, throw, abort
- char* emode = getenv("SCI_EXCEPTIONMODE");
+ const char* emode = getenv("SCI_EXCEPTIONMODE");
if(!emode)
emode = "dbx"; // Default exceptionmode
Modified: trunk/Core/Util/rgbe.cc
==============================================================================
--- trunk/Core/Util/rgbe.cc (original)
+++ trunk/Core/Util/rgbe.cc Thu Sep 18 13:19:32 2008
@@ -49,7 +49,7 @@
};
/* default error routine. change this to change error handling */
-static int rgbe_error(int rgbe_error_code, char *msg)
+static int rgbe_error(int rgbe_error_code, const char *msg)
{
switch (rgbe_error_code) {
case rgbe_read_error:
@@ -112,7 +112,7 @@
/* default minimal header. modify if you want more information in header */
int RGBE_WriteHeader(FILE *fp, int width, int height, rgbe_header_info *info)
{
- char *programtype = "RGBE";
+ const char *programtype = "RGBE";
if (info && (info->valid & RGBE_VALID_PROGRAMTYPE))
programtype = info->programtype;
Modified: trunk/Engine/Display/OpenGLDisplay.cc
==============================================================================
--- trunk/Engine/Display/OpenGLDisplay.cc (original)
+++ trunk/Engine/Display/OpenGLDisplay.cc Thu Sep 18 13:19:32 2008
@@ -201,8 +201,8 @@
if(!parentWindow){
XTextProperty tp;
- char* name = "Manta";
- XStringListToTextProperty(&name, 1, &tp);
+ const char* name = "Manta";
+ XStringListToTextProperty(const_cast<char**>(&name), 1, &tp);
XSizeHints sh;
sh.flags = USPosition|USSize;
- [Manta] r2328 - in trunk: Core/Color Core/Exceptions Core/Util Engine/Display, Thiago Ize, 09/18/2008
Archive powered by MHonArc 2.6.16.