summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-04-14 12:29:51 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-04-14 12:29:51 +0000
commit217f77c9ef015684b08f77b2d129155c76414f9e (patch)
tree50e3e4576a1dfd8e13fb4692f75536df4ed48126
parent8dda432b40163541d13f9f6cd520b5efbd82e0da (diff)
Eliminate compiler warnings on Solaris...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4282 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--fluid/Fl_Function_Type.cxx2
-rw-r--r--src/Fl_BMP_Image.cxx8
-rw-r--r--src/Fl_JPEG_Image.cxx18
-rw-r--r--src/Fl_PNM_Image.cxx2
-rw-r--r--test/editor.cxx11
5 files changed, 22 insertions, 19 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx
index eb90b4f15..5a4ad35dc 100644
--- a/fluid/Fl_Function_Type.cxx
+++ b/fluid/Fl_Function_Type.cxx
@@ -681,7 +681,7 @@ void Fl_Comment_Type::read_property(const char *c) {
#include "comments.h"
static void load_comments_preset(Fl_Preferences &menu) {
- static char *predefined_comment[] = {
+ static const char * const predefined_comment[] = {
"GNU Public License/GPL Header", "GNU Public License/GPL Footer",
"GNU Public License/LGPL Header", "GNU Public License/LGPL Footer",
"FLTK/Header", "FLTK/Footer" };
diff --git a/src/Fl_BMP_Image.cxx b/src/Fl_BMP_Image.cxx
index a7ca84523..6f6c3e23d 100644
--- a/src/Fl_BMP_Image.cxx
+++ b/src/Fl_BMP_Image.cxx
@@ -82,7 +82,7 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
byte; // Byte in image
uchar *ptr; // Pointer into pixels
uchar colormap[256][3];// Colormap
- uchar mask = 0; // single bit mask follows image data
+ uchar havemask = 0; // single bit mask follows image data
// Open the file...
if ((fp = fopen(bmp, "rb")) == NULL) return;
@@ -134,7 +134,7 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
int Bpp = depth/8;
int maskSize = (((w()*Bpp+3)&~3)*h()) + (((((w()+7)/8)+3)&~3)*h());
if (maskSize==2*dataSize) {
- mask = 1;
+ havemask = 1;
h(h()/2);
bDepth = 4;
}
@@ -329,7 +329,7 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
*ptr++ = colormap[temp][2];
*ptr++ = colormap[temp][1];
*ptr++ = colormap[temp][0];
- if (mask) ptr++;
+ if (havemask) ptr++;
}
if (!compression) {
@@ -375,7 +375,7 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
}
}
- if (mask) {
+ if (havemask) {
for (y = h() - 1; y >= 0; y --) {
ptr = (uchar *)array + y * w() * d() + 3;
for (x = w(), bit = 128; x > 0; x --, ptr+=bDepth) {
diff --git a/src/Fl_JPEG_Image.cxx b/src/Fl_JPEG_Image.cxx
index aab9fd5b6..e4cc88d13 100644
--- a/src/Fl_JPEG_Image.cxx
+++ b/src/Fl_JPEG_Image.cxx
@@ -73,15 +73,17 @@ struct fl_jpeg_error_mgr {
//
#ifdef HAVE_LIBJPEG
-static void
-fl_jpeg_error_handler(j_common_ptr dinfo) { // I - Decompressor info
- longjmp(((fl_jpeg_error_mgr *)(dinfo->err))->errhand_, 1);
- return;
-}
+extern "C" {
+ static void
+ fl_jpeg_error_handler(j_common_ptr dinfo) { // I - Decompressor info
+ longjmp(((fl_jpeg_error_mgr *)(dinfo->err))->errhand_, 1);
+ return;
+ }
-static void
-fl_jpeg_output_handler(j_common_ptr dinfo) { // I - Decompressor info
- return;
+ static void
+ fl_jpeg_output_handler(j_common_ptr dinfo) { // I - Decompressor info
+ return;
+ }
}
#endif // HAVE_LIBJPEG
diff --git a/src/Fl_PNM_Image.cxx b/src/Fl_PNM_Image.cxx
index 09c4fc93e..866c16aea 100644
--- a/src/Fl_PNM_Image.cxx
+++ b/src/Fl_PNM_Image.cxx
@@ -83,7 +83,7 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
format = atoi(lineptr);
while (isdigit(*lineptr)) lineptr ++;
- if (format == 7) lineptr = "";
+ if (format == 7) lineptr = (char *)"";
while (lineptr != NULL && w() == 0) {
if (*lineptr == '\0' || *lineptr == '#') {
diff --git a/test/editor.cxx b/test/editor.cxx
index d27b95e70..9d9759779 100644
--- a/test/editor.cxx
+++ b/test/editor.cxx
@@ -150,13 +150,14 @@ const char *code_types[] = { // List of known C/C++ types...
// 'compare_keywords()' - Compare two keywords...
//
-int
-compare_keywords(const void *a,
- const void *b) {
- return (strcmp(*((const char **)a), *((const char **)b)));
+extern "C" {
+ int
+ compare_keywords(const void *a,
+ const void *b) {
+ return (strcmp(*((const char **)a), *((const char **)b)));
+ }
}
-
//
// 'style_parse()' - Parse text and produce style data.
//