Browse Source

Fix remaining compiler warnings of (STR 3529)

src/Fl_File_Chooser2.cxx
src/Fl_File_Icon2.cxx
src/Fl_Help_View.cxx

The only known warnings are now in src/Fl_x.cxx as mentioned in
comment #1.
pull/36/head
Albrecht Schlosser 6 years ago
parent
commit
cb387bd6ff
  1. 22
      src/Fl_File_Chooser2.cxx
  2. 12
      src/Fl_File_Icon2.cxx
  3. 8
      src/Fl_Help_View.cxx

22
src/Fl_File_Chooser2.cxx

@ -385,7 +385,7 @@ Fl_File_Chooser::count() {
void void
Fl_File_Chooser::directory(const char *d)// I - Directory to change to Fl_File_Chooser::directory(const char *d)// I - Directory to change to
{ {
char *dirptr; // Pointer into directory char *dirptr; // Pointer into directory
char fixpath[FL_PATH_MAX]; // Path with slashes converted char fixpath[FL_PATH_MAX]; // Path with slashes converted
@ -457,8 +457,8 @@ void
Fl_File_Chooser::favoritesButtonCB() Fl_File_Chooser::favoritesButtonCB()
{ {
int v; // Current selection int v; // Current selection
char pathname[FL_PATH_MAX], // Pathname char pathname[FL_PATH_MAX], // Pathname
menuname[FL_PATH_MAX]; // Menu name menuname[FL_PATH_MAX]; // Menu name
v = favoritesButton->value(); v = favoritesButton->value();
@ -624,7 +624,7 @@ void
Fl_File_Chooser::fileListCB() Fl_File_Chooser::fileListCB()
{ {
char *filename, // New filename char *filename, // New filename
pathname[FL_PATH_MAX]; // Full pathname to file pathname[FL_PATH_MAX + 4]; // Full pathname to file
filename = (char *)fileList->text(fileList->value()); filename = (char *)fileList->text(fileList->value());
@ -809,7 +809,7 @@ Fl_File_Chooser::fileNameCB()
directory(pathname); directory(pathname);
if (filename[0]) { if (filename[0]) {
char tempname[FL_PATH_MAX]; char tempname[FL_PATH_MAX + 4];
snprintf(tempname, sizeof(tempname), "%s/%s", directory_, filename); snprintf(tempname, sizeof(tempname), "%s/%s", directory_, filename);
fileName->value(tempname); fileName->value(tempname);
@ -923,7 +923,7 @@ Fl_File_Chooser::filter(const char *p) // I - Pattern(s)
*start, // Start of pattern *start, // Start of pattern
*end; // End of pattern *end; // End of pattern
int allfiles; // Do we have a "*" pattern? int allfiles; // Do we have a "*" pattern?
char temp[FL_PATH_MAX]; // Temporary pattern string char temp[FL_PATH_MAX]; // Temporary pattern string
// Make sure we have a pattern... // Make sure we have a pattern...
@ -967,8 +967,8 @@ Fl_File_Chooser::filter(const char *p) // I - Pattern(s)
void void
Fl_File_Chooser::newdir() Fl_File_Chooser::newdir()
{ {
const char *dir; // New directory name const char *dir; // New directory name
char pathname[FL_PATH_MAX]; // Full path of directory char pathname[FL_PATH_MAX + 4]; // Full path of directory
// Get a directory name from the user // Get a directory name from the user
@ -1117,7 +1117,7 @@ Fl_File_Chooser::showChoiceCB()
const char *item, // Selected item const char *item, // Selected item
*patstart; // Start of pattern *patstart; // Start of pattern
char *patend; // End of pattern char *patend; // End of pattern
char temp[FL_PATH_MAX]; // Temporary string for pattern char temp[FL_PATH_MAX]; // Temporary string for pattern
item = showChoice->text(showChoice->value()); item = showChoice->text(showChoice->value());
@ -1154,7 +1154,7 @@ void
Fl_File_Chooser::update_favorites() Fl_File_Chooser::update_favorites()
{ {
int i; // Looping var int i; // Looping var
char pathname[FL_PATH_MAX], // Pathname char pathname[FL_PATH_MAX], // Pathname
menuname[2048]; // Menu name menuname[2048]; // Menu name
const char *home; // Home directory const char *home; // Home directory
@ -1380,7 +1380,7 @@ Fl_File_Chooser::value(int f) // I - File number
int i; // Looping var int i; // Looping var
int fcount; // Number of selected files int fcount; // Number of selected files
const char *name; // Current filename const char *name; // Current filename
static char pathname[FL_PATH_MAX]; // Filename + directory static char pathname[FL_PATH_MAX + 4]; // Filename + directory
name = fileName->value(); name = fileName->value();

12
src/Fl_File_Icon2.cxx

@ -6,7 +6,7 @@
// KDE icon code donated by Maarten De Boer. // KDE icon code donated by Maarten De Boer.
// //
// Copyright 1999-2010 by Michael Sweet. // Copyright 1999-2010 by Michael Sweet.
// Copyright 2011-2017 by Bill Spitzak and others. // Copyright 2011-2019 by Bill Spitzak and others.
// //
// This library is free software. Distribution and use rights are outlined in // This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this // the file "COPYING" which should have been included with this file. If this
@ -572,10 +572,10 @@ int Fl_File_Icon::load_image(const char *ifile) // I - File to read from
*/ */
void void
Fl_File_Icon::load_system_icons(void) { Fl_File_Icon::load_system_icons(void) {
int i; // Looping var int i; // Looping var
Fl_File_Icon *icon; // New icons Fl_File_Icon *icon; // New icons
char filename[FL_PATH_MAX]; // Filename char filename[FL_PATH_MAX + 60]; // Filename
char icondir[FL_PATH_MAX]; // Icon directory char icondir[FL_PATH_MAX]; // Icon directory
static int init = 0; // Have the icons been initialized? static int init = 0; // Have the icons been initialized?
const char * const icondirs[] = { const char * const icondirs[] = {
"Bluecurve", // Icon directories to look for, in order "Bluecurve", // Icon directories to look for, in order
@ -819,7 +819,7 @@ load_kde_mimelnk(const char *filename, // I - mimelnk filename
char pattern[1024]; char pattern[1024];
char mimetype[1024]; char mimetype[1024];
char *val; char *val;
char full_iconfilename[FL_PATH_MAX]; char full_iconfilename[2 * FL_PATH_MAX];
Fl_File_Icon *icon; Fl_File_Icon *icon;

8
src/Fl_Help_View.cxx

@ -7,7 +7,7 @@
// Image support by Matthias Melcher, Copyright 2000-2009. // Image support by Matthias Melcher, Copyright 2000-2009.
// //
// Buffer management (HV_Edit_Buffer) and more by AlbrechtS and others. // Buffer management (HV_Edit_Buffer) and more by AlbrechtS and others.
// Copyright 2011-2018 by Bill Spitzak and others. // Copyright 2011-2019 by Bill Spitzak and others.
// //
// This library is free software. Distribution and use rights are outlined in // This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this // the file "COPYING" which should have been included with this file. If this
@ -2775,7 +2775,7 @@ Fl_Shared_Image *
Fl_Help_View::get_image(const char *name, int W, int H) { Fl_Help_View::get_image(const char *name, int W, int H) {
const char *localname; // Local filename const char *localname; // Local filename
char dir[FL_PATH_MAX]; // Current directory char dir[FL_PATH_MAX]; // Current directory
char temp[FL_PATH_MAX], // Temporary filename char temp[2 * FL_PATH_MAX], // Temporary filename
*tempptr; // Pointer into temporary name *tempptr; // Pointer into temporary name
Fl_Shared_Image *ip; // Image pointer... Fl_Shared_Image *ip; // Image pointer...
@ -2872,7 +2872,7 @@ void Fl_Help_View::follow_link(Fl_Help_Link *linkp)
if (strcmp(linkp->filename, filename_) != 0 && linkp->filename[0]) if (strcmp(linkp->filename, filename_) != 0 && linkp->filename[0])
{ {
char dir[FL_PATH_MAX]; // Current directory char dir[FL_PATH_MAX]; // Current directory
char temp[FL_PATH_MAX], // Temporary filename char temp[2 * FL_PATH_MAX], // Temporary filename
*tempptr; // Pointer into temporary filename *tempptr; // Pointer into temporary filename
@ -3305,7 +3305,7 @@ int Fl_Help_View::load(const char *f)
char *target; // Target in file char *target; // Target in file
char *slash; // Directory separator char *slash; // Directory separator
const char *localname; // Local filename const char *localname; // Local filename
char error[1024]; // Error buffer char error[2 * FL_PATH_MAX]; // Error buffer
char newname[FL_PATH_MAX]; // New filename buffer char newname[FL_PATH_MAX]; // New filename buffer
// printf("load(%s)\n",f); fflush(stdout); // printf("load(%s)\n",f); fflush(stdout);

Loading…
Cancel
Save